start/db/catalog/
mod.rs

1use std::{cell::RefCell, rc::Rc};
2
3use collection::CollectionCatalog;
4use session::SessionCatalog;
5
6use super::storage::start_storage::StartStorage;
7
8pub mod collection;
9pub mod database;
10pub mod session;
11
12pub struct Catalog {
13    collection_catalog: Rc<RefCell<CollectionCatalog>>,
14    session_catalog: SessionCatalog
15}
16
17impl Catalog {
18    pub fn new(_ss: Rc<RefCell<StartStorage>>) -> Self {
19        Self {
20            collection_catalog: Rc::new(RefCell::new(CollectionCatalog::new())),
21            session_catalog: SessionCatalog
22        }
23    }
24
25    pub fn collection(&self) -> Rc<RefCell<CollectionCatalog>> {
26        self.collection_catalog.clone()
27    }
28
29    pub fn session(&self) -> SessionCatalog {
30        SessionCatalog
31    }
32}