pub struct InputTrie { /* private fields */ }Expand description
Represents a prefix trie based on input paths.
This is used to determine guest paths for inputs.
From the root to a terminal node represents a unique input.
Implementations§
Source§impl InputTrie
impl InputTrie
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new inputs trie without a guest inputs directory.
Terminal nodes in the trie will not be mapped to guest paths.
Sourcepub fn new_with_guest_dir(guest_inputs_dir: &'static str) -> Self
pub fn new_with_guest_dir(guest_inputs_dir: &'static str) -> Self
Constructs a new inputs trie with a guest inputs directory.
Inputs with a host path will be mapped to a guest path relative to the guest inputs directory.
Note: a guest inputs directory is always a Unix-style path.
§Panics
Panics if the guest inputs directory does not end with a slash.
Sourcepub fn insert(
&mut self,
kind: ContentKind,
path: &str,
base_dir: &EvaluationPath,
) -> Result<Option<usize>>
pub fn insert( &mut self, kind: ContentKind, path: &str, base_dir: &EvaluationPath, ) -> Result<Option<usize>>
Inserts a new input into the trie.
The path is either a local or remote input path.
Relative paths are made absolute via the provided base path.
If an input was added, returns Ok(Some(index)) where index is the
index of the input in the trie.
Returns Ok(None) if the provided path was already a guest input path.
Returns an error for an invalid input path.
Sourcepub fn as_slice_mut(&mut self) -> &mut [Input]
pub fn as_slice_mut(&mut self) -> &mut [Input]
Gets the inputs of the trie as a mutable slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputTrie
impl RefUnwindSafe for InputTrie
impl Send for InputTrie
impl Sync for InputTrie
impl Unpin for InputTrie
impl UnwindSafe for InputTrie
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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