#[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<T: ?Sized + 'static> Collect for Static<T>
impl<T: ?Sized + 'static> Collect for Static<T>
Source§fn needs_trace() -> bool
fn needs_trace() -> bool
As an optimization, if this type can never hold a
Gc pointer and trace is unnecessary
to call, you may implement this method and return false. The default implementation returns
true, signaling that Collect::trace must be called.Source§fn trace(&self, _cc: &Collection)
fn trace(&self, _cc: &Collection)
Must call
Collect::trace on all held Gc pointers. If this type holds inner types that
implement Collect, a valid implementation would simply call Collect::trace on all the
held values to ensure this.Source§impl<T: Ord + ?Sized> Ord for Static<T>
impl<T: Ord + ?Sized> Ord for Static<T>
Source§impl<T: PartialOrd + ?Sized> PartialOrd for Static<T>
impl<T: PartialOrd + ?Sized> PartialOrd for Static<T>
impl<T: Copy + ?Sized> Copy for Static<T>
impl<T: Eq + ?Sized> Eq 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> 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