ObjectBehavior

Trait ObjectBehavior 

Source
pub trait ObjectBehavior {
    // Required methods
    fn remove<T>(&mut self, key: &T) -> Option<Value>
       where T: ValueKeyBehavior;
    fn contains_key<T>(&self, key: &T) -> bool
       where T: ValueKeyBehavior;
    fn keys(&self) -> Vec<&ValueKey>;
    fn values(&self) -> Vec<&Value>;
}

Required Methods§

Source

fn remove<T>(&mut self, key: &T) -> Option<Value>

Removes a key-value pair from the object and returns the associated value. If the key is not present, returns None.

Source

fn contains_key<T>(&self, key: &T) -> bool

Returns true if the object contains a value for the specified key, otherwise false.

Source

fn keys(&self) -> Vec<&ValueKey>

Returns a Vec of references to the keys in the object, in the order they were inserted.

Source

fn values(&self) -> Vec<&Value>

Returns a Vec of references to the values in the object, in the order they were inserted.

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§