pub struct HttpServer {
pub synced_height_db: Arc<RwLock<SyncedHeightDB>>,
pub block_db: Arc<RwLock<BlockDB>>,
pub tx_db: Arc<RwLock<TxDB>>,
pub addr_index_db: Arc<RwLock<AddressIndexDB>>,
pub utxo_server: Arc<RwLock<UtxoServer>>,
pub rich_list: Arc<RwLock<RichList>>,
/* private fields */
}Fields§
§synced_height_db: Arc<RwLock<SyncedHeightDB>>§block_db: Arc<RwLock<BlockDB>>§tx_db: Arc<RwLock<TxDB>>§addr_index_db: Arc<RwLock<AddressIndexDB>>§utxo_server: Arc<RwLock<UtxoServer>>§rich_list: Arc<RwLock<RichList>>Implementations§
Source§impl HttpServer
impl HttpServer
pub fn new(coin: &str, config: &Config) -> Self
pub fn not_found(msg: &str) -> Response<Body>
pub fn bad_request(msg: &str) -> Response<Body>
pub fn internal_error(msg: &str) -> Response<Body>
pub fn ok(json: String, cacheable: bool) -> Response<Body>
pub fn json<S>(object: S, cacheable: bool) -> Response<Body>where
S: Serialize,
pub async fn run(&self, ip: &str, port: u16)
Trait Implementations§
Source§impl Clone for HttpServer
impl Clone for HttpServer
Source§fn clone(&self) -> HttpServer
fn clone(&self) -> HttpServer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpServer
impl !RefUnwindSafe for HttpServer
impl Send for HttpServer
impl Sync for HttpServer
impl Unpin for HttpServer
impl !UnwindSafe for HttpServer
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