nu_protocol/engine/cached_file.rs
1use crate::Span;
2use std::sync::Arc;
3
4/// Unit of cached source code
5#[derive(Clone, derive_more::Debug)]
6pub struct CachedFile {
7 // Use Arcs of slice types for more compact representation (capacity less)
8 // Could possibly become an `Arc<PathBuf>`
9 /// The file name with which the code is associated (also includes REPL input)
10 pub name: Arc<str>,
11 /// Source code as raw bytes
12 #[debug("[...]")]
13 pub content: Arc<[u8]>,
14 /// global span coordinates that are covered by this [`CachedFile`]
15 pub covered_span: Span,
16}