Struct Environment

Source
pub struct Environment { /* private fields */ }
Expand description

A wrapper for the VSScript environment.

Implementations§

Source§

impl Environment

Source

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.

Source

pub fn from_script(script: &str) -> Result<Self, Error>

Creates a script environment and evaluates a script contained in a string.

Source

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.

Source

pub fn eval_script(&mut self, script: &str) -> Result<(), Error>

Evaluates a script contained in a string.

Source

pub fn eval_file<P: AsRef<Path>>( &mut self, path: P, flags: EvalFlags, ) -> Result<(), Error>

Evaluates a script contained in a file.

Source

pub fn clear(&self)

Clears the script environment.

Source

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.

Source

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().

Source

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.

Source

pub fn get_variable(&self, name: &str, map: &mut Map<'_>) -> Result<(), Error>

Retrieves a variable from the script environment.

Source

pub fn set_variables(&self, variables: &Map<'_>) -> Result<(), Error>

Sets variables in the script environment.

Source

pub fn clear_variable(&self, name: &str) -> Result<(), Error>

Deletes a variable from the script environment.

Trait Implementations§

Source§

impl Debug for Environment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Environment

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Environment

Source§

impl Sync for Environment

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.