BlockObjectStore

Struct BlockObjectStore 

Source
pub struct BlockObjectStore { /* private fields */ }
Expand description

Durable object store backed by leased block storage.

Objects are appended sequentially starting after the superblock. An in-memory index maps URIs to their block locations. The index is checkpointed to reserved blocks at the end of the device.

Deleted objects are tombstoned in the index but their blocks are not reclaimed (append-only).

Implementations§

Source§

impl BlockObjectStore

Source

pub fn new(num_blocks: u64) -> Result<Self>

Create a new block object store with the given number of blocks.

Reserves the last 10% of blocks (minimum 4) for index checkpoints.

Source

pub fn checkpoint_index(&self) -> Result<()>

Checkpoint the in-memory index to the reserved block region.

Trait Implementations§

Source§

impl ObjectStore for BlockObjectStore

Source§

fn put( &mut self, uri: &FabricUri, data: &[u8], opts: Option<PutOptions>, ) -> Result<()>

Store an object at the given URI. Read more
Source§

fn get(&self, uri: &FabricUri) -> Result<Option<ObjectData>>

Retrieve an object by URI. Read more
Source§

fn head(&self, uri: &FabricUri) -> Result<Option<ObjectInfo>>

Retrieve object metadata without reading the data.
Source§

fn delete(&mut self, uri: &FabricUri) -> Result<bool>

Delete an object by URI. Returns true if the object existed.
Source§

fn list(&self, pool: &str, bucket: &str, prefix: &str) -> Result<Vec<String>>

List object keys matching a prefix within a bucket. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.