Skip to main content

Repeated

Struct Repeated 

Source
pub struct Repeated<C>(/* private fields */);
Expand description

Codec for repeated T extension fields, unpacked wire encoding.

Decode accepts both packed and unpacked wire forms (proto spec requires this). Encode emits one record per element — this is the proto2 default for extensions and what *Options extendees expect.

Trait Implementations§

Source§

impl<C: SingularCodec> ExtensionCodec for Repeated<C>

Source§

type Value = Vec<<C as SingularCodec>::Value>

The value type passed to ExtensionSet::set_extension.
Source§

type Output = Vec<<C as SingularCodec>::Value>

The return type of ExtensionSet::extension.
Source§

fn decode(number: u32, fields: &UnknownFields) -> Vec<C::Value>

Decode this extension’s value from the extendee’s unknown fields.
Source§

fn try_encode( number: u32, value: Vec<C::Value>, fields: &mut UnknownFields, ) -> Result<(), EncodeError>

Encode value into the extendee’s unknown fields. Read more
Source§

fn encode(number: u32, value: Self::Value, fields: &mut UnknownFields)

Panicking wrapper over try_encode. Read more

Auto Trait Implementations§

§

impl<C> Forget for Repeated<C>

§

impl<C> Freeze for Repeated<C>
where PhantomData<fn() -> C>: Freeze,

§

impl<C> Move for Repeated<C>

§

impl<C> RefUnwindSafe for Repeated<C>
where PhantomData<fn() -> C>: RefUnwindSafe,

§

impl<C> Send for Repeated<C>
where PhantomData<fn() -> C>: Send,

§

impl<C> Sync for Repeated<C>
where PhantomData<fn() -> C>: Sync,

§

impl<C> Unpin for Repeated<C>
where PhantomData<fn() -> C>: Unpin,

§

impl<C> UnsafeUnpin for Repeated<C>
where PhantomData<fn() -> C>: UnsafeUnpin,

§

impl<C> UnwindSafe for Repeated<C>
where PhantomData<fn() -> C>: 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.