pub struct GodotDictionary {
pub map: IndexMap<Box<dyn GodotVariant>, Box<dyn GodotVariant>>,
pub byte_size: usize,
}Expand description
A Dictionary from godot, similar to an object in javascript, it consists of key:value pairs
Fields§
§map: IndexMap<Box<dyn GodotVariant>, Box<dyn GodotVariant>>§byte_size: usizeImplementations§
Source§impl GodotDictionary
impl GodotDictionary
Sourcepub fn get<V>(&self, key: impl GodotVariant + 'static) -> Option<&V>where
V: GodotVariant + 'static,
pub fn get<V>(&self, key: impl GodotVariant + 'static) -> Option<&V>where
V: GodotVariant + 'static,
Gets a value from a dictionary
Sourcepub fn insert<K, V>(&mut self, key: K, value: V)where
K: GodotVariant + 'static,
V: GodotVariant + 'static,
pub fn insert<K, V>(&mut self, key: K, value: V)where
K: GodotVariant + 'static,
V: GodotVariant + 'static,
Inserst a value into a dictionary
pub fn new_from_map( map: IndexMap<Box<dyn GodotVariant>, Box<dyn GodotVariant>>, ) -> Self
Trait Implementations§
Source§impl Debug for GodotDictionary
impl Debug for GodotDictionary
Source§impl Default for GodotDictionary
impl Default for GodotDictionary
Source§impl GodotVariant for GodotDictionary
impl GodotVariant for GodotDictionary
Source§fn byte_length(&self) -> usize
fn byte_length(&self) -> usize
Describes the byte length of a variant, most primitive variants have a static byte length.
However some variants like a dictionary may have dynamic sizes
Source§fn variant_eq(&self, other: &dyn GodotVariant) -> bool
fn variant_eq(&self, other: &dyn GodotVariant) -> bool
Checks if a variant is equal to another variant
Auto Trait Implementations§
impl Freeze for GodotDictionary
impl !RefUnwindSafe for GodotDictionary
impl Send for GodotDictionary
impl Sync for GodotDictionary
impl Unpin for GodotDictionary
impl !UnwindSafe for GodotDictionary
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