pub trait SCStreamDelegateTrait: Send {
// Provided methods
fn output_video_effect_did_start_for_stream(&self) { ... }
fn output_video_effect_did_stop_for_stream(&self) { ... }
fn did_stop_with_error(&self, _error: SCError) { ... }
fn stream_did_stop(&self, _error: Option<String>) { ... }
}Expand description
Trait for handling stream lifecycle events
Implement this trait to receive notifications about stream state changes, errors, and video effects.
§Examples
use screencapturekit::stream::delegate_trait::SCStreamDelegateTrait;
use screencapturekit::error::SCError;
struct MyDelegate;
impl SCStreamDelegateTrait for MyDelegate {
fn stream_did_stop(&self, error: Option<String>) {
if let Some(err) = error {
eprintln!("Stream stopped with error: {}", err);
} else {
println!("Stream stopped normally");
}
}
fn did_stop_with_error(&self, error: SCError) {
eprintln!("Stream error: {}", error);
}
}Provided Methods§
Sourcefn output_video_effect_did_start_for_stream(&self)
fn output_video_effect_did_start_for_stream(&self)
Called when video effects start
Sourcefn output_video_effect_did_stop_for_stream(&self)
fn output_video_effect_did_stop_for_stream(&self)
Called when video effects stop
Sourcefn did_stop_with_error(&self, _error: SCError)
fn did_stop_with_error(&self, _error: SCError)
Called when stream stops with an error
Sourcefn stream_did_stop(&self, _error: Option<String>)
fn stream_did_stop(&self, _error: Option<String>)
Called when stream stops
§Parameters
error: Optional error message if the stream stopped due to an error