update create_history_stream example
This commit is contained in:
parent
80e99deb6f
commit
c556373a96
|
@ -4,7 +4,10 @@ use async_std::stream::StreamExt;
|
|||
use futures::TryStreamExt;
|
||||
|
||||
use golgi::{
|
||||
api::get_subset::{SubsetQuery, SubsetQueryOptions},
|
||||
api::{
|
||||
get_subset::{SubsetQuery, SubsetQueryOptions},
|
||||
history_stream::CreateHistoryStream,
|
||||
},
|
||||
messages::{SsbMessageContentType, SsbMessageKVT},
|
||||
sbot::Keystore,
|
||||
GolgiError, Sbot,
|
||||
|
@ -30,10 +33,11 @@ async fn run() -> Result<(), GolgiError> {
|
|||
|
||||
/* HISTORY STREAM EXAMPLE */
|
||||
|
||||
let history_stream_args = CreateHistoryStream::new(author.to_string());
|
||||
// Create an ordered stream of all messages authored by the `author`
|
||||
// identity. Messages are returned as KVTs (Key Value Timestamp).
|
||||
let history_stream = sbot_client
|
||||
.create_history_stream(author.to_string())
|
||||
.create_history_stream(history_stream_args)
|
||||
.await?;
|
||||
|
||||
// Pin the stream to the stack to allow polling of the `future`.
|
||||
|
@ -61,7 +65,7 @@ async fn run() -> Result<(), GolgiError> {
|
|||
// Create an ordered stream of all messages authored by the `author`
|
||||
// identity.
|
||||
let history_stream = sbot_client
|
||||
.create_history_stream(author.to_string())
|
||||
.create_history_stream(CreateHistoryStream::new(author.to_string()))
|
||||
.await?;
|
||||
|
||||
// Collect the stream elements into a `Vec<SsbMessageKVT>` using
|
||||
|
@ -78,7 +82,7 @@ async fn run() -> Result<(), GolgiError> {
|
|||
// Create an ordered stream of all messages authored by the `author`
|
||||
// identity.
|
||||
let history_stream = sbot_client
|
||||
.create_history_stream(author.to_string())
|
||||
.create_history_stream(CreateHistoryStream::new(author.to_string()))
|
||||
.await?;
|
||||
|
||||
// Iterate through the elements in the stream and use `map` to convert
|
||||
|
|
Loading…
Reference in New Issue