Struct tiny_firestore_odm::Collection[][src]

pub struct Collection<T> where
    T: Serialize + DeserializeOwned + 'static, 
{ /* fields omitted */ }
Expand description

Represents a collection of documents in a Firestore database.

Documents in Firestore do not have types, but on the Rust end, we associate each collection with a type. Documents are serialized into and deserialized from this type when writing/reading to Firestore.

Implementations

Construct a top-level collection (i.e. a collection whose parent is the root.)

Returns a stream of all of the documents in a collection (as NamedDocuments).

Create the given document in this collection with the given key. Returns an error if the key is already in use (if you intend to replace the document in that case, use upsert instead.)

Create the given document in this collection with the given key. Returns true if the document was created, or false if it already existed.

Add the given document to this collection, assigning it a new key at random.

Overwrite the given document to this collection, creating a new document if one does not exist.

Update the given document, returning an error if it does not exist.

Get the document with a given key.

Delete the document with a given key.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

Wrap the input message T in a tonic::Request

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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