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

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

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.