Struct TransparentEncoding
pub struct TransparentEncoding<E>(/* private fields */);Expand description
An encoding derived by mesh_derive for a transparent type, using inner
encoding E.
Trait Implementations§
§impl<E> Clone for TransparentEncoding<E>where
    E: Clone,
 
impl<E> Clone for TransparentEncoding<E>where
    E: Clone,
§fn clone(&self) -> TransparentEncoding<E>
 
fn clone(&self) -> TransparentEncoding<E>
Returns a duplicate 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 more§impl<T, E> DescribeField<T> for TransparentEncoding<E>
 
impl<T, E> DescribeField<T> for TransparentEncoding<E>
§const FIELD_TYPE: FieldType<'static> = E::FIELD_TYPE
 
const FIELD_TYPE: FieldType<'static> = E::FIELD_TYPE
The type of the field.
§const PACKED_TYPE: Option<&'static str> = E::PACKED_TYPE
 
const PACKED_TYPE: Option<&'static str> = E::PACKED_TYPE
The type name of the field in a packed context.
§impl<T, E> DescribeMessage<T> for TransparentEncoding<E>
 
impl<T, E> DescribeMessage<T> for TransparentEncoding<E>
§const DESCRIPTION: MessageDescription<'static> = E::DESCRIPTION
 
const DESCRIPTION: MessageDescription<'static> = E::DESCRIPTION
The message description.
§impl<'de, T, E, R> FieldDecode<'de, T, R> for TransparentEncoding<E>
 
impl<'de, T, E, R> FieldDecode<'de, T, R> for TransparentEncoding<E>
§const ENTRY: DecoderEntry<'de, T, R>
 
const ENTRY: DecoderEntry<'de, T, R>
The table decoder entry for this type, used in types from
table::decode. Read more§fn read_field(
    item: &mut InplaceOption<'_, T>,
    reader: FieldReader<'de, '_, R>,
) -> Result<(), Error>
 
fn read_field( item: &mut InplaceOption<'_, T>, reader: FieldReader<'de, '_, R>, ) -> Result<(), Error>
Reads a field into 
item.§fn default_field(item: &mut InplaceOption<'_, T>) -> Result<(), Error>
 
fn default_field(item: &mut InplaceOption<'_, T>) -> Result<(), Error>
Instantiates 
item with its default value, if there is one. Read more§fn wrap_in_sequence() -> bool
 
fn wrap_in_sequence() -> bool
Returns whether this field is wrapped in a message when encoded nested
in a sequence (such as a repeated field).
§fn packed<'p, C>() -> Option<&'p dyn PackedDecode<'a, T, C>>where
    C: CopyExtend<T>,
    T: 'p,
 
fn packed<'p, C>() -> Option<&'p dyn PackedDecode<'a, T, C>>where
    C: CopyExtend<T>,
    T: 'p,
Unless 
packed()::must_pack() is true, the sequence decoder must detect
the encoding (packed or not) and call the appropriate method.§fn read_field_in_sequence(
    item: &mut InplaceOption<'_, T>,
    reader: FieldReader<'a, '_, R>,
) -> Result<(), Error>
 
fn read_field_in_sequence( item: &mut InplaceOption<'_, T>, reader: FieldReader<'a, '_, R>, ) -> Result<(), Error>
Reads this field that was encoded as part of a sequence, unwrapping it
from a message if necessary.
§impl<T, E, R> FieldEncode<T, R> for TransparentEncoding<E>
 
impl<T, E, R> FieldEncode<T, R> for TransparentEncoding<E>
§const ENTRY: EncoderEntry<T, R>
 
const ENTRY: EncoderEntry<T, R>
The table encoder entry for this type, used in types from
table::encode. Read more§fn write_field(item: T, writer: FieldWriter<'_, '_, R>)
 
fn write_field(item: T, writer: FieldWriter<'_, '_, R>)
Writes 
item as a field.§fn compute_field_size(item: &mut T, sizer: FieldSizer<'_>)
 
fn compute_field_size(item: &mut T, sizer: FieldSizer<'_>)
Computes the size of 
item as a field. Read more§fn wrap_in_sequence() -> bool
 
fn wrap_in_sequence() -> bool
Returns whether this field should be wrapped in a message when encoded
nested in a sequence (such as a repeated field). Read more
§fn packed<'a>() -> Option<&'a dyn PackedEncode<T>>where
    T: 'a,
 
fn packed<'a>() -> Option<&'a dyn PackedEncode<T>>where
    T: 'a,
Returns the encoder for writing multiple instances of this field in a
packed list, or 
None if there is no packed encoding for this type.§fn write_field_in_sequence(item: T, writer: &mut SequenceWriter<'_, '_, R>)
 
fn write_field_in_sequence(item: T, writer: &mut SequenceWriter<'_, '_, R>)
Writes this field as part of a sequence, wrapping it in a message if
necessary.
§fn compute_field_size_in_sequence(item: &mut T, sizer: &mut SequenceSizer<'_>)
 
fn compute_field_size_in_sequence(item: &mut T, sizer: &mut SequenceSizer<'_>)
Computes the size of this field as part of a sequence, including the
size of a wrapping message.
§impl<'de, T, E, R> MessageDecode<'de, T, R> for TransparentEncoding<E>
 
impl<'de, T, E, R> MessageDecode<'de, T, R> for TransparentEncoding<E>
§fn read_message(
    item: &mut InplaceOption<'_, T>,
    reader: MessageReader<'de, '_, R>,
) -> Result<(), Error>
 
fn read_message( item: &mut InplaceOption<'_, T>, reader: MessageReader<'de, '_, R>, ) -> Result<(), Error>
Reads a message into 
item.§impl<T, E, R> MessageEncode<T, R> for TransparentEncoding<E>
 
impl<T, E, R> MessageEncode<T, R> for TransparentEncoding<E>
§fn write_message(item: T, writer: MessageWriter<'_, '_, R>)
 
fn write_message(item: T, writer: MessageWriter<'_, '_, R>)
Writes 
item as a message.§fn compute_message_size(item: &mut T, sizer: MessageSizer<'_>)
 
fn compute_message_size(item: &mut T, sizer: MessageSizer<'_>)
Computes the size of 
item as a message. Read moreimpl<E> Copy for TransparentEncoding<E>where
    E: Copy,
Auto Trait Implementations§
impl<E> Freeze for TransparentEncoding<E>where
    E: Freeze,
impl<E> RefUnwindSafe for TransparentEncoding<E>where
    E: RefUnwindSafe,
impl<E> Send for TransparentEncoding<E>where
    E: Send,
impl<E> Sync for TransparentEncoding<E>where
    E: Sync,
impl<E> Unpin for TransparentEncoding<E>where
    E: Unpin,
impl<E> UnwindSafe for TransparentEncoding<E>where
    E: 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