pub struct ErrorHandler<F>{ /* private fields */ }Expand description
A simple error handler wrapper for closures
Allows using a closure as a stream delegate that only handles errors.
§Examples
use screencapturekit::prelude::*;
use screencapturekit::stream::delegate_trait::ErrorHandler;
let error_handler = ErrorHandler::new(|error| {
eprintln!("Stream error: {}", error);
});
let stream = SCStream::new_with_delegate(&filter, &config, error_handler);Implementations§
Trait Implementations§
Source§impl<F> SCStreamDelegateTrait for ErrorHandler<F>
impl<F> SCStreamDelegateTrait for ErrorHandler<F>
Source§fn did_stop_with_error(&self, error: SCError)
fn did_stop_with_error(&self, error: SCError)
Called when stream stops with an error
Source§fn output_video_effect_did_start_for_stream(&self)
fn output_video_effect_did_start_for_stream(&self)
Called when video effects start
Source§fn output_video_effect_did_stop_for_stream(&self)
fn output_video_effect_did_stop_for_stream(&self)
Called when video effects stop
Auto Trait Implementations§
impl<F> Freeze for ErrorHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for ErrorHandler<F>where
F: RefUnwindSafe,
impl<F> Send for ErrorHandler<F>
impl<F> Sync for ErrorHandler<F>where
F: Sync,
impl<F> Unpin for ErrorHandler<F>where
F: Unpin,
impl<F> UnwindSafe for ErrorHandler<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more