Struct mesh_protobuf::transparent::TransparentEncoding

source ·
pub struct TransparentEncoding<E>(/* private fields */);
Expand description

An encoding derived by mesh_derive for a transparent type, using inner encoding E.

Trait Implementations§

source§

impl<E: Clone> Clone for TransparentEncoding<E>

source§

fn clone(&self) -> TransparentEncoding<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Transparent, E: DescribeField<T::Inner>> DescribeField<T> for TransparentEncoding<E>

source§

const FIELD_TYPE: FieldType<'static> = E::FIELD_TYPE

The type of the field.
source§

const PACKED_TYPE: Option<&'static str> = E::PACKED_TYPE

The type name of the field in a packed context.
source§

impl<T: Transparent, E: DescribeMessage<T::Inner>> DescribeMessage<T> for TransparentEncoding<E>

source§

const DESCRIPTION: MessageDescription<'static> = E::DESCRIPTION

The message description.
source§

impl<'de, T: Transparent, E: FieldDecode<'de, T::Inner, R>, R> FieldDecode<'de, T, R> for TransparentEncoding<E>

source§

fn read_field( item: &mut InplaceOption<'_, T>, reader: FieldReader<'de, '_, R>, ) -> Result<()>

Reads a field into item.
source§

fn default_field(item: &mut InplaceOption<'_, T>) -> Result<()>

Instantiates item with its default value, if there is one. Read more
source§

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).
source§

const ENTRY: DecoderEntry<'de, T, R> = _

The table decoder entry for this type, used in types from table::decode. Read more
source§

fn packed<'p, C: CopyExtend<T>>() -> Option<&'p dyn PackedDecode<'a, T, C>>
where T: 'p,

Unless packed()::must_pack() is true, the sequence decoder must detect the encoding (packed or not) and call the appropriate method.
source§

fn read_field_in_sequence( item: &mut InplaceOption<'_, T>, reader: FieldReader<'a, '_, R>, ) -> Result<()>

Reads this field that was encoded as part of a sequence, unwrapping it from a message if necessary.
source§

impl<T: Transparent, E: FieldEncode<T::Inner, R>, R> FieldEncode<T, R> for TransparentEncoding<E>

source§

fn write_field(item: T, writer: FieldWriter<'_, '_, R>)

Writes item as a field.
source§

fn compute_field_size(item: &mut T, sizer: FieldSizer<'_>)

Computes the size of item as a field. Read more
source§

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
source§

const ENTRY: EncoderEntry<T, R> = _

The table encoder entry for this type, used in types from table::encode. Read more
source§

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.
source§

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.
source§

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.
source§

impl<'de, T: Transparent, E: MessageDecode<'de, T::Inner, R>, R> MessageDecode<'de, T, R> for TransparentEncoding<E>

source§

fn read_message( item: &mut InplaceOption<'_, T>, reader: MessageReader<'de, '_, R>, ) -> Result<()>

Reads a message into item.
source§

impl<T: Transparent, E: MessageEncode<T::Inner, R>, R> MessageEncode<T, R> for TransparentEncoding<E>

source§

fn write_message(item: T, writer: MessageWriter<'_, '_, R>)

Writes item as a message.
source§

fn compute_message_size(item: &mut T, sizer: MessageSizer<'_>)

Computes the size of item as a message. Read more
source§

impl<E: Copy> Copy for TransparentEncoding<E>

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> Upcast<U> for T
where U: Downcast<T>,