Struct vapoursynth::prelude::Environment
source · [−]pub struct Environment { /* private fields */ }
Expand description
A wrapper for the VSScript environment.
Implementations
sourceimpl Environment
impl Environment
sourcepub fn new() -> Result<Self, Error>
pub fn new() -> 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(script: &str) -> Result<Self, Error>
pub fn from_script(script: &str) -> Result<Self, Error>
Creates a script environment and evaluates a script contained in a string.
sourcepub fn from_file<P: AsRef<Path>>(
path: P,
flags: EvalFlags
) -> Result<Self, Error>
pub fn from_file<P: AsRef<Path>>(
path: P,
flags: EvalFlags
) -> 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,
flags: EvalFlags
) -> Result<(), Error>
pub fn eval_file<P: AsRef<Path>>(
&mut self,
path: P,
flags: EvalFlags
) -> Result<(), Error>
Evaluates a script contained in a file.
sourcepub fn get_output(
&self,
index: i32
) -> Result<(Node<'_>, Option<Node<'_>>), Error>
pub fn get_output(
&self,
index: i32
) -> Result<(Node<'_>, Option<Node<'_>>), Error>
Retrieves a node from the script environment. A node in the script must have been marked for output with the requested index. The second node, if any, contains the alpha clip.
sourcepub fn clear_output(&self, index: i32) -> Result<(), Error>
pub fn clear_output(&self, index: i32) -> Result<(), Error>
Cancels a node set for output. The node will no longer be available to get_output()
.
sourcepub fn get_core(&self) -> Result<CoreRef<'_>, Error>
pub fn get_core(&self) -> Result<CoreRef<'_>, Error>
Retrieves the VapourSynth core that was created in the script environment. If a VapourSynth core has not been created yet, it will be created now, with the default options.
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.
Trait Implementations
sourceimpl Debug for Environment
impl Debug for Environment
sourceimpl Drop for Environment
impl Drop for Environment
impl Send for Environment
impl Sync for Environment
Auto Trait Implementations
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