Encode

Trait Encode 

Source
pub trait Encode {
    // Required method
    fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error<W::Error>>;
}
Expand description

Encode trait

Required Methods§

Source

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

Write the type to writer by CBOR encoding.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Encode for &str

Source§

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

Source§

impl Encode for bool

Source§

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

Source§

impl Encode for f32

Source§

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

Source§

impl Encode for f64

Source§

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

Source§

impl Encode for i8

Source§

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

Source§

impl Encode for i16

Source§

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

Source§

impl Encode for i32

Source§

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

Source§

impl Encode for i64

Source§

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

Source§

impl Encode for i128

Source§

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

Source§

impl Encode for u8

Source§

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

Source§

impl Encode for u16

Source§

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

Source§

impl Encode for u32

Source§

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

Source§

impl Encode for u64

Source§

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

Source§

impl Encode for u128

Source§

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

Source§

impl Encode for String

Available on crate feature use_alloc only.
Source§

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

Source§

impl Encode for f16

Available on crate feature half-f16 only.
Source§

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

Source§

impl<T: Encode> Encode for &[T]

Source§

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

Source§

impl<T: Encode> Encode for &T

Source§

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

Source§

impl<T: Encode> Encode for Box<T>

Available on crate feature use_alloc only.
Source§

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

Source§

impl<T: Encode> Encode for Vec<T>

Available on crate feature use_alloc only.
Source§

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

Implementors§