pub enum NodeServerMessage {
    ConnectionOpened {
        stream: TcpStream,
        is_server: bool,
    },
    CheckSession {
        peer_name: NameMessage,
        reply: RpcReplyPort<SessionCheckReply>,
    },
    UpdateSession {
        actor_id: ActorId,
        name: NameMessage,
    },
    GetSessions(RpcReplyPort<HashMap<NodeId, ActorRef<NodeSession>>>),
}
Expand description

Messages to/from the session manager

Variants§

§

ConnectionOpened

Fields

§stream: TcpStream

The TcpStream for this network connection

§is_server: bool

Flag denoting if it’s a server (incoming) connection when true, false for outgoing

Notifies the session manager that a new incoming (is_server = true) or outgoing (is_server = false) TcpStream was accepted

§

CheckSession

Fields

§peer_name: NameMessage

The peer’s name to investigate

§reply: RpcReplyPort<SessionCheckReply>

Reply channel for RPC

A request to check if a session is currently open, and if it is is the ordering such that we should reject the incoming request

i.e. if A is connected to B and A.name > B.name, but then B connects to A, B’s request to connect to A should be rejected

§

UpdateSession

Fields

§actor_id: ActorId

The ID of the NodeSession actor

§name: NameMessage

The node’s name (now that we’ve received it)

A request to update the session mapping with this now known node’s name

§

GetSessions(RpcReplyPort<HashMap<NodeId, ActorRef<NodeSession>>>)

Retrieve the current status of the node server, listing the node sessions

Trait Implementations§

source§

impl Message for NodeServerMessage

source§

fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>

Convert a BoxedMessage to this concrete type
source§

fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>

Convert this message to a BoxedMessage
source§

fn serializable() -> bool

Determines if this type is serializable
source§

fn serialize(self) -> Result<SerializedMessage, BoxedDowncastErr>

Serializes this message (if supported)
source§

fn deserialize(bytes: SerializedMessage) -> Result<Self, BoxedDowncastErr>

Deserialize binary data to this message type

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> State for Twhere
    T: Any + Send + 'static,