pub struct Secrets { /* private fields */ }
Expand description
Handle for Podman Secrets.
Implementations§
Source§impl Secrets
impl Secrets
Sourcepub async fn list(&self) -> Result<Vec<SecretInfoReport>>
pub async fn list(&self) -> Result<Vec<SecretInfoReport>>
List available secrets.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.secrets().list().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn create(
&self,
opts: &SecretCreateOpts,
secret: impl Into<String>,
) -> Result<Secret>
pub async fn create( &self, opts: &SecretCreateOpts, secret: impl Into<String>, ) -> Result<Secret>
Create a new secret.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::SecretCreateOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.secrets().create(
&SecretCreateOpts::builder("my-secret").build(),
"secret-value"
).await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Secrets
impl !RefUnwindSafe for Secrets
impl Send for Secrets
impl Sync for Secrets
impl Unpin for Secrets
impl !UnwindSafe for Secrets
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