agdb_api

Trait 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>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§