pub struct BucketManager { /* private fields */ }Expand description
Manages creation and lifecycle of object store buckets.
Buckets are logical containers within a pool. The bucket manager tracks which buckets exist and their metadata.
§Example
use grafos_store::BucketManager;
let mut mgr = BucketManager::new("default");
mgr.create("images").unwrap();
mgr.create("logs").unwrap();
assert!(mgr.exists("images"));
assert_eq!(mgr.list().len(), 2);Implementations§
Source§impl BucketManager
impl BucketManager
Sourcepub fn create(&mut self, name: &str) -> Result<&BucketInfo>
pub fn create(&mut self, name: &str) -> Result<&BucketInfo>
Create a new bucket. Returns an error if the bucket already exists.
Sourcepub fn drop_bucket(&mut self, name: &str) -> bool
pub fn drop_bucket(&mut self, name: &str) -> bool
Drop (delete) a bucket by name. Returns true if it existed.
Sourcepub fn create_bucket(&mut self, config: BucketConfig) -> Result<BucketHandle>
pub fn create_bucket(&mut self, config: BucketConfig) -> Result<BucketHandle>
Create a bucket from a configuration, returning a typed handle.
Sourcepub fn open_bucket(&self, name: &str) -> Result<BucketHandle>
pub fn open_bucket(&self, name: &str) -> Result<BucketHandle>
Open an existing bucket by name, returning a typed handle.
Sourcepub fn publish(&mut self, handle: &BucketHandle) -> BucketLocator
pub fn publish(&mut self, handle: &BucketHandle) -> BucketLocator
Publish a bucket handle as a locator for cross-app discovery.
Sourcepub fn discover(&self, name: &str) -> Option<&BucketLocator>
pub fn discover(&self, name: &str) -> Option<&BucketLocator>
Discover a previously published bucket locator by name.
Auto Trait Implementations§
impl Freeze for BucketManager
impl RefUnwindSafe for BucketManager
impl Send for BucketManager
impl Sync for BucketManager
impl Unpin for BucketManager
impl UnwindSafe for BucketManager
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