pub struct PemPath { /* private fields */ }Expand description
The value of a key of [ex-ostrya server] that names a PEM file:
tls-cert, tls-key, or tls-client-ca.
The path is not empty. A relative path has no .. component, and it is
relative to the repository root. A path that breaks a rule cannot be
built. The check of a relative path and of a .. component follows
the path rules of the target platform.
§Examples
use ostrya_core::config::PemPath;
assert!(PemPath::try_from("certs/server.pem").is_ok());
assert!(PemPath::try_from("/etc/../server.pem").is_ok());
assert!(PemPath::try_from("../server.pem").is_err());
assert!(PemPath::try_from("").is_err());Implementations§
Trait Implementations§
impl Eq for PemPath
impl StructuralPartialEq for PemPath
Source§impl TryFrom<&str> for PemPath
impl TryFrom<&str> for PemPath
Source§fn try_from(path: &str) -> Result<PemPath, ValueError>
fn try_from(path: &str) -> Result<PemPath, ValueError>
§Errors
A ValueError if path is empty, or is a relative path with a ..
component.
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for PemPath
impl TryFrom<String> for PemPath
Source§fn try_from(path: String) -> Result<PemPath, ValueError>
fn try_from(path: String) -> Result<PemPath, ValueError>
§Errors
A ValueError if path is empty, or is a relative path with a ..
component.
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Source§impl Value for PemPath
The text is decoded, and then checked as PemPath::try_from checks it.
impl Value for PemPath
The text is decoded, and then checked as PemPath::try_from checks it.
Auto Trait Implementations§
impl Forget for PemPath
impl Freeze for PemPath
impl Move for PemPath
impl RefUnwindSafe for PemPath
impl Send for PemPathwhere
RawVecInner: Send,
impl Sync for PemPathwhere
RawVecInner: Sync,
impl Unpin for PemPath
impl UnsafeUnpin for PemPath
impl UnwindSafe for PemPathwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
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