Struct firestore::FirestoreDb
source · [−]pub struct FirestoreDb { /* private fields */ }
Implementations
sourceimpl<'a> FirestoreDb
impl<'a> FirestoreDb
pub async fn new<S>(google_project_id: S) -> Result<Self, FirestoreError>where
S: AsRef<str>,
pub async fn with_options(
options: FirestoreDbOptions
) -> Result<Self, FirestoreError>
pub fn deserialize_doc_to<T>(doc: &Document) -> Result<T, FirestoreError>where
for<'de> T: Deserialize<'de>,
pub async fn ping(&self) -> Result<(), FirestoreError>
pub fn get_database_path(&self) -> &String
pub fn get_documents_path(&self) -> &String
pub fn client(&self) -> &GoogleApi<FirestoreClient<GoogleAuthMiddleware>>
pub async fn query_doc(
&'a self,
params: FirestoreQueryParams
) -> Result<Vec<Document>, FirestoreError>
pub async fn stream_query_doc<'b>(
&'a self,
params: FirestoreQueryParams
) -> Result<BoxStream<'b, Document>, FirestoreError>
pub async fn stream_query_doc_with_errors<'b>(
&'a self,
params: FirestoreQueryParams
) -> Result<BoxStream<'b, Result<Document, FirestoreError>>, FirestoreError>
pub async fn query_obj<T>(
&self,
params: FirestoreQueryParams
) -> Result<Vec<T>, FirestoreError>where
for<'de> T: Deserialize<'de>,
pub async fn stream_query_obj<'b, T>(
&'a self,
params: FirestoreQueryParams
) -> Result<BoxStream<'b, T>, FirestoreError>where
for<'de> T: Deserialize<'de>,
pub async fn stream_query_obj_with_errors<'b, T>(
&'a self,
params: FirestoreQueryParams
) -> Result<BoxStream<'b, Result<T, FirestoreError>>, FirestoreError>where
for<'de> T: Deserialize<'de>,
T: Send + 'b,
pub async fn get_doc_by_id<S>(
&self,
parent: &str,
collection_id: &str,
document_id: S
) -> Result<Document, FirestoreError>where
S: AsRef<str>,
pub async fn get_obj<T, S>(
&self,
collection_id: &str,
document_id: S
) -> Result<T, FirestoreError>where
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn get_obj_at<T, S>(
&self,
parent: &str,
collection_id: &str,
document_id: S
) -> Result<T, FirestoreError>where
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn get_obj_if_exists<T, S>(
&self,
collection_id: &str,
document_id: S
) -> Result<Option<T>, FirestoreError>where
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn get_obj_at_if_exists<T, S>(
&self,
parent: &str,
collection_id: &str,
document_id: S
) -> Result<Option<T>, FirestoreError>where
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn create_obj<T, S>(
&self,
collection_id: &str,
document_id: S,
obj: &T
) -> Result<T, FirestoreError>where
T: Serialize + Sync + Send,
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn create_obj_at<T, S>(
&self,
parent: &str,
collection_id: &str,
document_id: S,
obj: &T
) -> Result<T, FirestoreError>where
T: Serialize + Sync + Send,
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn create_doc<S>(
&self,
parent: &str,
collection_id: &str,
document_id: S,
input_doc: Document,
return_only_fields: Option<Vec<String>>
) -> Result<Document, FirestoreError>where
S: AsRef<str>,
pub async fn update_obj<T, S>(
&self,
collection_id: &str,
document_id: S,
obj: &T,
update_only: Option<Vec<String>>
) -> Result<T, FirestoreError>where
T: Serialize + Sync + Send,
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn update_obj_at<T, S>(
&self,
parent: &str,
collection_id: &str,
document_id: S,
obj: &T,
update_only: Option<Vec<String>>
) -> Result<T, FirestoreError>where
T: Serialize + Sync + Send,
for<'de> T: Deserialize<'de>,
S: AsRef<str>,
pub async fn update_doc(
&self,
collection_id: &str,
firestore_doc: Document,
update_only: Option<Vec<String>>,
return_only_fields: Option<Vec<String>>
) -> Result<Document, FirestoreError>
pub async fn delete_by_id<S>(
&self,
collection_id: &str,
document_id: S
) -> Result<(), FirestoreError>where
S: AsRef<str>,
pub async fn delete_by_id_at<S>(
&self,
parent: &str,
collection_id: &str,
document_id: S
) -> Result<(), FirestoreError>where
S: AsRef<str>,
pub async fn listen_doc<'b>(
&'a self,
database_path: &'a str,
params: &'a FirestoreQueryParams,
labels: HashMap<String, String>,
since_token_value: Option<Vec<u8>>,
target_id: i32
) -> Result<BoxStream<'b, Result<ListenResponse, FirestoreError>>, FirestoreError>
pub async fn list_doc(
&self,
params: FirestoreListDocParams
) -> Result<FirestoreListDocResult, FirestoreError>
pub async fn stream_list_doc(
&'a self,
params: FirestoreListDocParams
) -> Result<BoxStream<'a, Document>, FirestoreError>
pub async fn stream_list_obj<T>(
&'a self,
params: FirestoreListDocParams
) -> Result<BoxStream<'a, T>, FirestoreError>where
for<'de> T: Deserialize<'de>,
Auto Trait Implementations
impl !RefUnwindSafe for FirestoreDb
impl Send for FirestoreDb
impl Sync for FirestoreDb
impl Unpin for FirestoreDb
impl !UnwindSafe for FirestoreDb
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more