Skip to main content

PrefixedWrite

Trait PrefixedWrite 

Source
pub trait PrefixedWrite {
    // Required method
    fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>(
        &self,
        writer: &mut impl Write,
        bound: usize,
    ) -> Result<()>;

    // Provided method
    fn write_prefixed<P: TryFrom<usize> + WriteTo>(
        &self,
        writer: &mut impl Write,
    ) -> Result<()> { ... }
}
Expand description

A trait for writing prefixed data to a writer.

Required Methods§

Source

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Writes prefixed data to a writer with a bound.

Provided Methods§

Source

fn write_prefixed<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, ) -> Result<()>

Writes prefixed data to a writer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PrefixedWrite for String

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Source§

impl PrefixedWrite for str

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Source§

impl<T: PrefixedWrite> PrefixedWrite for Option<T>

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Source§

impl<T: WriteTo, const N: usize> PrefixedWrite for [T; N]

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Source§

impl<T: WriteTo> PrefixedWrite for Vec<T>

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Source§

impl<T: WriteTo> PrefixedWrite for [T]

Source§

fn write_prefixed_bound<P: TryFrom<usize> + WriteTo>( &self, writer: &mut impl Write, bound: usize, ) -> Result<()>

Implementors§