Skip to main content

MapMut

Struct MapMut 

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

An exclusive borrowed map. It cannot be copied or converted into an owner.

Implementations§

Source§

impl MapMut<'_>

Source

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

Source

pub fn as_ref(&self) -> MapRef<'_>

Source

pub fn reborrow(&mut self) -> MapMut<'_>

Source§

impl MapMut<'_>

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 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 clear(&mut self)

Source

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

Source

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

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> Debug for MapMut<'m>

Source§

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

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

impl<'m> Eq for MapMut<'m>

Source§

impl<'m> Hash for MapMut<'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 MapMut<'m>

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 Send for MapMut<'_>

Source§

impl<'m> StructuralPartialEq for MapMut<'m>

Auto Trait Implementations§

§

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

§

impl<'m> !UnwindSafe for MapMut<'m>

§

impl<'m> Forget for MapMut<'m>

§

impl<'m> Freeze for MapMut<'m>

§

impl<'m> Move for MapMut<'m>

§

impl<'m> RefUnwindSafe for MapMut<'m>

§

impl<'m> Unpin for MapMut<'m>

§

impl<'m> UnsafeUnpin for MapMut<'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> 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.