pub struct Tomb<'a> {
pub settings: TombSettings,
/* private fields */
}
Expand description
Tomb helper for given store.
Fields§
§settings: TombSettings
Tomb settings.
Implementations§
Source§impl<'a> Tomb<'a>
impl<'a> Tomb<'a>
Sourcepub fn new(
store: &'a Store,
quiet: bool,
verbose: bool,
force: bool,
) -> Tomb<'a>
pub fn new( store: &'a Store, quiet: bool, verbose: bool, force: bool, ) -> Tomb<'a>
Construct new Tomb helper for given store.
Sourcepub fn find_tomb_path(&self) -> Result<PathBuf>
pub fn find_tomb_path(&self) -> Result<PathBuf>
Find the tomb path.
Errors if it cannot be found.
Sourcepub fn find_tomb_key_path(&self) -> Result<PathBuf>
pub fn find_tomb_key_path(&self) -> Result<PathBuf>
Find the tomb key path.
Errors if it cannot be found.
Sourcepub fn open(&self) -> Result<Vec<Err>>
pub fn open(&self) -> Result<Vec<Err>>
Open the tomb.
This will keep the tomb open until it is manually closed. See start_timer()
.
On success this may return a list with soft-fail errors.
Sourcepub fn resize(&self, mbs: u32) -> Result<()>
pub fn resize(&self, mbs: u32) -> Result<()>
Resize the tomb.
The Tomb must not be mounted and the size must be larger than the current.
Sourcepub fn prepare(&self) -> Result<()>
pub fn prepare(&self) -> Result<()>
Prepare a Tomb store for usage.
- If this store is a Tomb, the tomb is opened.
Sourcepub fn start_timer(&self, sec: u32, force: bool) -> Result<()>
pub fn start_timer(&self, sec: u32, force: bool) -> Result<()>
Set up a timer to automatically close password store tomb.
TODO: add support for non-systemd systems
Sourcepub fn stop_timer(&self) -> Result<()>
pub fn stop_timer(&self) -> Result<()>
Stop automatic close timer if any is running.
Sourcepub fn init(&self, key: &Key, mbs: u32) -> Result<()>
pub fn init(&self, key: &Key, mbs: u32) -> Result<()>
Initialize tomb.
mbs
is the size in megabytes.
The given GPG key is used to encrypt the Tomb key with.
§Panics
Panics if given key is not a GPG key.
Sourcepub fn is_tomb(&self) -> bool
pub fn is_tomb(&self) -> bool
Check whether the password store is a tomb.
This guesses based on existence of some files. If this returns false you may assume this password store doesn’t use a tomb.
Sourcepub fn is_open(&self) -> Result<bool>
pub fn is_open(&self) -> Result<bool>
Check whether the password store is currently opened.
This guesses based on mount information for the password store directory.
Sourcepub fn fetch_size_stats(&self) -> Result<TombSize>
pub fn fetch_size_stats(&self) -> Result<TombSize>
Fetch Tomb size statistics.
This attempts to gather password store and tomb size statistics, whether this store is a tomb or not.
This is expensive.
Auto Trait Implementations§
impl<'a> Freeze for Tomb<'a>
impl<'a> RefUnwindSafe for Tomb<'a>
impl<'a> Send for Tomb<'a>
impl<'a> Sync for Tomb<'a>
impl<'a> Unpin for Tomb<'a>
impl<'a> UnwindSafe for Tomb<'a>
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self
to an expression for Diesel’s query builder. Read more