pub struct FeatureContext {
pub segwit: bool,
pub taproot: bool,
pub csv: bool,
pub cltv: bool,
pub rbf: bool,
pub ctv: bool,
pub height: u64,
pub timestamp: u64,
}Expand description
Feature context consolidating all Bitcoin feature flags at a specific height/timestamp This provides a single source of truth for feature activation state
Fields§
§segwit: boolSegWit (BIP141/143) activation state
taproot: boolTaproot (BIP341/342) activation state
csv: boolCSV (BIP112) activation state
cltv: boolCLTV (BIP65) activation state
rbf: boolRBF (BIP125) activation state (mempool policy)
ctv: boolCTV (BIP119) activation state
height: u64Block height at which this context is valid
timestamp: u64Timestamp at which this context is valid
Implementations§
Source§impl FeatureContext
impl FeatureContext
Sourcepub fn from_registry(
registry: &FeatureRegistry,
height: u64,
timestamp: u64,
) -> Self
pub fn from_registry( registry: &FeatureRegistry, height: u64, timestamp: u64, ) -> Self
Create a new feature context from a feature registry
Sourcepub fn active_features(&self) -> Vec<&'static str>
pub fn active_features(&self) -> Vec<&'static str>
Get list of all active features
Trait Implementations§
Source§impl Clone for FeatureContext
impl Clone for FeatureContext
Source§fn clone(&self) -> FeatureContext
fn clone(&self) -> FeatureContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FeatureContext
impl Debug for FeatureContext
Source§impl<'de> Deserialize<'de> for FeatureContext
impl<'de> Deserialize<'de> for FeatureContext
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 PartialEq for FeatureContext
impl PartialEq for FeatureContext
Source§fn eq(&self, other: &FeatureContext) -> bool
fn eq(&self, other: &FeatureContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FeatureContext
impl Serialize for FeatureContext
impl Copy for FeatureContext
impl Eq for FeatureContext
impl StructuralPartialEq for FeatureContext
Auto Trait Implementations§
impl Freeze for FeatureContext
impl RefUnwindSafe for FeatureContext
impl Send for FeatureContext
impl Sync for FeatureContext
impl Unpin for FeatureContext
impl UnsafeUnpin for FeatureContext
impl UnwindSafe for FeatureContext
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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