Crates.io | firebase-rs |
lib.rs | firebase-rs |
version | 2.1.2 |
source | src |
created_at | 2020-04-27 11:04:07.27605 |
updated_at | 2024-06-14 16:54:46.287237 |
description | Rust based Firebase library |
homepage | |
repository | https://github.com/emreyalvac/firebase-rs |
max_upload_size | |
id | 234618 |
size | 25,506 |
use firebase_rs::*;
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap();
let firebase = Firebase::auth("https://myfirebase.firebaseio.com", "AUTH_KEY").unwrap();
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID").at(...);
let firebase = Firebase::new("https://myfirebase.firebaseio.com").at("users").unwrap();
let stream = firebase.with_realtime_events().unwrap();
stream
.listen( | event_type, data| {
println ! ("Type: {:?} Data: {:?}", event_type, data);
}, | err| println!("{:?}", err), false).await;
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
let users = firebase.get_as_string().await;
#[derive(Serialize, Deserialize, Debug)]
struct User {
name: String
}
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
let user = firebase.get::<HashMap<String, User> > ().await;
#[derive(Serialize, Deserialize, Debug)]
struct User {
name: String
}
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
let user = firebase.get::<User>().await;
#[derive(Serialize, Deserialize, Debug)]
struct User {
name: String
}
let user = User { name: String::default () };
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
firebase.set( & user).await;
#[derive(Serialize, Deserialize, Debug)]
struct User {
name: String
}
let user = User { name: String::default () };
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
firebase.update( & user).await;
let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().with_params().start_at(1).order_by("name").equal_to(5).finish();
let result = firebase.get().await;
Thanks goes to these wonderful people ✨