pub enum GossipExt {
MainRouter = 0,
DirectRouter = 1,
GossipRouter = 2,
}Variants§
Trait Implementations§
Source§impl Extension<GossipExt> for DirectRouter
impl Extension<GossipExt> for DirectRouter
fn identity(&self) -> GossipExt
Source§fn update_from_peer(&mut self, message: &Messages) -> Result<(), Error>
fn update_from_peer(&mut self, message: &Messages) -> Result<(), Error>
Updates extension state from the data taken from the message received
from the remote peer
Source§fn update_from_local(&mut self, message: &UpdateMsg) -> Result<(), Error>
fn update_from_local(&mut self, message: &UpdateMsg) -> Result<(), Error>
Updates extension state from some local data
fn load_state(&mut self, state: &RouterState)
fn store_state(&self, state: &mut RouterState)
Source§fn state_change(
&mut self,
request: &<N as Nomenclature>::UpdateRequest,
message: &mut <N as Nomenclature>::PeerMessage,
) -> Result<(), <N as Nomenclature>::Error>
fn state_change( &mut self, request: &<N as Nomenclature>::UpdateRequest, message: &mut <N as Nomenclature>::PeerMessage, ) -> Result<(), <N as Nomenclature>::Error>
Perform a sate change and produce a message which should be communicated
to peers notifying them about the state change
Source§impl Extension<GossipExt> for GossipRouter
impl Extension<GossipExt> for GossipRouter
fn identity(&self) -> GossipExt
Source§fn update_from_local(&mut self, _message: &UpdateMsg) -> Result<(), Error>
fn update_from_local(&mut self, _message: &UpdateMsg) -> Result<(), Error>
Updates extension state from some local data
Source§fn update_from_peer(&mut self, message: &Messages) -> Result<(), Error>
fn update_from_peer(&mut self, message: &Messages) -> Result<(), Error>
Updates extension state from the data taken from the message received
from the remote peer
fn load_state(&mut self, state: &RouterState)
fn store_state(&self, state: &mut RouterState)
Source§fn state_change(
&mut self,
request: &<N as Nomenclature>::UpdateRequest,
message: &mut <N as Nomenclature>::PeerMessage,
) -> Result<(), <N as Nomenclature>::Error>
fn state_change( &mut self, request: &<N as Nomenclature>::UpdateRequest, message: &mut <N as Nomenclature>::PeerMessage, ) -> Result<(), <N as Nomenclature>::Error>
Perform a sate change and produce a message which should be communicated
to peers notifying them about the state change
Source§impl Nomenclature for GossipExt
impl Nomenclature for GossipExt
Source§impl Nomenclature for GossipExt
impl Nomenclature for GossipExt
type HopPayload = PaymentOnion
fn default_extensions() -> Vec<Box<dyn RouterExtension<Self>>>
Source§fn update_from_peer(
_router: &mut Router<Self>,
_message: &Messages,
) -> Result<(), Error>
fn update_from_peer( _router: &mut Router<Self>, _message: &Messages, ) -> Result<(), Error>
Updates router extension structure from peer message. Processed before
each of the registered extensions gets
Extension::update_from_peerSource§impl Ord for GossipExt
impl Ord for GossipExt
Source§impl PartialOrd for GossipExt
impl PartialOrd for GossipExt
Source§impl RouterExtension<GossipExt> for DirectRouter
impl RouterExtension<GossipExt> for DirectRouter
Source§fn new() -> Box<dyn RouterExtension<GossipExt>>where
Self: Sized,
fn new() -> Box<dyn RouterExtension<GossipExt>>where
Self: Sized,
Constructs boxed extension objects which can be inserted into router
extension pipeline
fn build_route( &mut self, payment: PaymentRequest, route: &mut Vec<Hop<PaymentOnion>>, )
Source§impl RouterExtension<GossipExt> for GossipRouter
impl RouterExtension<GossipExt> for GossipRouter
Source§fn new() -> Box<dyn RouterExtension<GossipExt>>where
Self: Sized,
fn new() -> Box<dyn RouterExtension<GossipExt>>where
Self: Sized,
Constructs boxed extension objects which can be inserted into router
extension pipeline
fn build_route( &mut self, _payment: PaymentRequest, _route: &mut Vec<Hop<PaymentOnion>>, )
Source§impl StrictDecode for GossipExt
impl StrictDecode for GossipExt
Source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
Decode with the given
std::io::Read instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and
StrictDecode::strict_decode to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
Reads data from file at
path and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed if file contains remaining
data after the object reconstruction.Source§impl StrictEncode for GossipExt
impl StrictEncode for GossipExt
Source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
Encode with the given
std::io::Write instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
functionimpl Copy for GossipExt
impl Eq for GossipExt
impl StructuralPartialEq for GossipExt
Auto Trait Implementations§
impl Freeze for GossipExt
impl RefUnwindSafe for GossipExt
impl Send for GossipExt
impl Sync for GossipExt
impl Unpin for GossipExt
impl UnwindSafe for GossipExt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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§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
Compare self to
key and return true if they are equal.