pub struct StorageRoots { /* private fields */ }Expand description
Optional roots used to resolve logical input and output paths.
Relative paths are joined to their corresponding root. Absolute paths are
always treated as explicit locations and bypass the roots. Relative paths
containing .. are rejected so a logical dataset path cannot escape its
configured root.
Implementations§
Source§impl StorageRoots
impl StorageRoots
Sourcepub const fn new(
input_root: Option<PathBuf>,
output_root: Option<PathBuf>,
) -> StorageRoots
pub const fn new( input_root: Option<PathBuf>, output_root: Option<PathBuf>, ) -> StorageRoots
Creates a root mapping. Either root may be omitted.
Sourcepub fn input_root(&self) -> Option<&Path>
pub fn input_root(&self) -> Option<&Path>
Returns the configured input root, if any.
Sourcepub fn output_root(&self) -> Option<&Path>
pub fn output_root(&self) -> Option<&Path>
Returns the configured output root, if any.
Sourcepub fn resolve_input(&self, path: impl AsRef<Path>) -> Result<PathBuf, IoError>
pub fn resolve_input(&self, path: impl AsRef<Path>) -> Result<PathBuf, IoError>
Resolves a logical input path against the configured input root.
Sourcepub fn resolve_output(&self, path: impl AsRef<Path>) -> Result<PathBuf, IoError>
pub fn resolve_output(&self, path: impl AsRef<Path>) -> Result<PathBuf, IoError>
Resolves a logical output path against the configured output root.
Sourcepub fn ensure_output_parent(
&self,
path: impl AsRef<Path>,
) -> Result<(), IoError>
pub fn ensure_output_parent( &self, path: impl AsRef<Path>, ) -> Result<(), IoError>
Creates the parent directory for an explicit output path when needed.
Sourcepub fn preflight_output(
&self,
required_free_bytes: u64,
) -> Result<StoragePreflight, IoError>
pub fn preflight_output( &self, required_free_bytes: u64, ) -> Result<StoragePreflight, IoError>
Checks the configured output root before opening an external data source.
Trait Implementations§
Source§impl Clone for StorageRoots
impl Clone for StorageRoots
Source§fn clone(&self) -> StorageRoots
fn clone(&self) -> StorageRoots
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StorageRoots
impl Debug for StorageRoots
Source§impl Default for StorageRoots
impl Default for StorageRoots
Source§fn default() -> StorageRoots
fn default() -> StorageRoots
Returns the “default value” for a type. Read more
Source§impl PartialEq for StorageRoots
impl PartialEq for StorageRoots
Source§fn eq(&self, other: &StorageRoots) -> bool
fn eq(&self, other: &StorageRoots) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StorageRoots
impl StructuralPartialEq for StorageRoots
Auto Trait Implementations§
impl Freeze for StorageRoots
impl RefUnwindSafe for StorageRoots
impl Send for StorageRoots
impl Sync for StorageRoots
impl Unpin for StorageRoots
impl UnsafeUnpin for StorageRoots
impl UnwindSafe for StorageRoots
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().