pub struct TableLocation(/* private fields */);Expand description
Table root location with table-scoped semantics.
This wraps StorageLocation and is used when callers need to treat the
location as a table root (e.g. log layout, segment paths, and helpers like
ensure_parquet_under_root).
Implementations§
Source§impl TableLocation
impl TableLocation
Sourcepub fn local(root: impl Into<PathBuf>) -> TableLocation
pub fn local(root: impl Into<PathBuf>) -> TableLocation
Creates a new TableLocation for a local filesystem path.
Sourcepub fn parse(spec: &str) -> Result<TableLocation, StorageError>
pub fn parse(spec: &str) -> Result<TableLocation, StorageError>
Parse a user-facing table location string into a TableLocation. v0.1: only local filesystem paths are supported.
Sourcepub fn storage(&self) -> &StorageLocation
pub fn storage(&self) -> &StorageLocation
Return the underlying StorageLocation
Sourcepub async fn ensure_parquet_under_root(
&self,
parquet_path: &Path,
) -> Result<PathBuf, StorageError>
pub async fn ensure_parquet_under_root( &self, parquet_path: &Path, ) -> Result<PathBuf, StorageError>
Ensure parquet_path is under this table root.
If not, copy it into data/<filename> and return the relative path.
Trait Implementations§
Source§impl AsRef<StorageLocation> for TableLocation
impl AsRef<StorageLocation> for TableLocation
Source§fn as_ref(&self) -> &StorageLocation
fn as_ref(&self) -> &StorageLocation
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for TableLocation
impl Clone for TableLocation
Source§fn clone(&self) -> TableLocation
fn clone(&self) -> TableLocation
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for TableLocation
impl RefUnwindSafe for TableLocation
impl Send for TableLocation
impl Sync for TableLocation
impl Unpin for TableLocation
impl UnsafeUnpin for TableLocation
impl UnwindSafe for TableLocation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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