Expand description
Content Addressable Storage (CAS) for images and thread data.
This crate provides a Git-like storage system for the Squigit application, storing images by their BLAKE3 hash (deduplication) and managing thread data with persistent storage.
§Example
use squigit_storage::{ThreadStorage, ThreadMetadata, ThreadData};
let storage = ThreadStorage::new().unwrap();
// Store an image
let image_bytes = std::fs::read("screenshot.png").unwrap();
let stored = storage.store_image(&image_bytes, None).unwrap();
println!("Image hash: {}", stored.hash);
println!("Image path: {}", stored.path);
// Create a thread
let metadata = ThreadMetadata::new("My Analysis".to_string(), stored.hash);
let initial = storage.attachment_manifest_entry(&metadata.image_hash, "squigitshot.png", chrono::Utc::now()).unwrap();
let thread = ThreadData::new(metadata, initial);
storage.save_thread(&thread).unwrap();Re-exports§
pub use cas::AttachmentFileType;pub use cas::DocumentConversion;pub use cas::ObjectFileContext;pub use cas::ObjectManifest;pub use cas::ObjectManifestLock;pub use cas::ObjectRemote;pub use cas::ReverseImageSearchCache;pub use cas::StoredImage;pub use cas::OBJECT_MANIFEST_SCHEMA_VERSION;pub use error::Result;pub use error::StorageError;pub use profiles::canonical_google_issuer;pub use profiles::EncryptedKeyRecord;pub use profiles::KeyFile;pub use profiles::KeyStoreTransaction;pub use profiles::LastLogin;pub use profiles::Profile;pub use profiles::ProfileAuth;pub use profiles::ProfileIdentity;pub use profiles::ProfileKeyRecords;pub use profiles::ProfileSnapshot;pub use profiles::ProfileStore;pub use profiles::RecordCipher;pub use profiles::RecordKdf;pub use profiles::AUTH_MODE_GOOGLE_OIDC_PKCE;pub use profiles::AUTH_SCHEMA_VERSION;pub use profiles::GOOGLE_ISSUER;pub use profiles::GOOGLE_PROFILE_ID_PREFIX;pub use profiles::GOOGLE_PROVIDER;pub use profiles::KEY_FILE_SCHEMA_VERSION;pub use threads::AttachmentManifest;pub use threads::AttachmentManifestEntry;pub use threads::ContextWindow;pub use threads::MessageAttachment;pub use threads::OcrAnnotationEntry;pub use threads::OcrAnnotations;pub use threads::OcrModelAnnotation;pub use threads::OcrRegion;pub use threads::SideChatData;pub use threads::SideChatMetadata;pub use threads::ThreadData;pub use threads::ThreadMessage;pub use threads::ThreadMetadata;pub use threads::ThreadStorage;pub use threads::WorkspaceMetadata;pub use threads::DEFAULT_SIDE_CHAT_TITLE;pub use threads::DEFAULT_THREAD_TITLE;pub use threads::EMPTY_STATE_ASSET_ID;pub use version::ProductVersion;pub use version::VersionFile;pub use version::VersionStore;pub use version::VersionStoreGuard;pub use version::VersionType;pub use version::VERSION_FILE_NAME;