pub trait Client: Clone {
    type Error: Debug;

    // Required method
    fn request_with_body_and_query<B, Q, R>(
        &self,
        method: Method,
        path: &str,
        body: Option<&B>,
        query: Option<&Q>
    ) -> Result<R, Self::Error>
       where B: Serialize,
             Q: Serialize,
             R: DeserializeOwned;

    // Provided methods
    fn request_with_body<B, R>(
        &self,
        method: Method,
        path: &str,
        body: &B
    ) -> Result<R, Self::Error>
       where B: Serialize,
             R: DeserializeOwned { ... }
    fn request_with_query<Q, R>(
        &self,
        method: Method,
        path: &str,
        query: &Q
    ) -> Result<R, Self::Error>
       where Q: Serialize,
             R: DeserializeOwned { ... }
    fn put<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>
       where B: Serialize,
             R: DeserializeOwned { ... }
    fn post<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>
       where B: Serialize,
             R: DeserializeOwned { ... }
    fn delete<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>
       where B: Serialize,
             R: DeserializeOwned { ... }
    fn get<Q, R>(&self, path: &str, query: &Q) -> Result<R, Self::Error>
       where Q: Serialize,
             R: DeserializeOwned { ... }
}

Required Associated Types§

Required Methods§

source

fn request_with_body_and_query<B, Q, R>( &self, method: Method, path: &str, body: Option<&B>, query: Option<&Q> ) -> Result<R, Self::Error>

Transmit an authenticated request to a Proxmox VE API endpoint using the provided method, path, body, and query.

Provided Methods§

source

fn request_with_body<B, R>( &self, method: Method, path: &str, body: &B ) -> Result<R, Self::Error>

source

fn request_with_query<Q, R>( &self, method: Method, path: &str, query: &Q ) -> Result<R, Self::Error>

source

fn put<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>

source

fn post<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>

source

fn delete<B, R>(&self, path: &str, body: &B) -> Result<R, Self::Error>

source

fn get<Q, R>(&self, path: &str, query: &Q) -> Result<R, Self::Error>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Client for &T
where T: Client,

§

type Error = <T as Client>::Error

source§

fn request_with_body_and_query<B, Q, R>( &self, method: Method, path: &str, body: Option<&B>, query: Option<&Q> ) -> Result<R, Self::Error>

Implementors§