pub struct ReadableSynchronousProxy { /* private fields */ }
Implementations§
source§impl ReadableSynchronousProxy
impl ReadableSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<ReadableEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<ReadableEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
sourcepub fn read(
&self,
count: u64,
___deadline: MonotonicInstant,
) -> Result<ReadableReadResult, Error>
pub fn read( &self, count: u64, ___deadline: MonotonicInstant, ) -> Result<ReadableReadResult, Error>
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.length
will never be greater thancount
. - If
data.length
is less thancount
, it means that the seek offset has reached the end of file as part of this operation. - If
data.length
is zero whilecount
is not, it means that the seek offset is already at or beyond the end of file, and no data could be read. - If
count
is zero, the server should perform all the checks ensuring read access without actually read anything, and return an emptydata
vector.
This method requires the [Rights.READ_BYTES
] right.
Returns ZX_ERR_OUT_OF_RANGE
if count
is greater than MAX_TRANSFER_SIZE
.
Trait Implementations§
source§impl Debug for ReadableSynchronousProxy
impl Debug for ReadableSynchronousProxy
source§impl SynchronousProxy for ReadableSynchronousProxy
impl SynchronousProxy for ReadableSynchronousProxy
§type Proxy = ReadableProxy
type Proxy = ReadableProxy
The async proxy for the same protocol.
§type Protocol = ReadableMarker
type Protocol = ReadableMarker
The protocol which this
Proxy
controls.source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for ReadableSynchronousProxy
impl RefUnwindSafe for ReadableSynchronousProxy
impl Send for ReadableSynchronousProxy
impl Sync for ReadableSynchronousProxy
impl Unpin for ReadableSynchronousProxy
impl UnwindSafe for ReadableSynchronousProxy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more