#[non_exhaustive]pub struct IncludeRequest<'a> {
pub spec: &'a str,
pub from_name: &'a str,
pub from_id: Option<&'a str>,
pub stack: Vec<String>,
pub size_remaining: Option<usize>,
pub location: Location,
}Expand description
A request passed to the include resolver to resolve an include directive.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.spec: &'a strThe include specification (e.g. the path or URL).
from_name: &'a strThe name of the file or source currently being parsed (top of the include stack).
from_id: Option<&'a str>The canonical identity of the source currently being parsed, or None for the root parser.
stack: Vec<String>The full chain of inclusions leading to this request, with the current file at the end.
size_remaining: Option<usize>Remaining decoded byte quota available for additional reader-backed input, if configured.
location: LocationThe location in the source file where the include was requested.
Implementations§
Source§impl<'a> IncludeRequest<'a>
impl<'a> IncludeRequest<'a>
Sourcepub fn new(spec: &'a str, from_name: &'a str, location: Location) -> Self
pub fn new(spec: &'a str, from_name: &'a str, location: Location) -> Self
Construct a root-level include request.
This is primarily useful when testing a resolver directly. Parser-created requests populate the same fields and may include parent-source and budget metadata.
Sourcepub fn with_from_id(self, from_id: &'a str) -> Self
pub fn with_from_id(self, from_id: &'a str) -> Self
Set the canonical identity of the source containing the include.
Sourcepub fn with_stack(self, stack: Vec<String>) -> Self
pub fn with_stack(self, stack: Vec<String>) -> Self
Set the include chain leading to this request.
Sourcepub fn with_size_remaining(self, size_remaining: usize) -> Self
pub fn with_size_remaining(self, size_remaining: usize) -> Self
Set the remaining reader-input byte budget.