[−][src]Struct transistor::http::HttpClient
HttpClient
has the reqwest::blocking::Client
, the uri
to query and the HeaderMap
with
all the possible headers. Default header is Content-Type: "application/edn"
. Synchronous request.
Implementations
impl HttpClient
[src]
pub fn state(&self) -> Result<StateResponse, CruxError>
[src]
Function state
queries endpoint /
with a GET
. Returned information consists of
various details about the state of the database and it can be used as a health check.
pub fn tx_log(&self, actions: Vec<Action>) -> Result<TxLogResponse, CruxError>
[src]
Function tx_log
requests endpoint /tx-log
via POST
which allow you to send actions Action
to CruxDB.
The "write" endpoint, to post transactions.
pub fn tx_logs(&self) -> Result<TxLogsResponse, CruxError>
[src]
Function tx_logs
requests endpoint /tx-log
via GET
and returns a list of all transactions
pub fn entity(&self, id: String) -> Result<Edn, CruxError>
[src]
Function entity
requests endpoint /entity
via POST
which retrieves the last document
in CruxDB.
Field with CruxId
is required.
Response is a reqwest::Result<edn_rs::Edn>
with the last Entity with that ID.
pub fn entity_tx(&self, id: String) -> Result<EntityTxResponse, CruxError>
[src]
Function entity_tx
requests endpoint /entity-tx
via POST
which retrieves the docs and tx infos
for the last document for that ID saved in CruxDB.
pub fn entity_history(
&self,
hash: String,
order: Order,
with_docs: bool
) -> Result<EntityHistoryResponse, CruxError>
[src]
&self,
hash: String,
order: Order,
with_docs: bool
) -> Result<EntityHistoryResponse, CruxError>
pub fn query(&self, query: Query) -> Result<BTreeSet<Vec<String>>, CruxError>
[src]
Function query
requests endpoint /query
via POST
which retrives a Set containing a vector of the values defined by the function Query::find
- github example.
Argument is a query
of the type Query
.
Auto Trait Implementations
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl !UnwindSafe for HttpClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,