Skip to main content

Fields

Struct Fields 

Source
pub struct Fields(/* private fields */);
Expand description

Field names and values in insertion order. Inserting a name that is already there keeps its place; removing one keeps the order of the others. Equality ignores the order, as for protobuf maps.

Implementations§

Source§

impl Fields

Source

pub fn new() -> Fields

Source

pub fn with_capacity(capacity: usize) -> Fields

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, key: &str) -> Option<&Value>

Source

pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>

Source

pub fn contains_key(&self, key: &str) -> bool

Source

pub fn insert(&mut self, key: String, value: Value) -> Option<Value>

Sets key, in place if it is there, else at the end.

Source

pub fn remove(&mut self, key: &str) -> Option<Value>

Removes key; the fields after it keep their order.

Source

pub fn push(&mut self, key: String, value: Value)

Sets key at the end, moving it there if it is already present.

Source

pub fn entry(&mut self, key: String) -> Entry<'_, String, Value>

Source

pub fn iter(&self) -> Iter<'_, String, Value> ⓘ

Source

pub fn iter_mut(&mut self) -> IterMut<'_, String, Value> ⓘ

Source

pub fn keys(&self) -> Keys<'_, String, Value> ⓘ

Source

pub fn values(&self) -> Values<'_, String, Value> ⓘ

Source

pub fn values_mut(&mut self) -> ValuesMut<'_, String, Value> ⓘ

Source

pub fn sorted(&self) -> Vec<(&String, &Value)>

The fields in Firestore’s canonical order: names by UTF-8 bytes, which is String’s Ord. Comparisons and index keys use this order, never the stored one.

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl Clone for Fields

Source§

fn clone(&self) -> Fields

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Fields

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Fields

Source§

fn default() -> Fields

Returns the “default value” for a type. Read more
Source§

impl Extend<(String, Value)> for Fields

Source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = (String, Value)>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<const N: usize> From<[(String, Value); N]> for Fields

Source§

fn from(entries: [(String, Value); N]) -> Fields

Converts to this type from the input type.
Source§

impl FromIterator<(String, Value)> for Fields

Source§

fn from_iter<I>(iter: I) -> Fields
where I: IntoIterator<Item = (String, Value)>,

Creates a value from an iterator. Read more
Source§

impl Index<&str> for Fields

Panics when key is missing, as BTreeMap does.

Source§

type Output = Value

The returned type after indexing.
Source§

fn index(&self, key: &str) -> &Value

Performs the indexing (container[index]) operation. Read more
Source§

impl IntoIterator for Fields

Source§

type Item = (String, Value)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<String, Value>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <Fields as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a Fields

Source§

type Item = (&'a String, &'a Value)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, String, Value>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a Fields as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut Fields

Source§

type Item = (&'a String, &'a mut Value)

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, String, Value>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a mut Fields as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for Fields

Source§

fn eq(&self, other: &Fields) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Fields

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more