pub struct RawAttributeEncoder { /* private fields */ }
Expand description

RawAttribute encoder.

Implementations§

source§

impl RawAttributeEncoder

source

pub fn new() -> Self

Makes a new RawAttributeEncoder instance.

Trait Implementations§

source§

impl Debug for RawAttributeEncoder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RawAttributeEncoder

source§

fn default() -> RawAttributeEncoder

Returns the “default value” for a type. Read more
source§

impl Encode for RawAttributeEncoder

§

type Item = RawAttribute

The type of items to be encoded.
source§

fn encode(&mut self, buf: &mut [u8], eos: Eos) -> Result<usize>

Encodes the items in the encoder and writes the encoded bytes to the given buffer. Read more
source§

fn start_encoding(&mut self, item: Self::Item) -> Result<()>

Tries to start encoding the given item. Read more
source§

fn requiring_bytes(&self) -> ByteCount

Returns the number of bytes required to encode all the items in the encoder. Read more
source§

fn is_idle(&self) -> bool

Returns true if there are no items to be encoded in the encoder, otherwise false. Read more
source§

impl SizedEncode for RawAttributeEncoder

source§

fn exact_requiring_bytes(&self) -> u64

Returns the exact number of bytes required to encode all the items remaining in the encoder.

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> EncodeExt for T
where T: Encode,

source§

fn with_item(item: Self::Item) -> Result<Self, Error>
where Self: Default,

Creates a new encoder instance that has the given initial item. Read more
source§

fn map_err<E, F>(self, f: F) -> MapErr<Self, E, F>
where F: Fn(Error) -> E, Error: From<E>,

Creates an encoder for modifying encoding errors produced by self. Read more
source§

fn map_from<T, F>(self, f: F) -> MapFrom<Self, T, F>
where F: Fn(T) -> Self::Item,

Creates an encoder that converts items into ones that suited to the self encoder by calling the given function. Read more
source§

fn try_map_from<T, E, F>(self, f: F) -> TryMapFrom<Self, T, E, F>
where F: Fn(T) -> Result<Self::Item, E>, Error: From<E>,

Creates an encoder that tries to convert items into ones that suited to the self encoder by calling the given function. Read more
source§

fn optional(self) -> Optional<Self>

Creates an encoder that represents an optional encoder. Read more
source§

fn max_bytes(self, n: u64) -> MaxBytes<Self>

Creates an encoder that will fail if the number of encoded bytes of an item exceeds n. Read more
source§

fn length(self, n: u64) -> Length<Self>

Creates an encoder that required to encode each item exactly at the specified number of bytes. Read more
source§

fn chain<T>(self, other: T) -> TupleEncoder<(Self, T)>
where T: Encode,

Takes two encoders and creates a new encoder that encodes both items in sequence. Read more
source§

fn repeat<I>(self) -> Repeat<Self, I>
where I: Iterator<Item = Self::Item>,

Creates an encoder that repeats encoding of Self::Item. Read more
source§

fn pre_encode(self) -> PreEncode<Self>

Creates an encoder that pre-encodes items when start_encoding method is called. Read more
source§

fn slice(self) -> Slice<Self>

Creates an encoder that makes it possible to slice the encoded byte sequence in arbitrary units. Read more
source§

fn last(self, item: Self::Item) -> Last<Self>

Creates an encoder that cannot accept any more items except the given one.
source§

fn encode_into_bytes(&mut self, item: Self::Item) -> Result<Vec<u8>, Error>

Encodes the given item and returns the resulting bytes. 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> IoEncodeExt for T
where T: Encode,

source§

fn encode_to_write_buf<B>(&mut self, buf: &mut WriteBuf<B>) -> Result<(), Error>
where B: AsMut<[u8]>,

Encodes the items remaining in the encoder and writes the encoded bytes to the given write buffer.
source§

fn encode_all<W>(&mut self, writer: W) -> Result<(), Error>
where W: Write,

Encodes all of the items remaining in the encoder and writes the encoded bytes to the given writer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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

§

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.