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: Time) -> Result<FakeEndpointEvent, Error>
pub fn wait_for_event(&self, deadline: Time) -> 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: Time) -> Result<(), Error>
pub fn write(&self, data: &[u8], ___deadline: Time) -> Result<(), Error>
Writes a frame to the network.
sourcepub fn read(&self, ___deadline: Time) -> Result<(Vec<u8>, u64), Error>
pub fn read(&self, ___deadline: Time) -> 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§
Auto Trait Implementations§
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