pub struct RequestManager {}
Implementations§
Source§impl RequestManager
impl RequestManager
pub const JSON_CONTENT_TYPE: &str = "application/json"
pub const MULTIPART_CONTENT_TYPE: &str = "multipart/form-data"
pub async fn post<TRequest, TResponse, TError>(
request_name: impl Into<String> + Display,
url: impl IntoUrl + Debug,
request: &TRequest,
content_type: impl Into<String> + Display,
context: &Arc<RwLock<BotXApiContext>>,
) -> BotXApiResult<TResponse, TError>where
TRequest: Serialize,
for<'a> TResponse: Deserialize<'a> + Debug,
for<'a> TError: Deserialize<'a> + Debug,
pub async fn put<TRequest, TResponse, TError>(
request_name: impl Into<String> + Display,
url: impl IntoUrl + Debug,
request: &TRequest,
content_type: impl Into<String> + Display,
context: &Arc<RwLock<BotXApiContext>>,
) -> BotXApiResult<TResponse, TError>where
TRequest: Serialize,
for<'a> TResponse: Deserialize<'a> + Debug,
for<'a> TError: Deserialize<'a> + Debug,
pub async fn get<TResponse, TError>( request_name: impl Into<String> + Display, url: impl IntoUrl + Debug, content_type: impl Into<String> + Display, context: &Arc<RwLock<BotXApiContext>>, ) -> BotXApiResult<TResponse, TError>
pub async fn get_file<TError>(
request_name: impl Into<String> + Display,
url: impl IntoUrl + Debug,
content_type: impl Into<String> + Display,
context: &Arc<RwLock<BotXApiContext>>,
) -> BotXApiResult<FileResponse, TError>where
for<'a> TError: Deserialize<'a> + Debug,
pub async fn get_csv<TResponse, TError>( request_name: impl Into<String> + Display, url: impl IntoUrl + Debug, content_type: impl Into<String> + Display, context: &Arc<RwLock<BotXApiContext>>, ) -> BotXApiResult<Vec<TResponse>, TError>
pub async fn delete<TResponse, TError>( request_name: impl Into<String> + Display, url: impl IntoUrl + Debug, content_type: impl Into<String> + Display, context: &Arc<RwLock<BotXApiContext>>, ) -> BotXApiResult<TResponse, TError>
pub async fn post_multipart<TResponse, TError>( request_name: impl Into<String> + Display, url: impl IntoUrl + Debug, data: Vec<MultipartPartData>, context: &Arc<RwLock<BotXApiContext>>, ) -> BotXApiResult<TResponse, TError>
Auto Trait Implementations§
impl Freeze for RequestManager
impl RefUnwindSafe for RequestManager
impl Send for RequestManager
impl Sync for RequestManager
impl Unpin for RequestManager
impl UnwindSafe for RequestManager
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