Trait Encode

Source
pub trait Encode: ThriftTyped {
    // Required method
    fn encode<P, T>(&self, _: &mut P, _: &mut T) -> Result<()>
       where P: Protocol,
             T: Transport;

    // Provided method
    fn should_encode(&self) -> bool { ... }
}

Required Methods§

Source

fn encode<P, T>(&self, _: &mut P, _: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Provided Methods§

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 bool

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for f64

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for i8

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for i16

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for i32

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for i64

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for ()

Source§

fn should_encode(&self) -> bool

Source§

fn encode<P, T>(&self, _: &mut P, _: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for String

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl Encode for Vec<u8>

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl<'a, E> Encode for &'a E
where E: Encode + ?Sized,

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

fn should_encode(&self) -> bool

Source§

impl<K: Encode + Ord + Default, V: Encode + Default> Encode for BTreeMap<K, V>

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl<X: Encode + Ord + Default> Encode for BTreeSet<X>

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl<X: Encode + Default> Encode for Option<X>

Source§

fn should_encode(&self) -> bool

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Source§

impl<X: Encode + Default> Encode for Vec<X>

Source§

fn encode<P, T>(&self, protocol: &mut P, transport: &mut T) -> Result<()>
where P: Protocol, T: Transport,

Implementors§