Skip to main content

WriteToDescriptorChain

Trait WriteToDescriptorChain 

Source
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§

Source

fn write_obj<T: VmediaType>(&mut self, obj: T) -> IoResult<()>

Write an arbitrary object to the guest.

Provided Methods§

Source

fn write_response<T: VmediaType>(&mut self, response: T) -> IoResult<()>

Write a command response to the guest.

Source

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§

Source§

impl<W> WriteToDescriptorChain for W
where W: Write,

Any implementor of std::io::Write can be used to write virtio-media responses.