pub struct Api { /* private fields */ }Expand description
A client for one server.
Implementations§
Source§impl Api
impl Api
Sourcepub async fn get<T: DeserializeOwned>(
&self,
path: &str,
timeout: Duration,
) -> Result<T, ApiError>
pub async fn get<T: DeserializeOwned>( &self, path: &str, timeout: Duration, ) -> Result<T, ApiError>
Gets path unsigned, for the discovery document.
Sourcepub async fn post<B: Serialize, T: DeserializeOwned>(
&self,
path: &str,
body: &B,
timeout: Duration,
) -> Result<T, ApiError>
pub async fn post<B: Serialize, T: DeserializeOwned>( &self, path: &str, body: &B, timeout: Duration, ) -> Result<T, ApiError>
Posts body unsigned, for enrolling.
Sourcepub async fn post_signed<B: Serialize, T: DeserializeOwned>(
&self,
path: &str,
body: &B,
key: &SigningKey,
keyid: &str,
timeout: Duration,
) -> Result<T, ApiError>
pub async fn post_signed<B: Serialize, T: DeserializeOwned>( &self, path: &str, body: &B, key: &SigningKey, keyid: &str, timeout: Duration, ) -> Result<T, ApiError>
Posts body signed with key as device keyid.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Api
impl !UnwindSafe for Api
impl Freeze for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl UnsafeUnpin for Api
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