Struct txtai::api::API[][src]

pub struct API { /* fields omitted */ }

Base API definition

Implementations

impl API[src]

Base API implementation

pub fn new(url: &str) -> API[src]

Creates an API instance.

Arguments

  • url - base url of txtai API

pub async fn get(&self, method: &str, params: &[(&str, &str)]) -> APIResponse[src]

Executes a GET request. Returns Response.

Arguments

  • method - API method
  • params - List of (name, value) tuples to use as query parameters

pub async fn post(&self, method: &str, json: &Value) -> APIResponse[src]

Executes a POST request. Returns Response.

Arguments

  • method - API method
  • json - Value object with post body

Auto Trait Implementations

impl RefUnwindSafe for API

impl Send for API

impl Sync for API

impl Unpin for API

impl UnwindSafe for API

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,