Struct prs_lib::types::Plaintext [−][src]
pub struct Plaintext(_);
Expand description
Plaintext.
Wraps plaintext bytes. This type is limited on purpose, to prevent accidentally leaking the
plaintext. Security properties are enforced by secstr::SecVec.
Implementations
Get unsecure reference to inner data.
Warning
Unsecure because we cannot guarantee that the referenced data isn’t cloned. Use with care!
The reference itself is safe to use and share. Data may be cloned from this reference
though, when that happens we lose track of it and are unable to securely handle it in
memory. You should clone Plaintext instead.
Get the plaintext as UTF8 string.
Warning
Unsecure because we cannot guarantee that the referenced data isn’t cloned. Use with care!
The reference itself is safe to use and share. Data may be cloned from this reference
though, when that happens we lose track of it and are unable to securely handle it in
memory. You should clone Plaintext instead.
Get the first line of this secret as plaintext.
Returns empty plaintext if there are no lines.
Get all lines execpt the first one.
Returns empty plaintext if there are no lines.
Get line with the given property.
Returns line with the given property. The property prefix is removed, and only the trimmed value is returned. Returns an error if the property does not exist.
This will never return the first line being the password.
Append other plaintext.
Optionally adds platform newline.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Plaintextimpl UnwindSafe for PlaintextBlanket Implementations
type Err = NoError
type Err = NoErrorThe error type produced by a failed conversion.
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>Convert the given value into an approximately equivalent representation.
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::ErrThe error type produced by a failed conversion.
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>Convert the subject into an approximately equivalent representation.
Mutably borrows from an owned value. Read more
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme, Approximate the subject to a given type with a specific scheme.
Attempt to convert the subject to a given type.
type Err = NoError
type Err = NoErrorThe error type produced by a failed conversion.
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>Convert the given value into an exactly equivalent representation.
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::ErrThe error type produced by a failed conversion.
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>Convert the subject into an exactly equivalent representation.