Struct rustsynth::map::Map

source ·
pub struct Map<'elem> { /* private fields */ }
Expand description

A VapourSynth map.

A map contains key-value pairs where the value is zero or more elements of a certain type.

Implementations§

source§

impl<'elem> Map<'elem>

source

pub fn is_key_valid(key: &str) -> Result<(), InvalidKeyError>

Checks if the key is valid. Valid keys start with an alphabetic character or an underscore, and contain only alphanumeric characters and underscores.

source

pub fn clear(&mut self)

Clears the map.

source

pub fn error(&self) -> Option<Cow<'_, str>>

Returns the error message contained in the map, if any.

source

pub fn set_error(&mut self, error_message: &str) -> Result<()>

Adds an error message to a map. The map is cleared first.

source

pub fn key_count(&self) -> usize

Returns the number of keys contained in a map.

source

pub fn key(&self, index: usize) -> &str

Returns a key from a map.

Panics

Panics if index >= self.key_count().

source

pub fn keys(&self) -> Keys<'_, '_>

Returns an iterator over all keys in a map.

source

pub fn value_count(&self, key: &str) -> Result<usize>

Returns the number of elements associated with a key in a map.

source

pub fn value_type(&self, key: &str) -> Result<ValueType>

Retrieves a value type from a map.

source

pub fn delete_key(&mut self, key: &str) -> Result<()>

Deletes the given key.

source

pub fn get<'map, T: Value<'map, 'elem> + Sized>( &'map self, key: &str ) -> Result<T>

Retrieves a property value.

source

pub fn get_iter<'map, T: ValueNotArray<'map, 'elem>>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, T>>

Retrieves an iterator over the map values.

source

pub fn set<'map, T: Value<'map, 'elem>>( &'map mut self, key: &str, x: &T ) -> Result<()>

Sets a property value.

source

pub fn append<'map, T: ValueNotArray<'map, 'elem>>( &'map mut self, key: &str, x: &T ) -> Result<()>

Appends a property value.

source

pub fn get_int(&self, key: &str) -> Result<i64>

Retrieves an integer from a map.

This function retrieves the first value associated with the key.

source

pub fn get_int_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, i64>>

Retrieves integers from a map.

source

pub fn get_float(&self, key: &str) -> Result<f64>

Retrieves a floating point number from a map.

This function retrieves the first value associated with the key.

source

pub fn get_float_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, f64>>

Retrieves floating point numbers from a map.

source

pub fn get_data(&self, key: &str) -> Result<Data<'elem>>

Retrieves data from a map.

This function retrieves the first value associated with the key.

source

pub fn get_data_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, Data<'elem>>>

Retrieves data from a map.

source

pub fn get_string_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, String>>

Retrieves data from a map.

source

pub fn get_node(&self, key: &str) -> Result<Node<'elem>>

Retrieves a node from a map.

This function retrieves the first value associated with the key.

source

pub fn get_node_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, Node<'elem>>>

Retrieves nodes from a map.

source

pub fn get_frame(&self, key: &str) -> Result<FrameRef<'elem>>

Retrieves a frame from a map.

This function retrieves the first value associated with the key.

source

pub fn get_frame_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, FrameRef<'elem>>>

Retrieves frames from a map.

source

pub fn get_function(&self, key: &str) -> Result<Function<'elem>>

Retrieves a function from a map.

This function retrieves the first value associated with the key.

source

pub fn get_function_iter<'map>( &'map self, key: &str ) -> Result<ValueIter<'map, 'elem, Function<'elem>>>

Retrieves functions from a map.

source

pub fn get_int_array(&self, key: &str) -> Result<Vec<i64>>

Retrieves int array from a map.

source

pub fn get_float_array(&self, key: &str) -> Result<Vec<f64>>

Retrieves float array from a map.

source

pub fn data_type_hint(&self, key: &CStr, index: i32) -> DataType

source

pub fn append_int(&mut self, key: &str, x: i64) -> Result<()>

Appends an integer to a map.

source

pub fn append_float(&mut self, key: &str, x: f64) -> Result<()>

Appends a floating point number to a map.

source

pub fn append_data(&mut self, key: &str, x: &[u8]) -> Result<()>

Appends data to a map.

source

pub fn append_node(&mut self, key: &str, x: &Node<'elem>) -> Result<()>

Appends a node to a map.

source

pub fn append_frame(&mut self, key: &str, x: &Frame<'elem>) -> Result<()>

Appends a frame to a map.

source

pub fn append_function(&mut self, key: &str, x: &Function<'elem>) -> Result<()>

Appends a function to a map.

source

pub fn set_int(&mut self, key: &str, x: i64) -> Result<()>

Sets a property value to an integer.

source

pub fn set_float(&mut self, key: &str, x: f64) -> Result<()>

Sets a property value to a floating point number.

source

pub fn set_data(&mut self, key: &str, x: &[u8]) -> Result<()>

Sets a property value to data.

source

pub fn set_node(&mut self, key: &str, x: &Node<'elem>) -> Result<()>

Sets a property value to a node.

source

pub fn set_frame(&mut self, key: &str, x: &Frame<'elem>) -> Result<()>

Sets a property value to a frame.

source

pub fn set_function(&mut self, key: &str, x: &Function<'elem>) -> Result<()>

Sets a property value to a function.

source

pub fn set_int_array(&mut self, key: &str, x: Vec<i64>) -> Result<()>

source

pub fn set_float_array(&mut self, key: &str, x: Vec<f64>) -> Result<()>

Trait Implementations§

source§

impl<'elem> Debug for Map<'elem>

source§

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

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

impl<'elem> Send for Map<'elem>

source§

impl<'elem> Sync for Map<'elem>

Auto Trait Implementations§

§

impl<'elem> RefUnwindSafe for Map<'elem>

§

impl<'elem> Unpin for Map<'elem>

§

impl<'elem> UnwindSafe for Map<'elem>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.