SCResult

Type Alias SCResult 

Source
pub type SCResult<T> = Result<T, SCError>;
Expand description

Result type alias for ScreenCaptureKit operations

This is a convenience alias for Result<T, SCError> used throughout the library.

§Examples

use screencapturekit::prelude::*;

fn validate_dimensions(width: u32, height: u32) -> SCResult<()> {
    if width == 0 {
        return Err(SCError::invalid_dimension("width", 0));
    }
    if height == 0 {
        return Err(SCError::invalid_dimension("height", 0));
    }
    Ok(())
}

assert!(validate_dimensions(0, 1080).is_err());
assert!(validate_dimensions(1920, 1080).is_ok());

Aliased Type§

pub enum SCResult<T> {
    Ok(T),
    Err(SCError),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(SCError)

Contains the error value