[][src]Struct snarkos_network::context::address_book::AddressBook

pub struct AddressBook { /* fields omitted */ }

Stores the existence of a peer and the date they were last seen.

Implementations

impl AddressBook[src]

pub fn new() -> Self[src]

Construct a new AddressBook.

pub fn update(&mut self, address: SocketAddr, date: DateTime<Utc>) -> bool[src]

Insert or update a new date for an address. Returns true if the new date is stored.

pub fn contains(&self, address: &SocketAddr) -> bool[src]

Returns true if address is stored in the mapping.

pub fn remove(&mut self, address: &SocketAddr) -> Option<DateTime<Utc>>[src]

Remove an address mapping and return its last seen date.

pub fn length(&self) -> u16[src]

Returns the number of stored peers.

pub fn get_addresses(&self) -> HashMap<SocketAddr, DateTime<Utc>>[src]

Returns copy of addresses

Trait Implementations

impl Clone for AddressBook[src]

impl Debug for AddressBook[src]

impl Eq for AddressBook[src]

impl PartialEq<AddressBook> for AddressBook[src]

impl StructuralEq for AddressBook[src]

impl StructuralPartialEq for AddressBook[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,