pub struct Secret {
pub name: String,
pub path: PathBuf,
}
Expand description
A password store secret.
Fields§
§name: String
Display name of the secret, relative path to the password store root.
path: PathBuf
Full path to the password store secret.
Implementations§
source§impl Secret
impl Secret
sourcepub fn from(store: &Store, path: PathBuf) -> Self
pub fn from(store: &Store, path: PathBuf) -> Self
Construct secret at given full path from given store.
sourcepub fn in_root(root: &Path, path: PathBuf) -> Self
pub fn in_root(root: &Path, path: PathBuf) -> Self
Construct secret at given path in the given password store root.
sourcepub fn relative_path<'a>(
&'a self,
root: &'a Path
) -> Result<&'a Path, StripPrefixError>
pub fn relative_path<'a>( &'a self, root: &'a Path ) -> Result<&'a Path, StripPrefixError>
Get relative path to this secret, root must be given.
sourcepub fn alias_target(&self, store: &Store) -> Result<Secret>
pub fn alias_target(&self, store: &Store) -> Result<Secret>
Returns pointed to secret.
If this secret is an alias, this will return the pointed to secret. If this secret is not an alias, an error will be returned.
The pointed to secret may be an alias as well.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnwindSafe for Secret
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>
Convert the given value into an approximately equivalent representation.
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,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
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>
Convert the subject into an approximately equivalent representation.
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
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>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.