pub struct Client { /* private fields */ }Expand description
The Client is used for all interaction with Control Tower or Edge Enforcer instances.
Use one of the login functions to create an instance.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Create a Client builder.
Sourcepub async fn token_is_expired(&self) -> bool
pub async fn token_is_expired(&self) -> bool
Returns true if the token has expired.
pub async fn token_expires(&self) -> DateTime<Utc>
pub async fn x509_svid(&self) -> Option<X509SVID>
Sourcepub async fn bearer_token(&self) -> String
pub async fn bearer_token(&self) -> String
Returns the login bearer token.
Sourcepub async fn get_json<T: DeserializeOwned>(
&self,
path: &str,
query_params: Option<&[(&str, &str)]>,
) -> Result<T>
pub async fn get_json<T: DeserializeOwned>( &self, path: &str, query_params: Option<&[(&str, &str)]>, ) -> Result<T>
GET a json payload from the REST API.
Sourcepub async fn get_bytes(
&self,
path: &str,
query_params: Option<&[(&str, &str)]>,
) -> Result<Bytes>
pub async fn get_bytes( &self, path: &str, query_params: Option<&[(&str, &str)]>, ) -> Result<Bytes>
GET a bytes payload from the REST API.
Sourcepub async fn put<T: Into<Body> + Debug>(
&self,
path: &str,
content_type: &str,
data: T,
) -> Result<()>
pub async fn put<T: Into<Body> + Debug>( &self, path: &str, content_type: &str, data: T, ) -> Result<()>
PUT arbitrary data to a path.
Sourcepub async fn volga_open_producer(
&self,
producer_name: &str,
topic: &str,
on_no_exists: OnNoExists,
) -> Result<Producer>
pub async fn volga_open_producer( &self, producer_name: &str, topic: &str, on_no_exists: OnNoExists, ) -> Result<Producer>
Sourcepub async fn volga_open_child_site_producer(
&self,
producer_name: &str,
topic: &str,
site: &str,
on_no_exists: OnNoExists,
) -> Result<Producer>
pub async fn volga_open_child_site_producer( &self, producer_name: &str, topic: &str, site: &str, on_no_exists: OnNoExists, ) -> Result<Producer>
Sourcepub async fn volga_open_parent_site_producer(
&self,
producer_name: &str,
topic: &str,
on_no_exists: OnNoExists,
) -> Result<Producer>
pub async fn volga_open_parent_site_producer( &self, producer_name: &str, topic: &str, on_no_exists: OnNoExists, ) -> Result<Producer>
Sourcepub async fn volga_open_consumer(
&self,
consumer_name: &str,
topic: &str,
options: Options<'_>,
) -> Result<Consumer>
pub async fn volga_open_consumer( &self, consumer_name: &str, topic: &str, options: Options<'_>, ) -> Result<Consumer>
Sourcepub async fn volga_open_child_site_consumer(
&self,
consumer_name: &str,
topic: &str,
site: &str,
options: Options<'_>,
) -> Result<Consumer>
pub async fn volga_open_child_site_consumer( &self, consumer_name: &str, topic: &str, site: &str, options: Options<'_>, ) -> Result<Consumer>
Sourcepub async fn volga_open_parent_site_consumer(
&self,
consumer_name: &str,
topic: &str,
options: Options<'_>,
) -> Result<Consumer>
pub async fn volga_open_parent_site_consumer( &self, consumer_name: &str, topic: &str, options: Options<'_>, ) -> Result<Consumer>
Sourcepub async fn volga_query_topic(&self, query: Query) -> Result<QueryStream>
pub async fn volga_query_topic(&self, query: Query) -> Result<QueryStream>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe 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