recomp 0.3.1

Reusable components
Documentation
use object_store::memory::InMemory;

use super::super::ObjectStorage;

/// Builder for in-memory object storage.
#[derive(Clone, Debug)]
pub struct MemoryObjectStorageBuilder {
    name: String,
}

impl MemoryObjectStorageBuilder {
    pub(crate) fn new(name: impl Into<String>) -> Self {
        Self { name: name.into() }
    }

    /// Builds the object storage component.
    #[must_use]
    pub fn build(self) -> ObjectStorage<InMemory> {
        ObjectStorage::from_store(self.name, InMemory::new())
    }
}