pub struct NodePath(/* private fields */);
Expand description
A Zarr hierarchy node path.
See https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.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<&NodePath> for StorePrefix
impl TryFrom<&NodePath> for StorePrefix
§type Error = StorePrefixError
type Error = StorePrefixError
The type returned in the event of a conversion error.
source§impl TryFrom<&StorePrefix> for NodePath
impl TryFrom<&StorePrefix> for NodePath
§type Error = NodePathError
type Error = NodePathError
The type returned in the event of a conversion error.
impl Eq for NodePath
impl StructuralPartialEq for NodePath
Auto Trait Implementations§
impl Freeze for NodePath
impl RefUnwindSafe for NodePath
impl Send for NodePath
impl Sync for NodePath
impl Unpin 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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§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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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