pub struct Context { /* private fields */ }
Expand description
Context
holds Metadata
and Config
.
The context is passed to Compiler::next_step
, and the modified context is returned.
Implementations§
Source§impl Context
impl Context
pub fn new(config: Config) -> Self
pub fn metadata(&self) -> &Metadata
pub fn metadata_mut(&mut self) -> &mut Metadata
Sourcepub async fn source_string(&self) -> Result<String, Error>
pub async fn source_string(&self) -> Result<String, Error>
Get source file string
Sourcepub async fn create_target_parent_dir(&self) -> Result<PathBuf, Error>
pub async fn create_target_parent_dir(&self) -> Result<PathBuf, Error>
Create target file’s parent directory
Sourcepub async fn open_target(&self) -> Result<File, Error>
pub async fn open_target(&self) -> Result<File, Error>
Open target file to write
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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