[][src]Struct protobuf_codec::field::Optional

pub struct Optional<T>(_);

Decoder and encoder for optinal fields.

Methods

impl<T> Optional<T>[src]

pub fn new(inner: T) -> Self[src]

Makes a new Optional instance.

pub fn inner_ref(&self) -> &T[src]

Returns a reference to the inner field encoder/decoder.

pub fn inner_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the inner field encoder/decoder.

pub fn into_inner(self) -> T[src]

Takes the ownership of the instance, and returns the inner field encoder/decoder.

Trait Implementations

impl<D: RequiredFieldDecode> FieldDecode for Optional<D>[src]

impl<E: RequiredFieldEncode> FieldEncode for Optional<E>[src]

impl<T: Default> Default for Optional<T>[src]

impl<T: Debug> Debug for Optional<T>[src]

impl<E: RequiredFieldEncode + SizedEncode> SizedEncode for Optional<E>[src]

impl<E: RequiredFieldEncode> Encode for Optional<E>[src]

type Item = Option<E::Item>

The type of items to be encoded.

impl<D: RequiredFieldDecode> Decode for Optional<D>[src]

type Item = Option<D::Item>

The type of items to be decoded.

Auto Trait Implementations

impl<T> Send for Optional<T> where
    T: Send

impl<T> Unpin for Optional<T> where
    T: Unpin

impl<T> Sync for Optional<T> where
    T: Sync

impl<T> UnwindSafe for Optional<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Optional<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> EncodeExt for T where
    T: Encode
[src]

impl<T> IoDecodeExt for T where
    T: Decode
[src]

impl<T> IoEncodeExt for T where
    T: Encode
[src]

impl<T> DecodeExt for T where
    T: Decode
[src]