pub struct NodePath(/* private fields */);Expand description
A Zarr hierarchy node path.
See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#path
Implementations§
Source§impl NodePath
impl NodePath
Sourcepub fn new(path: &str) -> Result<Self, NodePathError>
pub fn new(path: &str) -> Result<Self, NodePathError>
Create a new Zarr node path from path.
§Errors
Returns NodePathError if path is not valid according to NodePath::validate().
Sourcepub fn as_path(&self) -> &Path
pub fn as_path(&self) -> &Path
Extracts the path as a std::path::Path.
Sourcepub fn validate(path: &str) -> bool
pub fn validate(path: &str) -> bool
Validates a path according to the following rules from the specification:
- A path always starts with
/, and - a non-root path cannot end with
/, because node names must be non-empty and cannot contain/.
Additionally, it checks that there are no empty nodes (i.e. a // substring).
Trait Implementations§
Source§impl Ord for NodePath
impl Ord for NodePath
Source§impl PartialOrd for NodePath
impl PartialOrd for NodePath
Source§impl TryFrom<&StorePrefix> for NodePath
impl TryFrom<&StorePrefix> for NodePath
Source§type Error = NodePathError
type Error = NodePathError
The type returned in the event of a conversion error.
Source§impl TryInto<StorePrefix> for &NodePath
impl TryInto<StorePrefix> for &NodePath
Source§type Error = StorePrefixError
type Error = StorePrefixError
The type returned in the event of a conversion error.
Source§fn try_into(self) -> Result<StorePrefix, StorePrefixError>
fn try_into(self) -> Result<StorePrefix, StorePrefixError>
Performs the conversion.
impl Eq for NodePath
impl StructuralPartialEq for NodePath
Auto Trait Implementations§
impl Freeze for NodePath
impl Send for NodePath
impl Sync for NodePath
impl RefUnwindSafe for NodePath
impl Unpin for NodePath
impl UnsafeUnpin for NodePath
impl UnwindSafe for NodePath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more