Struct lightning::ln::peer_handler::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
sourceimpl CustomMessageHandler for IgnoringMessageHandler
impl CustomMessageHandler for IgnoringMessageHandler
sourcefn handle_custom_message(
&self,
_msg: Infallible,
_sender_node_id: &PublicKey
) -> Result<(), LightningError>
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. Read more
sourcefn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::CustomMessage)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::CustomMessage)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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. Read more
sourceimpl CustomMessageReader for IgnoringMessageHandler
impl CustomMessageReader for IgnoringMessageHandler
type CustomMessage = Infallible
type CustomMessage = Infallible
The type of the message decoded by the implementation.
sourcefn read<R: Read>(
&self,
_message_type: u16,
_buffer: &mut R
) -> Result<Option<Self::CustomMessage>, DecodeError>
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. Read more
sourceimpl Deref for IgnoringMessageHandler
impl Deref for IgnoringMessageHandler
type Target = IgnoringMessageHandler
type Target = IgnoringMessageHandler
The resulting type after dereferencing.
sourceimpl RoutingMessageHandler for IgnoringMessageHandler
impl RoutingMessageHandler for IgnoringMessageHandler
sourcefn handle_node_announcement(
&self,
_msg: &NodeAnnouncement
) -> Result<bool, LightningError>
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. Read more
sourcefn handle_channel_announcement(
&self,
_msg: &ChannelAnnouncement
) -> Result<bool, LightningError>
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. Read more
sourcefn handle_channel_update(
&self,
_msg: &ChannelUpdate
) -> Result<bool, LightningError>
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. Read more
sourcefn get_next_channel_announcements(
&self,
_starting_point: u64,
_batch_amount: u8
) -> Vec<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_next_channel_announcements(
&self,
_starting_point: u64,
_batch_amount: u8
) -> Vec<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets a subset of the 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 the batch_amount entries immediately higher in numerical value than starting_point. Read more
sourcefn get_next_node_announcements(
&self,
_starting_point: Option<&PublicKey>,
_batch_amount: u8
) -> Vec<NodeAnnouncement>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_next_node_announcements(
&self,
_starting_point: Option<&PublicKey>,
_batch_amount: u8
) -> Vec<NodeAnnouncement>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets a subset of the node announcements required to dump our routing table to a remote node,
starting at the node after the provided publickey and including batch_amount entries
immediately higher (as defined by
sourcefn sync_routing_table(&self, _their_node_id: &PublicKey, _init: &Init)
fn sync_routing_table(&self, _their_node_id: &PublicKey, _init: &Init)
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
sourcefn handle_reply_channel_range(
&self,
_their_node_id: &PublicKey,
_msg: ReplyChannelRange
) -> Result<(), LightningError>
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. Read more
sourcefn handle_reply_short_channel_ids_end(
&self,
_their_node_id: &PublicKey,
_msg: ReplyShortChannelIdsEnd
) -> Result<(), LightningError>
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. Read more
sourcefn handle_query_channel_range(
&self,
_their_node_id: &PublicKey,
_msg: QueryChannelRange
) -> Result<(), LightningError>
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. Read more
sourcefn handle_query_short_channel_ids(
&self,
_their_node_id: &PublicKey,
_msg: QueryShortChannelIds
) -> Result<(), LightningError>
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. Read more
Auto Trait Implementations
impl RefUnwindSafe for IgnoringMessageHandler
impl Send for IgnoringMessageHandler
impl Sync for IgnoringMessageHandler
impl Unpin for IgnoringMessageHandler
impl UnwindSafe for IgnoringMessageHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more