pub trait ReadableServerHandler<___T: Transport = Channel> {
// Required method
fn read(
&mut self,
request: Request<Read, ___T>,
responder: Responder<Read, ___T>,
) -> impl Future<Output = ()> + Send;
}Expand description
A server handler for the Readable protocol.
See Readable for more details.
Required Methods§
Sourcefn read(
&mut self,
request: Request<Read, ___T>,
responder: Responder<Read, ___T>,
) -> impl Future<Output = ()> + Send
fn read( &mut self, request: Request<Read, ___T>, responder: Responder<Read, ___T>, ) -> impl Future<Output = ()> + Send
Reads up to ‘count’ bytes at the seek offset. The seek offset is moved forward by the number of bytes read.
§Invariants
- The returned
data.lengthwill never be greater thancount. - If
data.lengthis less thancount, it means that the seek offset has reached the end of file as part of this operation. - If
data.lengthis zero whilecountis not, it means that the seek offset is already at or beyond the end of file, and no data could be read. - If
countis zero, the server should perform all the checks ensuring read access without actually read anything, and return an emptydatavector.
This method requires the [Rights.READ_BYTES] right.
Returns ZX_ERR_OUT_OF_RANGE if count is greater than MAX_TRANSFER_SIZE.
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.