pub struct Dictionary(/* private fields */);
Expand description
A reference-counted Dictionary
of Variant
key-value pairs.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new() -> Dictionary
pub fn new() -> Dictionary
Creates an empty Dictionary
.
Sourcepub fn contains(&self, key: &Variant) -> bool
pub fn contains(&self, key: &Variant) -> bool
Returns true if the Dictionary
contains the specified key.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn get(&self, key: &Variant) -> Variant
pub fn get(&self, key: &Variant) -> Variant
Returns a copy of the value corresponding to the key.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn to_json(&self) -> GodotString
pub fn to_json(&self) -> GodotString
Returns a GodotString of the Dictionary
.
Sourcepub fn keys(&self) -> VariantArray
pub fn keys(&self) -> VariantArray
Returns an array of the keys in the Dictionary
.
Sourcepub 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 new_ref(&self) -> Dictionary
Trait Implementations§
Source§impl Debug for Dictionary
impl Debug for Dictionary
Source§impl Default for Dictionary
impl Default for Dictionary
Source§fn default() -> Dictionary
fn default() -> Dictionary
Returns the “default value” for a type. Read more
Source§impl Drop for Dictionary
impl Drop for Dictionary
Source§impl<'l> From<&'l Dictionary> for Variant
impl<'l> From<&'l Dictionary> for Variant
Source§fn from(val: &'l Dictionary) -> Variant
fn from(val: &'l Dictionary) -> Variant
Converts to this type from the input type.
Source§impl PartialEq for Dictionary
impl PartialEq for Dictionary
Source§impl ToVariant for Dictionary
impl ToVariant for Dictionary
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<Dictionary>
impl Eq for Dictionary
Auto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more