Skip to main content

Script

Struct Script 

Source
pub struct Script { /* private fields */ }

Implementations§

Source§

impl Script

Source

pub fn new(core: Option<Core>, vssapi: VssApi) -> Self

Creates a new script instance.

A supplied core is transferred to VSScript. Pass None to use a default core.

§Panics

Panics if the VapourSynth API version is unavailable or script creation fails.

Source

pub fn get_api(&self) -> Api

Source

pub fn core(&self) -> Result<CoreRef<'_>, ScriptError>

Returns a reference to the core associated with this script.

§Errors

Returns an error message if the core could not be retrieved.

Source

pub fn evaluate( &self, buffer: &CStr, filename: &CStr, ) -> Result<(), ScriptError>

Evaluates a script buffer with the given filename.

§Errors

Returns an error message if the script evaluation fails.

Source

pub fn evaluate_file(&self, filename: &CStr) -> Result<(), ScriptError>

Evaluates a script from a file.

§Errors

Returns an error message if the script evaluation fails.

Source

pub fn get_output(&self, index: c_int) -> Result<OutputNode, ScriptError>

Gets the output node at the specified index.

§Errors

Returns a ScriptError if the output node could not be retrieved.

Source

pub fn get_output_ex( &self, index: c_int, flags: c_int, ) -> Result<OutputNode, ScriptError>

Gets an output node, using a bitmask of ffi::VSScriptGetFlags. Pass 0 to download GPU output or AllowGPUResident to preserve residency. Release the returned node before this script.

§Errors

Returns a ScriptError if the output is unset or could not be retrieved.

Source

pub fn get_output_alpha_ex( &self, index: c_int, flags: c_int, ) -> Result<VideoNode, ScriptError>

Gets an alpha output using a bitmask of ffi::VSScriptGetFlags. Pass 0 to download GPU output or AllowGPUResident to preserve residency. Release the returned node before this script.

§Errors

Returns a ScriptError if the alpha output is unset or unavailable.

Source

pub fn get_available_outputs_ex( &self, flags: c_int, ) -> Result<Vec<c_int>, ScriptError>

Lists output indices using a bitmask of ffi::VSScriptGetFlags.

§Errors

Returns a ScriptError if output enumeration fails.

Source

pub fn get_variable_ex( &self, name: &CStr, dst: &mut Map, flags: c_int, ) -> Result<(), ScriptError>

Copies a script variable into dst under its name. flags is a bitmask of ffi::VSScriptGetFlags. With no flags GPU nodes are downloaded and GPU frame variables are rejected. AllowGPUResident preserves the residency of nodes and frames.

§Errors

Returns a ScriptError if the variable is missing or cannot be stored.

Trait Implementations§

Source§

impl Debug for Script

Source§

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

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

impl Drop for Script

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Eq for Script

Source§

impl Hash for Script

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Script

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Script

Auto Trait Implementations§

§

impl !Send for Script

§

impl !Sync for Script

§

impl Forget for Script

§

impl Freeze for Script

§

impl Move for Script

§

impl RefUnwindSafe for Script

§

impl Unpin for Script

§

impl UnsafeUnpin for Script

§

impl UnwindSafe for Script

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.