Struct lance_io::object_store::ObjectStore
source · pub struct ObjectStore {
pub inner: Arc<dyn OSObjectStore>,
/* private fields */
}Expand description
Wraps ObjectStore
Fields§
§inner: Arc<dyn OSObjectStore>Implementations§
source§impl ObjectStore
impl ObjectStore
sourcepub async fn from_uri(uri: &str) -> Result<(Self, Path)>
pub async fn from_uri(uri: &str) -> Result<(Self, Path)>
Parse from a string URI.
Returns the ObjectStore instance and the absolute path to the object.
sourcepub async fn from_uri_and_params(
uri: &str,
params: &ObjectStoreParams
) -> Result<(Self, Path)>
pub async fn from_uri_and_params( uri: &str, params: &ObjectStoreParams ) -> Result<(Self, Path)>
Parse from a string URI.
Returns the ObjectStore instance and the absolute path to the object.
pub fn from_path(str_path: &str) -> Result<(Self, Path)>
sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Returns true if the object store pointed to a local file system.
pub fn block_size(&self) -> usize
pub fn set_block_size(&mut self, new_size: usize)
pub fn base_path(&self) -> &Path
sourcepub async fn open(&self, path: &Path) -> Result<Box<dyn Reader>>
pub async fn open(&self, path: &Path) -> Result<Box<dyn Reader>>
Open a file for path.
Parameters
path: Absolute path to the file.
sourcepub async fn create_local_writer(path: &Path) -> Result<ObjectWriter>
pub async fn create_local_writer(path: &Path) -> Result<ObjectWriter>
Create an ObjectWriter from local std::path::Path
sourcepub async fn open_local(path: &Path) -> Result<Box<dyn Reader>>
pub async fn open_local(path: &Path) -> Result<Box<dyn Reader>>
Open an Reader from local std::path::Path
sourcepub async fn create(&self, path: &Path) -> Result<ObjectWriter>
pub async fn create(&self, path: &Path) -> Result<ObjectWriter>
Create a new file.
sourcepub async fn put(&self, path: &Path, content: &[u8]) -> Result<()>
pub async fn put(&self, path: &Path, content: &[u8]) -> Result<()>
A helper function to create a file and write content to it.
pub async fn delete(&self, path: &Path) -> Result<()>
pub async fn copy(&self, from: &Path, to: &Path) -> Result<()>
sourcepub async fn read_dir(&self, dir_path: impl Into<Path>) -> Result<Vec<String>>
pub async fn read_dir(&self, dir_path: impl Into<Path>) -> Result<Vec<String>>
Read a directory (start from base directory) and returns all sub-paths in the directory.
sourcepub async fn read_dir_all(
&self,
dir_path: impl Into<&Path> + Send,
unmodified_since: Option<DateTime<Utc>>
) -> Result<BoxStream<'_, Result<ObjectMeta>>>
pub async fn read_dir_all( &self, dir_path: impl Into<&Path> + Send, unmodified_since: Option<DateTime<Utc>> ) -> Result<BoxStream<'_, Result<ObjectMeta>>>
Read all files (start from base directory) recursively
unmodified_since can be specified to only return files that have not been modified since the given time.
sourcepub async fn remove_dir_all(&self, dir_path: impl Into<Path>) -> Result<()>
pub async fn remove_dir_all(&self, dir_path: impl Into<Path>) -> Result<()>
Remove a directory recursively.
pub fn remove_stream<'a>( &'a self, locations: BoxStream<'a, Result<Path>> ) -> BoxStream<'_, Result<Path>>
source§impl ObjectStore
impl ObjectStore
pub fn new( store: Arc<DynObjectStore>, location: Url, block_size: Option<usize>, wrapper: Option<Arc<dyn WrappingObjectStore>> ) -> Self
Trait Implementations§
source§impl Clone for ObjectStore
impl Clone for ObjectStore
source§fn clone(&self) -> ObjectStore
fn clone(&self) -> ObjectStore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ObjectStore
impl Debug for ObjectStore
Auto Trait Implementations§
impl !RefUnwindSafe for ObjectStore
impl Send for ObjectStore
impl Sync for ObjectStore
impl Unpin for ObjectStore
impl !UnwindSafe for ObjectStore
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