MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / new

Method new

graphlite/src/storage/storage_manager.rs:64–79  ·  view source on GitHub ↗

Create a new storage manager with the specified method and configuration

(
        path: P,
        method: StorageMethod,
        storage_type: StorageType,
    )

Source from the content-addressed store, hash-verified

62impl StorageManager {
63 /// Create a new storage manager with the specified method and configuration
64 pub fn new<P: AsRef<Path>>(
65 path: P,
66 method: StorageMethod,
67 storage_type: StorageType,
68 ) -> Result<Self, Box<dyn std::error::Error>> {
69 info!(
70 "Creating storage manager with method: {:?}, storage type: {:?}",
71 method, storage_type
72 );
73
74 match method {
75 StorageMethod::DiskOnly => Self::init_disk_only(path, storage_type),
76 StorageMethod::MemoryOnly => Self::init_memory_only(path, storage_type),
77 StorageMethod::DiskAndMemory => Self::init_disk_and_memory(path, storage_type),
78 }
79 }
80
81 /// Initialize storage manager with disk-only storage (Sled)
82 fn init_disk_only<P: AsRef<Path>>(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected