pub struct ItchClient { /* private fields */ }Expand description
A client able to send requests to the itch.io API
Implementations§
Source§impl ItchClient
This block defines the ItchClient constructors and other functions
impl ItchClient
This block defines the ItchClient constructors and other functions
Sourcepub fn get_api_key(&self) -> &str
pub fn get_api_key(&self) -> &str
Obtain the API key associated with this ItchClient
Sourcepub fn new(api_key: String) -> Self
pub fn new(api_key: String) -> Self
Create a new client using the provided itch.io API key, without verifying its validity
§Arguments
api_key- A valid itch.io API key to store in the client
§Returns
An ItchClient struct with the given key
Sourcepub async fn auth(
api_key: String,
) -> Result<Self, ItchRequestJSONError<ApiResponseCommonErrors>>
pub async fn auth( api_key: String, ) -> Result<Self, ItchRequestJSONError<ApiResponseCommonErrors>>
Create a new client using the provided itch.io API key and verify its validity
§Arguments
api_key- A valid itch.io API key to store in the client
§Returns
An ItchClient struct with the given key
§Errors
If the request, retrieving its text, or parsing fails, or if the server returned an error
Trait Implementations§
Source§impl Clone for ItchClient
impl Clone for ItchClient
Source§fn clone(&self) -> ItchClient
fn clone(&self) -> ItchClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ItchClient
impl !RefUnwindSafe for ItchClient
impl Send for ItchClient
impl Sync for ItchClient
impl Unpin for ItchClient
impl !UnwindSafe for ItchClient
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