pub struct Resolution {
pub spec: PathSpec,
pub src: Option<String>,
pub val: Value,
pub found: bool,
pub search: Vec<String>,
pub err: Option<Box<TabnasError>>,
}Expand description
A source and where it was found.
Fields§
§spec: PathSpecThe normalized path, rewritten by the resolver when an implicit extension or an index file matched.
src: Option<String>The source text. None when nothing was found.
val: ValueThe processed value, filled by a Processor.
found: boolWhether a source was found.
search: Vec<String>Every path that was tried, for the not-found report.
err: Option<Box<TabnasError>>A failure while PROCESSING found source, for example a nested reference inside it that could not be resolved. The plugin propagates it so the parse fails, matching TypeScript, which lets a nested parse error escape rather than substituting raw text.
Implementations§
Source§impl Resolution
impl Resolution
Sourcepub fn not_found(spec: PathSpec) -> Self
pub fn not_found(spec: PathSpec) -> Self
A resolution that found nothing, for the spec it was built from.
Sourcepub fn found(
spec: PathSpec,
full: impl Into<String>,
src: impl Into<String>,
) -> Self
pub fn found( spec: PathSpec, full: impl Into<String>, src: impl Into<String>, ) -> Self
A resolution that found src at full.
Sourcepub fn with_search(self, search: Vec<String>) -> Self
pub fn with_search(self, search: Vec<String>) -> Self
Record the paths that were searched.
Trait Implementations§
Source§impl Clone for Resolution
impl Clone for Resolution
Source§impl Debug for Resolution
impl Debug for Resolution
Auto Trait Implementations§
impl !RefUnwindSafe for Resolution
impl !UnwindSafe for Resolution
impl Freeze for Resolution
impl Send for Resolution
impl Sync for Resolution
impl Unpin for Resolution
impl UnsafeUnpin for Resolution
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