Skip to main content

NodeEvent

Enum NodeEvent 

Source
pub enum NodeEvent {
    Chain(ChainEvent),
    Peer(PeerEvent),
    Relay {
        transactions: Arc<Vec<u8>>,
        except: Option<PeerId>,
    },
    Partial {
        incoming: Incoming,
        from: Option<PeerId>,
    },
    PulledPartial {
        peer: PeerId,
        pulled: Vec<PulledPartial>,
    },
    Pulled {
        peer: PeerId,
        transactions: Vec<Vec<u8>>,
    },
    Votes {
        messages: Vec<Vec<u8>>,
        from: Option<PeerId>,
    },
    VotesToRelay {
        messages: Vec<Vec<u8>>,
        except: Option<PeerId>,
    },
}
Expand description

駆動役の受信箱に入れる出来事。どちらの状態機械あてか

Variants§

§

Chain(ChainEvent)

§

Peer(PeerEvent)

§

Relay

新しく受け付けたトランザクション(1件以上を隙間なく並べたもの。Push_Transactions の本体)。つないでいるピアの みなに押し付ける。except は、それを渡してきたピア(送り返さない)。受け付けるのは初めて見たときだけなので、 ピアのあいだを回り続けることはない

Fields

§transactions: Arc<Vec<u8>>
§except: Option<PeerId>
§

Partial

連署を待つものが入ってきた。from は、それをくれたピア(送り返さない)

Fields

§incoming: Incoming
§

PulledPartial

ピアに頼んだ、連署を待つもの

Fields

§peer: PeerId
§

Pulled

ピアに頼んだ未承認のトランザクション(1件ずつのバイト列)

Fields

§peer: PeerId
§transactions: Vec<Vec<u8>>
§

Votes

ピアに頼んだか、押し付けられた投票のメッセージ(1つずつのバイト列)。from は頼んだピア

Fields

§messages: Vec<Vec<u8>>
§

VotesToRelay

投票するピアみなに配る投票のメッセージ。except は、それをくれたピア(送り返さない)

Fields

§messages: Vec<Vec<u8>>
§except: Option<PeerId>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.