Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

Module path

Module path 

Source
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.
PathBuilder
A builder for constructing paths incrementally.

Enums§

PathError
Error type for path validation failures.

Traits§

FromStrResult
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.