Trait binary_utils::SyncDataWriter

source ·
pub trait SyncDataWriter {
    // Required method
    fn write(&self, writer: &mut impl Write) -> Result<()>;
}
Expand description

A trait for types that have to be written to a synchronous stream

§Notes

This trait is intended to be implemented for types that represent structured data and provide a method to synchronously write that data into an output source. Implementations should handle error conditions appropriately and return a Result indicating success or failure.

Required Methods§

source

fn write(&self, writer: &mut impl Write) -> Result<()>

Writes the data of the object into the defined writer.

§Arguments
  • writer - A mutable reference to a type implementing Write trait, into which the data will be written.
§Returns

Returns a result indicating success or failure of the writing operation.

Object Safety§

This trait is not object safe.

Implementors§