pub struct NullMessageRouter {}Expand description
A special MessageRouter that performs no routing and does not create blinded paths.
Its purpose is to enable the creation of Offers and Refunds without blinded paths,
where the user’s node_id is used directly as the Destination.
§Note
NullMessageRouter must not be used as the type parameter for ChannelManager,
since ChannelManager requires a functioning MessageRouter to create blinded paths,
which are necessary for constructing reply paths in onion message communication.
However, NullMessageRouter can still be passed as an argument to ChannelManager
methods that accepts a MessageRouter, such as ChannelManager::create_offer_builder_using_router,
when blinded paths are not needed.
Trait Implementations§
Source§impl MessageRouter for NullMessageRouter
impl MessageRouter for NullMessageRouter
Source§fn find_path(
&self,
_sender: PublicKey,
_peers: Vec<PublicKey>,
_destination: Destination,
) -> Result<OnionMessagePath, ()>
fn find_path( &self, _sender: PublicKey, _peers: Vec<PublicKey>, _destination: Destination, ) -> Result<OnionMessagePath, ()>
Returns a route for sending an
OnionMessage to the given Destination.Source§fn create_blinded_paths<T: Signing + Verification>(
&self,
_recipient: PublicKey,
_local_node_receive_key: ReceiveAuthKey,
_context: MessageContext,
_peers: Vec<MessageForwardNode>,
_secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()>
fn create_blinded_paths<T: Signing + Verification>( &self, _recipient: PublicKey, _local_node_receive_key: ReceiveAuthKey, _context: MessageContext, _peers: Vec<MessageForwardNode>, _secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedMessagePath>, ()>
Creates
BlindedMessagePaths to the recipient node. The nodes in peers are assumed to
be direct peers with the recipient.Auto Trait Implementations§
impl Freeze for NullMessageRouter
impl RefUnwindSafe for NullMessageRouter
impl Send for NullMessageRouter
impl Sync for NullMessageRouter
impl Unpin for NullMessageRouter
impl UnwindSafe for NullMessageRouter
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