Created
February 10, 2022 03:56
-
-
Save caesaneer/47a4101064ebd6fc8a51a5795131c102 to your computer and use it in GitHub Desktop.
FRB
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
#![allow(unused_variables)] | |
use anyhow::Result; | |
use flutter_rust_bridge::StreamSink; | |
#[derive(Debug, Clone)] | |
pub struct MySize { | |
pub width: i32, | |
pub height: i32, | |
} | |
pub fn handle_stream(sink: StreamSink<MySize>, arg: String) -> Result<()> { | |
println!("handle_stream arg={}", arg); | |
for i in 0..5 { | |
sink.add(MySize { | |
width: 20, | |
height: 30, | |
}); | |
} | |
sink.close(); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment