pub struct NodeName(/* private fields */);Expand description
A Zarr hierarchy node name.
See
Implementations§
Source§impl NodeName
impl NodeName
Sourcepub fn new(name: impl Into<String>) -> Result<Self, NodeNameError>
pub fn new(name: impl Into<String>) -> Result<Self, NodeNameError>
Create a new Zarr node name from name.
§Errors
Returns NodeNameError if name is not valid according to NodeName::validate().
Sourcepub unsafe fn new_unchecked(name: impl Into<String>) -> Self
pub unsafe fn new_unchecked(name: impl Into<String>) -> Self
Create a new Zarr node name from name.
§Safety
name is not validated, so this can result in an invalid node name.
Sourcepub fn validate(node_name: &str) -> bool
pub fn validate(node_name: &str) -> bool
Validates a node name according to the following rules from the specification:
- The root node does not have a name and is the empty string “”.
Otherwise,
- must not be the empty string (“”),
- must not include the character “/”,
- must not be a string composed only of period characters, e.g. “.” or “..”, and
- must not start with the reserved prefix “__”.
Trait Implementations§
impl Eq for NodeName
impl StructuralPartialEq for NodeName
Auto Trait Implementations§
impl Freeze for NodeName
impl Send for NodeName
impl Sync for NodeName
impl RefUnwindSafe for NodeName
impl Unpin for NodeName
impl UnsafeUnpin for NodeName
impl UnwindSafe for NodeName
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<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