pub struct Functions { /* private fields */ }Expand description
Client entry point for invoking HTTPS callable Cloud Functions.
This mirrors the JavaScript FunctionsService implementation in
packages/functions/src/service.ts, exposing
a strongly-typed Rust surface that aligns with the modular SDK.
Implementations§
Source§impl Functions
impl Functions
pub fn app(&self) -> &FirebaseApp
pub fn region(&self) -> &str
Sourcepub fn https_callable<Request, Response>(
&self,
name: &str,
) -> FunctionsResult<CallableFunction<Request, Response>>where
Request: Serialize + 'static,
Response: DeserializeOwned + 'static,
pub fn https_callable<Request, Response>(
&self,
name: &str,
) -> FunctionsResult<CallableFunction<Request, Response>>where
Request: Serialize + 'static,
Response: DeserializeOwned + 'static,
Returns a typed callable reference for the given Cloud Function name.
This is the Rust equivalent of
httpsCallable from the
JavaScript SDK (packages/functions/src/service.ts).
§Examples
ⓘ
let functions = get_functions(Some(app.clone()), None).await?;
let callable = functions
.https_callable::<serde_json::Value, serde_json::Value>("helloWorld")?;
let response = callable
.call_async(&json!({"text": "hi"}))
.await?;
println!("{:?}", response);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Functions
impl RefUnwindSafe for Functions
impl Send for Functions
impl Sync for Functions
impl Unpin for Functions
impl UnwindSafe for Functions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more