Skip to content

Commit

Permalink
2.0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
yalvac committed Jul 26, 2022
1 parent e095210 commit 5045950
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "firebase-rs"
edition = "2021"
version = "2.0.3"
version = "2.0.4"
description = "Rust based Firebase library"
readme = "README.md"
repository = "https://github.com/emreyalvac/firebase-rs"
documentation = "https://docs.rs/firebase-rs/2.0.3/firebase_rs/"
documentation = "https://docs.rs/firebase-rs/2.0.4/firebase_rs/"
license = "MIT"
authors = ["Emre YALVAÇ <[email protected]>"]
exclude = ["examples/*", "tests/*"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Rust based Firebase library.
![firebase](https://firebase.google.com/downloads/brand-guidelines/SVG/logo-logomark.svg 'Firebase')

# Full Documentation
[Documentation](https://docs.rs/firebase-rs/2.0.3/firebase_rs/)
[Documentation](https://docs.rs/firebase-rs/2.0.4/firebase_rs/)


# TODO
Expand Down
38 changes: 22 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct Firebase {
impl Firebase {
/// ```
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap();
/// ```
pub fn new(uri: &str) -> UrlParseResult<Self>
Expand All @@ -36,6 +37,7 @@ impl Firebase {

/// ```
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap();
/// ```
pub fn auth(uri: &str, auth_key: &str) -> UrlParseResult<Self>
Expand All @@ -53,9 +55,10 @@ impl Firebase {

/// ```rust
/// use firebase_rs::Firebase;
///
/// # async fn run() {
/// 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::<String>().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::<String>().await;
/// # }
/// ```
pub fn with_params(&self) -> Params {
Expand All @@ -65,6 +68,7 @@ impl Firebase {

/// ```
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID").at("f69111a8a5258c15286d3d0bd4688c55");
/// ```
pub fn at(&mut self, path: &str) -> Self {
Expand Down Expand Up @@ -94,6 +98,7 @@ impl Firebase {

/// ```
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let uri = firebase.get_uri();
/// ```
Expand Down Expand Up @@ -192,9 +197,9 @@ impl Firebase {
/// }
///
/// # async fn run() {
/// let user = User { name: String::default() };
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let users = firebase.set(&user).await;
/// let user = User { name: String::default() };
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let users = firebase.set(&user).await;
/// # }
/// ```
pub async fn set<T>(&self, data: &T) -> RequestResult<Response>
Expand All @@ -216,8 +221,8 @@ impl Firebase {
/// }
///
/// # async fn run() {
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let users = firebase.get::<HashMap<String, User>>().await;
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let users = firebase.get::<HashMap<String, User>>().await;
/// # }
/// ```
pub async fn get_as_string(&self) -> RequestResult<Response> {
Expand All @@ -235,13 +240,13 @@ impl Firebase {
/// }
///
/// # async fn run() {
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// let user = firebase.get::<User>().await;
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// let user = firebase.get::<User>().await;
///
/// // OR
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let user = firebase.get::<HashMap<String, User>>().await;
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let user = firebase.get::<HashMap<String, User>>().await;
/// # }
/// ```
pub async fn get<T>(&self) -> RequestResult<T>
Expand All @@ -253,9 +258,10 @@ impl Firebase {

/// ```
/// use firebase_rs::Firebase;
///
/// # async fn run() {
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// firebase.delete().await;
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// firebase.delete().await;
/// # }
/// ```
pub async fn delete(&self) -> RequestResult<Response> {
Expand All @@ -272,9 +278,9 @@ impl Firebase {
/// }
///
/// # async fn run() {
/// let user = User { name: String::default() };
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// let users = firebase.update(&user).await;
/// let user = User { name: String::default() };
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID");
/// let users = firebase.update(&user).await;
/// # }
/// ```
pub async fn update<T>(&self, data: &T) -> RequestResult<Response>
Expand Down

0 comments on commit 5045950

Please sign in to comment.