#[repr(transparent)]pub struct Static<T: ?Sized>(pub T);Expand description
A wrapper type that implements Collect whenever the contained T is ’static, which is useful in generic contexts
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: ?Sized> BorrowMut<T> for Static<T>
impl<T: ?Sized> BorrowMut<T> for Static<T>
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<'gc, T: ?Sized + 'static> Collect<'gc> for Static<T>
impl<'gc, T: ?Sized + 'static> Collect<'gc> for Static<T>
Source§const NEEDS_TRACE: bool = false
const NEEDS_TRACE: bool = false
As an optimization, if this type can never hold a
Gc pointer and trace is unnecessary
to call, you may set this to false. The default value is true, signaling that
Collect::trace must be called.Source§fn trace<T: Trace<'gc>>(&self, cc: &mut T)
fn trace<T: Trace<'gc>>(&self, cc: &mut T)
Must call
Trace::trace_gc (resp. Trace::trace_gc_weak) on all directly owned
Gc (resp. GcWeak) pointers. If this type holds inner types that implement Collect,
a valid implementation would simply call Trace::trace on all the held values to ensure
this. Read moreimpl<T: Copy + ?Sized> Copy for Static<T>
impl<T: Eq + ?Sized> Eq for Static<T>
Source§impl<T: Ord + ?Sized> Ord for Static<T>
impl<T: Ord + ?Sized> Ord for Static<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + ?Sized> PartialOrd for Static<T>
impl<T: PartialOrd + ?Sized> PartialOrd for Static<T>
impl<T: ?Sized> StructuralPartialEq for Static<T>
Auto Trait Implementations§
impl<T> Freeze for Static<T>
impl<T> RefUnwindSafe for Static<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Static<T>
impl<T> Sync for Static<T>
impl<T> Unpin for Static<T>
impl<T> UnsafeUnpin for Static<T>where
T: UnsafeUnpin + ?Sized,
impl<T> UnwindSafe for Static<T>where
T: UnwindSafe + ?Sized,
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