Struct IgnoringMessageHandler

Source
pub struct IgnoringMessageHandler {}
Expand description

A dummy struct which implements RoutingMessageHandler without storing any routing information or doing any processing. You can provide one of these as the route_handler in a MessageHandler.

Trait Implementations§

Source§

impl CustomMessageHandler for IgnoringMessageHandler

Source§

fn handle_custom_message( &self, _msg: Infallible, _sender_node_id: &PublicKey, ) -> Result<(), LightningError>

Called with the message type that was received and the buffer to be read. Can return a MessageHandlingError if the message could not be handled.
Source§

fn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::CustomMessage)>

Gets the list of pending messages which were generated by the custom message handler, clearing the list in the process. The first tuple element must correspond to the intended recipients node ids. If no connection to one of the specified node does not exist, the message is simply not sent to it.
Source§

impl CustomMessageReader for IgnoringMessageHandler

Source§

type CustomMessage = Infallible

The type of the message decoded by the implementation.
Source§

fn read<R: Read>( &self, _message_type: u16, _buffer: &mut R, ) -> Result<Option<Self::CustomMessage>, DecodeError>

Decodes a custom message to CustomMessageType. If the given message type is known to the implementation and the message could be decoded, must return Ok(Some(message)). If the message type is unknown to the implementation, must return Ok(None). If a decoding error occur, must return Err(DecodeError::X) where X details the encountered error.
Source§

impl CustomOnionMessageHandler for IgnoringMessageHandler

Source§

type CustomMessage = Infallible

The message known to the handler. To support multiple message types, you may want to make this an enum with a variant for each supported message.
Source§

fn handle_custom_message(&self, _msg: Infallible)

Called with the custom message that was received.
Source§

fn read_custom_message<R: Read>( &self, _msg_type: u64, _buffer: &mut R, ) -> Result<Option<Infallible>, DecodeError>
where Self: Sized,

Read a custom message of type message_type from buffer, returning Ok(None) if the message type is unknown.
Source§

impl Deref for IgnoringMessageHandler

Source§

type Target = IgnoringMessageHandler

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self

Dereferences the value.
Source§

impl MessageSendEventsProvider for IgnoringMessageHandler

Source§

fn get_and_clear_pending_msg_events(&self) -> Vec<MessageSendEvent>

Gets the list of pending events which were generated by previous actions, clearing the list in the process.
Source§

impl OnionMessageHandler for IgnoringMessageHandler

Source§

fn handle_onion_message(&self, _their_node_id: &PublicKey, _msg: &OnionMessage)

Handle an incoming onion_message message from the given peer.
Source§

fn peer_connected( &self, _their_node_id: &PublicKey, _init: &Init, ) -> Result<(), ()>

Called when a connection is established with a peer. Can be used to track which peers advertise onion message support and are online. Read more
Source§

fn peer_disconnected( &self, _their_node_id: &PublicKey, _no_connection_possible: bool, )

Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to drop and refuse to forward onion messages to this peer. Read more
Source§

fn provided_node_features(&self) -> NodeFeatures

Gets the node feature flags which this handler itself supports. All available handlers are queried similarly and their feature flags are OR’d together to form the NodeFeatures which are broadcasted in our NodeAnnouncement message.
Source§

fn provided_init_features(&self, _their_node_id: &PublicKey) -> InitFeatures

Gets the init feature flags which should be sent to the given peer. All available handlers are queried similarly and their feature flags are OR’d together to form the InitFeatures which are sent in our Init message. Read more
Source§

impl OnionMessageProvider for IgnoringMessageHandler

Source§

fn next_onion_message_for_peer( &self, _peer_node_id: PublicKey, ) -> Option<OnionMessage>

Gets the next pending onion message for the peer with the given node id.
Source§

impl RoutingMessageHandler for IgnoringMessageHandler

Source§

fn handle_node_announcement( &self, _msg: &NodeAnnouncement, ) -> Result<bool, LightningError>

Handle an incoming node_announcement message, returning true if it should be forwarded on, false or returning an Err otherwise.
Source§

fn handle_channel_announcement( &self, _msg: &ChannelAnnouncement, ) -> Result<bool, LightningError>

Handle a channel_announcement message, returning true if it should be forwarded on, false or returning an Err otherwise.
Source§

fn handle_channel_update( &self, _msg: &ChannelUpdate, ) -> Result<bool, LightningError>

Handle an incoming channel_update message, returning true if it should be forwarded on, false or returning an Err otherwise.
Source§

fn get_next_channel_announcement( &self, _starting_point: u64, ) -> Option<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)>

Gets channel announcements and updates required to dump our routing table to a remote node, starting at the short_channel_id indicated by starting_point and including announcements for a single channel.
Source§

fn get_next_node_announcement( &self, _starting_point: Option<&PublicKey>, ) -> Option<NodeAnnouncement>

Gets a node announcement required to dump our routing table to a remote node, starting at the node after the provided pubkey and including up to one announcement immediately higher (as defined by ::cmp) than starting_point. If None is provided for starting_point, we start at the first node.
Source§

fn peer_connected( &self, _their_node_id: &PublicKey, _init: &Init, ) -> Result<(), ()>

Called when a connection is established with a peer. This can be used to perform routing table synchronization using a strategy defined by the implementor. Read more
Source§

fn handle_reply_channel_range( &self, _their_node_id: &PublicKey, _msg: ReplyChannelRange, ) -> Result<(), LightningError>

Handles the reply of a query we initiated to learn about channels for a given range of blocks. We can expect to receive one or more replies to a single query.
Source§

fn handle_reply_short_channel_ids_end( &self, _their_node_id: &PublicKey, _msg: ReplyShortChannelIdsEnd, ) -> Result<(), LightningError>

Handles the reply of a query we initiated asking for routing gossip messages for a list of channels. We should receive this message when a node has completed its best effort to send us the pertaining routing gossip messages.
Source§

fn handle_query_channel_range( &self, _their_node_id: &PublicKey, _msg: QueryChannelRange, ) -> Result<(), LightningError>

Handles when a peer asks us to send a list of short_channel_ids for the requested range of blocks.
Source§

fn handle_query_short_channel_ids( &self, _their_node_id: &PublicKey, _msg: QueryShortChannelIds, ) -> Result<(), LightningError>

Handles when a peer asks us to send routing gossip messages for a list of short_channel_ids.
Source§

fn provided_node_features(&self) -> NodeFeatures

Gets the node feature flags which this handler itself supports. All available handlers are queried similarly and their feature flags are OR’d together to form the NodeFeatures which are broadcasted in our NodeAnnouncement message.
Source§

fn provided_init_features(&self, _their_node_id: &PublicKey) -> InitFeatures

Gets the init feature flags which should be sent to the given peer. All available handlers are queried similarly and their feature flags are OR’d together to form the InitFeatures which are sent in our Init message. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.