From 306f307222358047ace385bb4126d9571858497f Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Tue, 23 Feb 2021 23:24:47 -0500 Subject: add some documentation --- ipfs-api-prelude/src/backend.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ipfs-api-prelude/src/backend.rs b/ipfs-api-prelude/src/backend.rs index 433cf4a..f2505ca 100644 --- a/ipfs-api-prelude/src/backend.rs +++ b/ipfs-api-prelude/src/backend.rs @@ -37,6 +37,8 @@ pub trait Backend: Default { /// type Error: Display + From + From + 'static; + /// Builds the url for an api call. + /// fn build_base_request( &self, req: &Req, @@ -45,8 +47,12 @@ pub trait Backend: Default { where Req: ApiRequest; + /// Get the value of a header from an HTTP response. + /// fn get_header<'a>(res: &'a Self::HttpResponse, key: HeaderName) -> Option<&'a HeaderValue>; + /// Generates a request, and returns the unprocessed response future. + /// async fn request_raw( &self, req: Req, @@ -59,6 +65,9 @@ pub trait Backend: Default { res: Self::HttpResponse, ) -> Box> + Unpin>; + /// Generic method for making a request that expects back a streaming + /// response. + /// fn request_stream( &self, req: Self::HttpRequest, -- cgit v1.2.3