pub struct Receiver { /* private fields */ }Expand description
Receiver for an AF_XDP socket.
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn recv(&mut self) -> Result<RouteEvent<'_>, ChannelError>
pub fn recv(&mut self) -> Result<RouteEvent<'_>, ChannelError>
Blocks until a packet is available.
This returns a RouteEvent, which references the underlying memory. It should quickly be
dropped or converted into an crate::events::route::OwnedRouteEvent to avoid frame
starvation.
§Errors
Returns ChannelError::Disconnected if the channel is closed.
Sourcepub fn try_recv(&mut self) -> Result<RouteEvent<'_>, ChannelError>
pub fn try_recv(&mut self) -> Result<RouteEvent<'_>, ChannelError>
Attempts to receive a packet.
This returns a RouteEvent, which references the underlying memory. It should quickly be
dropped or converted into an crate::events::route::OwnedRouteEvent to avoid frame
starvation.
§Errors
Returns ChannelError::Disconnected if the channel is closed.
Returns ChannelError::Empty if there are no packets available.
Auto Trait Implementations§
impl Freeze for Receiver
impl !RefUnwindSafe for Receiver
impl Send for Receiver
impl !Sync for Receiver
impl Unpin for Receiver
impl UnsafeUnpin for Receiver
impl !UnwindSafe for Receiver
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