Trait simple_tlv::Encodable[][src]

pub trait Encodable {
    fn encoded_length(&self) -> Result<Length>;
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>; fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]> { ... } }

Encoding trait.

Encode into encoder, which essentially is a mutable slice of bytes.

Additionally, the encoded length needs to be known without actually encoding.

Required methods

fn encoded_length(&self) -> Result<Length>[src]

Compute the length of this value in bytes when encoded as SIMPLE-TLV

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

Loading content...

Provided methods

fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>[src]

Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.

Loading content...

Implementors

impl Encodable for Length[src]

impl Encodable for Tag[src]

impl Encodable for [u8; 0][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 1][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 2][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 3][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 4][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 5][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 6][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 7][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 8][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 9][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 10][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 11][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 12][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 13][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 14][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 15][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 16][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 17][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 18][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 19][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 20][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 21][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 22][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 23][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 24][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 25][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 26][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 27][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 28][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 29][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 30][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 31][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl Encodable for [u8; 32][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl<'a> Encodable for &'a [u8][src]

fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]

Encode this value as SIMPLE-TLV using the provided Encoder.

impl<'a> Encodable for TaggedSlice<'a>[src]

impl<'a, E> Encodable for TaggedValue<&'a E> where
    E: Encodable
[src]

impl<TaggedContainer> Encodable for TaggedContainer where
    TaggedContainer: Tagged + Container
[src]

Loading content...