pub struct SumTypeLayout {
pub layout: Layout,
pub variants: Box<[SumTypeVariantLayout]>,
pub payload_offset: u16,
}Fields§
§layout: LayoutThe layout of a sum value of this sum type.
variants: Box<[SumTypeVariantLayout]>The variants of the sum type.
payload_offset: u16The relative offset of a sum value’s payload for sums of this type. Sum value tags are always at offset 0.
Implementations§
Source§impl SumTypeLayout
impl SumTypeLayout
pub fn offset_of_variant_data(&self, _variant_tag: u8) -> usize
pub fn offset_of_tag(&self) -> usize
Trait Implementations§
Source§impl Clone for SumTypeLayout
impl Clone for SumTypeLayout
Source§fn clone(&self) -> SumTypeLayout
fn clone(&self) -> SumTypeLayout
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 Debug for SumTypeLayout
impl Debug for SumTypeLayout
Source§impl<'de> DeserializeSeed<'de> for &SumTypeLayout
impl<'de> DeserializeSeed<'de> for &SumTypeLayout
Source§fn deserialize<D: Deserializer<'de>>(
self,
deserializer: D,
) -> Result<Self::Output, D::Error>
fn deserialize<D: Deserializer<'de>>( self, deserializer: D, ) -> Result<Self::Output, D::Error>
Equivalent to the more common
Deserialize::deserialize associated function,
except with some initial piece of data (the seed self) passed in.Source§impl From<SumType> for SumTypeLayout
impl From<SumType> for SumTypeLayout
Source§impl HasLayout for SumTypeLayout
impl HasLayout for SumTypeLayout
Source§impl MemoryUsage for SumTypeLayout
impl MemoryUsage for SumTypeLayout
Source§fn heap_usage(&self) -> usize
fn heap_usage(&self) -> usize
The heap memory usage of this type. The default implementation returns 0.
Source§impl PartialEq for SumTypeLayout
impl PartialEq for SumTypeLayout
Source§impl<'de> SumVisitor<'de> for &SumTypeLayout
impl<'de> SumVisitor<'de> for &SumTypeLayout
Source§impl VariantVisitor for &SumTypeLayout
impl VariantVisitor for &SumTypeLayout
impl Eq for SumTypeLayout
impl StructuralPartialEq for SumTypeLayout
Auto Trait Implementations§
impl Freeze for SumTypeLayout
impl RefUnwindSafe for SumTypeLayout
impl Send for SumTypeLayout
impl Sync for SumTypeLayout
impl Unpin for SumTypeLayout
impl UnwindSafe for SumTypeLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more