pub struct RecordingCallbacks { /* private fields */ }Expand description
Builder for closure-based recording delegate
Provides a convenient way to create a recording delegate using closures
instead of implementing the SCRecordingOutputDelegate trait.
§Examples
use screencapturekit::recording_output::{
SCRecordingOutput, SCRecordingOutputConfiguration, RecordingCallbacks
};
use std::path::Path;
let config = SCRecordingOutputConfiguration::new()
.with_output_url(Path::new("/tmp/recording.mp4"));
// Create delegate with all callbacks
let delegate = RecordingCallbacks::new()
.on_start(|| println!("Recording started!"))
.on_finish(|| println!("Recording finished!"))
.on_fail(|error| eprintln!("Recording failed: {}", error));
let recording = SCRecordingOutput::new_with_delegate(&config, delegate);
// Or just handle specific events
let delegate = RecordingCallbacks::new()
.on_fail(|error| eprintln!("Error: {}", error));Implementations§
Trait Implementations§
Source§impl Debug for RecordingCallbacks
impl Debug for RecordingCallbacks
Source§impl Default for RecordingCallbacks
impl Default for RecordingCallbacks
Source§impl SCRecordingOutputDelegate for RecordingCallbacks
impl SCRecordingOutputDelegate for RecordingCallbacks
Source§fn recording_did_start(&self)
fn recording_did_start(&self)
Called when recording starts successfully
Source§fn recording_did_fail(&self, error: String)
fn recording_did_fail(&self, error: String)
Called when recording fails with an error
Source§fn recording_did_finish(&self)
fn recording_did_finish(&self)
Called when recording finishes successfully
Auto Trait Implementations§
impl Freeze for RecordingCallbacks
impl !RefUnwindSafe for RecordingCallbacks
impl Send for RecordingCallbacks
impl !Sync for RecordingCallbacks
impl Unpin for RecordingCallbacks
impl !UnwindSafe for RecordingCallbacks
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