pub enum Source {
Bytes {
name: RawStr,
data: Bytes,
},
Path(PathBuf),
ConfinedPath {
path: PathBuf,
root: PathBuf,
},
Fetch {
name: RawStr,
fetch: Arc<dyn Fetch>,
},
}Expand description
Something to load. Every kind is bounded by Limits::max_input_bytes:
bytes longer than it, however they came, are refused
(LimitKind::InputBytes) before anything detects, parses or keeps
them, so a refused fetch’s bytes drop at once, with any charge they
carry.
Variants§
Bytes
Bytes in memory, under a name: refused above the bound from their length.
Path(PathBuf)
A path the core reads whole into memory, with read_path: refused
above Limits::max_input_bytes, and charged to the input’s meter
before it is read. (Not mapped: a mapping of a file another process
truncates faults, and the core takes no new dependency for it; a
caller who wants a mapping passes Source::Bytes or
Source::Fetch, whose bytes are the caller’s.)
ConfinedPath
A local path whose physical file and split companions must remain
beneath root. The restriction is retained if a dependency reopens.
Fields
Fetch
Bytes fetched on demand: refused above the bound from the size the
fetcher states (Fetch::size_hint) before it is fetched, and from
the length of the bytes it returns.