Skip to main content

DhttpHome

Struct DhttpHome 

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

A handle to the user’s dhttp home directory (e.g. ~/.dhttp/).

DhttpHome describes a directory that contains per-identity profiles and a global settings file. It does not own any in-memory configuration data; it is purely a typed path with helpers for resolving the layout inside.

Implementations§

Source§

impl DhttpHome

Source§

impl DhttpHome

Source

pub async fn resolve_default_identity_profile( &self, ) -> Result<IdentityProfile, ResolveDefaultIdentityProfileError>

Read the settings file and resolve the default identity profile it points to.

Source§

impl DhttpHome

Source

pub async fn resolve_identity_profile_exactly( &self, name: DhttpName<'_>, ) -> Result<IdentityProfile, ResolveIdentityProfileError>

Resolve name to an IdentityProfile by exact match only (no wildcard fallback).

Source

pub async fn resolve_identity_profile_wildcard( &self, name: DhttpName<'_>, ) -> Result<IdentityProfile, ResolveIdentityProfileError>

Resolve name to an IdentityProfile by wildcard match only (no exact fallback).

Source

pub async fn resolve_identity_profile( &self, name: DhttpName<'_>, ) -> Result<IdentityProfile, ResolveIdentityProfileError>

Resolve name to an IdentityProfile, trying exact match then wildcard match.

Source

pub fn identity_profile_names( &self, ) -> impl Stream<Item = Result<DhttpName<'static>, ListIdentityProfilesError>>

Stream the names of all identity profiles that look like a valid <name>/ssl/ layout under this home directory.

Source

pub async fn identity_profile_exists_exactly(&self, name: DhttpName<'_>) -> bool

Source

pub async fn identity_profile_exists_wildcard( &self, name: DhttpName<'_>, ) -> bool

Source

pub async fn identity_profile_exists(&self, name: DhttpName<'_>) -> bool

Source§

impl DhttpHome

Source

pub fn join_identity_name(&self, name: DhttpName<'_>) -> PathBuf

Source

pub fn identity_profile(&self, name: DhttpName<'_>) -> IdentityProfile

Construct an IdentityProfile handle for name without touching disk.

Use this when you only need the typed path (for example to compute a child file path). To verify that the directory actually exists, call DhttpHome::resolve_identity_profile instead.

Source§

impl DhttpHome

Source

pub const DIR_NAME: &str = ".dhttp"

Source

pub fn new(pathbuf: PathBuf) -> Self

Source

pub fn for_user_home_dir(home_dir: impl Into<PathBuf>) -> Self

Source

pub fn load_from_environment() -> Result<Self, LocateDhttpHomeError>

Source

pub fn as_path(&self) -> &Path

Source

pub fn join(&self, path: impl AsRef<Path>) -> PathBuf

Trait Implementations§

Source§

impl AsRef<Path> for DhttpHome

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for DhttpHome

Source§

fn clone(&self) -> DhttpHome

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

impl Debug for DhttpHome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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.