PackTwInt

Trait PackTwInt 

Source
pub trait PackTwInt {
    // Required method
    fn pack<T: Write + ?Sized>(self, dst: &mut T) -> Result<()>;
}
Expand description

Trait implemented by values that can be packed to a teeworlds variable int.

Note that teeworlds only packs i32 values.

This trait is more of a convenience to allow writing 0i32.pack(&mut buff)

Required Methods§

Source

fn pack<T: Write + ?Sized>(self, dst: &mut T) -> Result<()>

Pack this value into a teeworlds variable int.

§Errors

Returns Err if there is an error writing to dst.

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 PackTwInt for i32

Source§

fn pack<T: Write + ?Sized>(self, dst: &mut T) -> Result<()>

Implementors§