CommunicationChannel

Trait CommunicationChannel 

Source
pub trait CommunicationChannel {
    // Required methods
    fn out_transfer<B: AsRef<[u8]>>(
        &mut self,
        bytes: B,
    ) -> Result<usize, ScsiError>;
    fn in_transfer<B: AsMut<[u8]>>(
        &mut self,
        buffer: B,
    ) -> Result<usize, ScsiError>;
}
Expand description

The trait that all communication devices should implement if they are to be used to transfer SCSI information.

Required Methods§

Source

fn out_transfer<B: AsRef<[u8]>>(&mut self, bytes: B) -> Result<usize, ScsiError>

Sends the bytes currently stored in a buffer over the communication channel. Returns the number of bytes sent.

Source

fn in_transfer<B: AsMut<[u8]>>(&mut self, buffer: B) -> Result<usize, ScsiError>

Reads bytes from the channel up to the point where the buffer is filled. Returns the number of bytes successfully read.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§