Struct Features
pub struct Features<T>where
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§
§impl<T> Features<T>where
T: DataLossProtect,
impl<T> Features<T>where
T: DataLossProtect,
pub fn set_data_loss_protect_optional(&mut self)
pub fn set_data_loss_protect_optional(&mut self)
Set this feature as optional.
pub fn set_data_loss_protect_required(&mut self)
pub fn set_data_loss_protect_required(&mut self)
Set this feature as required.
pub fn supports_data_loss_protect(&self) -> bool
pub fn supports_data_loss_protect(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: DataLossProtect,
impl<T> Features<T>where
T: DataLossProtect,
pub fn requires_data_loss_protect(&self) -> bool
pub fn requires_data_loss_protect(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: InitialRoutingSync,
impl<T> Features<T>where
T: InitialRoutingSync,
pub fn set_initial_routing_sync_optional(&mut self)
pub fn set_initial_routing_sync_optional(&mut self)
Set this feature as optional.
pub fn set_initial_routing_sync_required(&mut self)
pub fn set_initial_routing_sync_required(&mut self)
Set this feature as required.
pub fn initial_routing_sync(&self) -> bool
pub fn initial_routing_sync(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: UpfrontShutdownScript,
impl<T> Features<T>where
T: UpfrontShutdownScript,
pub fn set_upfront_shutdown_script_optional(&mut self)
pub fn set_upfront_shutdown_script_optional(&mut self)
Set this feature as optional.
pub fn set_upfront_shutdown_script_required(&mut self)
pub fn set_upfront_shutdown_script_required(&mut self)
Set this feature as required.
pub fn supports_upfront_shutdown_script(&self) -> bool
pub fn supports_upfront_shutdown_script(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: UpfrontShutdownScript,
impl<T> Features<T>where
T: UpfrontShutdownScript,
pub fn requires_upfront_shutdown_script(&self) -> bool
pub fn requires_upfront_shutdown_script(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: GossipQueries,
impl<T> Features<T>where
T: GossipQueries,
pub fn set_gossip_queries_optional(&mut self)
pub fn set_gossip_queries_optional(&mut self)
Set this feature as optional.
pub fn set_gossip_queries_required(&mut self)
pub fn set_gossip_queries_required(&mut self)
Set this feature as required.
pub fn supports_gossip_queries(&self) -> bool
pub fn supports_gossip_queries(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: GossipQueries,
impl<T> Features<T>where
T: GossipQueries,
pub fn requires_gossip_queries(&self) -> bool
pub fn requires_gossip_queries(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: VariableLengthOnion,
impl<T> Features<T>where
T: VariableLengthOnion,
pub fn set_variable_length_onion_optional(&mut self)
pub fn set_variable_length_onion_optional(&mut self)
Set this feature as optional.
pub fn set_variable_length_onion_required(&mut self)
pub fn set_variable_length_onion_required(&mut self)
Set this feature as required.
pub fn supports_variable_length_onion(&self) -> bool
pub fn supports_variable_length_onion(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: VariableLengthOnion,
impl<T> Features<T>where
T: VariableLengthOnion,
pub fn requires_variable_length_onion(&self) -> bool
pub fn requires_variable_length_onion(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: StaticRemoteKey,
impl<T> Features<T>where
T: StaticRemoteKey,
pub fn set_static_remote_key_optional(&mut self)
pub fn set_static_remote_key_optional(&mut self)
Set this feature as optional.
pub fn set_static_remote_key_required(&mut self)
pub fn set_static_remote_key_required(&mut self)
Set this feature as required.
pub fn supports_static_remote_key(&self) -> bool
pub fn supports_static_remote_key(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: StaticRemoteKey,
impl<T> Features<T>where
T: StaticRemoteKey,
pub fn requires_static_remote_key(&self) -> bool
pub fn requires_static_remote_key(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: PaymentSecret,
impl<T> Features<T>where
T: PaymentSecret,
pub fn set_payment_secret_optional(&mut self)
pub fn set_payment_secret_optional(&mut self)
Set this feature as optional.
pub fn set_payment_secret_required(&mut self)
pub fn set_payment_secret_required(&mut self)
Set this feature as required.
pub fn supports_payment_secret(&self) -> bool
pub fn supports_payment_secret(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: PaymentSecret,
impl<T> Features<T>where
T: PaymentSecret,
pub fn requires_payment_secret(&self) -> bool
pub fn requires_payment_secret(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: BasicMPP,
impl<T> Features<T>where
T: BasicMPP,
pub fn set_basic_mpp_optional(&mut self)
pub fn set_basic_mpp_optional(&mut self)
Set this feature as optional.
pub fn set_basic_mpp_required(&mut self)
pub fn set_basic_mpp_required(&mut self)
Set this feature as required.
pub fn supports_basic_mpp(&self) -> bool
pub fn supports_basic_mpp(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: BasicMPP,
impl<T> Features<T>where
T: BasicMPP,
pub fn requires_basic_mpp(&self) -> bool
pub fn requires_basic_mpp(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: Wumbo,
impl<T> Features<T>where
T: Wumbo,
pub fn set_wumbo_optional(&mut self)
pub fn set_wumbo_optional(&mut self)
Set this feature as optional.
pub fn set_wumbo_required(&mut self)
pub fn set_wumbo_required(&mut self)
Set this feature as required.
pub fn supports_wumbo(&self) -> bool
pub fn supports_wumbo(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: Wumbo,
impl<T> Features<T>where
T: Wumbo,
pub fn requires_wumbo(&self) -> bool
pub fn requires_wumbo(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: AnchorsNonzeroFeeHtlcTx,
impl<T> Features<T>where
T: AnchorsNonzeroFeeHtlcTx,
pub 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.
pub 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.
pub 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.
§impl<T> Features<T>where
T: AnchorsNonzeroFeeHtlcTx,
impl<T> Features<T>where
T: AnchorsNonzeroFeeHtlcTx,
pub 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.
§impl<T> Features<T>where
T: AnchorsZeroFeeHtlcTx,
impl<T> Features<T>where
T: AnchorsZeroFeeHtlcTx,
pub 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.
pub 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.
pub 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.
§impl<T> Features<T>where
T: AnchorsZeroFeeHtlcTx,
impl<T> Features<T>where
T: AnchorsZeroFeeHtlcTx,
pub 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.
§impl<T> Features<T>where
T: ShutdownAnySegwit,
impl<T> Features<T>where
T: ShutdownAnySegwit,
pub fn set_shutdown_any_segwit_optional(&mut self)
pub fn set_shutdown_any_segwit_optional(&mut self)
Set this feature as optional.
pub fn set_shutdown_any_segwit_required(&mut self)
pub fn set_shutdown_any_segwit_required(&mut self)
Set this feature as required.
pub fn supports_shutdown_anysegwit(&self) -> bool
pub fn supports_shutdown_anysegwit(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: ShutdownAnySegwit,
impl<T> Features<T>where
T: ShutdownAnySegwit,
pub fn requires_shutdown_anysegwit(&self) -> bool
pub fn requires_shutdown_anysegwit(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: Taproot,
impl<T> Features<T>where
T: Taproot,
pub fn set_taproot_optional(&mut self)
pub fn set_taproot_optional(&mut self)
Set this feature as optional.
pub fn set_taproot_required(&mut self)
pub fn set_taproot_required(&mut self)
Set this feature as required.
pub fn supports_taproot(&self) -> bool
pub fn supports_taproot(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: Taproot,
impl<T> Features<T>where
T: Taproot,
pub fn requires_taproot(&self) -> bool
pub fn requires_taproot(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: OnionMessages,
impl<T> Features<T>where
T: OnionMessages,
pub fn set_onion_messages_optional(&mut self)
pub fn set_onion_messages_optional(&mut self)
Set this feature as optional.
pub fn set_onion_messages_required(&mut self)
pub fn set_onion_messages_required(&mut self)
Set this feature as required.
pub fn supports_onion_messages(&self) -> bool
pub fn supports_onion_messages(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: OnionMessages,
impl<T> Features<T>where
T: OnionMessages,
pub fn requires_onion_messages(&self) -> bool
pub fn requires_onion_messages(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: ChannelType,
impl<T> Features<T>where
T: ChannelType,
pub fn set_channel_type_optional(&mut self)
pub fn set_channel_type_optional(&mut self)
Set this feature as optional.
pub fn set_channel_type_required(&mut self)
pub fn set_channel_type_required(&mut self)
Set this feature as required.
pub fn supports_channel_type(&self) -> bool
pub fn supports_channel_type(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: ChannelType,
impl<T> Features<T>where
T: ChannelType,
pub fn requires_channel_type(&self) -> bool
pub fn requires_channel_type(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: SCIDPrivacy,
impl<T> Features<T>where
T: SCIDPrivacy,
pub fn set_scid_privacy_optional(&mut self)
pub fn set_scid_privacy_optional(&mut self)
Set this feature as optional.
pub fn set_scid_privacy_required(&mut self)
pub fn set_scid_privacy_required(&mut self)
Set this feature as required.
pub fn supports_scid_privacy(&self) -> bool
pub fn supports_scid_privacy(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: SCIDPrivacy,
impl<T> Features<T>where
T: SCIDPrivacy,
pub fn requires_scid_privacy(&self) -> bool
pub fn requires_scid_privacy(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: PaymentMetadata,
impl<T> Features<T>where
T: PaymentMetadata,
pub fn set_payment_metadata_optional(&mut self)
pub fn set_payment_metadata_optional(&mut self)
Set this feature as optional.
pub fn set_payment_metadata_required(&mut self)
pub fn set_payment_metadata_required(&mut self)
Set this feature as required.
pub fn supports_payment_metadata(&self) -> bool
pub fn supports_payment_metadata(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: PaymentMetadata,
impl<T> Features<T>where
T: PaymentMetadata,
pub fn requires_payment_metadata(&self) -> bool
pub fn requires_payment_metadata(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: ZeroConf,
impl<T> Features<T>where
T: ZeroConf,
pub fn set_zero_conf_optional(&mut self)
pub fn set_zero_conf_optional(&mut self)
Set this feature as optional.
pub fn set_zero_conf_required(&mut self)
pub fn set_zero_conf_required(&mut self)
Set this feature as required.
pub fn supports_zero_conf(&self) -> bool
pub fn supports_zero_conf(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: ZeroConf,
impl<T> Features<T>where
T: ZeroConf,
pub fn requires_zero_conf(&self) -> bool
pub fn requires_zero_conf(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: Keysend,
impl<T> Features<T>where
T: Keysend,
pub fn set_keysend_optional(&mut self)
pub fn set_keysend_optional(&mut self)
Set this feature as optional.
pub fn set_keysend_required(&mut self)
pub fn set_keysend_required(&mut self)
Set this feature as required.
pub fn supports_keysend(&self) -> bool
pub fn supports_keysend(&self) -> bool
Checks if this feature is supported.
§impl<T> Features<T>where
T: Keysend,
impl<T> Features<T>where
T: Keysend,
pub fn requires_keysend(&self) -> bool
pub fn requires_keysend(&self) -> bool
Checks if this feature is required.
§impl<T> Features<T>where
T: Context,
impl<T> Features<T>where
T: Context,
pub 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
pub 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
pub fn requires_unknown_bits_from(&self, other: &Features<T>) -> bool
pub fn requires_unknown_bits_from(&self, other: &Features<T>) -> bool
Returns true if this Features
object contains required features unknown by other
.
pub 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”.
pub 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
).
pub 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
).
pub 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
).
pub 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§
§impl Base32Len for Features<Bolt11InvoiceContext>
impl Base32Len for Features<Bolt11InvoiceContext>
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
§impl<T, Rhs> BitOrAssign<Rhs> for Features<T>
impl<T, Rhs> BitOrAssign<Rhs> for Features<T>
§fn bitor_assign(&mut self, rhs: Rhs)
fn bitor_assign(&mut self, rhs: Rhs)
|=
operation. Read more§impl FromBase32 for Features<Bolt11InvoiceContext>
impl FromBase32 for Features<Bolt11InvoiceContext>
§impl<T> Ord for Features<T>where
T: Context + Eq,
impl<T> Ord for Features<T>where
T: Context + Eq,
§impl<T> PartialOrd for Features<T>where
T: Context,
impl<T> PartialOrd for Features<T>where
T: Context,
§impl ToBase32 for Features<Bolt11InvoiceContext>
impl ToBase32 for Features<Bolt11InvoiceContext>
§fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
§impl Writeable for Features<BlindedHopContext>
impl Writeable for Features<BlindedHopContext>
§impl Writeable for Features<Bolt11InvoiceContext>
impl Writeable for Features<Bolt11InvoiceContext>
§impl Writeable for Features<Bolt12InvoiceContext>
impl Writeable for Features<Bolt12InvoiceContext>
§impl Writeable for Features<ChannelContext>
impl Writeable for Features<ChannelContext>
§impl Writeable for Features<ChannelTypeContext>
impl Writeable for Features<ChannelTypeContext>
§impl Writeable for Features<InitContext>
impl Writeable for Features<InitContext>
§impl Writeable for Features<NodeContext>
impl Writeable for Features<NodeContext>
impl<T> Eq for Features<T>where
T: Eq + Context,
Auto Trait Implementations§
impl<T> Freeze for Features<T>
impl<T> RefUnwindSafe for Features<T>where
T: RefUnwindSafe,
impl<T> Send for Features<T>where
T: Send,
impl<T> Sync for Features<T>where
T: Sync,
impl<T> Unpin for Features<T>where
T: Unpin,
impl<T> UnwindSafe for Features<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key
and return true
if they are equal.§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
§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
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request