pub enum FakeEndpointRequest {
Write {
data: Vec<u8>,
responder: FakeEndpointWriteResponder,
},
Read {
responder: FakeEndpointReadResponder,
},
}
Expand description
Fake endpoint can be added to a network to snoop or inject packets.
Variants§
Write
Writes a frame to the network.
Read
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
.
Fields
§
responder: FakeEndpointReadResponder
Implementations§
Source§impl FakeEndpointRequest
impl FakeEndpointRequest
pub fn into_write(self) -> Option<(Vec<u8>, FakeEndpointWriteResponder)>
pub fn into_read(self) -> Option<FakeEndpointReadResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FakeEndpointRequest
impl !RefUnwindSafe for FakeEndpointRequest
impl Send for FakeEndpointRequest
impl Sync for FakeEndpointRequest
impl Unpin for FakeEndpointRequest
impl !UnwindSafe for FakeEndpointRequest
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