pub struct Ref<'a, T: ?Sized>(pub &'a T);Expand description
A wrapper around &'a T to implement TypeSize.
This does not consider the size of the inner T, simply the size of the pointer.
Tuple Fields§
§0: &'a TTrait Implementations§
source§impl<'a, T: Ord + ?Sized> Ord for Ref<'a, T>
impl<'a, T: Ord + ?Sized> Ord for Ref<'a, T>
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<'a, T: PartialEq + ?Sized> PartialEq for Ref<'a, T>
impl<'a, T: PartialEq + ?Sized> PartialEq for Ref<'a, T>
source§impl<'a, T: PartialOrd + ?Sized> PartialOrd for Ref<'a, T>
impl<'a, T: PartialOrd + ?Sized> PartialOrd for Ref<'a, T>
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 moresource§impl<'a, T: ?Sized> TypeSize for Ref<'a, T>
impl<'a, T: ?Sized> TypeSize for Ref<'a, T>
source§fn extra_size(&self) -> usize
fn extra_size(&self) -> usize
The number of bytes more than the
std::mem::size_of that this value is using.source§fn get_size(&self) -> usize
fn get_size(&self) -> usize
The total number of bytes that this type is using, both direct
(
std::mem::size_of) and indirect (behind allocations) Read moresource§fn get_collection_item_count(&self) -> Option<usize>
fn get_collection_item_count(&self) -> Option<usize>
Returns information about the number of items this type is holding, if it is a collection.
impl<'a, T: Copy + ?Sized> Copy for Ref<'a, T>
impl<'a, T: Eq + ?Sized> Eq for Ref<'a, T>
impl<'a, T: ?Sized> StructuralEq for Ref<'a, T>
impl<'a, T: ?Sized> StructuralPartialEq for Ref<'a, T>
Auto Trait Implementations§
impl<'a, T: ?Sized> RefUnwindSafe for Ref<'a, T>where T: RefUnwindSafe,
impl<'a, T: ?Sized> Send for Ref<'a, T>where T: Sync,
impl<'a, T: ?Sized> Sync for Ref<'a, T>where T: Sync,
impl<'a, T: ?Sized> Unpin for Ref<'a, T>
impl<'a, T: ?Sized> UnwindSafe for Ref<'a, T>where T: RefUnwindSafe,
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