pub struct Observer { /* private fields */ }Expand description
投票を数える(鍵があれば投票もする)
Implementations§
Source§impl Observer
impl Observer
Sourcepub fn new(
finalized: &FinalizedBlockHeader,
parameters: ProofParameters,
settings: Settings,
voting: Option<Voting>,
status: Option<VotingStatus>,
) -> Self
pub fn new( finalized: &FinalizedBlockHeader, parameters: ProofParameters, settings: Settings, voting: Option<Voting>, status: Option<VotingStatus>, ) -> Self
中核の確定 finalized から始める。投票するなら voting と、前に書いた投票状況 status
Sourcepub fn round(&self) -> FinalizationRound
pub fn round(&self) -> FinalizationRound
段取り役のいるラウンド
Sourcepub fn request(&self) -> (FinalizationRound, FinalizationRound, Vec<u32>)
pub fn request(&self) -> (FinalizationRound, FinalizationRound, Vec<u32>)
ピアに頼むもの。集めている範囲(最小、最大のラウンド)と、持っているメッセージの短いハッシュ
Sourcepub fn unknown_to(
&self,
min: FinalizationRound,
max: FinalizationRound,
known: &BTreeSet<u32>,
) -> Vec<u8> ⓘ
pub fn unknown_to( &self, min: FinalizationRound, max: FinalizationRound, known: &BTreeSet<u32>, ) -> Vec<u8> ⓘ
ピアに引かれたときに返すもの。ラウンド min から max までのうち、短いハッシュが known にないもの
Sourcepub fn add(&mut self, messages: Vec<Vec<u8>>) -> Vec<Vec<u8>>
pub fn add(&mut self, messages: Vec<Vec<u8>>) -> Vec<Vec<u8>>
ピアから届いたメッセージを足し、新しく足せたもの(ほかの投票するピアに配る)を返す。範囲の外のもの、 同じものの重複は、足せなかったとは数えずに捨てる
Auto Trait Implementations§
impl !RefUnwindSafe for Observer
impl !Sync for Observer
impl !UnwindSafe for Observer
impl Freeze for Observer
impl Send for Observer
impl Unpin for Observer
impl UnsafeUnpin for Observer
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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