pub struct LocalAddress {
pub id: usize,
/* private fields */
}Available on non-WebAssembly only.
Expand description
How do we store peers locally
Fields§
§id: usizeRandom id for this peer
Implementations§
Source§impl LocalAddress
impl LocalAddress
pub fn new( address: AddrV2, last_connected: u64, state: AddressState, services: ServiceFlags, port: u16, id: usize, ) -> LocalAddress
Sourcepub fn get_net_address(&self) -> IpAddr
pub fn get_net_address(&self) -> IpAddr
Return an IP address associated with this peer address
Sourcepub fn get_address(&self) -> AddrV2
pub fn get_address(&self) -> AddrV2
Returns the actual address, as defined in AddrV2. This is useful if we are trying a peer that needs a proxy like Tor.
Trait Implementations§
Source§impl Clone for LocalAddress
impl Clone for LocalAddress
Source§fn clone(&self) -> LocalAddress
fn clone(&self) -> LocalAddress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalAddress
impl Debug for LocalAddress
Source§impl From<AddrV2> for LocalAddress
impl From<AddrV2> for LocalAddress
Source§impl From<AddrV2Message> for LocalAddress
impl From<AddrV2Message> for LocalAddress
Source§impl From<DiskLocalAddress> for LocalAddress
impl From<DiskLocalAddress> for LocalAddress
Source§fn from(value: DiskLocalAddress) -> Self
fn from(value: DiskLocalAddress) -> Self
Converts to this type from the input type.
Source§impl From<LocalAddress> for DiskLocalAddress
impl From<LocalAddress> for DiskLocalAddress
Source§fn from(value: LocalAddress) -> Self
fn from(value: LocalAddress) -> Self
Converts to this type from the input type.
Source§impl FromStr for LocalAddress
impl FromStr for LocalAddress
Source§impl PartialEq for LocalAddress
impl PartialEq for LocalAddress
Source§impl TryFrom<&str> for LocalAddress
impl TryFrom<&str> for LocalAddress
impl StructuralPartialEq for LocalAddress
Auto Trait Implementations§
impl Freeze for LocalAddress
impl RefUnwindSafe for LocalAddress
impl Send for LocalAddress
impl Sync for LocalAddress
impl Unpin for LocalAddress
impl UnwindSafe for LocalAddress
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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