pub struct IdentityProfile { /* private fields */ }Expand description
A handle to a per-identity profile directory (e.g. ~/.dhttp/reimu.pilot/).
IdentityProfile is one of N sibling directories living inside a DhttpHome.
Each profile owns that identity’s certificate, private key, server config,
and access database. The type is a typed path; it performs no IO on
construction.
Implementations§
Source§impl IdentityProfile
impl IdentityProfile
pub fn ssl_dir(&self) -> PathBuf
pub async fn load_certs( &self, ) -> Result<Vec<CertificateDer<'static>>, LoadCertsError>
pub async fn load_key(&self) -> Result<PrivateKeyDer<'static>, LoadKeyError>
Sourcepub async fn load_identity(&self) -> Result<Identity, LoadIdentityError>
pub async fn load_identity(&self) -> Result<Identity, LoadIdentityError>
Load this profile’s identity (certificate chain + private key) from disk.
pub async fn save_identity( &self, cert: &[u8], key: &[u8], ) -> Result<(), SaveIdentityError>
Source§impl IdentityProfile
impl IdentityProfile
pub const LOGS_DIR: &'static str = "logs"
pub const ACCESS_LOG_FILE: &'static str = "access.log"
pub const DB_DIR: &'static str = "db"
pub const ACCESS_DB_FILE: &'static str = "access.db"
pub const SERVER_CONF_FILE: &'static str = "server.conf"
pub fn name(&self) -> &DhttpName<'static>
pub fn path(&self) -> &Path
pub fn join(&self, sub: impl AsRef<Path>) -> PathBuf
pub fn logs_dir(&self) -> PathBuf
pub fn access_log_path(&self) -> PathBuf
pub fn access_db_path(&self) -> PathBuf
pub fn server_conf_path(&self) -> PathBuf
Trait Implementations§
Source§impl Clone for IdentityProfile
impl Clone for IdentityProfile
Source§fn clone(&self) -> IdentityProfile
fn clone(&self) -> IdentityProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdentityProfile
impl Debug for IdentityProfile
Source§impl TryFrom<&Path> for IdentityProfile
impl TryFrom<&Path> for IdentityProfile
Auto Trait Implementations§
impl !Freeze for IdentityProfile
impl RefUnwindSafe for IdentityProfile
impl Send for IdentityProfile
impl Sync for IdentityProfile
impl Unpin for IdentityProfile
impl UnsafeUnpin for IdentityProfile
impl UnwindSafe for IdentityProfile
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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