pub struct Quill {
pub glue_template: String,
pub metadata: HashMap<String, Value>,
pub base_path: PathBuf,
pub name: String,
pub glue_file: String,
pub files: HashMap<PathBuf, FileEntry>,
}Expand description
A quill template bundle. See module docs for examples.
Fields§
§glue_template: StringThe template content
metadata: HashMap<String, Value>Quill-specific metadata
base_path: PathBufBase path for resolving relative paths
name: StringName of the quill
glue_file: StringGlue template file name
files: HashMap<PathBuf, FileEntry>In-memory file system
Implementations§
Source§impl Quill
impl Quill
Sourcepub fn from_path<P: AsRef<Path>>(
path: P,
) -> Result<Self, Box<dyn StdError + Send + Sync>>
pub fn from_path<P: AsRef<Path>>( path: P, ) -> Result<Self, Box<dyn StdError + Send + Sync>>
Create a Quill from a directory path
Sourcepub fn toml_to_yaml_value(
toml_val: &Value,
) -> Result<Value, Box<dyn StdError + Send + Sync>>
pub fn toml_to_yaml_value( toml_val: &Value, ) -> Result<Value, Box<dyn StdError + Send + Sync>>
Convert TOML value to YAML value
Sourcepub fn assets_path(&self) -> PathBuf
pub fn assets_path(&self) -> PathBuf
Get the path to the assets directory
Sourcepub fn packages_path(&self) -> PathBuf
pub fn packages_path(&self) -> PathBuf
Get the path to the packages directory
Sourcepub fn typst_packages(&self) -> Vec<String>
pub fn typst_packages(&self) -> Vec<String>
Get the list of typst packages to download, if specified in Quill.toml
Sourcepub fn validate(&self) -> Result<(), Box<dyn StdError + Send + Sync>>
pub fn validate(&self) -> Result<(), Box<dyn StdError + Send + Sync>>
Validate the quill structure
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 get_file_entry<P: AsRef<Path>>(&self, path: P) -> Option<&FileEntry>
pub fn get_file_entry<P: AsRef<Path>>(&self, path: P) -> Option<&FileEntry>
Get file entry by path (includes metadata)
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 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)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Quill
impl RefUnwindSafe for Quill
impl Send for Quill
impl Sync for Quill
impl Unpin for Quill
impl UnwindSafe for Quill
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