pub enum PeerEvent {
Tick,
Connected {
id: PeerId,
},
ConnectFailed {
id: PeerId,
myself: bool,
},
Disconnected {
id: PeerId,
penalty: Penalty,
},
Released {
id: PeerId,
},
Info {
id: PeerId,
node: NetworkNode,
},
Nodes {
id: PeerId,
nodes: Vec<NetworkNode>,
},
}Expand description
駆動役からの出来事。now は今の時刻、unix はその UNIX 秒
Variants§
Tick
決まった間隔で入れる。足りなければつなぎに行き、ときどき一覧を聞き直す
Connected
頼んだ PeerAction::Connect がつながった
ConnectFailed
頼んだ PeerAction::Connect がつながらなかった。myself なら、つないだ先が自分だった
Disconnected
ピアを外した。penalty は中核が決めた罰(通信に失敗しただけなら Penalty::None)
Released
駆動役が自分の都合(入れ替えなど)でピアを外した。罰さない
Info
ピア自身の名乗り
Nodes
ピアの知っているノードの一覧
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerEvent
impl RefUnwindSafe for PeerEvent
impl Send for PeerEvent
impl Sync for PeerEvent
impl Unpin for PeerEvent
impl UnsafeUnpin for PeerEvent
impl UnwindSafe for PeerEvent
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