Builder

Trait Builder 

Source
pub trait Builder: Send + Sync {
    // Required methods
    fn bid<'life0, 'async_trait>(
        &'life0 self,
        chain_id: String,
        height: u64,
        kind: Kind,
        txs: Vec<Vec<u8>>,
    ) -> Pin<Box<dyn Future<Output = Result<BidResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn auction<'life0, 'async_trait>(
        &'life0 self,
        chain_id: String,
        height: u64,
    ) -> Pin<Box<dyn Future<Output = Result<AuctionResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The Builder trait encapsulates the capabilities of the Zenith builder API.

// import the `zenith-rs` crate, usually this is done
// with `use zenith_rs::*`
use zenith_rs::{Builder, Http as BuilderHttp};
use tokio::sync::{mpsc, watch, Mutex};

let builder = BuilderHttp::new(meka_api)?;
let height = 1325235;
let r = builder.auction("osmosis-1".to_string(), height).await;
match r {
  Err(e) => println!("no auction for {:?}: {:?}", height, e),
  Ok(a) => println!("found an auction for {:?}", a),
}

Required Methods§

Source

fn bid<'life0, 'async_trait>( &'life0 self, chain_id: String, height: u64, kind: Kind, txs: Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = Result<BidResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn auction<'life0, 'async_trait>( &'life0 self, chain_id: String, height: u64, ) -> Pin<Box<dyn Future<Output = Result<AuctionResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§