Trait agdb_api::HttpClient

source ·
pub trait HttpClient {
    // Required methods
    async fn delete(
        &self,
        uri: &str,
        token: &Option<String>,
    ) -> AgdbApiResult<u16>;
    async fn get<T: DeserializeOwned + Send>(
        &self,
        uri: &str,
        token: &Option<String>,
    ) -> AgdbApiResult<(u16, T)>;
    async fn post<T: Serialize, R: DeserializeOwned + Send>(
        &self,
        uri: &str,
        json: &Option<T>,
        token: &Option<String>,
    ) -> AgdbApiResult<(u16, R)>;
    async fn put<T: Serialize>(
        &self,
        uri: &str,
        json: &Option<T>,
        token: &Option<String>,
    ) -> AgdbApiResult<u16>;
}

Required Methods§

source

async fn delete(&self, uri: &str, token: &Option<String>) -> AgdbApiResult<u16>

source

async fn get<T: DeserializeOwned + Send>( &self, uri: &str, token: &Option<String>, ) -> AgdbApiResult<(u16, T)>

source

async fn post<T: Serialize, R: DeserializeOwned + Send>( &self, uri: &str, json: &Option<T>, token: &Option<String>, ) -> AgdbApiResult<(u16, R)>

source

async fn put<T: Serialize>( &self, uri: &str, json: &Option<T>, token: &Option<String>, ) -> AgdbApiResult<u16>

Object Safety§

This trait is not object safe.

Implementors§