Skip to main content

crabtalk_memory/
op.rs

1use crate::entry::EntryKind;
2
3/// Write operations. `Update` rewrites content and aliases but preserves
4/// `kind` — an archive stays an archive for life. Use `Remove` + `Add` to
5/// change kind.
6#[derive(Clone, Debug)]
7pub enum Op {
8    Add {
9        name: String,
10        content: String,
11        aliases: Vec<String>,
12        kind: EntryKind,
13    },
14    Update {
15        name: String,
16        content: String,
17        aliases: Vec<String>,
18    },
19    Alias {
20        name: String,
21        aliases: Vec<String>,
22    },
23    Remove {
24        name: String,
25    },
26}