generated from PlexSheep/rs-base
21 lines
351 B
Rust
21 lines
351 B
Rust
|
use std::sync::Arc;
|
||
|
|
||
|
pub type VaultRef = Arc<Vault>;
|
||
|
|
||
|
#[derive(Debug, Clone, PartialEq)]
|
||
|
pub struct Vault {
|
||
|
secret: String,
|
||
|
}
|
||
|
|
||
|
impl Vault {
|
||
|
pub fn new(secret: &str) -> VaultRef {
|
||
|
let v = Self {
|
||
|
secret: secret.to_string(),
|
||
|
};
|
||
|
Arc::new(v)
|
||
|
}
|
||
|
pub fn secret(&self) -> &str {
|
||
|
&self.secret
|
||
|
}
|
||
|
}
|