pub struct LinoClient { /* private fields */ }Expand description
A client for a service that speaks Links Notation.
Implementations§
Source§impl LinoClient
impl LinoClient
Sourcepub fn with_accept<S: Into<String>>(self, accept: S) -> Self
pub fn with_accept<S: Into<String>>(self, accept: S) -> Self
The same client asking for another representation.
Sourcepub fn with_content_type<S: Into<String>>(self, content_type: S) -> Self
pub fn with_content_type<S: Into<String>>(self, content_type: S) -> Self
The same client sending request bodies as another representation.
Sourcepub fn with_header<N: Into<String>, V: Into<String>>(
self,
name: N,
value: V,
) -> Self
pub fn with_header<N: Into<String>, V: Into<String>>( self, name: N, value: V, ) -> Self
The same client sending one more header with every request.
Sourcepub fn with_http_client(self, http: Client) -> Self
pub fn with_http_client(self, http: Client) -> Self
The same client built on a configured reqwest client.
Sourcepub async fn request(
&self,
method: &str,
path: &str,
body: Option<&LinoValue>,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn request( &self, method: &str, path: &str, body: Option<&LinoValue>, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
Perform a request and decode the response.
§Errors
A LinoClientError::Status for any 4xx or 5xx, carrying the
decoded problem details, and a LinoClientError::Transport when the
request never reached the service.
Sourcepub async fn get(
&self,
path: &str,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn get( &self, path: &str, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
GET a resource.
Sourcepub async fn post(
&self,
path: &str,
body: &LinoValue,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn post( &self, path: &str, body: &LinoValue, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
POST to a collection.
Sourcepub async fn put(
&self,
path: &str,
body: &LinoValue,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn put( &self, path: &str, body: &LinoValue, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
PUT a representation.
Sourcepub async fn patch(
&self,
path: &str,
body: &LinoValue,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn patch( &self, path: &str, body: &LinoValue, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
PATCH a representation.
Sourcepub async fn delete(
&self,
path: &str,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn delete( &self, path: &str, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
DELETE a resource.
Sourcepub async fn head(
&self,
path: &str,
options: &RequestOptions,
) -> Result<LinoResponse, LinoClientError>
pub async fn head( &self, path: &str, options: &RequestOptions, ) -> Result<LinoResponse, LinoClientError>
HEAD a resource.
Sourcepub async fn options(
&self,
path: &str,
options: &RequestOptions,
) -> Result<Vec<String>, LinoClientError>
pub async fn options( &self, path: &str, options: &RequestOptions, ) -> Result<Vec<String>, LinoClientError>
OPTIONS a path, returning the advertised methods.
Sourcepub async fn list(
&self,
path: &str,
options: &RequestOptions,
) -> Result<LinoValue, LinoClientError>
pub async fn list( &self, path: &str, options: &RequestOptions, ) -> Result<LinoValue, LinoClientError>
List a collection, returning the decoded envelope.
Sourcepub async fn describe(&self) -> Result<LinoValue, LinoClientError>
pub async fn describe(&self) -> Result<LinoValue, LinoClientError>
Fetch the service description of specification section 9.
Trait Implementations§
Source§impl Clone for LinoClient
impl Clone for LinoClient
Auto Trait Implementations§
impl !RefUnwindSafe for LinoClient
impl !UnwindSafe for LinoClient
impl Freeze for LinoClient
impl Send for LinoClient
impl Sync for LinoClient
impl Unpin for LinoClient
impl UnsafeUnpin for LinoClient
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