Skip to main content

PartitionIoServerHandler

Trait PartitionIoServerHandler 

Source
pub trait PartitionIoServerHandler<___T: Transport = Channel> {
    // Required methods
    fn get_partition_size(
        &mut self,
        request: Request<GetPartitionSize, ___T>,
        responder: Responder<GetPartitionSize, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn read_partition(
        &mut self,
        request: Request<ReadPartition, ___T>,
        responder: Responder<ReadPartition, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn write_partition(
        &mut self,
        request: Request<WritePartition, ___T>,
        responder: Responder<WritePartition, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn flush(
        &mut self,
        responder: Responder<Flush, ___T>,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A server handler for the PartitionIo protocol.

See PartitionIo for more details.

Required Methods§

Source

fn get_partition_size( &mut self, request: Request<GetPartitionSize, ___T>, responder: Responder<GetPartitionSize, ___T>, ) -> impl Future<Output = ()> + Send

Returns the size in bytes of a raw partition by name.

Source

fn read_partition( &mut self, request: Request<ReadPartition, ___T>, responder: Responder<ReadPartition, ___T>, ) -> impl Future<Output = ()> + Send

Reads size bytes from a raw partition by name starting at offset.

Both offset and size may be arbitrary byte values and do not need to be aligned to the partition’s block size. The ZX_PROP_VMO_CONTENT_SIZE property on the returned payload VMO will be set to size.

Returns ZX_ERR_INVALID_ARGS if size is 0, or ZX_ERR_OUT_OF_RANGE if offset + size exceeds the partition size.

Source

fn write_partition( &mut self, request: Request<WritePartition, ___T>, responder: Responder<WritePartition, ___T>, ) -> impl Future<Output = ()> + Send

Writes payload to a raw partition by name starting at offset.

The number of bytes to write is read from the ZX_PROP_VMO_CONTENT_SIZE property of payload. Both offset and the write size may be arbitrary byte values and do not need to be aligned to the partition’s block size.

Any leading partial block (when offset is not block-aligned) is always updated via read-modify-write to preserve existing bytes prior to offset. Behavior for partition contents after offset + size is controlled by trailing.

On some platforms, written data may be buffered in memory and is not guaranteed to be persisted to storage until Flush is called.

Returns ZX_ERR_OUT_OF_RANGE if offset + size exceeds the partition size.

Source

fn flush( &mut self, responder: Responder<Flush, ___T>, ) -> impl Future<Output = ()> + Send

Flushes all previous WritePartition operations to persistent storage.

Callers must invoke Flush after completing partition writes to ensure that any buffered data is persisted to storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§