pub struct Relay { /* private fields */ }Expand description
The relay owns queues and routes; it has no Noise transport or private key.
Implementations§
Source§impl Relay
impl Relay
Sourcepub fn new(
network: String,
recorded: BTreeMap<String, MachineIdentity>,
) -> Arc<Self> ⓘ
pub fn new( network: String, recorded: BTreeMap<String, MachineIdentity>, ) -> Arc<Self> ⓘ
Uses the holder-to-machine directory shared by the link host.
Sourcepub fn connect(
self: &Arc<Self>,
session: Arc<dyn LysSession>,
sink: Arc<dyn RelaySink>,
) -> Result<RelayConnection, RelayRefusal>
pub fn connect( self: &Arc<Self>, session: Arc<dyn LysSession>, sink: Arc<dyn RelaySink>, ) -> Result<RelayConnection, RelayRefusal>
Registers an already admitted session’s live connection.
§Errors
An unknown holder, a duplicate live machine, poisoned state or exhausted ids.
Sourcepub fn counters(
&self,
from: MachineIdentity,
to: MachineIdentity,
) -> Result<RelayCounters, RelayRefusal>
pub fn counters( &self, from: MachineIdentity, to: MachineIdentity, ) -> Result<RelayCounters, RelayRefusal>
Reads counters for one direction, retaining counts across reconnects.
§Errors
The relay state was poisoned.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Relay
impl RefUnwindSafe for Relay
impl Send for Relay
impl Sync for Relay
impl Unpin for Relay
impl UnsafeUnpin for Relay
impl UnwindSafe for Relay
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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