Struct MapRef

Source
pub struct MapRef<'m> { /* private fields */ }
Expand description

A borrowed reference to a ffi::VSMap.

Methods from Deref<Target = Map>§

Source

pub fn as_ptr(&self) -> *mut VSMap

Returns a raw pointer to the wrapped value.

Source

pub fn clear(&mut self)

Source

pub fn set_error(&mut self, msg: &CStr)

Source

pub fn get_error(&self) -> Option<&CStr>

Source

pub fn len(&self) -> i32

Source

pub fn is_empty(&self) -> bool

Source

pub fn get_key(&self, index: i32) -> &KeyStr

§Panics

Panics if index is out of bounds.

Source

pub fn delete_key(&mut self, key: &KeyStr)

Source

pub fn num_elements(&self, key: &KeyStr) -> Option<i32>

Source

pub fn get_int(&self, key: &KeyStr, index: i32) -> Result<i64, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_float( &self, key: &KeyStr, index: i32, ) -> Result<f64, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_binary( &self, key: &KeyStr, index: i32, ) -> Result<&[u8], MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_utf8( &self, key: &KeyStr, index: i32, ) -> Result<&str, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_function( &self, key: &KeyStr, index: i32, ) -> Result<Function, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_video_node( &self, key: &KeyStr, index: i32, ) -> Result<VideoNode, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_audio_node( &self, key: &KeyStr, index: i32, ) -> Result<AudioNode, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_video_frame( &self, key: &KeyStr, index: i32, ) -> Result<VideoFrame, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_audio_frame( &self, key: &KeyStr, index: i32, ) -> Result<AudioFrame, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get( &self, key: &KeyStr, index: i32, ) -> Result<Value<'_>, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_int_saturated( &self, key: &KeyStr, index: i32, ) -> Result<i32, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_int_array(&self, key: &KeyStr) -> Result<&[i64], MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_float_saturated( &self, key: &KeyStr, index: i32, ) -> Result<f32, MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn get_float_array(&self, key: &KeyStr) -> Result<&[f64], MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn set_empty(&mut self, key: &KeyStr, type_: VSPropertyType)

§Panics

Panics if the key exists or is invalid

Source

pub fn set( &mut self, key: &KeyStr, val: Value<'_>, append: AppendMode, ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError::InvalidType if the key’s type is not the same with val

§Panics

Panic if the Value::Data’s or Value::Utf8’s len is larger than i32::MAX

Source

pub fn set_int_array( &mut self, key: &KeyStr, val: &[i64], ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

§Panics

Panic if the val.len() is larger than i32::MAX

Source

pub fn set_float_array( &mut self, key: &KeyStr, val: &[f64], ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

§Panics

Panic if the val.len() is larger than i32::MAX

Source

pub fn consume_node( &mut self, key: &KeyStr, node: impl Node, append: AppendMode, ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn consume_frame( &mut self, key: &KeyStr, frame: impl Frame, append: AppendMode, ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Source

pub fn consume_function( &mut self, key: &KeyStr, function: Function, append: AppendMode, ) -> Result<(), MapPropertyError>

§Errors

Return MapPropertyError if the underlying API does not success

Trait Implementations§

Source§

impl<'m> Clone for MapRef<'m>

Source§

fn clone(&self) -> MapRef<'m>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'m> Debug for MapRef<'m>

Source§

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

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

impl Deref for MapRef<'_>

Source§

type Target = Map

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for MapRef<'_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'m> Hash for MapRef<'m>

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<'m> PartialEq for MapRef<'m>

Source§

fn eq(&self, other: &MapRef<'m>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'m> Copy for MapRef<'m>

Source§

impl<'m> Eq for MapRef<'m>

Source§

impl<'m> StructuralPartialEq for MapRef<'m>

Auto Trait Implementations§

§

impl<'m> Freeze for MapRef<'m>

§

impl<'m> RefUnwindSafe for MapRef<'m>

§

impl<'m> !Send for MapRef<'m>

§

impl<'m> !Sync for MapRef<'m>

§

impl<'m> Unpin for MapRef<'m>

§

impl<'m> UnwindSafe for MapRef<'m>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.