pub struct NodeId(/* private fields */);Expand description
A validated node identifier: n- followed by 4 or more ASCII digits
(e.g. n-0001). Mirrors what crate::format_node_id emits.
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub fn parse_str(s: &str) -> Result<Self, IdValidationError>
pub fn parse_str(s: &str) -> Result<Self, IdValidationError>
Parse and validate a node_id. Requires the n- prefix followed by
4 to 10 ASCII digits; rejects anything else (wrong prefix, too few or
too many digits, non-digit body). The 10-digit ceiling covers the full
u32 counter range crate::format_node_id draws from while bounding
the filename length (a defense against ENAMETOOLONG from a forged id).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeId
Source§impl Ord for NodeId
impl Ord for NodeId
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 PartialOrd for NodeId
impl PartialOrd for NodeId
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
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