Struct tectonic_docmodel::workspace::Workspace
source · pub struct Workspace { /* private fields */ }
Expand description
A Tectonic workspace.
For the time being, a Workspace is just a thin wrapper to provide access to
a Document
instance. In the future, it might become possible for one
workspace to contain multiple documents.
In most cases, you will want to create a Workspace
by opening an
existing one using Workspace::open_from_environment
.
Implementations§
source§impl Workspace
impl Workspace
sourcepub fn first_document(&self) -> &Document
pub fn first_document(&self) -> &Document
Get the first document in the workspace.
Right now, workspaces in fact only include one document. That may change in the future.
sourcepub fn first_document_mut(&mut self) -> &mut Document
pub fn first_document_mut(&mut self) -> &mut Document
Get the first document in the workspace, mutably.
Right now, workspaces in fact only include one document. That may change in the future.
sourcepub fn open_from_environment() -> Result<Self>
pub fn open_from_environment() -> Result<Self>
Open up a workspace based on the current process environment.
This function searches the current directory and its parents for a
Tectonic.toml
file. Because workspaces can currently only contain a
single document, the search stops when the first such file is found. If
no such file is found, an error downcastable into
NoWorkspaceFoundError
is returned.