pub struct HybridStorage<C> { /* private fields */ }Expand description
Hybrid storage combining hot in-memory and cold persistent storage.
Implementations§
Source§impl<C> HybridStorage<C>
impl<C> HybridStorage<C>
Sourcepub fn new(cold: C, config: HybridConfig) -> Self
pub fn new(cold: C, config: HybridConfig) -> Self
Creates a new hybrid storage.
Sourcepub fn with_defaults(cold: C) -> Self
pub fn with_defaults(cold: C) -> Self
Creates with default configuration.
Sourcepub fn get(&self, id: &ObjectId) -> Result<Option<GitObject>>
pub fn get(&self, id: &ObjectId) -> Result<Option<GitObject>>
Gets an object, checking hot storage first.
Sourcepub fn put(&self, object: GitObject) -> Result<ObjectId>
pub fn put(&self, object: GitObject) -> Result<ObjectId>
Puts an object (always goes to hot first, then cold).
Sourcepub fn list_objects(&self) -> Result<Vec<ObjectId>>
pub fn list_objects(&self) -> Result<Vec<ObjectId>>
Lists all object IDs.
Sourcepub fn stats(&self) -> HybridStatsSnapshot
pub fn stats(&self) -> HybridStatsSnapshot
Returns storage statistics.
Trait Implementations§
Auto Trait Implementations§
impl<C> !Freeze for HybridStorage<C>
impl<C> !RefUnwindSafe for HybridStorage<C>
impl<C> Send for HybridStorage<C>
impl<C> Sync for HybridStorage<C>
impl<C> Unpin for HybridStorage<C>
impl<C> !UnwindSafe for HybridStorage<C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more