pub struct Peers { /* private fields */ }Expand description
ピアについての意思決定
Implementations§
Source§impl Peers
impl Peers
Sourcepub fn new(
book: Book,
parameters: &'static NetworkParameters,
own_key: PublicKey,
want: usize,
) -> Self
pub fn new( book: Book, parameters: &'static NetworkParameters, own_key: PublicKey, want: usize, ) -> Self
住所録 book から始め、want か所につないでおく。own_key は自分の鍵(一覧から自分を外す)
Sourcepub fn adopt(&mut self, address: String, now: Instant, unix: u64) -> PeerId
pub fn adopt(&mut self, address: String, now: Instant, unix: u64) -> PeerId
始めるときにもうつないであるピア(追いつく段階から引き継いだものなど)を、新しい番号で入れる
pub fn book(&self) -> &Book
pub fn is_empty(&self) -> bool
Sourcepub fn with_roles(&self, roles: NodeRoles) -> Vec<PeerId>
pub fn with_roles(&self, roles: NodeRoles) -> Vec<PeerId>
つないでいるピアのうち、名乗ったロールに roles がすべてあるもの
Sourcepub fn take_actions(&mut self) -> Vec<PeerAction>
pub fn take_actions(&mut self) -> Vec<PeerAction>
駆動役にまだ渡していない指示
Auto Trait Implementations§
impl Freeze for Peers
impl RefUnwindSafe for Peers
impl Send for Peers
impl Sync for Peers
impl Unpin for Peers
impl UnsafeUnpin for Peers
impl UnwindSafe for Peers
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