Struct gdnative_physics::common::Dictionary [−]
pub struct Dictionary(_);
A reference-counted Dictionary
of Variant
key-value pairs.
Methods
impl Dictionary
impl Dictionary
pub fn new() -> Dictionary
pub fn new() -> Dictionary
Creates an empty Dictionary
.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if the Dictionary
contains no elements.
pub fn len(&self) -> i32
pub fn len(&self) -> i32
Returns the number of elements in the Dictionary
.
pub fn clear(&mut self)
pub fn clear(&mut self)
Clears the Dictionary
, removing all key-value pairs.
pub fn contains(&self, key: &Variant) -> bool
pub fn contains(&self, key: &Variant) -> bool
Returns true if the Dictionary
contains the specified key.
pub fn contains_all(&self, keys: &VariantArray) -> bool
pub fn contains_all(&self, keys: &VariantArray) -> bool
Returns true if the Dictionary
has all of the keys in the given array.
pub fn erase(&mut self, key: &Variant)
pub fn erase(&mut self, key: &Variant)
Erase a key-value pair in the Dictionary
by the specified key.
pub fn get(&self, key: &Variant) -> Variant
pub fn get(&self, key: &Variant) -> Variant
Returns a copy of the value corresponding to the key.
pub fn set(&mut self, key: &Variant, val: &Variant)
pub fn set(&mut self, key: &Variant, val: &Variant)
Sets a value to the element corresponding to the key.
pub fn get_ref(&self, key: &Variant) -> &Variant
pub fn get_ref(&self, key: &Variant) -> &Variant
Returns a reference to the value corresponding to the key.
pub fn get_mut_ref(&mut self, key: &Variant) -> &mut Variant
pub fn get_mut_ref(&mut self, key: &Variant) -> &mut Variant
Returns a mutable reference to the value corresponding to the key.
pub fn to_json(&self) -> GodotString
pub fn to_json(&self) -> GodotString
Returns a GodotString of the Dictionary
.
pub fn keys(&self) -> VariantArray
pub fn keys(&self) -> VariantArray
Returns an array of the keys in the Dictionary
.
pub fn values(&self) -> VariantArray
pub fn values(&self) -> VariantArray
Returns an array of the values in the Dictionary
.
pub fn get_next(&self, key: &Variant) -> &Variant
pub fn get_next(&self, key: &Variant) -> &Variant
pub fn hash(&self) -> i32
pub fn hash(&self) -> i32
Return a hashed i32 value representing the dictionary's contents.
pub fn new_ref(&self) -> Dictionary
pub fn new_ref(&self) -> Dictionary
Trait Implementations
impl ToVariant for Dictionary
impl ToVariant for Dictionary
fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<Dictionary>
fn from_variant(variant: &Variant) -> Option<Dictionary>
impl Debug for Dictionary
impl Debug for Dictionary
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'l> From<&'l Dictionary> for Variant
impl<'l> From<&'l Dictionary> for Variant
fn from(val: &'l Dictionary) -> Variant
fn from(val: &'l Dictionary) -> Variant
Performs the conversion.
impl Default for Dictionary
impl Default for Dictionary
fn default() -> Dictionary
fn default() -> Dictionary
Returns the "default value" for a type. Read more
impl Eq for Dictionary
impl Eq for Dictionary
impl Drop for Dictionary
impl Drop for Dictionary
impl PartialEq<Dictionary> for Dictionary
impl PartialEq<Dictionary> for Dictionary
Auto Trait Implementations
impl Send for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Sync for Dictionary