Skip to main content

Crate link_cli

Crate link_cli 

Source
Expand description

Link CLI Library - Core functionality for links manipulation

This library provides the core data structures and functionality for the link-cli tool, implementing a doublet storage system with LiNo notation support.

§Modules

Every module is public: clink is one front end over this library, and an application that needs a different one should be able to reach the same pieces rather than reimplement them.

  • link - The core Link data structure
  • error - Error types for link operations
  • lino_link - LiNo link representation
  • parser - LiNo notation parser
  • link_storage - Persistent link storage
  • storage - Reusable storage traits and the doublets-backed store
  • changes_simplifier - Changes simplification
  • query_processor - LiNo query processing
  • query_types - Patterns and resolved links, the shapes a query passes through
  • link_reference_validator - Checking, and optionally creating, referenced links
  • named_type_links - The storage interface every layer is written against
  • named_types, pinned_types - Named and pinned type decorators
  • persistent_transformations - Persistent transformation triggers
  • transactions, version_control - Reversible transitions, branches and tags
  • cli - Argument parsing, so a custom tool can accept the same options

§Extending

NamedTypeLinks is the seam: every layer of the stack is written against it, and every decorator both implements it and wraps another implementation of it. A layer of your own – a cache, an access check, a remote store – implements the trait and slots in anywhere, including under QueryProcessor, which never learns what is beneath it.

Re-exports§

pub use changes_simplifier::simplify_changes;
pub use error::LinkError;
pub use hybrid_reference::external_reference;
pub use hybrid_reference::external_reference_value;
pub use hybrid_reference::HybridReference;
pub use link_storage::LinkStorage;
pub use lino_database_input::import_lino_file;
pub use lino_database_input::import_lino_text;
pub use named_types::NamedTypes;
pub use named_types::NamedTypesDecorator;
pub use parser::Parser;
pub use persistent_transformations::make_triggers_database_filename;
pub use persistent_transformations::PersistentTransformation;
pub use persistent_transformations::PersistentTransformationDecorator;
pub use persistent_transformations::PersistentTransformationKind;
pub use persistent_transformations::PersistentTransformationQuery;
pub use persistent_transformations::TriggerStore;
pub use persistent_transformations::INTERNAL_NAME_PREFIX;
pub use pinned_types::PinnedTypes;
pub use pinned_types::PinnedTypesAccess;
pub use pinned_types::PinnedTypesDecorator;
pub use query_options::QueryOptions;
pub use query_processor::QueryProcessor;
pub use storage::lock_file_path;
pub use storage::DoubletsStorage;
pub use storage::FileLock;
pub use storage::FileMappedUnitStore;
pub use storage::LinksStorage;
pub use storage::LinksStorageRef;
pub use storage::LockMode;
pub use storage::PersistentFileMapped;
pub use storage::ResolvedFileMappedUnitStore;
pub use storage::StorageRevision;
pub use transactions::CommitMode;
pub use transactions::FileTransitionLog;
pub use transactions::GenericTransactionsDecorator;
pub use transactions::GenericTransition;
pub use transactions::LogRetentionPolicy;
pub use transactions::TransactionHandle;
pub use transactions::TransactionsDecorator;
pub use transactions::Transition;
pub use transactions::TransitionKind;
pub use transactions::TransitionLogStore;
pub use unicode_string_storage::UnicodeStringStorage;
pub use version_control::BranchInfo;
pub use version_control::VersionControlDecorator;
pub use version_control::DEFAULT_BRANCH_NAME;
pub use doublets;

Modules§

changes_simplifier
ChangesSimplifier - Simplifies a list of changes
cli
Command-line argument parsing for the clink binary.
decorators
The upstream doublets decorator layer, re-exported so downstream crates can stack decorators onto a DoubletsStorage through DoubletsStorage::map_store without depending on doublets directly (and without risking a version mismatch). Zero-cost decorators that add policy to any Doublets store.
error
Error types for link operations
hybrid_reference
Platform.Data.Hybrid<uint>-compatible reference encoding.
link
Link - A doublet (source, target) pair with an index
link_reference_validator
Checking that every link a query refers to exists, and creating the ones that do not when the caller asked for that.
link_storage
LinkStorage - Persistent storage for links
link_storage_doublets
Bridge between the CLI’s LinkStorage and the upstream doublets traits.
lino_database_input
LiNo database import helpers.
lino_link
LinoLink - A parsed LiNo link structure
named_links
Link-backed names facade matching the C# NamedLinks<uint> role.
named_type_links
NamedTypeLinks, the storage interface every layer of the CLI is written against, and its implementations for the plain store and for each decorator.
named_types
Named type decorator for Rust link storage.
parser
LiNo Parser - Parses LiNo notation into LinoLink structures.
persistent_transformations
Persistent transformation triggers.
pinned_types
Pinned type allocation compatible with the C# PinnedTypes helper.
query_options
The options one query is processed with.
query_processor
QueryProcessor - Handles LiNo query parsing and execution
query_processor_substitution
The substitution half of QueryProcessor: turning a matched restriction plus a substitution pattern into the links to write.
query_types
The intermediate shapes a query passes through: the Pattern a restriction or substitution parses into, and the ResolvedLink a pattern becomes once its variables are bound.
sequences
Rust ports of the Data.Doublets.Sequences abstractions used by C#.
storage
Reusable storage layer: traits, a doublets-backed implementation and advisory locking helpers.
transactions
Optional transactions layer for the Rust link-cli.
unicode_string_storage
Unicode string and name storage backed by doublet links.
version_control
Optional version-control layer for the Rust link-cli.