Struct rustsynth::vsscript::Environment
source · pub struct Environment { /* private fields */ }
Expand description
A wrapper for the VSScript environment.
Implementations§
source§impl Environment
impl Environment
sourcepub fn new(core: &CoreRef<'_>) -> Result<Self, Error>
pub fn new(core: &CoreRef<'_>) -> Result<Self, Error>
Creates an empty script environment.
Useful if it is necessary to set some variable in the script environment before evaluating any scripts.
sourcepub fn from_script(core: &CoreRef<'_>, script: &str) -> Result<Self, Error>
pub fn from_script(core: &CoreRef<'_>, script: &str) -> Result<Self, Error>
Creates a script environment and evaluates a script contained in a string.
sourcepub fn from_file<P: AsRef<Path>>(
core: &CoreRef<'_>,
path: P
) -> Result<Self, Error>
pub fn from_file<P: AsRef<Path>>( core: &CoreRef<'_>, path: P ) -> Result<Self, Error>
Creates a script environment and evaluates a script contained in a file.
sourcepub fn eval_script(&mut self, script: &str) -> Result<(), Error>
pub fn eval_script(&mut self, script: &str) -> Result<(), Error>
Evaluates a script contained in a string.
sourcepub fn eval_file<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>
pub fn eval_file<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>
Evaluates a script contained in a file.
sourcepub fn get_variable(&self, name: &str, map: &mut Map<'_>) -> Result<(), Error>
pub fn get_variable(&self, name: &str, map: &mut Map<'_>) -> Result<(), Error>
Retrieves a variable from the script environment.
sourcepub fn set_variables(&self, variables: &Map<'_>) -> Result<(), Error>
pub fn set_variables(&self, variables: &Map<'_>) -> Result<(), Error>
Sets variables in the script environment.
pub fn get_output(&self, index: usize) -> Option<Node<'_>>
pub fn get_output_alpha(&self, index: usize) -> Option<Node<'_>>
pub fn clear_output(&self, index: usize) -> Result<(), Error>
Trait Implementations§
source§impl Debug for Environment
impl Debug for Environment
source§impl Drop for Environment
impl Drop for Environment
impl Send for Environment
impl Sync for Environment
Auto Trait Implementations§
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