pub struct ConfigPath { /* private fields */ }Expand description
The value of a key that names a file, as the key holds it.
The path can be empty. A relative path has no .. component. A path
that breaks the rule cannot be built. The code that reads the file
resolves a relative path, by the rules of config::remote, “Paths”.
The check of a relative path and of a .. component follows
the path rules of the target platform.
§Examples
use ostrya_core::config::ConfigPath;
assert!(ConfigPath::try_from("/etc/ca.pem").is_ok());
assert!(ConfigPath::try_from("/etc/../ca.pem").is_ok());
assert!(ConfigPath::try_from("").is_ok());
assert!(ConfigPath::try_from("../ca.pem").is_err());Implementations§
Trait Implementations§
Source§impl Clone for ConfigPath
impl Clone for ConfigPath
Source§impl Debug for ConfigPath
impl Debug for ConfigPath
impl Eq for ConfigPath
Source§impl Hash for ConfigPath
impl Hash for ConfigPath
Source§impl PartialEq for ConfigPath
impl PartialEq for ConfigPath
impl StructuralPartialEq for ConfigPath
Source§impl TryFrom<&str> for ConfigPath
impl TryFrom<&str> for ConfigPath
Source§fn try_from(path: &str) -> Result<ConfigPath, ValueError>
fn try_from(path: &str) -> Result<ConfigPath, ValueError>
§Errors
A ValueError if path 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 ConfigPath
impl TryFrom<String> for ConfigPath
Source§fn try_from(path: String) -> Result<ConfigPath, ValueError>
fn try_from(path: String) -> Result<ConfigPath, ValueError>
§Errors
A ValueError if path 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 ConfigPath
The text is decoded, and then checked as ConfigPath::try_from checks
it.
impl Value for ConfigPath
The text is decoded, and then checked as ConfigPath::try_from checks
it.
Auto Trait Implementations§
impl Forget for ConfigPath
impl Freeze for ConfigPath
impl Move for ConfigPath
impl RefUnwindSafe for ConfigPath
impl Send for ConfigPathwhere
RawVecInner: Send,
impl Sync for ConfigPathwhere
RawVecInner: Sync,
impl Unpin for ConfigPath
impl UnsafeUnpin for ConfigPath
impl UnwindSafe for ConfigPathwhere
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