pub struct Model { /* private fields */ }Expand description
Represents a Fornjot model
Implementations
sourceimpl Model
impl Model
sourcepub fn from_path(path: PathBuf) -> Result<Self, Error>
pub fn from_path(path: PathBuf) -> Result<Self, Error>
Initialize the model using the path to its crate (i.e. the folder
containing Cargo.toml).
Optionally, the target directory where plugin files are compiled to can be provided. If it is not provided, the target directory is assumed to be located within the model path.
sourcepub fn load_once(&self, arguments: &Parameters) -> Result<Shape, Error>
pub fn load_once(&self, arguments: &Parameters) -> Result<Shape, Error>
Load the model once
The passed arguments are provided to the model. Returns the shape that the model returns.
Please refer to Model::load_and_watch, if you want to watch the
model for changes, reloading it continually.
sourcepub fn load_and_watch(self, parameters: Parameters) -> Result<Watcher, Error>
pub fn load_and_watch(self, parameters: Parameters) -> Result<Watcher, Error>
Load the model, then watch it for changes
Whenever a change is detected, the model is being reloaded.
Consumes this instance of Model and returns a Watcher, which can
be queried for changes to the model.
Auto Trait Implementations
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more