pub struct Netinfo { /* private fields */ }
Expand description
The netinfo message ends channel negotiation.
It tells the other party on the channel our view of the current time, our own list of public addresses, and our view of its address.
When we get a netinfo cell, we can start creating circuits on a channel and sending data.
Implementations§
source§impl Netinfo
impl Netinfo
sourcepub fn from_client(their_addr: Option<IpAddr>) -> Self
pub fn from_client(their_addr: Option<IpAddr>) -> Self
Construct a new Netinfo to be sent by a client.
sourcepub fn from_relay<V>(
timestamp: u32,
their_addr: Option<IpAddr>,
my_addrs: V
) -> Self
pub fn from_relay<V>( timestamp: u32, their_addr: Option<IpAddr>, my_addrs: V ) -> Self
Construct a new Netinfo to be sent by a relay
sourcepub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Return the time reported in this NETINFO cell.
Trait Implementations§
source§impl Body for Netinfo
impl Body for Netinfo
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Consume this message and encode its body onto
w
. Read moresource§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a channel cell body from a provided reader.
source§impl ChanMsg for Netinfo
impl ChanMsg for Netinfo
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Write the body of this message (not including length or command).
source§impl From<Netinfo> for AnyChanMsg
impl From<Netinfo> for AnyChanMsg
source§fn from(m: Netinfo) -> AnyChanMsg
fn from(m: Netinfo) -> AnyChanMsg
Converts to this type from the input type.
source§impl From<Netinfo> for AnyChanCell
impl From<Netinfo> for AnyChanCell
source§fn from(body: Netinfo) -> AnyChanCell
fn from(body: Netinfo) -> AnyChanCell
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Netinfo
impl RefUnwindSafe for Netinfo
impl Send for Netinfo
impl Sync for Netinfo
impl Unpin for Netinfo
impl UnwindSafe for Netinfo
Blanket Implementations§
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> 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