Encoder

Trait Encoder 

Source
pub trait Encoder: Sized {
    // Required method
    fn write_to(&self, w: &mut impl Write) -> Result<()>;
}

Required Methods§

Source

fn write_to(&self, w: &mut impl Write) -> Result<()>

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 Encoder for bool

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for f32

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for f64

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for i8

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for i16

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for i32

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for i64

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for u8

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for u16

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for String

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for Vec<i64>

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl Encoder for Vec<u8>

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl<'a, T> Encoder for &'a T
where T: Encoder,

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Source§

impl<T> Encoder for Option<T>
where T: Encoder,

Source§

fn write_to(&self, w: &mut impl Write) -> Result<()>

Implementors§

Source§

impl Encoder for Angle

Source§

impl Encoder for Nbt

Source§

impl Encoder for Position

Source§

impl Encoder for Uuid

Source§

impl Encoder for VarInt

Source§

impl Encoder for VarLong

Source§

impl<'a> Encoder for LengthInferredVecU8<'a>

Source§

impl<'a, P, T> Encoder for LengthPrefixedVec<'a, P, T>
where T: Encoder, [T]: ToOwned<Owned = Vec<T>>, P: TryFrom<usize> + Encoder, P::Error: Error + Send + Sync + 'static,