Struct message_io::network::NetworkProcessor
source · pub struct NetworkProcessor { /* private fields */ }
Expand description
Instance in charge of process input network events.
These events are offered to the user as a NetEvent
its processing data.
Implementations§
source§impl NetworkProcessor
impl NetworkProcessor
sourcepub fn process_poll_event(
&mut self,
timeout: Option<Duration>,
event_callback: impl FnMut(NetEvent<'_>)
)
pub fn process_poll_event( &mut self, timeout: Option<Duration>, event_callback: impl FnMut(NetEvent<'_>) )
Process the next poll event.
This method waits the timeout specified until the poll event is generated.
If None
is passed as timeout, it will wait indefinitely.
Note that there is no 1-1 relation between an internal poll event and a NetEvent
.
You need to assume that process an internal poll event could call 0 or N times to
the callback with diferents NetEvent
s.
sourcepub fn process_poll_events_until_timeout(
&mut self,
timeout: Duration,
event_callback: impl FnMut(NetEvent<'_>)
)
pub fn process_poll_events_until_timeout( &mut self, timeout: Duration, event_callback: impl FnMut(NetEvent<'_>) )
Process poll events until there is no more events during a timeout
duration.
This method makes succesive calls to NetworkProcessor::process_poll_event()
.
Auto Trait Implementations§
impl !RefUnwindSafe for NetworkProcessor
impl Send for NetworkProcessor
impl Sync for NetworkProcessor
impl Unpin for NetworkProcessor
impl UnwindSafe for NetworkProcessor
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