pub trait BlockConnector: Send + Sync {
// Required method
fn connect_channel_to_block(
&self,
server_end: ServerEnd<BlockMarker>,
) -> Result<(), Error>;
// Provided method
fn connect_block(&self) -> Result<ClientEnd<BlockMarker>, Error> { ... }
}Expand description
Creates new connections to an instance of fuchsia.hardware.block.Block and similar protocols (Volume, Partition).
NOTE: It is important to understand the difference between BlockConnector and the actual
protocols (e.g. a ClientEnd<BlockMarker> or BlockProxy): BlockConnector is used to create
new connections to a Block.
It is not possible to directly convert a ClientEnd<BlockMarker> (or BlockProxy) into a
BlockConnector, because Block is not cloneable. To implement BlockConnector, you will need
a way to generate new connections to a Block instance. A few common implementations are
provided below.
Required Methods§
fn connect_channel_to_block( &self, server_end: ServerEnd<BlockMarker>, ) -> Result<(), Error>
Provided Methods§
fn connect_block(&self) -> Result<ClientEnd<BlockMarker>, Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".