pub trait Writer<F> {
// Required methods
fn write_opaque_variable(&mut self, bytes: &[u8]) -> Result<(), WriteError>;
fn write_i64(&mut self, n: i64) -> Result<(), WriteError>;
fn write_i32(&mut self, n: i32) -> Result<(), WriteError>;
fn write_i16(&mut self, n: i16) -> Result<(), WriteError>;
fn write_u64(&mut self, n: u64) -> Result<(), WriteError>;
fn write_u32(&mut self, n: u32) -> Result<(), WriteError>;
fn write_u16(&mut self, n: u16) -> Result<(), WriteError>;
fn write_bool(&mut self, b: bool) -> Result<(), WriteError>;
fn write_f32(&mut self, n: f32) -> Result<(), WriteError>;
fn write_f64(&mut self, n: f64) -> Result<(), WriteError>;
}Expand description
Something that can write XDR values to a serialization format.
This trait provides methods for writing XDR primitive types to an
underlying serialization format. The type parameter F represents
the format being written (e.g., CXS or TXS).
Implementations of this trait are used by WriteXDR
to serialize complex types.
Required Methods§
Sourcefn write_opaque_variable(&mut self, bytes: &[u8]) -> Result<(), WriteError>
fn write_opaque_variable(&mut self, bytes: &[u8]) -> Result<(), WriteError>
Writes a byte sequence of variable length.
Sourcefn write_bool(&mut self, b: bool) -> Result<(), WriteError>
fn write_bool(&mut self, b: bool) -> Result<(), WriteError>
Writes a boolean value.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".