pub struct ProposalView { /* private fields */ }
Expand description
A view captures point-time proposal set, representing on-chain proposed transaction pool, stored in the memory so that there is no need to fetch on hard disk, create by ProposalTable finalize method w_close and w_far define the closest and farthest on-chain distance between a transaction’s proposal and commitment.
Implementations§
Source§impl ProposalView
impl ProposalView
Sourcepub fn new(
gap: HashSet<ProposalShortId>,
set: HashSet<ProposalShortId>,
) -> ProposalView
pub fn new( gap: HashSet<ProposalShortId>, set: HashSet<ProposalShortId>, ) -> ProposalView
Create new ProposalView
Sourcepub fn gap(&self) -> &HashSet<ProposalShortId>
pub fn gap(&self) -> &HashSet<ProposalShortId>
Return proposals between w_close and tip
Sourcepub fn set(&self) -> &HashSet<ProposalShortId>
pub fn set(&self) -> &HashSet<ProposalShortId>
Return proposals between w_close and w_far
Sourcepub fn contains_proposed(&self, id: &ProposalShortId) -> bool
pub fn contains_proposed(&self, id: &ProposalShortId) -> bool
Returns true if the proposals set between w_close and w_far contains the id.
Sourcepub fn contains_gap(&self, id: &ProposalShortId) -> bool
pub fn contains_gap(&self, id: &ProposalShortId) -> bool
Returns true if the proposals set between w_close and tip contains the id.
Trait Implementations§
Source§impl Clone for ProposalView
impl Clone for ProposalView
Source§fn clone(&self) -> ProposalView
fn clone(&self) -> ProposalView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProposalView
impl Debug for ProposalView
Source§impl Default for ProposalView
impl Default for ProposalView
Source§fn default() -> ProposalView
fn default() -> ProposalView
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProposalView
impl RefUnwindSafe for ProposalView
impl Send for ProposalView
impl Sync for ProposalView
impl Unpin for ProposalView
impl UnwindSafe for ProposalView
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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