-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(client): clean up rust doc landing page
- Loading branch information
1 parent
fc2d453
commit 219c07e
Showing
13 changed files
with
77 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,55 @@ | ||
pub mod client; | ||
pub mod error; | ||
pub mod tls; | ||
//! # Rust Firehose Client | ||
//! | ||
//! Rust implementation of a client for the [StreamingFast Firehose](https://firehose.streamingfast.io/) | ||
//! gRPC Fetch `Block` and Stream `Block`s APIs. | ||
//! | ||
//! ## Example Fetching an Ethereum Block | ||
//! | ||
//! ```no_run | ||
//! # use firehose_client::{Chain, FirehoseClient}; | ||
//! # use firehose_protos::EthBlock as Block; | ||
//! # #[tokio::main] | ||
//! # async fn main() -> Result<(), firehose_protos::ProtosError> { | ||
//! let mut client = FirehoseClient::new(Chain::Ethereum); | ||
//! | ||
//! if let Some(response) = client.fetch_block(20672593).await.unwrap().ok() { | ||
//! let block = Block::try_from(response.into_inner())?; | ||
//! assert_eq!(block.number, 20672593); | ||
//! assert_eq!( | ||
//! format!("0x{}", hex::encode(block.hash)).as_str(), | ||
//! "0xea48ba1c8e38ea586239e9c5ec62949ddd79404c6006c099bb02a8b22ddd18e4" | ||
//! ); | ||
//! } | ||
//! # Ok(()) | ||
//! # } | ||
//! ``` | ||
//! | ||
//! ## Example Streaming Ethereum Blocks | ||
//! | ||
//! ```no_run | ||
//! # use firehose_client::{Chain, FirehoseClient}; | ||
//! # use futures::StreamExt; | ||
//! # #[tokio::main] | ||
//! # async fn main() -> Result<(), firehose_protos::ProtosError> { | ||
//! const TOTAL_BLOCKS: u64 = 8192; | ||
//! const START_BLOCK: u64 = 19581798; | ||
//! | ||
//! let mut client = FirehoseClient::new(Chain::Ethereum); | ||
//! let mut stream = client | ||
//! .stream_blocks(START_BLOCK, TOTAL_BLOCKS) | ||
//! .await | ||
//! .unwrap(); | ||
//! | ||
//! while let Some(block) = stream.next().await { | ||
//! // Do Something with the extracted stream of blocks. | ||
//! } | ||
//! # Ok(()) | ||
//! # } | ||
//! ``` | ||
//! | ||
mod client; | ||
mod error; | ||
mod tls; | ||
|
||
pub use crate::client::{Chain, FirehoseClient}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters