[−][src]Struct nu_protocol::value::dict::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 insert(&mut self, key: String, value: Value) -> Option<Value>
[src]
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]
pub fn clone(&self) -> Dictionary
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Dictionary
[src]
impl Default for Dictionary
[src]
pub fn default() -> Dictionary
[src]
impl<'de> Deserialize<'de> for Dictionary
[src]
pub 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]
pub fn from(input: IndexMap<String, Value>) -> Dictionary
[src]
Create a dictionary from a map of strings to Values
impl Hash for Dictionary
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
Create the hash function to allow the Hash trait for dictionaries
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Dictionary
[src]
pub fn cmp(&self, other: &Dictionary) -> Ordering
[src]
Compare two dictionaries for ordering
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Dictionary> for Dictionary
[src]
pub fn eq(&self, other: &Dictionary) -> bool
[src]
pub fn ne(&self, other: &Dictionary) -> bool
[src]
impl PartialEq<Value> for Dictionary
[src]
pub fn eq(&self, other: &Value) -> bool
[src]
Test a dictionary against a Value for equality
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Dictionary> for Dictionary
[src]
pub fn partial_cmp(&self, other: &Dictionary) -> Option<Ordering>
[src]
Compare two dictionaries for sort ordering
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PrettyDebug for Dictionary
[src]
pub fn pretty(&self) -> DebugDocBuilder
[src]
Get a Dictionary ready to be pretty-printed
pub fn to_doc(&self) -> DebugDoc
[src]
pub fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
pub fn pretty_builder(
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
[src]
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
pub fn display(&self) -> String
[src]
pub fn plain_string(&self, width: usize) -> String
[src]
pub fn colored_string(&self, width: usize) -> String
[src]
impl Serialize for Dictionary
[src]
pub 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.
pub fn try_from(value: &'a Value) -> Result<&'a Dictionary, ShellError>
[src]
Convert to a dictionary, if possible
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
[src]
impl Send for Dictionary
[src]
impl Sync for Dictionary
[src]
impl Unpin for Dictionary
[src]
impl UnwindSafe for Dictionary
[src]
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,
pub 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,
pub 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,
pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder
[src]
pub fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
pub fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
[src]
Self: Clone,
pub fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
[src]
impl<T> SpannedItem for T
[src]
pub fn spanned(self, span: impl Into<Span>) -> Spanned<Self>
[src]
pub fn spanned_unknown(self) -> Spanned<Self>
[src]
impl<T> TaggedItem for T
[src]
pub fn tagged(self, tag: impl Into<Tag>) -> Tagged<Self>
[src]
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,