mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-21 00:06:34 +00:00
Make Pollee
stateless
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
5450d0bd71
commit
fab61f5f66
@ -3,9 +3,19 @@
|
||||
/// A observer that will be invoked whenever events occur on the socket.
|
||||
pub trait SocketEventObserver: Send + Sync {
|
||||
/// Notifies that events occurred on the socket.
|
||||
fn on_events(&self);
|
||||
fn on_events(&self, events: SocketEvents);
|
||||
}
|
||||
|
||||
impl SocketEventObserver for () {
|
||||
fn on_events(&self) {}
|
||||
fn on_events(&self, _events: SocketEvents) {}
|
||||
}
|
||||
|
||||
bitflags::bitflags! {
|
||||
/// Socket events caused by the _network_.
|
||||
pub struct SocketEvents: u8 {
|
||||
const CAN_RECV = 1;
|
||||
const CAN_SEND = 2;
|
||||
const PEER_CLOSED = 4;
|
||||
const CLOSED = 8;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user