Expand description
Path types for hierarchical document access.
This module provides type-safe path construction and validation for accessing nested structures in CRDT documents. The Path/PathBuf types follow the same borrowed/owned pattern as std::path::Path/PathBuf.
§Core Types
Path- An unsized borrowed path type (always behind a reference)PathBuf- An owned path type that can be constructed and modified
§Usage
use eidetica::crdt::doc::{Path, PathBuf};
use std::str::FromStr;
// Construct from string (automatically normalized)
let path = PathBuf::from_str("user.profile.name")?;
// Build incrementally (infallible)
let path = PathBuf::new()
.push("user")
.push("profile")
.push("name");
// Use in document operations
let mut doc = Doc::new();
doc.set(path, "Alice");Structs§
- Component
- A validated component of a path.
- Path
- A borrowed, validated path for hierarchical document access.
- PathBuf
- An owned, validated path for hierarchical document access.
- Path
Builder - A builder for constructing paths incrementally.
Enums§
- Path
Error - Error type for path validation failures.
Traits§
- From
StrResult - Backward compatibility: FromStr that can return a PathError
Functions§
- normalize_
const - Normalizes a path string at compile time for string literals.
- normalize_
path - Normalizes a path string by cleaning up dots and empty components.