pub struct ApiClient<T: Transport> { /* private fields */ }Implementations§
Source§impl<T: Transport> ApiClient<T>
impl<T: Transport> ApiClient<T>
pub fn new(transport: T) -> Self
pub fn transport(&self) -> &T
pub fn get_json( &self, path: &str, query: Vec<(String, String)>, ) -> Result<Value, AppError>
pub fn get_json_absolute(&self, url: String) -> Result<Value, AppError>
pub fn get_raw( &self, path: &str, query: Vec<(String, String)>, ) -> Result<ResponseData, AppError>
pub fn post_json(&self, path: &str, body: Value) -> Result<Value, AppError>
pub fn post_json_raw( &self, path: &str, body: Value, ) -> Result<ResponseData, AppError>
pub fn post_multipart( &self, path: &str, fields: Vec<(String, String)>, file: MultipartFile, ) -> Result<Value, AppError>
pub fn patch_json(&self, path: &str, body: Value) -> Result<Value, AppError>
pub fn put_json(&self, path: &str, body: Value) -> Result<Value, AppError>
pub fn delete(&self, path: &str) -> Result<(), AppError>
pub fn paginate( &self, path: &str, query: Vec<(String, String)>, ) -> Result<Vec<Value>, AppError>
pub fn ping(&self, base_url: &str) -> Result<Value, AppError>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ApiClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for ApiClient<T>where
T: RefUnwindSafe,
impl<T> Send for ApiClient<T>where
T: Send,
impl<T> Sync for ApiClient<T>where
T: Sync,
impl<T> Unpin for ApiClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for ApiClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ApiClient<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more