pub struct Features<T: Context> { /* private fields */ }
Expand description
Tracks the set of features which a node implements, templated by the context in which it appears.
This is not exported to bindings users as we map the concrete feature types below directly instead
Implementations§
source§impl<T: DataLossProtect> Features<T>
impl<T: DataLossProtect> Features<T>
sourcepub fn set_data_loss_protect_optional(&mut self)
pub fn set_data_loss_protect_optional(&mut self)
Set this feature as optional.
sourcepub fn set_data_loss_protect_required(&mut self)
pub fn set_data_loss_protect_required(&mut self)
Set this feature as required.
sourcepub fn supports_data_loss_protect(&self) -> bool
pub fn supports_data_loss_protect(&self) -> bool
Checks if this feature is supported.
source§impl<T: DataLossProtect> Features<T>
impl<T: DataLossProtect> Features<T>
sourcepub fn requires_data_loss_protect(&self) -> bool
pub fn requires_data_loss_protect(&self) -> bool
Checks if this feature is required.
source§impl<T: InitialRoutingSync> Features<T>
impl<T: InitialRoutingSync> Features<T>
sourcepub fn set_initial_routing_sync_optional(&mut self)
pub fn set_initial_routing_sync_optional(&mut self)
Set this feature as optional.
sourcepub fn set_initial_routing_sync_required(&mut self)
pub fn set_initial_routing_sync_required(&mut self)
Set this feature as required.
sourcepub fn initial_routing_sync(&self) -> bool
pub fn initial_routing_sync(&self) -> bool
Checks if this feature is supported.
source§impl<T: UpfrontShutdownScript> Features<T>
impl<T: UpfrontShutdownScript> Features<T>
sourcepub fn set_upfront_shutdown_script_optional(&mut self)
pub fn set_upfront_shutdown_script_optional(&mut self)
Set this feature as optional.
sourcepub fn set_upfront_shutdown_script_required(&mut self)
pub fn set_upfront_shutdown_script_required(&mut self)
Set this feature as required.
sourcepub fn supports_upfront_shutdown_script(&self) -> bool
pub fn supports_upfront_shutdown_script(&self) -> bool
Checks if this feature is supported.
source§impl<T: UpfrontShutdownScript> Features<T>
impl<T: UpfrontShutdownScript> Features<T>
sourcepub fn requires_upfront_shutdown_script(&self) -> bool
pub fn requires_upfront_shutdown_script(&self) -> bool
Checks if this feature is required.
source§impl<T: GossipQueries> Features<T>
impl<T: GossipQueries> Features<T>
sourcepub fn set_gossip_queries_optional(&mut self)
pub fn set_gossip_queries_optional(&mut self)
Set this feature as optional.
sourcepub fn set_gossip_queries_required(&mut self)
pub fn set_gossip_queries_required(&mut self)
Set this feature as required.
sourcepub fn supports_gossip_queries(&self) -> bool
pub fn supports_gossip_queries(&self) -> bool
Checks if this feature is supported.
source§impl<T: GossipQueries> Features<T>
impl<T: GossipQueries> Features<T>
sourcepub fn requires_gossip_queries(&self) -> bool
pub fn requires_gossip_queries(&self) -> bool
Checks if this feature is required.
source§impl<T: VariableLengthOnion> Features<T>
impl<T: VariableLengthOnion> Features<T>
sourcepub fn set_variable_length_onion_optional(&mut self)
pub fn set_variable_length_onion_optional(&mut self)
Set this feature as optional.
sourcepub fn set_variable_length_onion_required(&mut self)
pub fn set_variable_length_onion_required(&mut self)
Set this feature as required.
sourcepub fn supports_variable_length_onion(&self) -> bool
pub fn supports_variable_length_onion(&self) -> bool
Checks if this feature is supported.
source§impl<T: VariableLengthOnion> Features<T>
impl<T: VariableLengthOnion> Features<T>
sourcepub fn requires_variable_length_onion(&self) -> bool
pub fn requires_variable_length_onion(&self) -> bool
Checks if this feature is required.
source§impl<T: StaticRemoteKey> Features<T>
impl<T: StaticRemoteKey> Features<T>
sourcepub fn set_static_remote_key_optional(&mut self)
pub fn set_static_remote_key_optional(&mut self)
Set this feature as optional.
sourcepub fn set_static_remote_key_required(&mut self)
pub fn set_static_remote_key_required(&mut self)
Set this feature as required.
sourcepub fn supports_static_remote_key(&self) -> bool
pub fn supports_static_remote_key(&self) -> bool
Checks if this feature is supported.
source§impl<T: StaticRemoteKey> Features<T>
impl<T: StaticRemoteKey> Features<T>
sourcepub fn requires_static_remote_key(&self) -> bool
pub fn requires_static_remote_key(&self) -> bool
Checks if this feature is required.
source§impl<T: PaymentSecret> Features<T>
impl<T: PaymentSecret> Features<T>
sourcepub fn set_payment_secret_optional(&mut self)
pub fn set_payment_secret_optional(&mut self)
Set this feature as optional.
sourcepub fn set_payment_secret_required(&mut self)
pub fn set_payment_secret_required(&mut self)
Set this feature as required.
sourcepub fn supports_payment_secret(&self) -> bool
pub fn supports_payment_secret(&self) -> bool
Checks if this feature is supported.
source§impl<T: PaymentSecret> Features<T>
impl<T: PaymentSecret> Features<T>
sourcepub fn requires_payment_secret(&self) -> bool
pub fn requires_payment_secret(&self) -> bool
Checks if this feature is required.
source§impl<T: BasicMPP> Features<T>
impl<T: BasicMPP> Features<T>
sourcepub fn set_basic_mpp_optional(&mut self)
pub fn set_basic_mpp_optional(&mut self)
Set this feature as optional.
sourcepub fn set_basic_mpp_required(&mut self)
pub fn set_basic_mpp_required(&mut self)
Set this feature as required.
sourcepub fn supports_basic_mpp(&self) -> bool
pub fn supports_basic_mpp(&self) -> bool
Checks if this feature is supported.
source§impl<T: BasicMPP> Features<T>
impl<T: BasicMPP> Features<T>
sourcepub fn requires_basic_mpp(&self) -> bool
pub fn requires_basic_mpp(&self) -> bool
Checks if this feature is required.
source§impl<T: Wumbo> Features<T>
impl<T: Wumbo> Features<T>
sourcepub fn set_wumbo_optional(&mut self)
pub fn set_wumbo_optional(&mut self)
Set this feature as optional.
sourcepub fn set_wumbo_required(&mut self)
pub fn set_wumbo_required(&mut self)
Set this feature as required.
sourcepub fn supports_wumbo(&self) -> bool
pub fn supports_wumbo(&self) -> bool
Checks if this feature is supported.
source§impl<T: Wumbo> Features<T>
impl<T: Wumbo> Features<T>
sourcepub fn requires_wumbo(&self) -> bool
pub fn requires_wumbo(&self) -> bool
Checks if this feature is required.
source§impl<T: AnchorsNonzeroFeeHtlcTx> Features<T>
impl<T: AnchorsNonzeroFeeHtlcTx> Features<T>
sourcepub fn set_anchors_nonzero_fee_htlc_tx_optional(&mut self)
pub fn set_anchors_nonzero_fee_htlc_tx_optional(&mut self)
Set this feature as optional.
sourcepub fn set_anchors_nonzero_fee_htlc_tx_required(&mut self)
pub fn set_anchors_nonzero_fee_htlc_tx_required(&mut self)
Set this feature as required.
sourcepub fn supports_anchors_nonzero_fee_htlc_tx(&self) -> bool
pub fn supports_anchors_nonzero_fee_htlc_tx(&self) -> bool
Checks if this feature is supported.
source§impl<T: AnchorsNonzeroFeeHtlcTx> Features<T>
impl<T: AnchorsNonzeroFeeHtlcTx> Features<T>
sourcepub fn requires_anchors_nonzero_fee_htlc_tx(&self) -> bool
pub fn requires_anchors_nonzero_fee_htlc_tx(&self) -> bool
Checks if this feature is required.
source§impl<T: AnchorsZeroFeeHtlcTx> Features<T>
impl<T: AnchorsZeroFeeHtlcTx> Features<T>
sourcepub fn set_anchors_zero_fee_htlc_tx_optional(&mut self)
pub fn set_anchors_zero_fee_htlc_tx_optional(&mut self)
Set this feature as optional.
sourcepub fn set_anchors_zero_fee_htlc_tx_required(&mut self)
pub fn set_anchors_zero_fee_htlc_tx_required(&mut self)
Set this feature as required.
sourcepub fn supports_anchors_zero_fee_htlc_tx(&self) -> bool
pub fn supports_anchors_zero_fee_htlc_tx(&self) -> bool
Checks if this feature is supported.
source§impl<T: AnchorsZeroFeeHtlcTx> Features<T>
impl<T: AnchorsZeroFeeHtlcTx> Features<T>
sourcepub fn requires_anchors_zero_fee_htlc_tx(&self) -> bool
pub fn requires_anchors_zero_fee_htlc_tx(&self) -> bool
Checks if this feature is required.
source§impl<T: RouteBlinding> Features<T>
impl<T: RouteBlinding> Features<T>
sourcepub fn set_route_blinding_optional(&mut self)
pub fn set_route_blinding_optional(&mut self)
Set this feature as optional.
sourcepub fn set_route_blinding_required(&mut self)
pub fn set_route_blinding_required(&mut self)
Set this feature as required.
sourcepub fn supports_route_blinding(&self) -> bool
pub fn supports_route_blinding(&self) -> bool
Checks if this feature is supported.
source§impl<T: RouteBlinding> Features<T>
impl<T: RouteBlinding> Features<T>
sourcepub fn requires_route_blinding(&self) -> bool
pub fn requires_route_blinding(&self) -> bool
Checks if this feature is required.
source§impl<T: ShutdownAnySegwit> Features<T>
impl<T: ShutdownAnySegwit> Features<T>
sourcepub fn set_shutdown_any_segwit_optional(&mut self)
pub fn set_shutdown_any_segwit_optional(&mut self)
Set this feature as optional.
sourcepub fn set_shutdown_any_segwit_required(&mut self)
pub fn set_shutdown_any_segwit_required(&mut self)
Set this feature as required.
sourcepub fn supports_shutdown_anysegwit(&self) -> bool
pub fn supports_shutdown_anysegwit(&self) -> bool
Checks if this feature is supported.
source§impl<T: ShutdownAnySegwit> Features<T>
impl<T: ShutdownAnySegwit> Features<T>
sourcepub fn requires_shutdown_anysegwit(&self) -> bool
pub fn requires_shutdown_anysegwit(&self) -> bool
Checks if this feature is required.
source§impl<T: Taproot> Features<T>
impl<T: Taproot> Features<T>
sourcepub fn set_taproot_optional(&mut self)
pub fn set_taproot_optional(&mut self)
Set this feature as optional.
sourcepub fn set_taproot_required(&mut self)
pub fn set_taproot_required(&mut self)
Set this feature as required.
sourcepub fn supports_taproot(&self) -> bool
pub fn supports_taproot(&self) -> bool
Checks if this feature is supported.
source§impl<T: Taproot> Features<T>
impl<T: Taproot> Features<T>
sourcepub fn requires_taproot(&self) -> bool
pub fn requires_taproot(&self) -> bool
Checks if this feature is required.
source§impl<T: OnionMessages> Features<T>
impl<T: OnionMessages> Features<T>
sourcepub fn set_onion_messages_optional(&mut self)
pub fn set_onion_messages_optional(&mut self)
Set this feature as optional.
sourcepub fn set_onion_messages_required(&mut self)
pub fn set_onion_messages_required(&mut self)
Set this feature as required.
sourcepub fn supports_onion_messages(&self) -> bool
pub fn supports_onion_messages(&self) -> bool
Checks if this feature is supported.
source§impl<T: OnionMessages> Features<T>
impl<T: OnionMessages> Features<T>
sourcepub fn requires_onion_messages(&self) -> bool
pub fn requires_onion_messages(&self) -> bool
Checks if this feature is required.
source§impl<T: ChannelType> Features<T>
impl<T: ChannelType> Features<T>
sourcepub fn set_channel_type_optional(&mut self)
pub fn set_channel_type_optional(&mut self)
Set this feature as optional.
sourcepub fn set_channel_type_required(&mut self)
pub fn set_channel_type_required(&mut self)
Set this feature as required.
sourcepub fn supports_channel_type(&self) -> bool
pub fn supports_channel_type(&self) -> bool
Checks if this feature is supported.
source§impl<T: ChannelType> Features<T>
impl<T: ChannelType> Features<T>
sourcepub fn requires_channel_type(&self) -> bool
pub fn requires_channel_type(&self) -> bool
Checks if this feature is required.
source§impl<T: SCIDPrivacy> Features<T>
impl<T: SCIDPrivacy> Features<T>
sourcepub fn set_scid_privacy_optional(&mut self)
pub fn set_scid_privacy_optional(&mut self)
Set this feature as optional.
sourcepub fn set_scid_privacy_required(&mut self)
pub fn set_scid_privacy_required(&mut self)
Set this feature as required.
sourcepub fn supports_scid_privacy(&self) -> bool
pub fn supports_scid_privacy(&self) -> bool
Checks if this feature is supported.
source§impl<T: SCIDPrivacy> Features<T>
impl<T: SCIDPrivacy> Features<T>
sourcepub fn requires_scid_privacy(&self) -> bool
pub fn requires_scid_privacy(&self) -> bool
Checks if this feature is required.
source§impl<T: PaymentMetadata> Features<T>
impl<T: PaymentMetadata> Features<T>
sourcepub fn set_payment_metadata_optional(&mut self)
pub fn set_payment_metadata_optional(&mut self)
Set this feature as optional.
sourcepub fn set_payment_metadata_required(&mut self)
pub fn set_payment_metadata_required(&mut self)
Set this feature as required.
sourcepub fn supports_payment_metadata(&self) -> bool
pub fn supports_payment_metadata(&self) -> bool
Checks if this feature is supported.
source§impl<T: PaymentMetadata> Features<T>
impl<T: PaymentMetadata> Features<T>
sourcepub fn requires_payment_metadata(&self) -> bool
pub fn requires_payment_metadata(&self) -> bool
Checks if this feature is required.
source§impl<T: ZeroConf> Features<T>
impl<T: ZeroConf> Features<T>
sourcepub fn set_zero_conf_optional(&mut self)
pub fn set_zero_conf_optional(&mut self)
Set this feature as optional.
sourcepub fn set_zero_conf_required(&mut self)
pub fn set_zero_conf_required(&mut self)
Set this feature as required.
sourcepub fn supports_zero_conf(&self) -> bool
pub fn supports_zero_conf(&self) -> bool
Checks if this feature is supported.
source§impl<T: ZeroConf> Features<T>
impl<T: ZeroConf> Features<T>
sourcepub fn requires_zero_conf(&self) -> bool
pub fn requires_zero_conf(&self) -> bool
Checks if this feature is required.
source§impl<T: Keysend> Features<T>
impl<T: Keysend> Features<T>
sourcepub fn set_keysend_optional(&mut self)
pub fn set_keysend_optional(&mut self)
Set this feature as optional.
sourcepub fn set_keysend_required(&mut self)
pub fn set_keysend_required(&mut self)
Set this feature as required.
sourcepub fn supports_keysend(&self) -> bool
pub fn supports_keysend(&self) -> bool
Checks if this feature is supported.
source§impl<T: Keysend> Features<T>
impl<T: Keysend> Features<T>
sourcepub fn requires_keysend(&self) -> bool
pub fn requires_keysend(&self) -> bool
Checks if this feature is required.
source§impl<T: Context> Features<T>
impl<T: Context> Features<T>
sourcepub fn from_le_bytes(flags: Vec<u8>) -> Features<T>
pub fn from_le_bytes(flags: Vec<u8>) -> Features<T>
Create a Features given a set of flags, in little-endian. This is in reverse byte order from most on-the-wire encodings.
This is not exported to bindings users as we don’t support export across multiple T
sourcepub fn from_be_bytes(flags: Vec<u8>) -> Features<T>
pub fn from_be_bytes(flags: Vec<u8>) -> Features<T>
Create a Features
given a set of flags, in big-endian. This is in byte order from
most on-the-wire encodings.
This is not exported to bindings users as we don’t support export across multiple T
sourcepub fn requires_unknown_bits_from(&self, other: &Self) -> bool
pub fn requires_unknown_bits_from(&self, other: &Self) -> bool
Returns true if this Features
object contains required features unknown by other
.
sourcepub fn requires_unknown_bits(&self) -> bool
pub fn requires_unknown_bits(&self) -> bool
Returns true if this Features
object contains unknown feature flags which are set as
“required”.
sourcepub fn set_required_feature_bit(&mut self, bit: usize) -> Result<(), ()>
pub fn set_required_feature_bit(&mut self, bit: usize) -> Result<(), ()>
Sets a required feature bit. Errors if bit
is outside the feature range as defined
by BOLT 9.
Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
be set instead (i.e., bit - 1
).
sourcepub fn set_optional_feature_bit(&mut self, bit: usize) -> Result<(), ()>
pub fn set_optional_feature_bit(&mut self, bit: usize) -> Result<(), ()>
Sets an optional feature bit. Errors if bit
is outside the feature range as defined
by BOLT 9.
Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
set instead (i.e., bit + 1
).
sourcepub fn set_required_custom_bit(&mut self, bit: usize) -> Result<(), ()>
pub fn set_required_custom_bit(&mut self, bit: usize) -> Result<(), ()>
Sets a required custom feature bit. Errors if bit
is outside the custom range as defined
by bLIP 2 or if it is a known T
feature.
Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
be set instead (i.e., bit - 1
).
sourcepub fn set_optional_custom_bit(&mut self, bit: usize) -> Result<(), ()>
pub fn set_optional_custom_bit(&mut self, bit: usize) -> Result<(), ()>
Sets an optional custom feature bit. Errors if bit
is outside the custom range as defined
by bLIP 2 or if it is a known T
feature.
Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
set instead (i.e., bit + 1
).
Trait Implementations§
source§impl<T: Context, Rhs: Borrow<Self>> BitOrAssign<Rhs> for Features<T>
impl<T: Context, Rhs: Borrow<Self>> BitOrAssign<Rhs> for Features<T>
source§fn bitor_assign(&mut self, rhs: Rhs)
fn bitor_assign(&mut self, rhs: Rhs)
|=
operation. Read moresource§impl<T: Context + Eq> Ord for Features<T>
impl<T: Context + Eq> Ord for Features<T>
source§impl<T: Context> PartialOrd for Features<T>
impl<T: Context> PartialOrd for Features<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more