radicle_protocol/worker/
fetch.rs1pub mod error;
2
3use std::collections::HashSet;
4
5use radicle::crypto::PublicKey;
6use radicle::{identity::DocAt, storage::RefUpdate};
7
8#[derive(Debug, Clone)]
9pub struct FetchResult {
10 pub updated: Vec<RefUpdate>,
12 pub namespaces: HashSet<PublicKey>,
14 pub clone: bool,
16 pub doc: DocAt,
18}
19
20impl FetchResult {
21 pub fn new(doc: DocAt) -> Self {
22 Self {
23 updated: vec![],
24 namespaces: HashSet::new(),
25 clone: false,
26 doc,
27 }
28 }
29}
30
31#[cfg(any(test, feature = "test"))]
32impl qcheck::Arbitrary for FetchResult {
33 fn arbitrary(g: &mut qcheck::Gen) -> Self {
34 FetchResult {
35 updated: vec![],
36 namespaces: HashSet::arbitrary(g),
37 clone: bool::arbitrary(g),
38 doc: DocAt::arbitrary(g),
39 }
40 }
41}