pub struct Ready<N: Network> { /* private fields */ }Expand description
Maintains a queue of verified (“ready”) transmissions.
Implementations§
Source§impl<N: Network> Ready<N>
impl<N: Network> Ready<N>
Sourcepub fn num_transmissions(&self) -> usize
pub fn num_transmissions(&self) -> usize
Returns the number of transmissions in the ready queue.
Sourcepub fn num_ratifications(&self) -> usize
pub fn num_ratifications(&self) -> usize
Returns the number of ratifications in the ready queue.
Sourcepub fn num_solutions(&self) -> usize
pub fn num_solutions(&self) -> usize
Returns the number of solutions in the ready queue.
Sourcepub fn num_transactions(&self) -> usize
pub fn num_transactions(&self) -> usize
Returns the number of transactions in the ready queue.
Sourcepub fn transmission_ids(&self) -> IndexSet<TransmissionID<N>>
pub fn transmission_ids(&self) -> IndexSet<TransmissionID<N>>
Returns the transmission IDs in the ready queue.
Sourcepub fn transmissions(&self) -> IndexMap<TransmissionID<N>, Transmission<N>>
pub fn transmissions(&self) -> IndexMap<TransmissionID<N>, Transmission<N>>
Returns the transmissions in the ready queue.
Sourcepub fn solutions(&self) -> Vec<(SolutionID<N>, Data<Solution<N>>)>
pub fn solutions(&self) -> Vec<(SolutionID<N>, Data<Solution<N>>)>
Returns the solutions in the ready queue.
Sourcepub fn transactions(&self) -> Vec<(N::TransactionID, Data<Transaction<N>>)>
pub fn transactions(&self) -> Vec<(N::TransactionID, Data<Transaction<N>>)>
Returns the transactions in the ready queue.
Source§impl<N: Network> Ready<N>
impl<N: Network> Ready<N>
Sourcepub fn contains(&self, transmission_id: impl Into<TransmissionID<N>>) -> bool
pub fn contains(&self, transmission_id: impl Into<TransmissionID<N>>) -> bool
Returns true if the ready queue contains the specified transmission ID.
Sourcepub fn get(
&self,
transmission_id: impl Into<TransmissionID<N>>,
) -> Option<Transmission<N>>
pub fn get( &self, transmission_id: impl Into<TransmissionID<N>>, ) -> Option<Transmission<N>>
Returns the transmission, given the specified transmission ID.
Sourcepub fn insert(
&mut self,
transmission_id: impl Into<TransmissionID<N>>,
transmission: Transmission<N>,
) -> bool
pub fn insert( &mut self, transmission_id: impl Into<TransmissionID<N>>, transmission: Transmission<N>, ) -> bool
Inserts the specified (transmission ID, transmission) to the ready queue.
Returns true if the transmission is new, and was added to the ready queue.
Sourcepub fn insert_front(
&mut self,
transmission_id: impl Into<TransmissionID<N>>,
transmission: Transmission<N>,
) -> bool
pub fn insert_front( &mut self, transmission_id: impl Into<TransmissionID<N>>, transmission: Transmission<N>, ) -> bool
Inserts the specified (transmission ID, transmission) at the front
of the ready queue.
Returns true if the transmission is new, and was added to the ready queue.
Sourcepub fn remove_front(&mut self) -> Option<(TransmissionID<N>, Transmission<N>)>
pub fn remove_front(&mut self) -> Option<(TransmissionID<N>, Transmission<N>)>
Removes and returns the transmission at the front of the queue.
Sourcepub fn clear_solutions(&mut self)
pub fn clear_solutions(&mut self)
Removes all solution transmissions from the queue (O(n)).
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for Ready<N>
impl<N> RefUnwindSafe for Ready<N>where
<N as Network>::TransmissionChecksum: RefUnwindSafe,
<N as Network>::TransactionID: RefUnwindSafe,
N: RefUnwindSafe,
<N as Network>::BlockHash: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Network>::StateRoot: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
impl<N> Send for Ready<N>
impl<N> Sync for Ready<N>
impl<N> Unpin for Ready<N>where
<N as Network>::TransmissionChecksum: Unpin,
<N as Network>::TransactionID: Unpin,
N: Unpin,
<N as Network>::BlockHash: Unpin,
<N as Environment>::Field: Unpin,
<N as Network>::StateRoot: Unpin,
<N as Network>::TransitionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
impl<N> UnwindSafe for Ready<N>where
<N as Network>::TransmissionChecksum: UnwindSafe,
<N as Network>::TransactionID: UnwindSafe,
N: UnwindSafe,
<N as Network>::BlockHash: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Network>::StateRoot: UnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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