Skip to main content

GatewayChannel

Struct GatewayChannel 

Source
pub struct GatewayChannel {
    pub channel: Channel,
    pub nodename: Option<String>,
    pub topology: Option<Vec<u8>>,
}
Expand description

High level logic for gateways (mirrors Gateway.GatewayChannel).

This is the TARGET side of a tree channel: it receives the configuration from the admin node, ACKs it, and then accepts control messages. Any processing failure — including undecodable payloads such as a gateway message stamped with an unsupported pickle protocol — is turned into an Error reply sent back to the initiator, after which the channel is closed (fatal channel error).

Fields§

§channel: Channel

The underlying communication channel (target end: initiator=false).

§nodename: Option<String>

This gateway’s node name (from CFG or system hostname fallback).

§topology: Option<Vec<u8>>

Decoded topology payload received in CFG.

Implementations§

Source§

impl GatewayChannel

Source

pub fn new() -> Self

Create a new gateway channel ready to accept communication.

Source

pub fn close(&mut self)

Close the gateway channel (mirrors GatewayChannel.close).

Source

pub fn feed(&mut self, data: &str)

Feed raw incoming data to the channel, mirroring the read side of upstream Channel.ev_read for a target: parse errors are reported back to the initiator as an Error message and close the channel.

Source

pub fn recv(&mut self, msg: Message)

Handle one incoming message (mirrors GatewayChannel.recv).

Dispatch errors are reported back to the initiator as an Error message, then the channel is closed — including configuration payload decode failures (90d3195’s gateway side: the admin later reports this reason as gateway stderr).

Trait Implementations§

Source§

impl Debug for GatewayChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GatewayChannel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.