Struct anyscript_compiler::types::dict::Dict
source · pub struct Dict<K, V> {
pub keys: Vec<K>,
pub values: Vec<V>,
pub size: usize,
pub dict: HashMap<K, V>,
}
Expand description
Class to Handle a Dictionary
Fields§
§keys: Vec<K>
§values: Vec<V>
§size: usize
§dict: HashMap<K, V>
Implementations§
source§impl<K: Default + Display + Eq + Hash + Clone + Send + Sync, V: Default + Display + Clone + Send + Sync> Dict<K, V>
impl<K: Default + Display + Eq + Hash + Clone + Send + Sync, V: Default + Display + Clone + Send + Sync> Dict<K, V>
pub fn new() -> Self
pub fn insert(&mut self, key: K, value: V)
pub fn to_string2(&self) -> String
pub fn to_cstring(&self) -> CString
pub fn to_dict(&mut self) -> HashMap<K, V>
pub fn get_type(&self) -> String
pub fn get_size(&mut self) -> usize
pub fn replace(&mut self, key: K, new: V)
pub fn remove(&mut self, key: K)
pub fn destroy(&mut self)
pub fn get_key_items(&self) -> List<K>
pub fn get_value_items(&self) -> List<V>
pub fn get(&self, key: K) -> V
pub fn to_list(&self) -> Tuple<List<K>, List<V>>
pub fn from(map: HashMap<K, V>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Dict<K, V>
impl<K, V> RefUnwindSafe for Dict<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Dict<K, V>
impl<K, V> Sync for Dict<K, V>
impl<K, V> Unpin for Dict<K, V>
impl<K, V> UnwindSafe for Dict<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more