mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
21 lines
601 B
Rust
21 lines
601 B
Rust
//! `check` example
|
|
use rustic_core::{CheckOpts, Repository, RepositoryOptions};
|
|
use simplelog::{Config, LevelFilter, SimpleLogger};
|
|
use std::error::Error;
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
// Display info logs
|
|
let _ = SimpleLogger::init(LevelFilter::Info, Config::default());
|
|
|
|
// Open repository
|
|
let repo_opts = RepositoryOptions::default()
|
|
.repository("/tmp/repo")
|
|
.password("test");
|
|
let repo = Repository::new(&repo_opts)?.open()?;
|
|
|
|
// Check respository with standard options
|
|
let opts = CheckOpts::default();
|
|
repo.check(opts)?;
|
|
Ok(())
|
|
}
|