pub struct Client { /* private fields */ }
Expand description
NATS client that can be used to interact with secrets
Implementations§
source§impl Client
impl Client
sourcepub async fn new(
backend: &str,
prefix: &str,
nats_client: Client,
) -> Result<Self, SecretClientError>
pub async fn new( backend: &str, prefix: &str, nats_client: Client, ) -> Result<Self, SecretClientError>
Create a new Client
, negotiating a server Xkey along the way
sourcepub async fn new_with_version(
backend: &str,
prefix: &str,
nats_client: Client,
api_version: Option<&str>,
) -> Result<Self, SecretClientError>
pub async fn new_with_version( backend: &str, prefix: &str, nats_client: Client, api_version: Option<&str>, ) -> Result<Self, SecretClientError>
Create a new Client
with a specific API version
sourcepub async fn get(
&self,
secret_request: SecretRequest,
request_xkey: XKey,
) -> Result<Secret, SecretClientError>
pub async fn get( &self, secret_request: SecretRequest, request_xkey: XKey, ) -> Result<Secret, SecretClientError>
Retrieve a given secret
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 !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