Write

Trait Write 

Source
pub trait Write {
    // Required method
    fn write(&self, buf: &mut impl BufMut);
}
Expand description

Trait for types that can be written (encoded) to a byte buffer.

Required Methods§

Source

fn write(&self, buf: &mut impl BufMut)

Writes the binary representation of self to the provided buffer buf.

Implementations should panic if the buffer doesn’t have enough capacity.

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 Write for SocketAddr

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for bool

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for f32

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for f64

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for i8

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for i16

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for i32

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for i64

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for i128

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for u8

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for u16

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for u32

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for u64

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for u128

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for usize

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for Ipv4Addr

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for Ipv6Addr

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for SocketAddrV4

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for SocketAddrV6

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl Write for Bytes

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<K: Ord + Hash + Eq + Write> Write for BTreeSet<K>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<K: Ord + Hash + Eq + Write> Write for HashSet<K>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<K: Ord + Hash + Eq + Write, V: Write> Write for BTreeMap<K, V>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<K: Ord + Hash + Eq + Write, V: Write> Write for HashMap<K, V>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write> Write for (T0,)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write> Write for (T0, T1)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write> Write for (T0, T1, T2)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write> Write for (T0, T1, T2, T3)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write> Write for (T0, T1, T2, T3, T4)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write> Write for (T0, T1, T2, T3, T4, T5)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write> Write for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write, T7: Write> Write for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write, T7: Write, T8: Write> Write for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write, T7: Write, T8: Write, T9: Write> Write for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write, T7: Write, T8: Write, T9: Write, T10: Write> Write for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T0: Write, T1: Write, T2: Write, T3: Write, T4: Write, T5: Write, T6: Write, T7: Write, T8: Write, T9: Write, T10: Write, T11: Write> Write for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T: Write> Write for Option<T>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<T: Write> Write for Vec<T>

Source§

fn write(&self, buf: &mut impl BufMut)

Source§

impl<const N: usize> Write for [u8; N]

Source§

fn write(&self, buf: &mut impl BufMut)

Implementors§

Source§

impl<S: SPrim> Write for SInt<S>

Source§

impl<U: UPrim> Write for UInt<U>