What is rustic_core?
rustic_core is a powerful Rust library for creating fast, encrypted, and deduplicated backups. It serves as the core foundation for rustic-rs, a modern backup solution written in Rust. The library implements the restic repository format, making it fully compatible with existing restic repositories while providing a native Rust API for building backup applications.Key Features
Fast & Efficient
Parallel processing with rayon, efficient chunking with CDC (Content-Defined Chunking), and optimized cryptographic operations
Encrypted
AES-256-CTR encryption with Poly1305 authentication ensures your data is secure at rest
Deduplicated
Content-defined chunking identifies duplicate data blocks across all snapshots, saving storage space
Restic Compatible
Read and write repositories in the restic format, allowing seamless interoperability
Core Capabilities
rustic_core provides comprehensive backup operations:- Repository Management: Initialize, open, and configure backup repositories
- Backup Operations: Create snapshots with incremental, deduplicated backups
- Restore Operations: Restore full snapshots or individual files/directories
- Snapshot Management: List, filter, group, and forget snapshots with flexible retention policies
- Repository Maintenance: Check repository integrity, prune unused data, repair index files
- Multi-Backend Support: Local filesystem, REST server, and more through rustic_backend
- Virtual File System: Access repository contents through a VFS interface
rustic_core is in active development and its API may change in upcoming releases. We welcome feedback through GitHub Discussions.
Why rustic_core?
Built with Rust
Leveraging Rust’s safety guarantees and performance characteristics:- Memory safety without garbage collection
- Thread safety with fearless concurrency
- Zero-cost abstractions for optimal performance
- Rich type system preventing common errors at compile time
Restic Compatibility
rustic_core maintains full compatibility with the restic repository format:- Read existing repositories: Access backups created with restic
- Shared repositories: Use the same repository with both tools
- Migration path: Transition from restic to rustic_core gradually
- Battle-tested format: Benefit from restic’s proven repository design
The restic repository format is well-documented and designed for long-term archival, with built-in integrity checking and encryption.
Architecture Overview
The library is structured around a statefulRepository type:
- Open: Basic operations like listing snapshots, checking repository
- IndexedIds: Required for backup operations, maintains blob index
- IndexedTree: Optimized for operations on tree structures
- IndexedFull: Full index for advanced operations like pruning
Key Types
Repository Types
Repository<S>: Main entry point, parameterized by stateRepositoryOptions: Configure repository access (passwords, hot/cold storage, etc.)RepositoryBackends: Backend storage abstraction
Configuration Types
ConfigOptions: Repository configuration (chunker polynomial, compression, etc.)KeyOptions: Encryption key optionsBackupOptions: Backup behavior configurationRestoreOptions: Restore behavior configurationPruneOptions: Data pruning configuration
Data Types
SnapshotFile: Represents a backup snapshotNode: File system entry (file, directory, symlink, etc.)Tree: Directory tree structurePackFile: Container for multiple blobsIndexFile: Maps blob IDs to pack files
Use Cases
rustic_core is ideal for:- Building custom backup tools with Rust
- Integrating backup functionality into Rust applications
- Creating specialized backup workflows
- Developing backup automation systems
- Building backup GUIs or web interfaces
Resources
GitHub Repository
Source code, issue tracker, and contributions
API Documentation
Complete API reference on docs.rs
Discussions
Ask questions and share ideas
Discord Community
Chat with other users and developers
License
rustic_core is dual-licensed under:- Apache License, Version 2.0
- MIT License
Next Steps
Installation
Add rustic_core to your project
Quick Start
Create your first backup in minutes