pub struct RelayInfo {
pub address: Multiaddr,
pub peer_id: Option<PeerId>,
pub status: RelayStatus,
pub last_attempt: Option<Instant>,
pub failed_attempts: u32,
pub circuit_address: Option<Multiaddr>,
}Expand description
Information about a relay connection
Fields§
§address: MultiaddrMultiaddr of the relay server
peer_id: Option<PeerId>PeerId of the relay server (if known)
status: RelayStatusCurrent connection status
last_attempt: Option<Instant>Last connection attempt time
failed_attempts: u32Number of failed connection attempts
circuit_address: Option<Multiaddr>p2p-circuit address (if listening)
Implementations§
Source§impl RelayInfo
impl RelayInfo
pub fn new(address: Multiaddr) -> Self
Sourcepub fn mark_connecting(&mut self)
pub fn mark_connecting(&mut self)
Mark connection attempt started
Sourcepub fn mark_connected(&mut self, peer_id: PeerId)
pub fn mark_connected(&mut self, peer_id: PeerId)
Mark connection as successful
Sourcepub fn mark_failed(&mut self, reason: String)
pub fn mark_failed(&mut self, reason: String)
Mark connection as failed
Sourcepub fn mark_listening(&mut self, circuit_address: Multiaddr)
pub fn mark_listening(&mut self, circuit_address: Multiaddr)
Mark as listening on relay
Sourcepub fn should_retry(&self, reconnect_interval: Duration) -> bool
pub fn should_retry(&self, reconnect_interval: Duration) -> bool
Check if we should retry connection
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RelayInfo
impl RefUnwindSafe for RelayInfo
impl Send for RelayInfo
impl Sync for RelayInfo
impl Unpin for RelayInfo
impl UnwindSafe for RelayInfo
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
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>
Converts
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>
Converts
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