pub struct PeerSamplingService { /* private fields */ }Expand description
Peer sampling service to by used by application
Implementations§
Source§impl PeerSamplingService
impl PeerSamplingService
Sourcepub fn new(config: Config) -> PeerSamplingService
pub fn new(config: Config) -> PeerSamplingService
Create a new peer sampling service with provided parameters
§Arguments
config- The parameters for the peer sampling protocol
Sourcepub fn init(&mut self, initial_peer: Box<dyn FnOnce() -> Option<Peer>>)
pub fn init(&mut self, initial_peer: Box<dyn FnOnce() -> Option<Peer>>)
Initializes service
§Arguments
initial_peer- A closure returning the initial peer for starting the protocol
Auto Trait Implementations§
impl Freeze for PeerSamplingService
impl !RefUnwindSafe for PeerSamplingService
impl Send for PeerSamplingService
impl Sync for PeerSamplingService
impl Unpin for PeerSamplingService
impl !UnwindSafe for PeerSamplingService
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