Skip to main content

Module storage

Module storage 

Source
Expand description

Storage backend for XET content-addressed storage operations.

This module provides the StorageBackend trait for abstracting XET CAS (Content-Addressed Storage) operations, and the XetStorage implementation that integrates with XET’s data client.

§Overview

The storage backend handles two main operations:

  • Clean: Upload file content to XET CAS and return a JSON pointer
  • Smudge: Download content from XET CAS using a JSON pointer or merkle hash

§Example

ⓘ
use git_xet_filter::storage::{StorageBackend, XetStorage};
use git_xet_filter::config::XetConfig;

let config = XetConfig::huggingface();
let storage = XetStorage::new(&config).await?;

// Upload a file
let pointer = storage.clean_file(Path::new("model.safetensors")).await?;

// Download to bytes
let data = storage.smudge_bytes(&pointer).await?;

Structs§

XetStorage
XET storage backend implementation.

Traits§

StorageBackend
Storage backend trait for XET filter operations.