Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
emreyalvac committed Jul 13, 2023
1 parent ea455e3 commit 710a390
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
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.7"
version = "2.0.8"
description = "Rust based Firebase library"
readme = "README.md"
repository = "https://github.com/emreyalvac/firebase-rs"
documentation = "https://docs.rs/firebase-rs/2.0.7/firebase_rs/"
documentation = "https://docs.rs/firebase-rs/2.0.8/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 @@ -8,7 +8,7 @@ Rust based Firebase library.

# Full Documentation

[Documentation](https://docs.rs/firebase-rs/2.0.7/firebase_rs/)
[Documentation](https://docs.rs/firebase-rs/2.0.8/firebase_rs/)

# Features

Expand Down
35 changes: 18 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Firebase {
}

impl Firebase {
/// ```
/// ```rust
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap();
Expand All @@ -38,14 +38,13 @@ impl Firebase {
}
}

/// ```
/// const URI = "...";
/// const AUTH_KEY = "...";
/// ```rust
/// const URI: &str = "...";
/// const AUTH_KEY: &str = "...";
///
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap();
/// let parsed = firebase.auth(URI, AUTH_KEY);
/// let firebase = Firebase::auth("https://myfirebase.firebaseio.com", AUTH_KEY).unwrap();
/// ```
pub fn auth(uri: &str, auth_key: &str) -> UrlParseResult<Self>
where
Expand Down Expand Up @@ -80,23 +79,25 @@ impl Firebase {
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let stream = firebase.with_realtime_events().unwrap();
/// stream.listen(|event_type, data| {
/// println!(event_type, data);
/// }, |err| println!(err), false).await;
/// println!("{:?} {:?}" ,event_type, data);
/// }, |err| println!("{:?}" ,err), false).await;
/// # }
/// ```
///
/// To use streaming interface for async code, pair with `.stream()`:
/// ```rust
/// use firebase_rs::Firebase;
/// use futures_util::StreamExt;
///
/// # async fn run() {
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
/// let stream = firebase.with_realtime_events()
/// .unwrap()
/// .stream(true);
/// stream.for_each(|event| {
/// match event {
/// Ok((event_type, maybe_data)) => stream_event(event_type, maybe_data),
/// Err(x) => stream_err(x),
/// Ok((event_type, maybe_data)) => println!("{:?} {:?}" ,event_type, maybe_data),
/// Err(err) => println!("{:?}" ,err),
/// }
/// futures_util::future::ready(())
/// }).await;
Expand All @@ -106,7 +107,7 @@ impl Firebase {
ServerEvents::new(self.uri.as_str())
}

/// ```
/// ```rust
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users").at("USER_ID").at("f69111a8a5258c15286d3d0bd4688c55");
Expand Down Expand Up @@ -135,7 +136,7 @@ impl Firebase {
}
}

/// ```
/// ```rust
/// use firebase_rs::Firebase;
///
/// let firebase = Firebase::new("https://myfirebase.firebaseio.com").unwrap().at("users");
Expand Down Expand Up @@ -226,7 +227,7 @@ impl Firebase {
}
}

/// ```
/// ```rust
/// use firebase_rs::Firebase;
/// use serde::{Serialize, Deserialize};
///
Expand All @@ -249,7 +250,7 @@ impl Firebase {
self.request(Method::POST, Some(data)).await
}

/// ```
/// ```rust
/// use std::collections::HashMap;
/// use firebase_rs::Firebase;
/// use serde::{Serialize, Deserialize};
Expand All @@ -268,7 +269,7 @@ impl Firebase {
self.request(Method::GET, None).await
}

/// ```
/// ```rust
/// use std::collections::HashMap;
/// use firebase_rs::Firebase;
/// use serde::{Serialize, Deserialize};
Expand All @@ -295,7 +296,7 @@ impl Firebase {
self.request_generic::<T>(Method::GET).await
}

/// ```
/// ```rust
/// use firebase_rs::Firebase;
///
/// # async fn run() {
Expand All @@ -307,7 +308,7 @@ impl Firebase {
self.request(Method::DELETE, None).await
}

/// ```
/// ```rust
/// use firebase_rs::Firebase;
/// use serde::{Serialize, Deserialize};
///
Expand Down

0 comments on commit 710a390

Please sign in to comment.