pub struct BackendWithGlobalOptions<Back: Backend> { /* private fields */ }
Implementations
sourceimpl<Back: Backend> BackendWithGlobalOptions<Back>
impl<Back: Backend> BackendWithGlobalOptions<Back>
sourcepub fn into_inner(self) -> Back
pub fn into_inner(self) -> Back
Return the wrapped Backend
sourcepub fn new(backend: Back, options: GlobalOptions) -> Self
pub fn new(backend: Back, options: GlobalOptions) -> Self
Construct
While possible, it is not recommended to wrap a Backend twice.
Trait Implementations
sourceimpl<Back: Backend> Backend for BackendWithGlobalOptions<Back>
impl<Back: Backend> Backend for BackendWithGlobalOptions<Back>
type HttpRequest = <Back as Backend>::HttpRequest
type HttpResponse = <Back as Backend>::HttpResponse
type Error = <Back as Backend>::Error
sourcefn build_base_request<Req>(
&self,
req: Req,
form: Option<Form<'static>>
) -> Result<Self::HttpRequest, Self::Error>where
Req: ApiRequest,
fn build_base_request<Req>(
&self,
req: Req,
form: Option<Form<'static>>
) -> Result<Self::HttpRequest, Self::Error>where
Req: ApiRequest,
Builds the url for an api call. Read more
sourcefn get_header(res: &Self::HttpResponse, key: HeaderName) -> Option<&HeaderValue>
fn get_header(res: &Self::HttpResponse, key: HeaderName) -> Option<&HeaderValue>
Get the value of a header from an HTTP response. Read more
sourcefn request_raw<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<(StatusCode, Bytes), Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn request_raw<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<(StatusCode, Bytes), Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Generates a request, and returns the unprocessed response future. Read more
fn response_to_byte_stream(
res: Self::HttpResponse
) -> BoxStream<Bytes, Self::Error>
sourcefn request_stream<Res, F>(
&self,
req: Self::HttpRequest,
process: F
) -> BoxStream<Res, Self::Error>where
F: 'static + Send + Fn(Self::HttpResponse) -> BoxStream<Res, Self::Error>,
fn request_stream<Res, F>(
&self,
req: Self::HttpRequest,
process: F
) -> BoxStream<Res, Self::Error>where
F: 'static + Send + Fn(Self::HttpResponse) -> BoxStream<Res, Self::Error>,
Generic method for making a request that expects back a streaming
response. Read more
sourcefn process_error_from_body(body: Bytes) -> Self::Error
fn process_error_from_body(body: Bytes) -> Self::Error
Builds an Api error from a response body. Read more
sourcefn process_json_response<Res>(
status: StatusCode,
body: Bytes
) -> Result<Res, Self::Error>where
for<'de> Res: 'static + Deserialize<'de> + Send,
fn process_json_response<Res>(
status: StatusCode,
body: Bytes
) -> Result<Res, Self::Error>where
for<'de> Res: 'static + Deserialize<'de> + Send,
Processes a response that expects a json encoded body, returning an
error or a deserialized json response. Read more
sourcefn process_stream_response<D, Res>(
res: Self::HttpResponse,
decoder: D
) -> FramedRead<StreamReader<BoxStream<Bytes, Self::Error>>, D>where
D: Decoder<Item = Res, Error = Error>,
fn process_stream_response<D, Res>(
res: Self::HttpResponse,
decoder: D
) -> FramedRead<StreamReader<BoxStream<Bytes, Self::Error>>, D>where
D: Decoder<Item = Res, Error = Error>,
Processes a response that returns a stream of json deserializable
results. Read more
sourcefn request<'life0, 'async_trait, Req, Res>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<Res, Self::Error>> + 'async_trait>>where
Req: ApiRequest,
for<'de> Res: 'static + Deserialize<'de> + Send,
Req: 'async_trait,
Res: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn request<'life0, 'async_trait, Req, Res>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<Res, Self::Error>> + 'async_trait>>where
Req: ApiRequest,
for<'de> Res: 'static + Deserialize<'de> + Send,
Req: 'async_trait,
Res: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Generic method for making a request to the Ipfs server, and getting
a deserializable response. Read more
sourcefn request_empty<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn request_empty<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Generic method for making a request to the Ipfs server, and getting
back a response with no body. Read more
sourcefn request_string<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn request_string<'life0, 'async_trait, Req>(
&'life0 self,
req: Req,
form: Option<Form<'static>>
) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + 'async_trait>>where
Req: ApiRequest,
Req: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Generic method for making a request to the Ipfs server, and getting
back a raw String response. Read more
sourcefn request_stream_bytes(
&self,
req: Self::HttpRequest
) -> BoxStream<Bytes, Self::Error>
fn request_stream_bytes(
&self,
req: Self::HttpRequest
) -> BoxStream<Bytes, Self::Error>
Generic method for making a request to the Ipfs server, and getting
back a raw stream of bytes. Read more
sourcefn request_stream_json<Res>(
&self,
req: Self::HttpRequest
) -> BoxStream<Res, Self::Error>where
for<'de> Res: 'static + Deserialize<'de> + Send,
fn request_stream_json<Res>(
&self,
req: Self::HttpRequest
) -> BoxStream<Res, Self::Error>where
for<'de> Res: 'static + Deserialize<'de> + Send,
Generic method to return a streaming response of deserialized json
objects delineated by new line separators. Read more
Auto Trait Implementations
impl<Back> RefUnwindSafe for BackendWithGlobalOptions<Back>where
Back: RefUnwindSafe,
impl<Back> Send for BackendWithGlobalOptions<Back>where
Back: Send,
impl<Back> Sync for BackendWithGlobalOptions<Back>where
Back: Sync,
impl<Back> Unpin for BackendWithGlobalOptions<Back>where
Back: Unpin,
impl<Back> UnwindSafe for BackendWithGlobalOptions<Back>where
Back: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more