Module error

Module error 

Source
Expand description

Error types for ScreenCaptureKit

This module provides comprehensive error types for all operations in the library. All operations return SCResult<T> which is an alias for Result<T, SCError>.

§Examples

use screencapturekit::prelude::*;

fn setup_capture() -> SCResult<()> {
    // Configure with mutable configuration
    let mut config = SCStreamConfiguration::default();
    config.set_width(1920);
    config.set_height(1080);
    Ok(())
}

// Pattern matching on errors
match setup_capture() {
    Ok(_) => println!("Success!"),
    Err(SCError::InvalidDimension { field, value }) => {
        eprintln!("Invalid {}: {}", field, value);
    }
    Err(e) => eprintln!("Error: {}", e),
}

Enums§

SCError
Comprehensive error type for ScreenCaptureKit operations

Functions§

create_sc_error
Helper function to create an error (for backward compatibility)

Type Aliases§

SCResult
Result type alias for ScreenCaptureKit operations