pub trait WriteToDescriptorChain: WSealed {
// Required method
fn write_obj<T: VmediaType>(&mut self, obj: T) -> IoResult<()>;
// Provided methods
fn write_response<T: VmediaType>(&mut self, response: T) -> IoResult<()> { ... }
fn write_err_response(&mut self, code: c_int) -> IoResult<()> { ... }
}Expand description
Extension trait for writing objects and responses into the device-writable section of a descriptor chain, after converting them to little-endian representation.
Required Methods§
Sourcefn write_obj<T: VmediaType>(&mut self, obj: T) -> IoResult<()>
fn write_obj<T: VmediaType>(&mut self, obj: T) -> IoResult<()>
Write an arbitrary object to the guest.
Provided Methods§
Sourcefn write_response<T: VmediaType>(&mut self, response: T) -> IoResult<()>
fn write_response<T: VmediaType>(&mut self, response: T) -> IoResult<()>
Write a command response to the guest.
Sourcefn write_err_response(&mut self, code: c_int) -> IoResult<()>
fn write_err_response(&mut self, code: c_int) -> IoResult<()>
Send code as the error code of an error response.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<W> WriteToDescriptorChain for Wwhere
W: Write,
Any implementor of std::io::Write can be used to write virtio-media responses.