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 parse_url_opts(
object_store_url: &str,
) -> Result<(Arc<dyn ObjectStore>, Path), Error>
pub fn parse_url_opts( object_store_url: &str, ) -> Result<(Arc<dyn ObjectStore>, Path), Error>
Parses an object store URL into the raw (unwrapped, un-prefixed) store and
the lake root path, using the same env-var-derived options as connect /
connect_with_layer. Exposed so callers that need to apply their own layer
(e.g. the object cache client) and also need the root prefix (e.g. to key a
write-time cache warm the same way PrefixStore keys a demand read) don’t
have to re-parse the URL or duplicate the env-var lowercasing.
Sourcepub fn connect_with_layer(
object_store_url: &str,
layer: impl FnOnce(Arc<dyn ObjectStore>) -> Arc<dyn ObjectStore>,
) -> Result<BlobStorage, Error>
pub fn connect_with_layer( object_store_url: &str, layer: impl FnOnce(Arc<dyn ObjectStore>) -> Arc<dyn ObjectStore>, ) -> Result<BlobStorage, Error>
Connects to a blob storage service and applies a layer to the raw store before
wrapping it in PrefixStore. The layer receives the full-bucket store so its
keys are bucket-relative (including the lake root prefix).
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.
Sourcepub async fn delete(&self, obj_path: &str) -> Result<(), Error>
pub async fn delete(&self, obj_path: &str) -> Result<(), Error>
Deletes 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 UnsafeUnpin 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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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>
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>
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>
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>,
Layered].