pub enum Path {
Directory(Directory),
File(File),
Link(Link),
}
Expand description
Represents the three possible types inside a path type line of an MTREE file.
While serializing, the type is converted into a type
field on the inner struct.
This means that Vec<Path>
will be serialized to a list of maps where each map has a type
entry with the respective name.
Variants§
Implementations§
Source§impl Path
impl Path
Sourcepub fn equals_path(
&self,
input_path: &InputPath<'_, '_>,
) -> Result<(), Vec<PathValidationError>>
pub fn equals_path( &self, input_path: &InputPath<'_, '_>, ) -> Result<(), Vec<PathValidationError>>
Checks whether an InputPath
equals self
.
Depending on type of Path
, delegates to Directory::equals_path
,
File::equals_path
or Link::equals_path
.
§Errors
Returns a list of PathValidationError
s if issues have been found during validation of
input_path
.
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Sourcepub fn as_path(&self) -> &Path
pub fn as_path(&self) -> &Path
Returns the std::path::Path
of the Path
.
Sourcepub fn as_normalized_path(&self) -> Result<&Path, Error>
pub fn as_normalized_path(&self) -> Result<&Path, Error>
Returns the normalized std::path::Path
of the Path
.
Normalization strips the prefix MTREE_PATH_PREFIX
.
§Errors
Returns an alpm_common::Error
if the prefix can not be stripped.
Trait Implementations§
Source§impl Ord for Path
impl Ord for Path
Source§impl PartialOrd for Path
impl PartialOrd for Path
impl Eq for Path
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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