Struct gc_arena::StaticCollect
source · #[repr(transparent)]pub struct StaticCollect<T>(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: T
Trait Implementations§
source§impl<T> AsMut<T> for StaticCollect<T>
impl<T> AsMut<T> for StaticCollect<T>
source§impl<T> AsRef<T> for StaticCollect<T>
impl<T> AsRef<T> for StaticCollect<T>
source§impl<T> Borrow<T> for StaticCollect<T>
impl<T> Borrow<T> for StaticCollect<T>
source§impl<T> BorrowMut<T> for StaticCollect<T>
impl<T> BorrowMut<T> for StaticCollect<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: Clone> Clone for StaticCollect<T>
impl<T: Clone> Clone for StaticCollect<T>
source§fn clone(&self) -> StaticCollect<T>
fn clone(&self) -> StaticCollect<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: 'static> Collect for StaticCollect<T>
impl<T: 'static> Collect for StaticCollect<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: Debug> Debug for StaticCollect<T>
impl<T: Debug> Debug for StaticCollect<T>
source§impl<T: Default> Default for StaticCollect<T>
impl<T: Default> Default for StaticCollect<T>
source§fn default() -> StaticCollect<T>
fn default() -> StaticCollect<T>
Returns the “default value” for a type. Read more
source§impl<T> Deref for StaticCollect<T>
impl<T> Deref for StaticCollect<T>
source§impl<T> DerefMut for StaticCollect<T>
impl<T> DerefMut for StaticCollect<T>
source§impl<T> From<T> for StaticCollect<T>
impl<T> From<T> for StaticCollect<T>
source§impl<T: Hash> Hash for StaticCollect<T>
impl<T: Hash> Hash for StaticCollect<T>
source§impl<T: Ord> Ord for StaticCollect<T>
impl<T: Ord> Ord for StaticCollect<T>
source§fn cmp(&self, other: &StaticCollect<T>) -> Ordering
fn cmp(&self, other: &StaticCollect<T>) -> Ordering
1.21.0 · 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: PartialEq> PartialEq for StaticCollect<T>
impl<T: PartialEq> PartialEq for StaticCollect<T>
source§fn eq(&self, other: &StaticCollect<T>) -> bool
fn eq(&self, other: &StaticCollect<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for StaticCollect<T>
impl<T: PartialOrd> PartialOrd for StaticCollect<T>
source§fn partial_cmp(&self, other: &StaticCollect<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &StaticCollect<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy> Copy for StaticCollect<T>
impl<T: Eq> Eq for StaticCollect<T>
impl<T> StructuralPartialEq for StaticCollect<T>
Auto Trait Implementations§
impl<T> Freeze for StaticCollect<T>where
T: Freeze,
impl<T> RefUnwindSafe for StaticCollect<T>where
T: RefUnwindSafe,
impl<T> Send for StaticCollect<T>where
T: Send,
impl<T> Sync for StaticCollect<T>where
T: Sync,
impl<T> Unpin for StaticCollect<T>where
T: Unpin,
impl<T> UnwindSafe for StaticCollect<T>where
T: UnwindSafe,
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