pub struct Book { /* private fields */ }Expand description
知っているノードのアドレスと、それぞれを今使っているか、次にいつ試してよいか。アドレスはどこにも出さない
Implementations§
Source§impl Book
impl Book
pub fn new(addresses: Vec<String>, now: Instant) -> Self
Sourcepub fn load(known: Vec<(String, KnownPeer)>, now: Instant, unix: u64) -> Self
pub fn load(known: Vec<(String, KnownPeer)>, now: Instant, unix: u64) -> Self
しまってあった住所録から作る。続けて失敗していたものは、その回数に応じて空けてから試す。unix(今の
UNIX 秒)でまだ ban の続いているものは試さない
Sourcepub fn insert(&mut self, address: String, now: Instant) -> bool
pub fn insert(&mut self, address: String, now: Instant) -> bool
知らないアドレスなら足して真を返す。もう MAX_CANDIDATES 件あれば足さない
pub fn insert_in_use(&mut self, address: &str, now: Instant)
Auto Trait Implementations§
impl Freeze for Book
impl RefUnwindSafe for Book
impl Send for Book
impl Sync for Book
impl Unpin for Book
impl UnsafeUnpin for Book
impl UnwindSafe for Book
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> 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