[−][src]Struct snarkos_network::context::address_book::AddressBook
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]
fn clone(&self) -> AddressBook
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AddressBook
[src]
impl Eq for AddressBook
[src]
impl PartialEq<AddressBook> for AddressBook
[src]
fn eq(&self, other: &AddressBook) -> bool
[src]
fn ne(&self, other: &AddressBook) -> bool
[src]
impl StructuralEq for AddressBook
[src]
impl StructuralPartialEq for AddressBook
[src]
Auto Trait Implementations
impl RefUnwindSafe for AddressBook
impl Send for AddressBook
impl Sync for AddressBook
impl Unpin for AddressBook
impl UnwindSafe for AddressBook
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,