Expand description
§Firebase App SDK
The Firebase App SDK for Rust provides a Rust API for integrating Firebase services into your Rust applications. This SDK allows you to easily access Firebase features such as authentication, real-time database, storage, and more.
§Usage
To interact with Firebase services, you need to create an App
instance with the required options. Here’s an example:
use firebase_app::{App,DEFAULT,Options};
fn main() {
let options = Options::new("YOUR_APPLICATION_ID", "YOUR_API_KEY")
.with_database_url("YOUR_DATABASE_URL")
.with_storage_bucket("YOUR_STORAGE_BUCKET");
let app = App::new(DEFAULT, options);
}
Once you have created an App instance, you can pass it to other Firebase services for further interactions. Here’s an example of using the app instance with the Firebase Authentication service:
use firebase_app::App;
use firebase_app::Options;
use firebase_auth::auth::Authentication;
const DEFAULT: &str = "DEFAULT";
fn main() {
let options = Options::new("YOUR_APPLICATION_ID", "YOUR_API_KEY")
.with_auth_domain("YOUR_AUTH_DOMAIN");
let app = App::new(DEFAULT, options);
// Use the app instance with the Firebase Authentication service
let auth = Authentication::new(&app);
// Perform authentication operations using the `auth` instance
// ...
}
Please note that the above examples are simplified and serve as a starting point. Refer to the documentation of each Firebase service for detailed usage instructions.
Structs§
- App
- Represents an application with its associated options.
- Options
- Represents the configurable options for an application.
Constants§
- DEFAULT
- Represents a default value or identifier in the context of the Firebase application.