Trait DictTrait

Source
pub trait DictTrait: DictTraitConst {
    // Required method
    fn as_raw_mut_Dict(&mut self) -> *mut c_void;

    // Provided methods
    unsafe fn ptr_mut(&mut self, key: &str) -> Result<DictValue> { ... }
    fn set_str(&mut self, key: &str, value: &str) -> Result<String> { ... }
    fn set(
        &mut self,
        key: &str,
        value: &impl DictValueTraitConst,
    ) -> Result<DictValue> { ... }
    fn set_f64(&mut self, key: &str, value: &f64) -> Result<f64> { ... }
    fn set_i64(&mut self, key: &str, value: &i64) -> Result<i64> { ... }
    fn erase(&mut self, key: &str) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::dnn::Dict

Required Methods§

Provided Methods§

Source

unsafe fn ptr_mut(&mut self, key: &str) -> Result<DictValue>

If the @p key in the dictionary then returns pointer to its value, else returns NULL.

Source

fn set_str(&mut self, key: &str, value: &str) -> Result<String>

Sets new @p value for the @p key, or adds new key-value pair into the dictionary.

Source

fn set( &mut self, key: &str, value: &impl DictValueTraitConst, ) -> Result<DictValue>

Sets new @p value for the @p key, or adds new key-value pair into the dictionary.

Source

fn set_f64(&mut self, key: &str, value: &f64) -> Result<f64>

Sets new @p value for the @p key, or adds new key-value pair into the dictionary.

Source

fn set_i64(&mut self, key: &str, value: &i64) -> Result<i64>

Sets new @p value for the @p key, or adds new key-value pair into the dictionary.

Source

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

Erase @p key from the dictionary.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§