pub struct Static<'tcx> {
param_env: ParamEnv<'tcx>,
safety: Safety,
mutability: Mutability,
thread_local: bool,
ty: Ty<'tcx>,
}Fields§
§param_env: ParamEnv<'tcx>§safety: SafetyWhether it’s a unsafe static, safe static (inside extern only) or just a static.
mutability: MutabilityWhether it’s a static mut or just a static.
thread_local: boolWhether it’s a #[thread_local] static.
ty: Ty<'tcx>Implementations§
Source§impl<'tcx> Static<'tcx>
impl<'tcx> Static<'tcx>
pub fn param_env(&self) -> &ParamEnv<'tcx>
Sourcepub fn safety(&self) -> Safety
pub fn safety(&self) -> Safety
Whether it’s a unsafe static, safe static (inside extern only) or just a static.
Sourcepub fn mutability(&self) -> Mutability
pub fn mutability(&self) -> Mutability
Whether it’s a static mut or just a static.
Sourcepub fn thread_local(&self) -> bool
pub fn thread_local(&self) -> bool
Whether it’s a #[thread_local] static.
pub fn ty(&self) -> &Ty<'tcx>
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> DynSend for Static<'tcx>
impl<'tcx> DynSync for Static<'tcx>
impl<'tcx> Freeze for Static<'tcx>
impl<'tcx> RefUnwindSafe for Static<'tcx>
impl<'tcx> Send for Static<'tcx>
impl<'tcx> Sync for Static<'tcx>
impl<'tcx> Unpin for Static<'tcx>
impl<'tcx> UnsafeUnpin for Static<'tcx>
impl<'tcx> UnwindSafe for Static<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more