pub enum GossipExt {
MainRouter,
DirectRouter,
GossipRouter,
}
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
type State = RouterState
type Error = Error
type PeerMessage = Messages
type UpdateMessage = UpdateMsg
type UpdateRequest = ()
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_peer
source§impl Ord for GossipExt
impl Ord for GossipExt
source§impl PartialEq<GossipExt> for GossipExt
impl PartialEq<GossipExt> for GossipExt
source§impl PartialOrd<GossipExt> for GossipExt
impl PartialOrd<GossipExt> for GossipExt
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§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, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
functionimpl Copy for GossipExt
impl Eq for GossipExt
impl StructuralEq for GossipExt
impl StructuralPartialEq for GossipExt
Auto Trait Implementations§
impl RefUnwindSafe for GossipExt
impl Send for GossipExt
impl Sync for GossipExt
impl Unpin for GossipExt
impl UnwindSafe for GossipExt
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.