Struct mesh::payload::encoding::VarintField

source ·
pub struct VarintField;
Expand description

A field encoder for varint fields.

Trait Implementations§

source§

impl DescribeField<NonZero<i16>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<i32>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<i64>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<i8>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<isize>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<u16>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<u32>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<u64>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<u8>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<NonZero<usize>> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<bool> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<i16> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<i32> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<i64> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<i8> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<isize> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<u16> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<u32> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<u64> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<u8> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl DescribeField<usize> for VarintField

source§

const FIELD_TYPE: FieldType<'static> = _

The type of the field.
source§

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

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

impl<'a, T, R> FieldDecode<'a, T, R> for VarintField
where T: FromNumber,

source§

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

Reads a field into item.
source§

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

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

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

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

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

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

impl<T, R> FieldEncode<T, R> for VarintField
where T: ToNumber,

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

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§

const ENTRY: EncoderEntry<T, R> = _

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

impl<T, C> PackedDecode<'_, T, C> for VarintField
where T: FromNumber, C: CopyExtend<T>,

source§

fn read_packed( &self, data: &mut C, reader: &mut PackedReader<'_>, ) -> Result<(), Error>

Reads from the packed format into data.
source§

fn must_pack(&self) -> bool

If true, when this type is decoded as part of a sequence, it must be done with read_packed and not the field methods.
source§

impl<T> PackedEncode<T> for VarintField
where T: ToNumber,

source§

fn write_packed(&self, data: &[T], writer: PackedWriter<'_, '_>)

Writes a slice of data in packed format.
source§

fn compute_packed_size(&self, data: &[T], sizer: PackedSizer<'_>)

Computes the size of the data in packed format.
source§

fn must_pack(&self) -> bool

If true, when this type is encoded as part of a sequence, it cannot be encoded with a normal repeated encoding and must be packed. This is used to determine if a nested repeated sequence needs to be wrapped in a message to avoid ambiguity.

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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