pub fn sync_callback<F>(f: F) -> MessageCallbackExpand description
Wrap a synchronous closure in a MessageCallback.
This is the ergonomic constructor for callbacks that perform only
synchronous work. The closure receives ownership of each Message
and returns immediately; the resulting future resolves in a single poll.
ยงExample
use gemini_cli_sdk::callback::sync_callback;
let cb = sync_callback(|msg| {
println!("message for session {:?}", msg.session_id());
});