pub struct ReqwestClient { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(host: &str, user: &str, realm: &str, client: Option<Client>) -> Self
pub fn with_api_token(self, token_id: &str, token: &str) -> Self
pub async fn with_login(self, password: &str) -> Result<Self, Error>
pub async fn with_ticket(self, ticket: &str, csrf: &str) -> Result<Self, Error>
Trait Implementations§
Source§impl Client for Client
impl Client for Client
type Error = Error
Source§async fn request_with_body_and_query<B, Q, R>(
&self,
method: Method,
path: &str,
body: Option<&B>,
query: Option<&Q>,
) -> Result<R, Error>
async fn request_with_body_and_query<B, Q, R>( &self, method: Method, path: &str, body: Option<&B>, query: Option<&Q>, ) -> Result<R, Error>
Transmit an authenticated request to a Proxmox VE API endpoint
using the provided method, path, body, and query.
fn request_with_body<B, R>(
&self,
method: Method,
path: &str,
body: &B,
) -> impl Future<Output = Result<R, Self::Error>>where
B: Serialize,
R: DeserializeOwned,
fn request_with_query<Q, R>(
&self,
method: Method,
path: &str,
query: &Q,
) -> impl Future<Output = Result<R, Self::Error>>where
Q: Serialize,
R: DeserializeOwned,
fn put<B, R>(
&self,
path: &str,
body: &B,
) -> impl Future<Output = Result<R, Self::Error>>where
B: Serialize,
R: DeserializeOwned,
fn post<B, R>(
&self,
path: &str,
body: &B,
) -> impl Future<Output = Result<R, Self::Error>>where
B: Serialize,
R: DeserializeOwned,
fn delete<B, R>(
&self,
path: &str,
query: &B,
) -> impl Future<Output = Result<R, Self::Error>>where
B: Serialize,
R: DeserializeOwned,
fn get<Q, R>(
&self,
path: &str,
query: &Q,
) -> impl Future<Output = Result<R, Self::Error>>where
Q: Serialize,
R: DeserializeOwned,
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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