[−][src]Struct nu_protocol::Dictionary
A dictionary that can hold a mapping from names to Values
Fields
entries: IndexMap<String, Value>Implementations
impl Dictionary[src]
impl Dictionary[src]
impl Dictionary[src]
pub fn get_data(&self, desc: &str) -> MaybeOwned<'_, Value>[src]
Find the matching Value for a given key, if possible. If not, return a Primitive::Nothing
pub fn merge_from(&self, other: &Dictionary) -> Dictionary[src]
pub fn keys(&self) -> impl Iterator<Item = &String>[src]
Iterate the keys in the Dictionary
pub fn values(&self) -> impl Iterator<Item = &Value>[src]
Iterate the values in the Dictionary
pub fn contains_key(&self, key: &str) -> bool[src]
Checks if given key exists
pub fn get_data_by_key(&self, name: Spanned<&str>) -> Option<Value>[src]
Find the matching Value for a key, if possible
pub fn get_mut_data_by_key(&mut self, name: &str) -> Option<&mut Value>[src]
Get a mutable entry that matches a key, if possible
pub fn insert_data_at_key(&mut self, name: &str, value: Value)[src]
Insert a new key/value pair into the dictionary
pub fn length(&self) -> usize[src]
Return size of dictionary
Trait Implementations
impl Clone for Dictionary[src]
fn clone(&self) -> Dictionary[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for Dictionary[src]
impl Default for Dictionary[src]
fn default() -> Dictionary[src]
impl<'de> Deserialize<'de> for Dictionary[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Eq for Dictionary[src]
impl From<IndexMap<String, Value, RandomState>> for Dictionary[src]
fn from(input: IndexMap<String, Value>) -> Dictionary[src]
Create a dictionary from a map of strings to Values
impl Hash for Dictionary[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
Create the hash function to allow the Hash trait for dictionaries
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for Dictionary[src]
fn cmp(&self, other: &Dictionary) -> Ordering[src]
Compare two dictionaries for ordering
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<Dictionary> for Dictionary[src]
fn eq(&self, other: &Dictionary) -> bool[src]
fn ne(&self, other: &Dictionary) -> bool[src]
impl PartialEq<Value> for Dictionary[src]
fn eq(&self, other: &Value) -> bool[src]
Test a dictionary against a Value for equality
#[must_use]fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<Dictionary> for Dictionary[src]
fn partial_cmp(&self, other: &Dictionary) -> Option<Ordering>[src]
Compare two dictionaries for sort ordering
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PrettyDebug for Dictionary[src]
fn pretty(&self) -> DebugDocBuilder[src]
Get a Dictionary ready to be pretty-printed
fn to_doc(&self) -> DebugDoc[src]
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>[src]
fn display(&self) -> String[src]
fn plain_string(&self, width: usize) -> String[src]
fn colored_string(&self, width: usize) -> String[src]
impl Serialize for Dictionary[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralEq for Dictionary[src]
impl StructuralPartialEq for Dictionary[src]
impl<'a> TryFrom<&'a Value> for &'a Dictionary[src]
type Error = ShellError
The type returned in the event of a conversion error.
fn try_from(value: &'a Value) -> Result<&'a Dictionary, ShellError>[src]
Convert to a dictionary, if possible
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]
T: PrettyDebug,
fn pretty_debug(&self, _source: &str) -> DebugDocBuilder[src]
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone, [src]
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>[src]
impl<T> SpannedItem for T[src]
fn spanned(self, span: impl Into<Span>) -> Spanned<Self>[src]
fn spanned_unknown(self) -> Spanned<Self>[src]
impl<T> TaggedItem for T[src]
fn tagged(self, tag: impl Into<Tag>) -> Tagged<Self>[src]
fn tagged_unknown(self) -> Tagged<Self>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,