pub struct RelayManager { /* private fields */ }Expand description
A connected relay client: the persistent identity, registration loops and live sessions, plus the transport that exposes it to iroh.
Implementations§
Source§impl RelayManager
impl RelayManager
Sourcepub fn start(options: RelayManagerOptions, own_node: PublicKey) -> Result<Self>
pub fn start(options: RelayManagerOptions, own_node: PublicKey) -> Result<Self>
Start registration with the configured relays and build the transport
for iroh. The transport advertises a custom address carrying own_node.
§Errors
Returns an error if the relay identity cannot be loaded or generated, or if the TLS configuration cannot be built.
Sourcepub fn transport(&self) -> SyncthingRelayTransport
pub fn transport(&self) -> SyncthingRelayTransport
The transport to install on the iroh endpoint.
Sourcepub fn local_addr(&self) -> CustomAddr
pub fn local_addr(&self) -> CustomAddr
The custom address this node advertises.
Sourcepub fn relay_id(&self) -> [u8; 32]
pub fn relay_id(&self) -> [u8; 32]
The relay device id of this node (SHA-256 of its certificate).
Sourcepub fn remember_node(&self, relay_id: &[u8; 32], node: PublicKey)
pub fn remember_node(&self, relay_id: &[u8; 32], node: PublicKey)
Record the iroh node id owning a peer relay id so inbound datagrams from that peer can be attributed.
Sourcepub async fn test_relay(&self, url: &str) -> Result<TestRelayReport>
pub async fn test_relay(&self, url: &str) -> Result<TestRelayReport>
Test whether url accepts our registration. A fresh TLS join request
is made; receiving the “joined” or “already connected” responses both
prove the relay knows our identity.
§Errors
Returns an error if the relay is unreachable, misbehaving, or rejects our identity.
Trait Implementations§
Source§impl Clone for RelayManager
impl Clone for RelayManager
Auto Trait Implementations§
impl !RefUnwindSafe for RelayManager
impl !UnwindSafe for RelayManager
impl Freeze for RelayManager
impl Send for RelayManager
impl Sync for RelayManager
impl Unpin for RelayManager
impl UnsafeUnpin for RelayManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more