pub struct NodeAliasBehavior { /* private fields */ }Implementations§
Source§impl NodeAliasBehavior
impl NodeAliasBehavior
pub fn new(node_id: NodeId, pubsub_sdk: PubsubSdk) -> (Self, NodeAliasSdk)
Trait Implementations§
Source§impl<BE, HE, SE> NetworkBehavior<BE, HE, SE> for NodeAliasBehavior
impl<BE, HE, SE> NetworkBehavior<BE, HE, SE> for NodeAliasBehavior
Source§fn service_id(&self) -> u8
fn service_id(&self) -> u8
Returns the service ID of the behavior.
Source§fn on_started(&mut self, ctx: &BehaviorContext, _now_ms: u64)
fn on_started(&mut self, ctx: &BehaviorContext, _now_ms: u64)
Called when the behavior is started.
Source§fn on_tick(&mut self, _ctx: &BehaviorContext, now_ms: u64, _interval_ms: u64)
fn on_tick(&mut self, _ctx: &BehaviorContext, now_ms: u64, _interval_ms: u64)
Called on each tick of the behavior.
Source§fn on_awake(&mut self, _ctx: &BehaviorContext, now_ms: u64)
fn on_awake(&mut self, _ctx: &BehaviorContext, now_ms: u64)
Called when the behavior is awoken.
Source§fn on_sdk_msg(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_from_service: u8,
_event: SE,
)
fn on_sdk_msg( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _from_service: u8, _event: SE, )
Called when a message is received from other SDK.
Source§fn on_local_msg(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_msg: TransportMsg,
)
fn on_local_msg( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _msg: TransportMsg, )
Called when a message is received locally.
Source§fn check_incoming_connection(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node: NodeId,
_conn_id: ConnId,
) -> Result<(), ConnectionRejectReason>
fn check_incoming_connection( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node: NodeId, _conn_id: ConnId, ) -> Result<(), ConnectionRejectReason>
Called when an incoming connection is received.
Source§fn check_outgoing_connection(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node: NodeId,
_conn_id: ConnId,
) -> Result<(), ConnectionRejectReason>
fn check_outgoing_connection( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node: NodeId, _conn_id: ConnId, ) -> Result<(), ConnectionRejectReason>
Called when an outgoing connection is initiated.
Source§fn on_incoming_connection_connected(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_conn: Arc<dyn ConnectionSender>,
) -> Option<Box<dyn ConnectionHandler<BE, HE>>>
fn on_incoming_connection_connected( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _conn: Arc<dyn ConnectionSender>, ) -> Option<Box<dyn ConnectionHandler<BE, HE>>>
Called when an incoming connection is established.
Source§fn on_outgoing_connection_connected(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_conn: Arc<dyn ConnectionSender>,
) -> Option<Box<dyn ConnectionHandler<BE, HE>>>
fn on_outgoing_connection_connected( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _conn: Arc<dyn ConnectionSender>, ) -> Option<Box<dyn ConnectionHandler<BE, HE>>>
Called when an outgoing connection is established.
Source§fn on_incoming_connection_disconnected(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node_id: NodeId,
_conn_id: ConnId,
)
fn on_incoming_connection_disconnected( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node_id: NodeId, _conn_id: ConnId, )
Called when an incoming connection is disconnected.
Source§fn on_outgoing_connection_disconnected(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node_id: NodeId,
_conn_id: ConnId,
)
fn on_outgoing_connection_disconnected( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node_id: NodeId, _conn_id: ConnId, )
Called when an outgoing connection is disconnected.
Source§fn on_outgoing_connection_error(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node_id: NodeId,
_conn_id: ConnId,
_err: &OutgoingConnectionError,
)
fn on_outgoing_connection_error( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node_id: NodeId, _conn_id: ConnId, _err: &OutgoingConnectionError, )
Called when an outgoing connection encounters an error.
Source§fn on_handler_event(
&mut self,
_ctx: &BehaviorContext,
_now_ms: u64,
_node_id: NodeId,
_conn_id: ConnId,
_event: BE,
)
fn on_handler_event( &mut self, _ctx: &BehaviorContext, _now_ms: u64, _node_id: NodeId, _conn_id: ConnId, _event: BE, )
Called when a handler event is received.
Source§fn on_stopped(&mut self, _ctx: &BehaviorContext, _now_ms: u64)
fn on_stopped(&mut self, _ctx: &BehaviorContext, _now_ms: u64)
Called when the behavior is stopped.
Source§fn pop_action(&mut self) -> Option<NetworkBehaviorAction<HE, SE>>
fn pop_action(&mut self) -> Option<NetworkBehaviorAction<HE, SE>>
Pops the next action from the behavior’s action queue.
Auto Trait Implementations§
impl Freeze for NodeAliasBehavior
impl !RefUnwindSafe for NodeAliasBehavior
impl Send for NodeAliasBehavior
impl Sync for NodeAliasBehavior
impl Unpin for NodeAliasBehavior
impl !UnwindSafe for NodeAliasBehavior
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