Field

Struct Field 

Source
#[non_exhaustive]
pub struct Field { pub name: String, pub index_config: Option<IndexConfig>, pub ttl_config: Option<TtlConfig>, /* private fields */ }
Expand description

Represents a single field in the database.

Fields are grouped by their “Collection Group”, which represent all collections in the database with the same ID.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Required. A field name of the form: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}

A field path can be a simple field name, e.g. address or a path to fields within map_value , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.

Field paths can be quoted using ` (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: *, ., ` (backtick), [, ], as well as any ascii symbolic characters.

Examples: `address.city` represents a field named address.city, not the map key city in the field address. `*` represents a field named *, not any field.

A special Field contains the default indexing settings for all fields. This field’s resource name is: projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.

§index_config: Option<IndexConfig>

The index configuration for this field. If unset, field indexing will revert to the configuration defined by the ancestor_field. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes.

§ttl_config: Option<TtlConfig>

The TTL configuration for this Field. Setting or unsetting this will enable or disable the TTL for documents that have this Field.

Implementations§

Source§

impl Field

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Field::new().set_name("example");
Source

pub fn set_index_config<T>(self, v: T) -> Self
where T: Into<IndexConfig>,

Sets the value of index_config.

§Example
use google_cloud_firestore_admin_v1::model::field::IndexConfig;
let x = Field::new().set_index_config(IndexConfig::default()/* use setters */);
Source

pub fn set_or_clear_index_config<T>(self, v: Option<T>) -> Self
where T: Into<IndexConfig>,

Sets or clears the value of index_config.

§Example
use google_cloud_firestore_admin_v1::model::field::IndexConfig;
let x = Field::new().set_or_clear_index_config(Some(IndexConfig::default()/* use setters */));
let x = Field::new().set_or_clear_index_config(None::<IndexConfig>);
Source

pub fn set_ttl_config<T>(self, v: T) -> Self
where T: Into<TtlConfig>,

Sets the value of ttl_config.

§Example
use google_cloud_firestore_admin_v1::model::field::TtlConfig;
let x = Field::new().set_ttl_config(TtlConfig::default()/* use setters */);
Source

pub fn set_or_clear_ttl_config<T>(self, v: Option<T>) -> Self
where T: Into<TtlConfig>,

Sets or clears the value of ttl_config.

§Example
use google_cloud_firestore_admin_v1::model::field::TtlConfig;
let x = Field::new().set_or_clear_ttl_config(Some(TtlConfig::default()/* use setters */));
let x = Field::new().set_or_clear_ttl_config(None::<TtlConfig>);

Trait Implementations§

Source§

impl Clone for Field

Source§

fn clone(&self) -> Field

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Field

Source§

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

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

impl Default for Field

Source§

fn default() -> Field

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

impl Message for Field

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Field

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Field

Auto Trait Implementations§

§

impl Freeze for Field

§

impl RefUnwindSafe for Field

§

impl Send for Field

§

impl Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,