Skip to main content

Crate dhara_storage

Crate dhara_storage 

Source
Expand description

Rust-native storage and content-analysis primitives for Dhara Storage.

This crate provides definition-driven file typing (bundled filedefs.dat), path-based file and directory handles, transfers with optional progress, and debounced directory watching. Framework primitives (DSFD encode/decode, progress/cancel, portable value types) live in dhara_storage_core and are re-exported here for the usual application dependency path. This crate embeds and indexes the runtime filedefs.dat.

Re-exports§

pub use analysis::AnalysisReport;
pub use analysis::ContentKind;
pub use analysis::DetectedDefinition;
pub use analysis::analyze_path;
pub use analysis::analyze_reader;
pub use definitions::DEFINITION_PACKAGE_ID;
pub use definitions::bundled_definition_package;
pub use definitions::decode_definition_package;
pub use error::StorageError;
pub use metadata::DEFAULT_SHELL_ICON_SIZE;
pub use metadata::DirectoryMetadata;
pub use metadata::DirectorySummary;
pub use metadata::FileExtension;
pub use metadata::FileMetadata;
pub use metadata::ShellIcon;
pub use metadata::StorageMetadata;
pub use metadata::StorageType;
pub use metadata::apply_storage_attributes;
pub use metadata::is_temporary_path;
pub use metadata::scan_directory_summary;
pub use operations::ProcessOutcome;
pub use operations::StorageProcess;
pub use operations::copy_directory;
pub use operations::copy_directory_with_options;
pub use operations::copy_file;
pub use operations::copy_file_with_options;
pub use operations::create_directory;
pub use operations::create_directory_all;
pub use operations::delete_directory;
pub use operations::delete_directory_with_options;
pub use operations::delete_file;
pub use operations::execute_copy_directory_with_options;
pub use operations::execute_copy_file_with_options;
pub use operations::execute_move_directory_with_options;
pub use operations::execute_move_file_with_options;
pub use operations::move_directory;
pub use operations::move_directory_with_options;
pub use operations::move_file;
pub use operations::move_file_with_options;
pub use operations::open_for_read;
pub use operations::open_for_write;
pub use operations::read_file;
pub use operations::read_file_to_string;
pub use operations::rename_directory;
pub use operations::rename_file;
pub use operations::start_copy_directory;
pub use operations::start_copy_directory_with_options;
pub use operations::start_copy_file;
pub use operations::start_copy_file_with_options;
pub use operations::start_move_directory;
pub use operations::start_move_directory_with_options;
pub use operations::start_move_file;
pub use operations::start_move_file_with_options;
pub use operations::write_file;
pub use operations::write_file_from_reader;
pub use operations::write_file_string;
pub use storage::DirectoryStorage;
pub use storage::FileStorage;
pub use storage::SearchScope;
pub use storage::StorageEntry;
pub use watch::DirectoryWatchHandle;
pub use watch::StorageChangeEvent;
pub use watch::StorageChangeType;
pub use watch::StorageWatchConfig;

Modules§

analysis
Content-based file analysis and heuristic classification helpers. Content-based file analysis against the bundled definition package.
definitions
Runtime file-definition package types and decoders. Runtime loading and decoding of the bundled file-definition database.
error
Typed error values returned by storage operations and metadata queries. Typed errors for analysis, metadata, and storage operations.
metadata
On-demand metadata, attributes, permissions, and size helpers. On-demand storage metadata, attributes, permissions, and size helpers.
operations
File and directory mutation APIs (progress/cancel types from core, re-exported). Free functions for file and directory create/copy/move/delete with progress options.
process
Awaitable storage process handle for in-flight copy/move work. Public awaitable StorageProcess handle for in-flight storage work.
storage
Path-based storage handles layered over the core operation APIs. Path-based FileStorage and DirectoryStorage handles.
watch
Debounced directory watching primitives. Debounced directory watching and change-event types.

Structs§

DefinitionPackage
Serialized file-definition package loaded from filedefs.dat.
DefinitionRecord
Single normalized file-type definition record.
DirectoryDeleteOptions
Options for directory deletion.
OpenReadOptions
Options for engine/interop read opens.
OpenWriteOptions
Options for engine/interop write opens.
ReadOptions
Common options for byte-oriented read operations.
SignatureDefinition
Signature material used to identify a file type from file bytes.
SignaturePattern
Byte sequence that should match at a specific offset within a file.
StorageAttributes
Settable storage attributes shared by files and directories.
StorageCancellationToken
Cooperative cancellation token for long-running storage operations.
StoragePermissions
Best-effort effective permissions for the current process.
StorageSize
On-demand storage size: raw OS bytes plus a readable label.
TransferOptions
Common options for copy and move style operations.
WriteOptions
Common options for file write operations.

Enums§

DefinitionPackageDecodeError
Errors returned while encoding or decoding definition packages.
FileShareMode
How other processes may share an opened file (Windows share mode; Unix ignores exclusivity nuances where N/A).
SizeUnit
Units used for formatting byte sizes.
StorageProcessEvent
Event emitted by a process session / public storage process during long-running work.

Traits§

ProcessEventReporter
Receives process events from an in-flight transfer session.

Functions§

format_size
Formats a byte count using either the requested unit or an automatically selected one.

Type Aliases§

SharedProcessEventReporter
Shared reporter type used by sync APIs and daemon/FFI bridges.