use async_trait::async_trait;
use futures::StreamExt;
use strmline::{Progress, State, Streamline};
use tokio::runtime::Runtime;
#[test]
fn completes_up() {
#[derive(Debug)]
struct Context;
#[derive(Clone, Debug, PartialEq)]
enum MyState {
Start,
Middle(String),
End(String),
}
impl Default for MyState {
fn default() -> Self {
Self::Start
}
}
#[async_trait(?Send)]
impl State for MyState {
type Context = Context;
type Error = ();
async fn next(
&self,
_context: Option<&Self::Context>,
) -> Result