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
) -> Selfwhere
V: Into<Vec<IpAddr>>,
pub fn from_relay<V>( timestamp: u32, their_addr: Option<IpAddr>, my_addrs: V ) -> Selfwhere V: Into<Vec<IpAddr>>,
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 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.
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.
Auto Trait Implementations§
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