Skip to main content

SCStreamErrorCode

Enum SCStreamErrorCode 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum SCStreamErrorCode {
Show 23 variants UserDeclined = -3_801, FailedToStart = -3_802, MissingEntitlements = -3_803, FailedApplicationConnectionInvalid = -3_804, FailedApplicationConnectionInterrupted = -3_805, FailedNoMatchingApplicationContext = -3_806, AttemptToStartStreamState = -3_807, AttemptToStopStreamState = -3_808, AttemptToUpdateFilterState = -3_809, AttemptToConfigState = -3_810, InternalError = -3_811, InvalidParameter = -3_812, NoWindowList = -3_813, NoDisplayList = -3_814, NoCaptureSource = -3_815, RemovingStream = -3_816, UserStopped = -3_817, FailedToStartAudioCapture = -3_818, FailedToStopAudioCapture = -3_819, FailedToStartMicrophoneCapture = -3_820, SystemStoppedStream = -3_821, InsufficientStorage = -3_822, NotSupported = -3_823,
}
Expand description

Error codes from Apple’s SCStreamError.Code

These correspond to the error codes returned by ScreenCaptureKit operations.

Based on Apple’s SCStreamErrorCode from SCError.h.

This enum is #[non_exhaustive]. Apple has historically added new codes in point releases (e.g. -3818..=-3819 in macOS 13.0, -3820..=-3821 in macOS 15.0) and is likely to add more. Downstream match statements must include a wildcard arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UserDeclined = -3_801

The user chose not to authorize capture

§

FailedToStart = -3_802

The stream failed to start

§

MissingEntitlements = -3_803

The stream failed due to missing entitlements

§

FailedApplicationConnectionInvalid = -3_804

Failed during recording - application connection invalid

§

FailedApplicationConnectionInterrupted = -3_805

Failed during recording - application connection interrupted

§

FailedNoMatchingApplicationContext = -3_806

Failed during recording - context id does not match application

§

AttemptToStartStreamState = -3_807

Failed due to attempting to start a stream that’s already in a recording state

§

AttemptToStopStreamState = -3_808

Failed due to attempting to stop a stream that’s already in a recording state

§

AttemptToUpdateFilterState = -3_809

Failed due to attempting to update the filter on a stream

§

AttemptToConfigState = -3_810

Failed due to attempting to update stream config on a stream

§

InternalError = -3_811

Failed to start due to video/audio capture failure

§

InvalidParameter = -3_812

Failed due to invalid parameter

§

NoWindowList = -3_813

Failed due to no window list

§

NoDisplayList = -3_814

Failed due to no display list

§

NoCaptureSource = -3_815

Failed due to no display or window list to capture

§

RemovingStream = -3_816

Failed to remove stream

§

UserStopped = -3_817

The stream was stopped by the user

§

FailedToStartAudioCapture = -3_818

The stream failed to start audio (macOS 13.0+)

§

FailedToStopAudioCapture = -3_819

The stream failed to stop audio (macOS 13.0+)

§

FailedToStartMicrophoneCapture = -3_820

The stream failed to start microphone (macOS 15.0+)

§

SystemStoppedStream = -3_821

The stream was stopped by the system (macOS 15.0+)

§

InsufficientStorage = -3_822

§

NotSupported = -3_823

Implementations§

Source§

impl SCStreamErrorCode

Source

pub fn from_raw(code: i32) -> Option<Self>

Create from raw error code value

Source

pub const fn as_raw(self) -> i32

Get the raw error code value

Trait Implementations§

Source§

impl Clone for SCStreamErrorCode

Source§

fn clone(&self) -> SCStreamErrorCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SCStreamErrorCode

Source§

impl Debug for SCStreamErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SCStreamErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SCStreamErrorCode

Source§

impl From<SCStreamErrorCode> for SCError

Source§

fn from(code: SCStreamErrorCode) -> Self

Converts to this type from the input type.
Source§

impl Hash for SCStreamErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SCStreamErrorCode

Source§

fn eq(&self, other: &SCStreamErrorCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SCStreamErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.