Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Storage Rust Bindings
This repository provides Rust bindings for the Storage library, enabling seamless integration with Rust projects.
Usage
Include in your Cargo project:
[]
= "0.2.0"
To learn how to use those bindings, take a look at the example project or the integration tests directory.
Building
Building will automatically:
- Fetch the pinned static binary release of libstorage for your platform from the logos-storage-nim-bin repository releases
- Generate Rust bindings and compile the crate
Note: The first build will download the prebuilt binary (~50MB). Subsequent builds will use the cached version.
Caching
Prebuilt binaries are automatically cached to improve build performance and reduce network usage.
Cache Location
Prebuilt binaries are cached in a platform-specific location:
- Linux:
~/.cache/storage-bindings/ - macOS:
~/Library/Caches/storage-bindings/ - Windows:
%LOCALAPPDATA%\storage-bindings\cache\
The cache is organized by version and platform:
~/.cache/storage-bindings/
├── v0.3.0/ # Stable release
│ ├── linux-amd64/
│ │ ├── libstorage.a
│ │ ├── libstorage.h
│ │ └── SHA256SUMS.txt
│ └── darwin-arm64/
│ └── ...
├── master-60861d6a/ # Nightly release
│ ├── linux-amd64/
│ └── darwin-arm64/
└── master-2b3d4e5/
└── ...
Managing the Cache
Force Re-download
To force a fresh download without clearing the cache:
STORAGE_BINDINGS_FORCE_DOWNLOAD=1
Clean Entire Cache
To remove all cached binaries:
# Linux/macOS
# Windows
# Or using the build script
STORAGE_BINDINGS_CLEAN_CACHE=1
Supported Platforms
- Linux x86_64 (x86_64-unknown-linux-gnu)
- Linux ARM64 (aarch64-unknown-linux-gnu)
- macOS Apple Silicon (aarch64-apple-darwin)
- macOS Intel (x86_64-apple-darwin)
Libstorage Version Pinning
This crate is pinned to a stable release by default. You can override the version if needed. See available versions here.
Option 1: Cargo.toml metadata
Add to your Cargo.toml:
[]
= "v0.3.0"
Option 2: Environment variable (for local overrides)
Using Latest Stable Release
To use the latest stable release:
[]
# Leave empty or remove the section to use latest
Or via environment variable:
Building from source
# or, for debug
Building using local libraries
To use locally built libraries instead of downloading from GitHub, set the STORAGE_BINDINGS_LOCAL_LIBS environment variable to the path of the dist folder:
Testing
The library includes comprehensive integration tests that demonstrate all major functionality.
Running All Tests
# Run all tests (unit tests + integration tests)
Running Specific Tests
# Run only unit tests
# Run only integration tests
Available Integration Tests
- basic_usage: Demonstrates basic upload/download functionality
- chunk_operations: Shows chunk-based upload and download operations
- debug_operations: Demonstrates debug operations and logging
- p2p_networking: Shows P2P networking operations
- storage_management: Demonstrates storage management operations
- two_node_network: Shows two-node network setup and data transfer
- thread_safe_tests: Tests thread-safe node lifecycle and concurrent operations