pub struct Api { /* private fields */ }Expand description
Wrapper struct for API, implements all API methods. Generally not useful for clients.
Implementations§
Source§impl Api
impl Api
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Determines if the current session is authenticated
Sourcepub fn url(&self, endpoint: &str) -> Result<Url, ApiError>
pub fn url(&self, endpoint: &str) -> Result<Url, ApiError>
Assembles an API url from the base url and an endpoint.
Sourcepub fn request(
&self,
endpoint: &str,
method: Method,
) -> Result<RequestBuilder, ApiError>
pub fn request( &self, endpoint: &str, method: Method, ) -> Result<RequestBuilder, ApiError>
Assembles a request builder with default settings
Sourcepub async fn extract_response<T: DeserializeOwned + Debug>(
&self,
response: Response,
) -> Result<T, ApiError>
pub async fn extract_response<T: DeserializeOwned + Debug>( &self, response: Response, ) -> Result<T, ApiError>
Extracts a reponse with serde
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Api
impl RefUnwindSafe for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl UnwindSafe for Api
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