pub struct FakeEndpointSynchronousProxy { /* private fields */ }
Implementations§
Source§impl FakeEndpointSynchronousProxy
impl FakeEndpointSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<FakeEndpointEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<FakeEndpointEvent, 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 write(
&self,
data: &[u8],
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn write( &self, data: &[u8], ___deadline: MonotonicInstant, ) -> Result<(), Error>
Writes a frame to the network.
Sourcepub fn read(
&self,
___deadline: MonotonicInstant,
) -> Result<(Vec<u8>, u64), Error>
pub fn read( &self, ___deadline: MonotonicInstant, ) -> Result<(Vec<u8>, u64), Error>
Reads a single frame from the network.
Blocks until new data is available to be read. FakeEndpoint will keep a limited amount of
frames to be read, dropping the oldest ones if the data is not fetched fast enough. The
number of dropped frames since the last call to Read
is returned in dropped_frames
.
Issuing a second Read
request when the first one is still pending will cause the channel
to be closed with ZX_ERR_BAD_STATE
.
Trait Implementations§
Source§impl Debug for FakeEndpointSynchronousProxy
impl Debug for FakeEndpointSynchronousProxy
Source§impl SynchronousProxy for FakeEndpointSynchronousProxy
impl SynchronousProxy for FakeEndpointSynchronousProxy
Source§type Proxy = FakeEndpointProxy
type Proxy = FakeEndpointProxy
The async proxy for the same protocol.
Source§type Protocol = FakeEndpointMarker
type Protocol = FakeEndpointMarker
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 FakeEndpointSynchronousProxy
impl RefUnwindSafe for FakeEndpointSynchronousProxy
impl Send for FakeEndpointSynchronousProxy
impl Sync for FakeEndpointSynchronousProxy
impl Unpin for FakeEndpointSynchronousProxy
impl UnwindSafe for FakeEndpointSynchronousProxy
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