pub struct HttpTransportBoxed { /* private fields */ }Implementations§
Source§impl HttpTransportBoxed
impl HttpTransportBoxed
pub fn new(inner: HttpTransport) -> Self
Trait Implementations§
Source§impl DynHttpTransport for HttpTransportBoxed
impl DynHttpTransport for HttpTransportBoxed
fn get_json<'a>( &'a self, url: &'a str, headers: Option<HashMap<String, String>>, ) -> BoxFuture<'a, Result<Value, AiLibError>>
fn post_json<'a>( &'a self, url: &'a str, headers: Option<HashMap<String, String>>, body: Value, ) -> BoxFuture<'a, Result<Value, AiLibError>>
fn post_stream<'a>( &'a self, _url: &'a str, _headers: Option<HashMap<String, String>>, _body: Value, ) -> BoxFuture<'a, Result<Pin<Box<dyn Stream<Item = Result<Bytes, AiLibError>> + Send>>, AiLibError>>
Source§fn upload_multipart<'a>(
&'a self,
url: &'a str,
headers: Option<HashMap<String, String>>,
field_name: &'a str,
file_name: &'a str,
bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Value, AiLibError>> + Send + 'a>>
fn upload_multipart<'a>( &'a self, url: &'a str, headers: Option<HashMap<String, String>>, field_name: &'a str, file_name: &'a str, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Value, AiLibError>> + Send + 'a>>
Upload a single file via multipart/form-data. Implementations should post a multipart
form with a single file field and return the parsed JSON body as serde_json::Value.
Auto Trait Implementations§
impl !RefUnwindSafe for HttpTransportBoxed
impl !UnwindSafe for HttpTransportBoxed
impl Freeze for HttpTransportBoxed
impl Send for HttpTransportBoxed
impl Sync for HttpTransportBoxed
impl Unpin for HttpTransportBoxed
impl UnsafeUnpin for HttpTransportBoxed
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