Struct ckb_proposal_table::ProposalView
source · [−]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
sourceimpl 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
sourceimpl Clone for ProposalView
impl Clone for ProposalView
sourcefn clone(&self) -> ProposalView
fn clone(&self) -> ProposalView
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ProposalView
impl Debug for ProposalView
sourceimpl Default for ProposalView
impl Default for ProposalView
sourcefn default() -> ProposalView
fn default() -> ProposalView
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ProposalView
impl Send for ProposalView
impl Sync for ProposalView
impl Unpin for ProposalView
impl UnwindSafe for ProposalView
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more