pub trait Extension<N: Nomenclature> {
// Required methods
fn identity(&self) -> N;
fn update_from_peer(
&mut self,
message: &<N as Nomenclature>::PeerMessage
) -> Result<(), <N as Nomenclature>::Error>;
fn update_from_local(
&mut self,
message: &<N as Nomenclature>::UpdateMessage
) -> Result<(), <N as Nomenclature>::Error>;
fn load_state(&mut self, state: &N::State);
fn store_state(&self, state: &mut N::State);
// Provided method
fn state_change(
&mut self,
request: &<N as Nomenclature>::UpdateRequest,
message: &mut <N as Nomenclature>::PeerMessage
) -> Result<(), <N as Nomenclature>::Error> { ... }
}
Required Methods§
fn identity(&self) -> N
sourcefn update_from_peer(
&mut self,
message: &<N as Nomenclature>::PeerMessage
) -> Result<(), <N as Nomenclature>::Error>
fn update_from_peer( &mut self, message: &<N as Nomenclature>::PeerMessage ) -> Result<(), <N as Nomenclature>::Error>
Updates extension state from the data taken from the message received from the remote peer
sourcefn update_from_local(
&mut self,
message: &<N as Nomenclature>::UpdateMessage
) -> Result<(), <N as Nomenclature>::Error>
fn update_from_local( &mut self, message: &<N as Nomenclature>::UpdateMessage ) -> Result<(), <N as Nomenclature>::Error>
Updates extension state from some local data
fn load_state(&mut self, state: &N::State)
fn store_state(&self, state: &mut N::State)
Provided Methods§
sourcefn 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
Implementors§
impl Extension<BoltExt> for AnchorOutputs
impl Extension<BoltExt> for BoltChannel
impl Extension<BoltExt> for Htlc
impl Extension<BoltExt> for Bip96
impl Extension<GossipExt> for DirectRouter
impl Extension<GossipExt> for GossipRouter
impl<N> Extension<N> for Channel<N>where N: 'static + Nomenclature, N::State: State,
Channel is the extension to itself :) so it receives the same input as any other extension and just forwards it to them