pub struct ElementType { /* private fields */ }Expand description
A type in a container type: the element of a maybe or of an array, or the key or the value of a dict entry.
It dereferences to the Type that it holds. It keeps the alignment and
the fixed size of that type, which it computes one time when it is
constructed.
Methods from Deref<Target = Type>§
Sourcepub fn alignment(&self) -> usize
pub fn alignment(&self) -> usize
Returns the alignment requirement of the serialized form, in bytes.
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the serialized size, or None if the type has a variable size.
The size of a tuple or a dict entry includes the padding at its end to
its alignment, so (ty) has the size 16. The empty tuple () has the
fixed size 1.
Trait Implementations§
Source§impl AsRef<Type> for ElementType
impl AsRef<Type> for ElementType
Source§impl Clone for ElementType
impl Clone for ElementType
Source§impl Debug for ElementType
impl Debug for ElementType
Source§impl Deref for ElementType
impl Deref for ElementType
impl Eq for ElementType
Source§impl PartialEq for ElementType
impl PartialEq for ElementType
impl StructuralPartialEq for ElementType
Auto Trait Implementations§
impl Forget for ElementType
impl Freeze for ElementType
impl Move for ElementType
impl RefUnwindSafe for ElementType
impl Send for ElementType
impl Sync for ElementType
impl Unpin for ElementType
impl UnsafeUnpin for ElementTypewhere
*const Type is !null: UnsafeUnpin,
PhantomData<Type>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
impl UnwindSafe for ElementType
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