Struct nakamoto_net_poll::reactor::Reactor
source · pub struct Reactor<R: Write + Read, Id: PeerId = SocketAddr> { /* private fields */ }
Expand description
A single-threaded non-blocking reactor.
Trait Implementations
sourceimpl<Id: PeerId> Reactor<Id> for Reactor<TcpStream, Id>
impl<Id: PeerId> Reactor<Id> for Reactor<TcpStream, Id>
sourcefn new(
shutdown: Receiver<()>,
listening: Sender<SocketAddr>
) -> Result<Self, Error>
fn new(
shutdown: Receiver<()>,
listening: Sender<SocketAddr>
) -> Result<Self, Error>
Construct a new reactor, given a channel to send events on.
sourcefn run<S, E>(
&mut self,
listen_addrs: &[SocketAddr],
service: S,
publisher: E,
commands: Receiver<S::Command>
) -> Result<(), Error>where
S: Service<Id>,
S::DisconnectReason: Into<Disconnect<S::DisconnectReason>>,
E: Publisher<S::Event>,
fn run<S, E>(
&mut self,
listen_addrs: &[SocketAddr],
service: S,
publisher: E,
commands: Receiver<S::Command>
) -> Result<(), Error>where
S: Service<Id>,
S::DisconnectReason: Into<Disconnect<S::DisconnectReason>>,
E: Publisher<S::Event>,
Run the given service with the reactor.
Auto Trait Implementations
impl<R, Id> RefUnwindSafe for Reactor<R, Id>where
Id: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, Id> Send for Reactor<R, Id>where
Id: Send,
R: Send,
impl<R, Id> Sync for Reactor<R, Id>where
Id: Sync,
R: Sync,
impl<R, Id> Unpin for Reactor<R, Id>where
Id: Unpin,
R: Unpin,
impl<R, Id> UnwindSafe for Reactor<R, Id>where
Id: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more