Enum bdk_chain::ChainPosition
source · pub enum ChainPosition<A> {
Confirmed(A),
Unconfirmed(u64),
}
Expand description
Represents the observed position of some chain data.
The generic A
should be a Anchor
implementation.
Variants§
Confirmed(A)
The chain data is seen as confirmed, and in anchored by A
.
Unconfirmed(u64)
The chain data is not confirmed and last seen in the mempool at this timestamp.
Implementations§
source§impl<A> ChainPosition<A>
impl<A> ChainPosition<A>
sourcepub fn is_confirmed(&self) -> bool
pub fn is_confirmed(&self) -> bool
Returns whether ChainPosition
is confirmed or not.
source§impl<A: Clone> ChainPosition<&A>
impl<A: Clone> ChainPosition<&A>
sourcepub fn cloned(self) -> ChainPosition<A>
pub fn cloned(self) -> ChainPosition<A>
Maps a ChainPosition<&A>
into a ChainPosition<A>
by cloning the contents.
source§impl<A: Anchor> ChainPosition<A>
impl<A: Anchor> ChainPosition<A>
sourcepub fn confirmation_height_upper_bound(&self) -> Option<u32>
pub fn confirmation_height_upper_bound(&self) -> Option<u32>
Determines the upper bound of the confirmation height.
Trait Implementations§
source§impl<A: Clone> Clone for ChainPosition<A>
impl<A: Clone> Clone for ChainPosition<A>
source§fn clone(&self) -> ChainPosition<A>
fn clone(&self) -> ChainPosition<A>
Returns a copy 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<A: Debug> Debug for ChainPosition<A>
impl<A: Debug> Debug for ChainPosition<A>
source§impl<'de, A> Deserialize<'de> for ChainPosition<A>where
A: Ord + Deserialize<'de>,
impl<'de, A> Deserialize<'de> for ChainPosition<A>where
A: Ord + Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<A: Hash> Hash for ChainPosition<A>
impl<A: Hash> Hash for ChainPosition<A>
source§impl<A: Ord> Ord for ChainPosition<A>
impl<A: Ord> Ord for ChainPosition<A>
source§fn cmp(&self, other: &ChainPosition<A>) -> Ordering
fn cmp(&self, other: &ChainPosition<A>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<A: PartialEq> PartialEq for ChainPosition<A>
impl<A: PartialEq> PartialEq for ChainPosition<A>
source§fn eq(&self, other: &ChainPosition<A>) -> bool
fn eq(&self, other: &ChainPosition<A>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<A: PartialOrd> PartialOrd for ChainPosition<A>
impl<A: PartialOrd> PartialOrd for ChainPosition<A>
source§fn partial_cmp(&self, other: &ChainPosition<A>) -> Option<Ordering>
fn partial_cmp(&self, other: &ChainPosition<A>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<A> Serialize for ChainPosition<A>
impl<A> Serialize for ChainPosition<A>
impl<A: Copy> Copy for ChainPosition<A>
impl<A: Eq> Eq for ChainPosition<A>
impl<A> StructuralPartialEq for ChainPosition<A>
Auto Trait Implementations§
impl<A> Freeze for ChainPosition<A>where
A: Freeze,
impl<A> RefUnwindSafe for ChainPosition<A>where
A: RefUnwindSafe,
impl<A> Send for ChainPosition<A>where
A: Send,
impl<A> Sync for ChainPosition<A>where
A: Sync,
impl<A> Unpin for ChainPosition<A>where
A: Unpin,
impl<A> UnwindSafe for ChainPosition<A>where
A: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more