aboutsummaryrefslogtreecommitdiff
path: root/src/storage/in_memory.rs
blob: cde2335157bc1280b25e5a7013a3c4da1725e117 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use futures::FutureExt;
use crate::storage::*;

#[derive(Clone, Debug, Hash)]
pub struct FullMem {}
pub struct MemStore {}
pub struct MemRef {}
pub struct MemValue {}

#[derive(Clone, Debug, PartialEq)]
pub struct MemOrphanRowRef {}

impl IBuilders for FullMem {
    fn row_store(&self) -> Result<RowStore, StorageError> {
        unimplemented!();
    }

    fn blob_store(&self) -> Result<BlobStore, StorageError> {
        unimplemented!();
    }

    fn url(&self) -> &str {
        return "mem://unimplemented;"
    }
}

impl IRowStore for MemStore {
    fn row(&self, partition: &str, sort: &str) -> RowRef {
        unimplemented!();
    }

    fn select(&self, selector: Selector) -> AsyncResult<Vec<RowValue>> {
        unimplemented!()
    }

    fn rm(&self, selector: Selector) -> AsyncResult<()> {
        unimplemented!();
    }

    fn from_orphan(&self, orphan: OrphanRowRef) -> Result<RowRef, StorageError> {
        unimplemented!();
    }
}

impl IRowRef for MemRef {
    fn to_orphan(&self) -> OrphanRowRef {
        unimplemented!()
    }

    fn key(&self) -> (&str, &str) {
        unimplemented!();
    }

    /*fn clone_boxed(&self) -> RowRef {
        unimplemented!();
    }*/

    fn set_value(&self, content: Vec<u8>) -> RowValue {
        unimplemented!();
    }
    fn fetch(&self) -> AsyncResult<RowValue> {
        unimplemented!();
    }
    fn rm(&self) -> AsyncResult<()> {
        unimplemented!();
    }
    fn poll(&self) -> AsyncResult<RowValue> {
        async {
            let rv: RowValue = Box::new(MemValue{});
            Ok(rv)
        }.boxed()
    }
}

impl std::fmt::Debug for MemRef {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        unimplemented!();
    }
}

impl IRowValue for MemValue {
    fn to_ref(&self) -> RowRef {
        unimplemented!();
    }
    fn content(&self) -> ConcurrentValues {
        unimplemented!();
    }
    fn push(&self) -> AsyncResult<()> {
        unimplemented!();
    }
}