[go: up one dir, main page]

Trait tora::write::ToraWrite

source ·
pub trait ToraWrite {
    // Required methods
    fn writes<S>(&mut self, s: &S) -> Result<()>
       where S: SerializeIo;
    fn write_utf8<S>(&mut self, s: S) -> Result<()>
       where S: AsRef<str>;
    fn write_dyn_bytes<B>(&mut self, b: B) -> Result<()>
       where B: AsRef<[u8]>;
    fn write_dyn<T, D>(&mut self, d: D) -> Result<()>
       where D: AsRef<[T]>,
             T: SerializeIo;
}
Expand description

An extension to the standard Write trait.

Required Methods§

source

fn writes<S>(&mut self, s: &S) -> Result<()>where S: SerializeIo,

Serialize and write the given data.

source

fn write_utf8<S>(&mut self, s: S) -> Result<()>where S: AsRef<str>,

Write the given string in UTF-8.

If the given string does not end in a NUL 0x00 byte, one will be appended.

source

fn write_dyn_bytes<B>(&mut self, b: B) -> Result<()>where B: AsRef<[u8]>,

Write a dynamic amount of bytes.

Opposite of ToraRead::read_dyn_bytes.

source

fn write_dyn<T, D>(&mut self, d: D) -> Result<()>where D: AsRef<[T]>, T: SerializeIo,

Write a dynamic amount of objects.

Opposite of ToraRead::read_dyn.

Implementors§

source§

impl<W> ToraWrite for Wwhere W: Write,