Layer2Protocol

Trait Layer2Protocol 

Source
pub trait Layer2Protocol {
    // Required methods
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn connect<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_state<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ProtocolState, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tx_data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_transaction_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tx_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn sync_state<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn issue_asset<'life0, 'async_trait>(
        &'life0 self,
        params: AssetParams,
    ) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn transfer_asset<'life0, 'async_trait>(
        &'life0 self,
        transfer: AssetTransfer,
    ) -> Pin<Box<dyn Future<Output = Result<TransferResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn verify_proof<'life0, 'async_trait>(
        &'life0 self,
        proof: Proof,
    ) -> Pin<Box<dyn Future<Output = Result<VerificationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn validate_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state_data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<ValidationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Modern Layer2 protocol interface (async trait for modern implementation)

Required Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn connect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ProtocolState, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn submit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn check_transaction_status<'life0, 'life1, 'async_trait>( &'life0 self, tx_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn sync_state<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn issue_asset<'life0, 'async_trait>( &'life0 self, params: AssetParams, ) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn transfer_asset<'life0, 'async_trait>( &'life0 self, transfer: AssetTransfer, ) -> Pin<Box<dyn Future<Output = Result<TransferResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn verify_proof<'life0, 'async_trait>( &'life0 self, proof: Proof, ) -> Pin<Box<dyn Future<Output = Result<VerificationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn validate_state<'life0, 'life1, 'async_trait>( &'life0 self, state_data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<ValidationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl Layer2Protocol for BobClient

Source§

impl Layer2Protocol for DlcProtocol

Source§

impl Layer2Protocol for LightningNetwork

Source§

impl Layer2Protocol for LiquidModule

Implementation of async Layer2Protocol trait for LiquidModule

Source§

impl Layer2Protocol for LiquidProtocol

Source§

impl Layer2Protocol for MockLayer2Protocol

Source§

impl Layer2Protocol for RgbProtocol

Source§

impl Layer2Protocol for RskClient

Implementation of async Layer2Protocol trait for RskClient

Source§

impl Layer2Protocol for RskProtocol

Source§

impl Layer2Protocol for StacksClient

Implementation of async Layer2Protocol trait for StacksClient

Source§

impl Layer2Protocol for StacksProtocol

Source§

impl Layer2Protocol for StateChannel

Implementation of async Layer2Protocol trait for StateChannel

Source§

impl Layer2Protocol for StateChannelsProtocol

Source§

impl Layer2Protocol for TaprootAssetsProtocol

Implementation of async Layer2Protocol trait for TaprootAssetsProtocol