pub struct OpenDalBlobs { /* private fields */ }Expand description
Content-addressed blobs on an OpenDAL operator.
Implementations§
Source§impl OpenDalBlobs
impl OpenDalBlobs
Sourcepub fn new(op: Operator, prefix: impl Into<String>) -> Self
pub fn new(op: Operator, prefix: impl Into<String>) -> Self
Store blobs under prefix on this operator.
Sourcepub fn for_tenant(self, tenant: TenantId) -> Self
pub fn for_tenant(self, tenant: TenantId) -> Self
Serve one tenant.
Blobs are content-addressed, so without this two tenants writing the same bytes share one object — and erasing it for one destroys it for the other while reporting both requests discharged. The tenant leads the path, so the sharing cannot happen.
Trait Implementations§
Source§impl BlobStore for OpenDalBlobs
impl BlobStore for OpenDalBlobs
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Digest, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Digest, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store bytes and return the address they landed at. Read more
Source§fn put_at<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: Digest,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_at<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: Digest,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store bytes at an address that is not their own digest. Read more
Source§fn get_raw<'life0, 'async_trait>(
&'life0 self,
digest: Digest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_raw<'life0, 'async_trait>(
&'life0 self,
digest: Digest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch exactly what is stored, without verifying it against the address. Read more
Source§fn get<'life0, 'async_trait>(
&'life0 self,
digest: Digest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
digest: Digest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch bytes, verifying them against the address before returning. Read more
Source§fn expire<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: Digest,
at: Timestamp,
reason: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn expire<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: Digest,
at: Timestamp,
reason: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Drop a blob’s bytes, leaving a tombstone that says it was deliberate. Read more
Source§impl Clone for OpenDalBlobs
impl Clone for OpenDalBlobs
Auto Trait Implementations§
impl !RefUnwindSafe for OpenDalBlobs
impl !UnwindSafe for OpenDalBlobs
impl Freeze for OpenDalBlobs
impl Send for OpenDalBlobs
impl Sync for OpenDalBlobs
impl Unpin for OpenDalBlobs
impl UnsafeUnpin for OpenDalBlobs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.