pub struct QuillSource { /* private fields */ }Expand description
A quill source bundle — pure data parsed from an authored quill directory.
A QuillSource is the file-bundle, config, and metadata; it has no rendering
ability. The engine composes a QuillSource with a resolved backend into a
renderable Quill (see quillmark::Quill).
Implementations§
Source§impl QuillSource
impl QuillSource
Sourcepub fn from_tree(root: FileTreeNode) -> Result<Self, Vec<Diagnostic>>
pub fn from_tree(root: FileTreeNode) -> Result<Self, Vec<Diagnostic>>
Create a QuillSource from a tree structure.
This is the authoritative method for creating a QuillSource from an
in-memory file tree. Filesystem walking belongs upstream (see
quillmark::Quillmark::quill_from_path).
§Arguments
root- The root node of the file tree
§Errors
Returns a non-empty Vec<Diagnostic> describing every problem found.
When Quill.yaml itself contains multiple errors they are all
reported together; subsequent failures (missing plate, malformed
example) surface as single-element vectors.
Source§impl QuillSource
impl QuillSource
Sourcepub fn get_file<P: AsRef<Path>>(&self, path: P) -> Option<&[u8]>
pub fn get_file<P: AsRef<Path>>(&self, path: P) -> Option<&[u8]>
Get file contents by path (relative to quill root)
Sourcepub fn file_exists<P: AsRef<Path>>(&self, path: P) -> bool
pub fn file_exists<P: AsRef<Path>>(&self, path: P) -> bool
Check if a file exists in memory
Sourcepub fn dir_exists<P: AsRef<Path>>(&self, path: P) -> bool
pub fn dir_exists<P: AsRef<Path>>(&self, path: P) -> bool
Check if a directory exists in memory
Sourcepub fn list_files<P: AsRef<Path>>(&self, path: P) -> Vec<String>
pub fn list_files<P: AsRef<Path>>(&self, path: P) -> Vec<String>
List files in a directory (non-recursive, returns file names only)
Sourcepub fn list_subdirectories<P: AsRef<Path>>(&self, path: P) -> Vec<String>
pub fn list_subdirectories<P: AsRef<Path>>(&self, path: P) -> Vec<String>
List subdirectories in a directory (non-recursive, returns directory names only)
Sourcepub fn list_directory<P: AsRef<Path>>(&self, dir_path: P) -> Vec<PathBuf>
pub fn list_directory<P: AsRef<Path>>(&self, dir_path: P) -> Vec<PathBuf>
List all files in a directory (returns paths relative to quill root)
Source§impl QuillSource
impl QuillSource
Sourcepub fn backend_id(&self) -> &str
pub fn backend_id(&self) -> &str
The backend identifier declared in Quill.yaml (e.g. "typst").
Sourcepub fn metadata(&self) -> &HashMap<String, QuillValue>
pub fn metadata(&self) -> &HashMap<String, QuillValue>
Quill-specific metadata parsed from Quill.yaml.
Sourcepub fn config(&self) -> &QuillConfig
pub fn config(&self) -> &QuillConfig
The parsed schema configuration.
Sourcepub fn files(&self) -> &FileTreeNode
pub fn files(&self) -> &FileTreeNode
The in-memory file tree for this quill.
Trait Implementations§
Source§impl Clone for QuillSource
impl Clone for QuillSource
Source§fn clone(&self) -> QuillSource
fn clone(&self) -> QuillSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more