pub enum BlockRequest {
GetInfo {
responder: BlockGetInfoResponder,
},
GetStats {
clear: bool,
responder: BlockGetStatsResponder,
},
OpenSession {
session: ServerEnd<SessionMarker>,
control_handle: BlockControlHandle,
},
ReadBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: BlockReadBlocksResponder,
},
WriteBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: BlockWriteBlocksResponder,
},
}
Expand description
Defines access to a device which is accessible in block-granularity chunks for reading and writing.
Variants§
GetInfo
Get information about the underlying block device.
Fields
responder: BlockGetInfoResponder
GetStats
Returns stats about block device operations. Setting clear
will reset stats counters.
OpenSession
Opens a new FIFO-based session on the block device.
ReadBlocks
Reads from a block device.
This read does not require exclusive access. length, dev_offset and vmo_offset are specified in bytes, but they must be block-aligned. This method is provided for backward compatibility, and is not intended for new code. New code should use the FIFO interface along with the client libraries to read and write from block devices.
WriteBlocks
Writes to a block device.
This write does not require exclusive access. length, dev_offset and vmo_offset are specified in bytes, but they must be block-aligned. This method is provided for backward compatibility, and is not intended for new code. New code should use the FIFO interface along with the client libraries to read and write from block devices.
Implementations§
source§impl BlockRequest
impl BlockRequest
pub fn into_get_info(self) -> Option<BlockGetInfoResponder>
pub fn into_get_stats(self) -> Option<(bool, BlockGetStatsResponder)>
pub fn into_open_session( self ) -> Option<(ServerEnd<SessionMarker>, BlockControlHandle)>
pub fn into_read_blocks( self ) -> Option<(Vmo, u64, u64, u64, BlockReadBlocksResponder)>
pub fn into_write_blocks( self ) -> Option<(Vmo, u64, u64, u64, BlockWriteBlocksResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL