pub struct Map { /* private fields */ }
Expand description
An owned ffi::VSMap
.
Implementations§
Source§impl Map
impl Map
pub fn clear(&mut self)
pub fn set_error(&mut self, msg: &CStr)
pub fn get_error(&self) -> Option<&CStr>
pub fn len(&self) -> i32
pub fn is_empty(&self) -> bool
pub fn delete_key(&mut self, key: &KeyStr)
pub fn num_elements(&self, key: &KeyStr) -> Option<i32>
Sourcepub fn get_int(&self, key: &KeyStr, index: i32) -> Result<i64, MapPropertyError>
pub fn get_int(&self, key: &KeyStr, index: i32) -> Result<i64, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_float(
&self,
key: &KeyStr,
index: i32,
) -> Result<f64, MapPropertyError>
pub fn get_float( &self, key: &KeyStr, index: i32, ) -> Result<f64, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_binary(
&self,
key: &KeyStr,
index: i32,
) -> Result<&[u8], MapPropertyError>
pub fn get_binary( &self, key: &KeyStr, index: i32, ) -> Result<&[u8], MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_utf8(
&self,
key: &KeyStr,
index: i32,
) -> Result<&str, MapPropertyError>
pub fn get_utf8( &self, key: &KeyStr, index: i32, ) -> Result<&str, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_function(
&self,
key: &KeyStr,
index: i32,
) -> Result<Function, MapPropertyError>
pub fn get_function( &self, key: &KeyStr, index: i32, ) -> Result<Function, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_video_node(
&self,
key: &KeyStr,
index: i32,
) -> Result<VideoNode, MapPropertyError>
pub fn get_video_node( &self, key: &KeyStr, index: i32, ) -> Result<VideoNode, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_audio_node(
&self,
key: &KeyStr,
index: i32,
) -> Result<AudioNode, MapPropertyError>
pub fn get_audio_node( &self, key: &KeyStr, index: i32, ) -> Result<AudioNode, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_video_frame(
&self,
key: &KeyStr,
index: i32,
) -> Result<VideoFrame, MapPropertyError>
pub fn get_video_frame( &self, key: &KeyStr, index: i32, ) -> Result<VideoFrame, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_audio_frame(
&self,
key: &KeyStr,
index: i32,
) -> Result<AudioFrame, MapPropertyError>
pub fn get_audio_frame( &self, key: &KeyStr, index: i32, ) -> Result<AudioFrame, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get(
&self,
key: &KeyStr,
index: i32,
) -> Result<Value<'_>, MapPropertyError>
pub fn get( &self, key: &KeyStr, index: i32, ) -> Result<Value<'_>, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_int_saturated(
&self,
key: &KeyStr,
index: i32,
) -> Result<i32, MapPropertyError>
pub fn get_int_saturated( &self, key: &KeyStr, index: i32, ) -> Result<i32, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_int_array(&self, key: &KeyStr) -> Result<&[i64], MapPropertyError>
pub fn get_int_array(&self, key: &KeyStr) -> Result<&[i64], MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_float_saturated(
&self,
key: &KeyStr,
index: i32,
) -> Result<f32, MapPropertyError>
pub fn get_float_saturated( &self, key: &KeyStr, index: i32, ) -> Result<f32, MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn get_float_array(&self, key: &KeyStr) -> Result<&[f64], MapPropertyError>
pub fn get_float_array(&self, key: &KeyStr) -> Result<&[f64], MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success
Sourcepub fn set_empty(&mut self, key: &KeyStr, type_: VSPropertyType)
pub fn set_empty(&mut self, key: &KeyStr, type_: VSPropertyType)
§Panics
Panics if the key exists or is invalid
Sourcepub fn set(
&mut self,
key: &KeyStr,
val: Value<'_>,
append: AppendMode,
) -> Result<(), MapPropertyError>
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
Sourcepub fn set_int_array(
&mut self,
key: &KeyStr,
val: &[i64],
) -> Result<(), MapPropertyError>
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
Sourcepub fn set_float_array(
&mut self,
key: &KeyStr,
val: &[f64],
) -> Result<(), MapPropertyError>
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
Sourcepub fn consume_node(
&mut self,
key: &KeyStr,
node: impl Node,
append: AppendMode,
) -> Result<(), MapPropertyError>
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
Sourcepub fn consume_frame(
&mut self,
key: &KeyStr,
frame: impl Frame,
append: AppendMode,
) -> Result<(), MapPropertyError>
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
Sourcepub fn consume_function(
&mut self,
key: &KeyStr,
function: Function,
append: AppendMode,
) -> Result<(), MapPropertyError>
pub fn consume_function( &mut self, key: &KeyStr, function: Function, append: AppendMode, ) -> Result<(), MapPropertyError>
§Errors
Return MapPropertyError
if the underlying API does not success