Expand description
Xvc Core Library for common operations
Re-exports§
pub use types::hashalgorithm::HashAlgorithm;pub use types::recheckmethod::RecheckMethod;pub use types::xvcdigest::content_digest::ContentDigest;pub use types::xvcdigest::path_collection_digest::PathCollectionDigest;pub use types::xvcdigest::stdout_digest::StdoutDigest;pub use types::xvcdigest::url_get_digest::UrlContentDigest;pub use types::xvcdigest::xvc_metadata_digest::XvcMetadataDigest;pub use types::xvcdigest::AttributeDigest;pub use types::xvcdigest::XvcDigest;pub use types::xvcdigest::XvcDigests;pub use types::diff::Diff;pub use types::diff::DiffStore;pub use types::diff::DiffStore2;pub use types::diff::DiffStore3;pub use types::diff::DiffStore4;pub use types::diff::apply_diff;pub use types::diff::diff_store;pub use types::diff::update_with_actual;pub use types::textorbinary::TextOrBinary;pub use types::xvcfiletype::XvcFileType;pub use types::xvcmetadata::XvcMetadata;pub use types::xvcpath::XvcCachePath;pub use types::xvcpath::XvcPath;pub use types::xvcroot::find_root;pub use types::xvcroot::XvcRoot;pub use error::Error;pub use error::Result;pub use util::git;pub use util::file::all_paths_and_metadata;pub use util::file::dir_includes;pub use util::file::glob_includes;pub use util::file::glob_paths;pub use util::git::build_gitignore;pub use util::git::exec_git;pub use util::git::get_absolute_git_command;pub use util::git::get_git_tracked_files;pub use util::git::git_auto_commit;pub use util::git::git_auto_stage;pub use util::git::git_checkout_ref;pub use util::git::git_ignored;pub use util::git::handle_git_automation;pub use util::git::inside_git;pub use util::git::stash_user_staged_files;pub use util::git::unstash_user_staged_files;pub use util::pmp::XvcPathMetadataProvider;pub use util::XvcPathMetadataMap;pub use xvc_walker as walker;
Modules§
- check_
ignore - xvc check ignore CLI handling module
- configuration
- This module defines the core Xvc configuration structures and logic.
It includes
XvcConfigurationfor complete settings,XvcOptionalConfigurationfor partial overrides, and functions for merging configurations from various sources like default values, files, and environment variables. - error
- Error messages for Xvc core crate
- root
- Get the Xvc root directory for the current project
- types
- Xvc basic types used across the whole program
- util
- Various utility functions
- walk_
parallel - Parallel walk implementation
- walk_
serial - Serial directory walker without parallelization
See [
walk_parallel] for parallel version.
Macros§
- attribute_
digest - Specifies an attribute digest
- debug
- Either send XvcOutputLine::Debug to the given channel, or log via
logcrate - error
- Either send a XvcOutputLine::Error value to the given channel, or log via
logcrate - info
- Either send XvcOutputLine::Info to the given channel, or log via
logcrate - output
- Either send XvcOutputLine::Output to the given channel, or print to stdout
- panic
- Either send XvcOutputLine::Panic to the given channel, or print to stdout
- persist
- Specifies the store name a type is stored. Usually it’s the string representation of a type. These strings are used to generate store locations for types. They must be unique across the project.
- trace
- Either send [XvcOutputLine::Trace] to the given channel, or log via
logcrate - uwo
- Unwrap an option, and if it is an error, send it to the given channel
and panic.
This is mostly to be used in
for_eachblocks, where the error is not propagated. - uwr
- Unwrap the result of an expression, and if it is an error, send it to the given channel
and panic.
This is mostly to be used in
for_eachblocks, where the error is not propagated. - warn
- Either send XvcOutputLine::Warn to the given channel, or log via
logcrate - watch
- Debugging macro to print the given expression and its value, with the module, function and line number
Structs§
- Absolute
Path - A specialized path type for absolute paths.
- Event
Log - A series of Event values.
- Glob
Globrepresents a glob pattern matcher with support for multi-pattern matching.- HStore
- This is a HashMap for more random access and less restrictions, no support for serialization
- Ignore
Rules - Complete set of ignore rules for a directory and its child directories.
- Path
Sync - When multiple threads try to access the same path (especially in cache operations) we get weird race conditions, This structure is to make those operations atomic and thread safe.
- R1NStore
- RNStore is 1-N RelationStore, where we store one-to-many relationships between two entities. It doesn’t have any semantics except binding two entities together.
- R11Store
- Associates two XvcStores with two different type of components with a single XvcEntity. It’s like using the same primary key in two database tables.
- RMNStore
- RMNStore is M-N RelationStore, where we store arbitrary relationships between two entities. It doesn’t have any semantics except binding two entities together.
- VStore
- This is a tuple-vector for (XvcEntity, T) to enable faster serial access
- Walk
Options - What’s the ignore file name and should we add directories to the result?
- XvcConfig
- Keeps track of all Xvc configuration.
- XvcConfiguration
- The top-level Xvc configuration structure.
- XvcEntity
- Describes an entity in Entity Component System-sense.
- XvcLoad
Params - How should we initialize the configuration?
- XvcOptional
Configuration - The top-level optional Xvc configuration structure, used for partial updates.
- XvcStore
- A database table like store for type
T
Enums§
- Event
- Records add and remove operations of a serializable component
T. - Match
Result - Show whether a path matches to a glob rule
- Path
Event - An walker-relevant event for changes in a directory. It packs newer std::fs::Metadata if there is.
- XvcConfig
Error - Error enum that uses ThisError. The messages should be self-explanatory, so skipping the docs.
- XvcConfig
Option Source - Define the source where an option is obtained
- XvcEcs
Error - Error type for ECS. We allow missing docs, the names should be self-explanatory.
- XvcOutput
Line - Different channels of outputs Xvc can print
- XvcVerbosity
- Verbosity levels for Xvc CLI
- XvcWalker
Error - Error type for Xvc Walker
Constants§
- CHANNEL_
BOUND - Channel size for crossbeam_channel::bounded used across the library. TODO: This can be configurable for smaller/larger RAM sizes.
- GITIGNORE_
INITIAL_ CONTENT - The initial content for
.xvc/.gitignoreto hide files in .xvc/ - GIT_DIR
- The Git directory for a project.
- GUID_
FILENAME - Globally Unique Identified for the Xvc Repository / Project
- XVCIGNORE_
FILENAME - The standard ignore filename
- XVCIGNORE_
INITIAL_ CONTENT - Initial .xvgignore content when a project is initialized
- XVC_DIR
- The standard metadata directory
Traits§
- From
Config - Trait to update CLI options with defaults from configuration.
- Storable
- Marks the traits as storable in XvcStore
- Update
From Config - A trait for updating an existing configuration struct with values from a complete
XvcConfiguration.
Functions§
- blank_
optional_ config - Returns a blank
XvcOptionalConfigurationwith all fields set toNone. - content_
to_ patterns - convert a set of rules in
contentto glob patterns. patterns may come fromsource. the root directory of all search is inignore_root. - make_
polling_ watcher - Create a notify::PollWatcher and a crossbeam_channel::Receiver to receive PathEvents. It creates the channel and [PathEventHandler] with its Sender, then returns the Receiver for consumption.
- path_
metadata_ map_ from_ file_ targets - Return path metadata only for the listed files to avoid recursing directories
- setup_
logging - Init logging if it’s not initialized before.
Uses Once to run (non-public fn)
init_loggingonce. - walk_
parallel - Walk all child paths under
dirand send non-ignored paths topath_sender. Newly found ignore rules are sent throughignore_sender. The ignore file name (.xvcignore,.gitignore,.ignore, …) is set bywalk_options. - walk_
serial - Walk
dirwithwalk_options, with the given initialignore_rules. Note that ignore rules are expanded with the rules given in theignore_filenameinwalk_options. The result is added to givenres_pathsto reduce the number of memory inits for vec.
Type Aliases§
- SharedH
Store - A shared version of HStore for use in multithreaded environments.
- SharedX
Store - A shared version of XvcStore that we use to pass around for thread safety.
- XvcConfig
Result - Result type for xvc-config crate
- XvcEcs
Result - Result type for Xvc ECS functions that may return Error
- XvcOutput
Sender - The channel type to send and receive output/log/debug messages
- XvcWalker
Result - Result type for xvc-walker that may also return Error