pub struct BlobStorage { /* private fields */ }Expand description
A client for interacting with blob storage.
This struct wraps an ObjectStore and prefixes all paths with a root path,
providing a convenient way to interact with a specific “folder” within the blob storage.
Implementations§
Source§impl BlobStorage
impl BlobStorage
Sourcepub fn new(
blob_store: Arc<dyn ObjectStore>,
blob_store_root: Path,
) -> BlobStorage
pub fn new( blob_store: Arc<dyn ObjectStore>, blob_store_root: Path, ) -> BlobStorage
Creates a new BlobStorage instance.
Sourcepub fn connect(object_store_url: &str) -> Result<BlobStorage, Error>
pub fn connect(object_store_url: &str) -> Result<BlobStorage, Error>
Connects to a blob storage service using the provided URL.
Sourcepub fn inner(&self) -> Arc<dyn ObjectStore>
pub fn inner(&self) -> Arc<dyn ObjectStore>
Returns a shared reference to the inner ObjectStore.
Sourcepub async fn put(&self, obj_path: &str, buffer: Bytes) -> Result<(), Error>
pub async fn put(&self, obj_path: &str, buffer: Bytes) -> Result<(), Error>
Puts a blob into storage at the specified path.
Sourcepub async fn read_blob(&self, obj_path: &str) -> Result<Bytes, Error>
pub async fn read_blob(&self, obj_path: &str) -> Result<Bytes, Error>
Reads a blob from storage at the specified path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlobStorage
impl !RefUnwindSafe for BlobStorage
impl Send for BlobStorage
impl Sync for BlobStorage
impl Unpin for BlobStorage
impl !UnwindSafe for BlobStorage
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].