[−][src]Struct avocado::dsl::doc::Document
A top-level DSL document consisting of multiple path => sub-operation specifiers and respecting the order of insertion during iteration.
Methods
impl<T> Document<T>
[src]
impl<T> Document<T>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates an empty document.
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
Creates an empty document with the specified capacity.
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
Returns the current capacity of the document.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of entries (key-value pairs) in the document.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true
if and only if the document contains no entries.
pub fn reserve(&mut self, additional: usize)
[src]
pub fn reserve(&mut self, additional: usize)
Reserves additional capacity for the document.
pub fn insert(&mut self, key: Cow<'static, str>, value: T) -> Option<T>
[src]
pub fn insert(&mut self, key: Cow<'static, str>, value: T) -> Option<T>
Inserts a key and a value into the document. If the key already exists, returns the previous value associated with it.
pub fn contains_key(&self, key: &str) -> bool
[src]
pub fn contains_key(&self, key: &str) -> bool
Returns true
if and only if the document contains the specified key.
pub fn get(&self, key: &str) -> Option<&T>
[src]
pub fn get(&self, key: &str) -> Option<&T>
Returns a reference to the subquery associated with the key.
pub fn get_mut(&mut self, key: &str) -> Option<&mut T>
[src]
pub fn get_mut(&mut self, key: &str) -> Option<&mut T>
Returns a mutable reference to the subquery associated with the key.
pub fn remove(&mut self, key: &str) -> Option<T>
[src]
pub fn remove(&mut self, key: &str) -> Option<T>
Removes the subquery associated with the key and returns it.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Removes all key-value pairs, leaving the document in an empty state.
Trait Implementations
impl<T: PartialOrd> PartialOrd<Document<T>> for Document<T>
[src]
impl<T: PartialOrd> PartialOrd<Document<T>> for Document<T>
fn partial_cmp(&self, other: &Document<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Document<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Document<T>) -> bool
[src]
fn lt(&self, other: &Document<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Document<T>) -> bool
[src]
fn le(&self, other: &Document<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Document<T>) -> bool
[src]
fn gt(&self, other: &Document<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Document<T>) -> bool
[src]
fn ge(&self, other: &Document<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T> Default for Document<T>
[src]
impl<T> Default for Document<T>
impl<T: Ord> Ord for Document<T>
[src]
impl<T: Ord> Ord for Document<T>
fn cmp(&self, other: &Document<T>) -> Ordering
[src]
fn cmp(&self, other: &Document<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T: PartialEq> PartialEq<Document<T>> for Document<T>
[src]
impl<T: PartialEq> PartialEq<Document<T>> for Document<T>
fn eq(&self, other: &Document<T>) -> bool
[src]
fn eq(&self, other: &Document<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Document<T>) -> bool
[src]
fn ne(&self, other: &Document<T>) -> bool
This method tests for !=
.
impl From<Document<Filter>> for Filter
[src]
impl From<Document<Filter>> for Filter
Filter::from(FilterDoc)
yields a Filter::Doc(...)
.
impl<T: Clone> Clone for Document<T>
[src]
impl<T: Clone> Clone for Document<T>
fn clone(&self) -> Document<T>
[src]
fn clone(&self) -> Document<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> IntoIterator for Document<T>
[src]
impl<T> IntoIterator for Document<T>
type Item = (Cow<'static, str>, T)
The type of the elements being iterated over.
type IntoIter = IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a, T> IntoIterator for &'a Document<T>
[src]
impl<'a, T> IntoIterator for &'a Document<T>
type Item = (&'a str, &'a T)
The type of the elements being iterated over.
type IntoIter = Iter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a, T> IntoIterator for &'a mut Document<T>
[src]
impl<'a, T> IntoIterator for &'a mut Document<T>
type Item = (&'a str, &'a mut T)
The type of the elements being iterated over.
type IntoIter = IterMut<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<T, K, V> Extend<(K, V)> for Document<T> where
K: Into<Cow<'static, str>>,
V: Into<T>,
[src]
impl<T, K, V> Extend<(K, V)> for Document<T> where
K: Into<Cow<'static, str>>,
V: Into<T>,
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<T: Eq> Eq for Document<T>
[src]
impl<T: Eq> Eq for Document<T>
impl<T: Debug> Debug for Document<T>
[src]
impl<T: Debug> Debug for Document<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Hash> Hash for Document<T>
[src]
impl<T: Hash> Hash for Document<T>
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, K, V> FromIterator<(K, V)> for Document<T> where
K: Into<Cow<'static, str>>,
V: Into<T>,
[src]
impl<T, K, V> FromIterator<(K, V)> for Document<T> where
K: Into<Cow<'static, str>>,
V: Into<T>,
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<'de, T> Deserialize<'de> for Document<T> where
T: Deserialize<'de>,
[src]
impl<'de, T> Deserialize<'de> for Document<T> where
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T> Serialize for Document<T> where
T: Serialize,
[src]
impl<T> Serialize for Document<T> where
T: Serialize,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<I> IntoIterator for I where
I: Iterator,
[src]
impl<I> IntoIterator for I where
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
fn into_iter(self) -> I
Creates an iterator from a value. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T, U> TryInto for T where
U: TryFrom<T>,
impl<T, U> TryInto for T where
U: TryFrom<T>,
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self