Skip to main content

hashtree_collection/
lib.rs

1//! Immutable by-id, key-index, search-index, schema, and federated-search
2//! collections for hashtree.
3
4use std::collections::BTreeMap;
5
6use hashtree_core::Cid;
7
8pub const MANIFEST_BY_ID: &str = "by-id";
9
10pub type CollectionWriteContext = BTreeMap<String, Cid>;
11
12mod definition;
13mod error;
14mod federated;
15mod helpers;
16mod manifest;
17mod schema;
18mod source;
19mod state;
20mod writer;
21
22pub use definition::{
23    default_search_prefix, CollectionDefinition, CollectionEntryContext,
24    CollectionKeyIndexDefinition, CollectionPublishedSchema, CollectionSearchEntry,
25    CollectionSearchIndexDefinition,
26};
27pub use error::CollectionError;
28pub use federated::{
29    federated_search, FederatedCollectionSource, FederatedSearchHit, FederatedSearchOptions,
30    FederatedSearchSourceHit,
31};
32pub use manifest::{
33    load_collection_manifest_metadata, CollectionManifestMetadata,
34    COLLECTION_MANIFEST_METADATA_FILE,
35};
36pub use schema::{
37    get_collection_schema, get_schema_version, normalize_collection_item, CollectionSchema,
38    NormalizeCollectionItemOptions,
39};
40pub use source::{CollectionIndexLinkResult, CollectionSource};
41pub use state::{
42    create_empty_collection_state, load_collection_state, CollectionOptions, CollectionState,
43};
44pub use writer::CollectionWriter;
45
46pub use hashtree_index::{SearchIndexOptions, SearchLinkResult, SearchOptions};