pub struct Path(_);
Expand description
A filesystem path.
Implementations§
source§impl Path
impl Path
sourcepub fn new(path: impl AsRef<str> + Into<String>) -> Result<Self, ParseError>
pub fn new(path: impl AsRef<str> + Into<String>) -> Result<Self, ParseError>
Creates a Path
from a String
, returning an Err
if the string
fails validation. The string must be non-empty, no more than 1024
characters in length, start with a leading /
, and contain no empty
path segments.
sourcepub fn validate(path: &str) -> Result<(), ParseError>
pub fn validate(path: &str) -> Result<(), ParseError>
Validates path
but does not construct a new Path
object.
pub fn as_str(&self) -> &str
Trait Implementations§
source§impl<'de> Deserialize<'de> for Path
impl<'de> Deserialize<'de> for Path
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more