From c556373a9691182ab8f01c28babe81a1e98da9f1 Mon Sep 17 00:00:00 2001 From: glyph Date: Tue, 9 Aug 2022 08:24:53 +0100 Subject: [PATCH] update create_history_stream example --- examples/streams.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/streams.rs b/examples/streams.rs index a9b9106..be7d5bc 100644 --- a/examples/streams.rs +++ b/examples/streams.rs @@ -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` 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