pub trait Vault {
// Required methods
fn new(
public: Option<PublicKey>,
private: Option<PrivateKey>,
) -> Result<Self>
where Self: Sized;
fn create(
&self,
password: SecretSlice<u8>,
data: &mut [u8],
) -> Result<String>;
fn view(
&self,
password: &[u8],
data: &[u8],
fingerprint: &str,
) -> Result<String>;
}Expand description
Trait defining the vault operations for different key types
Required Methods§
Sourcefn new(public: Option<PublicKey>, private: Option<PrivateKey>) -> Result<Self>where
Self: Sized,
fn new(public: Option<PublicKey>, private: Option<PrivateKey>) -> Result<Self>where
Self: Sized,
Creates a new vault instance with the given keys
§Errors
Returns an error if the provided keys are invalid or mismatched.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".