Skip to main content

Paths

Struct Paths 

Source
pub struct Paths { /* private fields */ }
Expand description

Home-derived file locations under ~/.purple and ~/.ssh. One place that knows the on-disk layout; every consumer asks here instead of joining the home directory itself.

Implementations§

Source§

impl Paths

Source

pub fn new(home: impl Into<PathBuf>) -> Self

Source

pub fn home(&self) -> &Path

Source

pub fn purple_dir(&self) -> PathBuf

~/.purple.

Source

pub fn preferences(&self) -> PathBuf

~/.purple/preferences.

Source

pub fn snippets_dir(&self) -> PathBuf

~/.purple/snippets.

Source

pub fn container_cache(&self) -> PathBuf

~/.purple/container_cache.jsonl.

Source

pub fn log_file(&self) -> PathBuf

~/.purple/purple.log.

Source

pub fn history(&self) -> PathBuf

~/.purple/history.tsv.

Source

pub fn last_version_check(&self) -> PathBuf

~/.purple/last_version_check.

Source

pub fn certs_dir(&self) -> PathBuf

~/.purple/certs.

Source

pub fn cert_for(&self, alias: &str) -> PathBuf

~/.purple/certs/<alias>-cert.pub.

Source

pub fn ssh_dir(&self) -> PathBuf

~/.ssh.

Source

pub fn askpass_marker(&self, alias: &str) -> PathBuf

Askpass retry marker ~/.purple/.askpass_<safe>. The alias is sanitised (/, \, . become _) to prevent path traversal.

Trait Implementations§

Source§

impl Clone for Paths

Source§

fn clone(&self) -> Paths

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Paths

§

impl RefUnwindSafe for Paths

§

impl Send for Paths

§

impl Sync for Paths

§

impl Unpin for Paths

§

impl UnsafeUnpin for Paths

§

impl UnwindSafe for Paths

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V