pub struct PeerRepeaterTable { /* private fields */ }Expand description
The repeaters whose identities this node has seen.
RAM-only: a listing describes a neighborhood as it is now, and a table restored from flash would name repeaters that may have moved or gone.
Implementations§
Source§impl PeerRepeaterTable
impl PeerRepeaterTable
pub fn new() -> Self
Sourcepub fn is_repeater(identity: &NodeIdentityPayload) -> bool
pub fn is_repeater(identity: &NodeIdentityPayload) -> bool
Whether an identity describes a repeater, and so belongs here.
The capability is the claim that matters — a node may forward while presenting itself as something else — but a node whose whole role is repeating counts even if it advertises no capability bitmap.
Sourcepub fn observe_identity(
&mut self,
from: &PublicKey,
identity: &NodeIdentityPayload,
now_ms: u64,
) -> bool
pub fn observe_identity( &mut self, from: &PublicKey, identity: &NodeIdentityPayload, now_ms: u64, ) -> bool
Record what an identity said, if it came from a repeater.
Returns whether the table changed. A repeat identity replaces the record rather than merging with it: the newest advertisement is the node’s own account of itself.
pub fn iter(&self) -> impl Iterator<Item = &PeerRepeaterRecord>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn generation(&self) -> u16
pub fn generation(&self) -> u16
The value a paging cursor carries, so a follow-up request that resumes into a changed list is recognized as stale.
Trait Implementations§
Source§impl Clone for PeerRepeaterTable
impl Clone for PeerRepeaterTable
Source§fn clone(&self) -> PeerRepeaterTable
fn clone(&self) -> PeerRepeaterTable
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PeerRepeaterTable
impl Debug for PeerRepeaterTable
Source§impl Default for PeerRepeaterTable
impl Default for PeerRepeaterTable
Source§fn default() -> PeerRepeaterTable
fn default() -> PeerRepeaterTable
Auto Trait Implementations§
impl Freeze for PeerRepeaterTable
impl RefUnwindSafe for PeerRepeaterTable
impl Send for PeerRepeaterTable
impl Sync for PeerRepeaterTable
impl Unpin for PeerRepeaterTable
impl UnwindSafe for PeerRepeaterTable
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)