MCPcopy Create free account
hub / github.com/Rustixir/darkbird / main

Function main

example/before-vsn-6.1.0-migration.rs:2–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1#[tokio::main]
2async fn main() {
3
4 // path must be full path for migration::run
5 let path = "/home/ai/Documents/Rust/blackbird";
6
7 let storage_name = "blackbird";
8 let total_page_size = 1000;
9
10
11
12 // if storage exist, next time can call migration::run before calling storage::open,
13 // for update schmea (key, document)
14
15 migration::run(path,
16 storage_name,
17 total_page_size,
18 |rquery: RQuery<Pid, User>| -> RQuery<Pid, User2> {
19 match rquery {
20 RQuery::Insert(pid, doc) => {
21 RQuery::Insert(pid, User2::new(doc.fullname, 23))
22 }
23 RQuery::Remove(pid) => {
24 RQuery::Remove(pid)
25 }
26 }
27 });
28
29
30
31
32 let s = Storage::<Pid, User2>::open(path, storage_name, total_page_size, true).await.unwrap();
33
34
35}
36
37
38type Pid = String;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected