pub struct M2dirStore { /* private fields */ }Expand description
Root m2store directory holding one or more crate::m2dir::types::M2dirs.
Implementations§
Source§impl M2dirStore
impl M2dirStore
Sourcepub fn from_path(path: impl Into<M2dirPath>) -> Self
pub fn from_path(path: impl Into<M2dirPath>) -> Self
Builds an M2dirStore from a path without checking the marker.
Sourcepub fn marker_path(&self) -> M2dirPath
pub fn marker_path(&self) -> M2dirPath
Returns the path to the .m2store marker file.
Sourcepub fn delivery_path(&self) -> M2dirPath
pub fn delivery_path(&self) -> M2dirPath
Returns the path to the .delivery entry.
Sourcepub fn resolve_folder_path(
&self,
name: &str,
) -> Result<M2dirPath, M2dirStoreError>
pub fn resolve_folder_path( &self, name: &str, ) -> Result<M2dirPath, M2dirStoreError>
Resolves a folder name (relative path, components percent encoded per the m2dir specification) to its on-disk path inside this store.
Returns an error if name is absolute or escapes the store
root.
Sourcepub fn decode_folder_name(&self, path: &M2dirPath) -> Option<String>
pub fn decode_folder_name(&self, path: &M2dirPath) -> Option<String>
Decodes a path inside the store back to its UTF-8 folder name.
Trait Implementations§
Source§impl AsRef<M2dirPath> for M2dirStore
impl AsRef<M2dirPath> for M2dirStore
Source§impl AsRef<str> for M2dirStore
impl AsRef<str> for M2dirStore
Source§impl Clone for M2dirStore
impl Clone for M2dirStore
Source§fn clone(&self) -> M2dirStore
fn clone(&self) -> M2dirStore
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 M2dirStore
impl Debug for M2dirStore
impl Eq for M2dirStore
Source§impl From<M2dirPath> for M2dirStore
impl From<M2dirPath> for M2dirStore
Source§impl Ord for M2dirStore
impl Ord for M2dirStore
Source§fn cmp(&self, other: &M2dirStore) -> Ordering
fn cmp(&self, other: &M2dirStore) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for M2dirStore
impl PartialEq for M2dirStore
Source§fn eq(&self, other: &M2dirStore) -> bool
fn eq(&self, other: &M2dirStore) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for M2dirStore
impl PartialOrd for M2dirStore
impl StructuralPartialEq for M2dirStore
Auto Trait Implementations§
impl Freeze for M2dirStore
impl RefUnwindSafe for M2dirStore
impl Send for M2dirStore
impl Sync for M2dirStore
impl Unpin for M2dirStore
impl UnsafeUnpin for M2dirStore
impl UnwindSafe for M2dirStore
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