NodeAliasBehavior

Struct NodeAliasBehavior 

Source
pub struct NodeAliasBehavior { /* private fields */ }

Implementations§

Source§

impl NodeAliasBehavior

Source

pub fn new(node_id: NodeId, pubsub_sdk: PubsubSdk) -> (Self, NodeAliasSdk)

Trait Implementations§

Source§

impl<BE, HE, SE> NetworkBehavior<BE, HE, SE> for NodeAliasBehavior

Source§

fn service_id(&self) -> u8

Returns the service ID of the behavior.
Source§

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)

Called on each tick of the behavior.
Source§

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, )

Called when a message is received from other SDK.
Source§

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>

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>

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>>>

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>>>

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, )

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, )

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, )

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, )

Called when a handler event is received.
Source§

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>>

Pops the next action from the behavior’s action queue.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V