[][src]Struct imagevault::Client

pub struct Client<T: Authentication> { /* fields omitted */ }

Client

A client that is used to consume the ImageVault API.

Remarks

The client saves and mutates the authentication, so it is recommended to re-use the client as much as possible in order to minimize the need to re-authenticate.

Methods

impl<T: Authentication> Client<T>[src]

pub async fn assets_info<'_>(&'_ mut self) -> Result<InfoResult, Box<dyn Error>>[src]

impl<T: Authentication> Client<T>[src]

pub async fn info_version<'_>(
    &'_ mut self
) -> Result<VersionResult, Box<dyn Error>>
[src]

impl<T: Authentication> Client<T>[src]

pub fn new(
    client_identity: &str,
    client_secret: &str,
    base_url: &str
) -> Result<Self, Box<dyn Error>>
[src]

Creates a new Client

Arguments

  • client_identity - The client identity
  • client_secret - The client secret
  • base_url - The base URL to ImageVault, e.g. https://myimagevault.se

pub fn with_authentication(self, authentication: T) -> Self[src]

Adds authentication to the Client

Arguments

  • authentication - The Authentication to use

Remarks

Pretty much everything in the ImageVault API requires authentication, so this should be included most of the time.

Examples

use imagevault::{Client, authentication::ClientCredentialsAuthentication};

let authentication = ClientCredentialsAuthentication::new();

let client = Client::new(
    "identity",
    "secret",
    "https://myimagevault.local")
    .unwrap()
    .with_authentication(authentication);

Auto Trait Implementations

impl<T> !RefUnwindSafe for Client<T>

impl<T> Send for Client<T> where
    T: Send

impl<T> Sync for Client<T> where
    T: Send

impl<T> Unpin for Client<T>

impl<T> !UnwindSafe for Client<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,