pub struct Api { /* private fields */ }Expand description
A logged-in client for /admin/*.
Implementations§
Source§impl Api
impl Api
pub fn new(cfg: AdminConfig) -> Self
pub fn config(&self) -> &AdminConfig
pub async fn whoami(&self) -> Result<Value>
pub async fn list_teams(&self) -> Result<Value>
pub async fn create_team(&self, slug: &str, name: Option<&str>) -> Result<Value>
pub async fn list_agents(&self, team: &str) -> Result<Value>
pub async fn create_agent( &self, team: &str, name: &str, display_name: Option<&str>, ) -> Result<Value>
pub async fn list_tokens(&self, team: &str) -> Result<Value>
pub async fn issue_token( &self, team: &str, agent: &str, label: Option<&str>, ) -> Result<Issued>
pub async fn revoke_token(&self, team: &str, id: Uuid) -> Result<Value>
pub async fn list_credentials(&self) -> Result<Value>
pub async fn grant_credential( &self, team: Option<&str>, label: Option<&str>, ) -> Result<Value>
pub async fn revoke_credential(&self, id: Uuid) -> Result<Value>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more