Skip to main content

Relay

Struct Relay 

Source
pub struct Relay { /* private fields */ }
Expand description

A forwarding-only view of the same engine used by Router. It exposes no application publishing or local endpoint registration API.

Implementations§

Source§

impl Relay

Source

pub fn new(clock: Box<dyn Clock + Send + Sync>) -> Self

Source

pub fn new_with_config( cfg: RelayConfig, clock: Box<dyn Clock + Send + Sync>, ) -> Self

Source

pub fn sender(&self) -> Arc<str> ⓘ

Source

pub fn set_sender<S: AsRef<str>>(&self, sender: S)

Source

pub fn add_side_packed<N, F>(&self, name: N, tx: F) -> RelaySideId
where N: AsRef<str>, F: Fn(&[u8]) -> TelemetryResult<()> + Send + Sync + 'static,

Source

pub fn add_side_packed_small_packets<N, F>( &self, name: N, tx: F, max_frame_bytes: usize, ) -> RelaySideId
where N: AsRef<str>, F: Fn(&[u8]) -> TelemetryResult<()> + Send + Sync + 'static,

Source

pub fn add_side_packed_with_options<N, F>( &self, name: N, tx: F, opts: RelaySideOptions, ) -> RelaySideId
where N: AsRef<str>, F: Fn(&[u8]) -> TelemetryResult<()> + Send + Sync + 'static,

Source

pub fn add_side_packet<N, F>(&self, name: N, tx: F) -> RelaySideId
where N: AsRef<str>, F: Fn(&Packet) -> TelemetryResult<()> + Send + Sync + 'static,

Source

pub fn add_side_packet_with_options<N, F>( &self, name: N, tx: F, opts: RelaySideOptions, ) -> RelaySideId
where N: AsRef<str>, F: Fn(&Packet) -> TelemetryResult<()> + Send + Sync + 'static,

Source

pub fn remove_side(&self, side: RelaySideId) -> TelemetryResult<()>

Source

pub fn set_side_ingress_enabled( &self, side: RelaySideId, enabled: bool, ) -> TelemetryResult<()>

Source

pub fn set_side_egress_enabled( &self, side: RelaySideId, enabled: bool, ) -> TelemetryResult<()>

Source

pub fn set_source_route_mode( &self, src: Option<RelaySideId>, mode: RouteSelectionMode, ) -> TelemetryResult<()>

Source

pub fn clear_source_route_mode( &self, src: Option<RelaySideId>, ) -> TelemetryResult<()>

Source

pub fn set_route_weight( &self, src: Option<RelaySideId>, dst: RelaySideId, weight: u32, ) -> TelemetryResult<()>

Source

pub fn clear_route_weight( &self, src: Option<RelaySideId>, dst: RelaySideId, ) -> TelemetryResult<()>

Source

pub fn set_route_priority( &self, src: Option<RelaySideId>, dst: RelaySideId, priority: u32, ) -> TelemetryResult<()>

Source

pub fn clear_route_priority( &self, src: Option<RelaySideId>, dst: RelaySideId, ) -> TelemetryResult<()>

Source

pub fn set_route( &self, src: Option<RelaySideId>, dst: RelaySideId, enabled: bool, ) -> TelemetryResult<()>

Source

pub fn set_typed_route( &self, src: Option<RelaySideId>, ty: DataType, dst: RelaySideId, enabled: bool, ) -> TelemetryResult<()>

Source

pub fn clear_typed_route( &self, src: Option<RelaySideId>, ty: DataType, dst: RelaySideId, ) -> TelemetryResult<()>

Source

pub fn clear_route( &self, src: Option<RelaySideId>, dst: RelaySideId, ) -> TelemetryResult<()>

Source

pub fn announce_discovery(&self) -> TelemetryResult<()>

Source

pub fn announce_leave(&self) -> TelemetryResult<()>

Source

pub fn poll_discovery(&self) -> TelemetryResult<bool>

Source

pub fn export_topology(&self) -> TopologySnapshot

Source

pub fn client_stats(&self, sender_id: &str) -> Option<ClientStatsSnapshot>

Source

pub fn export_runtime_stats(&self) -> RuntimeStatsSnapshot

Source

pub fn export_memory_layout_json(&self) -> String

Source

pub fn rx_packed_from_side( &self, src: RelaySideId, bytes: &[u8], ) -> TelemetryResult<()>

Source

pub fn rx_from_side( &self, src: RelaySideId, packet: Packet, ) -> TelemetryResult<()>

Source

pub fn clear_queues(&self)

Source

pub fn clear_rx_queue(&self)

Source

pub fn clear_tx_queue(&self)

Source

pub fn process_rx_queue(&self) -> TelemetryResult<()>

Source

pub fn process_tx_queue(&self) -> TelemetryResult<()>

Source

pub fn process_all_queues(&self) -> TelemetryResult<()>

Source

pub fn process_tx_queue_with_timeout( &self, timeout_ms: u32, ) -> TelemetryResult<()>

Source

pub fn process_rx_queue_with_timeout( &self, timeout_ms: u32, ) -> TelemetryResult<()>

Source

pub fn process_all_queues_with_timeout( &self, timeout_ms: u32, ) -> TelemetryResult<()>

Source

pub fn drain_queues_with_timeout(&self, timeout_ms: u32) -> TelemetryResult<()>

Source

pub fn periodic(&self, timeout_ms: u32) -> TelemetryResult<()>

Auto Trait Implementations§

§

impl !Freeze for Relay

§

impl !RefUnwindSafe for Relay

§

impl !UnwindSafe for Relay

§

impl Send for Relay

§

impl Sync for Relay

§

impl Unpin for Relay

§

impl UnsafeUnpin for Relay

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.