pub struct NetworkInterface {
pub addr: SocketAddr,
/* private fields */
}Fields§
§addr: SocketAddrImplementations§
Source§impl NetworkInterface
impl NetworkInterface
pub fn new(own_ip: SocketAddr, addr: SocketAddr, seed: bool) -> NetworkInterface
pub fn from_stream( own_ip: SocketAddr, addr: SocketAddr, stream: TcpStream, ) -> NetworkInterface
Trait Implementations§
Source§impl Actor for NetworkInterface
impl Actor for NetworkInterface
Source§type Context = Context<NetworkInterface>
type Context = Context<NetworkInterface>
Actor execution context type
Source§fn started(&mut self, ctx: &mut Context<Self>)
fn started(&mut self, ctx: &mut Context<Self>)
Called when an actor gets polled the first time.
Source§fn stopping(&mut self, ctx: &mut Context<Self>) -> Running
fn stopping(&mut self, ctx: &mut Context<Self>) -> Running
Called after an actor is in
Actor::Stopping state. Read moreSource§fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
Start new actor in arbiter’s thread.
Source§impl Debug for NetworkInterface
impl Debug for NetworkInterface
Source§impl Handler<ClusterMessage> for NetworkInterface
impl Handler<ClusterMessage> for NetworkInterface
Source§impl StreamHandler<Result<ClusterMessage, Error>> for NetworkInterface
impl StreamHandler<Result<ClusterMessage, Error>> for NetworkInterface
Source§fn handle(
&mut self,
item: Result<ClusterMessage, Error>,
ctx: &mut Context<Self>,
)
fn handle( &mut self, item: Result<ClusterMessage, Error>, ctx: &mut Context<Self>, )
Called for every message emitted by the stream.
Source§fn add_stream<S>(stream: S, ctx: &mut Self::Context) -> SpawnHandlewhere
S: Stream + 'static,
Self: StreamHandler<<S as Stream>::Item>,
Self::Context: AsyncContext<Self>,
fn add_stream<S>(stream: S, ctx: &mut Self::Context) -> SpawnHandlewhere
S: Stream + 'static,
Self: StreamHandler<<S as Stream>::Item>,
Self::Context: AsyncContext<Self>,
Register a Stream to the actor context.
Source§impl Supervised for NetworkInterface
impl Supervised for NetworkInterface
Source§fn restarting(&mut self, ctx: &mut Self::Context)
fn restarting(&mut self, ctx: &mut Self::Context)
Called when the supervisor restarts a failed actor.
Auto Trait Implementations§
impl Freeze for NetworkInterface
impl !RefUnwindSafe for NetworkInterface
impl Send for NetworkInterface
impl Sync for NetworkInterface
impl Unpin for NetworkInterface
impl UnsafeUnpin for NetworkInterface
impl !UnwindSafe for NetworkInterface
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
Source§impl<A> BrokerIssue for A
impl<A> BrokerIssue for A
Source§fn issue_async<T, M>(&self, msg: M)where
T: RegisteredBroker,
M: BrokerMsg,
fn issue_async<T, M>(&self, msg: M)where
T: RegisteredBroker,
M: BrokerMsg,
Asynchronously issue a message.
This bypasses the mailbox capacity, and will always queue the message.
If the mailbox is closed, the message is silently dropped and the subscriber
is detached from the broker.
Source§fn issue_sync<T, M>(&self, msg: M, ctx: &mut Self::Context)where
T: RegisteredBroker,
M: BrokerMsg,
fn issue_sync<T, M>(&self, msg: M, ctx: &mut Self::Context)where
T: RegisteredBroker,
M: BrokerMsg,
Synchronously issue a message.
This also causes the broker to synchronously forward those messages on to any subscribers
before handling any other messages.
Source§fn issue_system_async<M>(&self, msg: M)where
M: BrokerMsg,
fn issue_system_async<M>(&self, msg: M)where
M: BrokerMsg,
Helper to asynchronously issue to an system broker
This is the equivalent of
self.issue_async::<SystemBroker, M>(ctx);Source§fn issue_system_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
fn issue_system_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
Helper to synchronously issue to an system broker
This is the equivalent of
self.issue_sync::<SystemBroker, M>(ctx);Source§fn issue_arbiter_async<M>(&self, msg: M)where
M: BrokerMsg,
fn issue_arbiter_async<M>(&self, msg: M)where
M: BrokerMsg,
Helper to asynchronously issue to an arbiter-specific broker
This is the equivalent of
self.issue_async::<ArbiterBroker, M>(ctx);Source§fn issue_arbiter_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
fn issue_arbiter_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
Helper to synchronously issue to an arbiter-specific broker
This is the equivalent of
self.issue_sync::<ArbiterBroker, M>(ctx);Source§impl<A> BrokerSubscribe for A
impl<A> BrokerSubscribe for A
Source§fn subscribe_async<T, M>(&self, ctx: &mut Self::Context)
fn subscribe_async<T, M>(&self, ctx: &mut Self::Context)
Asynchronously subscribe to a message.
Source§fn subscribe_sync<T, M>(&self, ctx: &mut Self::Context)
fn subscribe_sync<T, M>(&self, ctx: &mut Self::Context)
Synchronously subscribe to a message.
This actor will do nothing else until its interest is registered.
If messages of that type have been sent to the broker previously, a copy of the latest
message is sent to the calling actor after it has subscribed.
Source§fn subscribe_system_async<M>(&self, ctx: &mut Self::Context)
fn subscribe_system_async<M>(&self, ctx: &mut Self::Context)
Helper to asynchronously subscribe to a system broker
This is the equivalent of
self.subscribe_async::<SystemBroker, M>(ctx);Source§fn subscribe_system_sync<M>(&self, ctx: &mut Self::Context)
fn subscribe_system_sync<M>(&self, ctx: &mut Self::Context)
Helper to synchronously subscribe to a system broker
This is the equivalent of `self.subscribe_sync::<SystemBroker, M>(ctx);
Source§fn subscribe_arbiter_async<M>(&self, ctx: &mut Self::Context)
fn subscribe_arbiter_async<M>(&self, ctx: &mut Self::Context)
Helper to asynchronously subscribe to an arbiter-specific broker
This is the equivalent of
self.subscribe_async::<ArbiterBroker, M>(ctx);Source§fn subscribe_arbiter_sync<M>(&self, ctx: &mut Self::Context)
fn subscribe_arbiter_sync<M>(&self, ctx: &mut Self::Context)
Helper to synchronously subscribe to an arbiter-specific broker
This is the equivalent of `self.subscribe_sync::<ArbiterBroker, M>(ctx);