pub struct Database { /* private fields */ }
Expand description
A handle to the underlying secrets database.
Any calls to this object’s methods (load, store..) will result in a similar call on the
injected Backend
implementation, no caching is being done. Every call will also invoke
encryption/decryption logic, which should be considered slow.
Implementations
sourceimpl Database
impl Database
sourcepub fn new(backend: Box<dyn Backend>, encrypter: Box<dyn Encrypter>) -> Self
pub fn new(backend: Box<dyn Backend>, encrypter: Box<dyn Encrypter>) -> Self
Instantiate a new Database
with injected Backend
/Encrypter
.
sourcepub fn from_file(path: PathBuf, password: String) -> Result<Self>
pub fn from_file(path: PathBuf, password: String) -> Result<Self>
Instantiate a new Database
from a file.
This function will try to guess which database type is needed, and create the appropriate
backend based on that. This is used in the binary, which supports only the Backend
s and
Encrypter
s shipped with hips.
sourceimpl Database
impl Database
sourcepub fn template(&self, template: String) -> Result<String>
pub fn template(&self, template: String) -> Result<String>
Process the database through a template.
This call will read the provided template
and replace all references to secrets with the
secrets stored in the database. We use the tinytemplate engine, see their syntax
page for more context.
Auto Trait Implementations
impl !RefUnwindSafe for Database
impl !Send for Database
impl !Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more