pub enum CameraState {
Idle,
Starting,
Running,
Unavailable,
Denied,
Error(String),
}Expand description
What the camera is doing, as the native side reports it.
Variants§
Idle
No session: never started, stopped, or waiting for a permission the app has not asked for.
Starting
The session is being configured and started.
Running
The preview is live and a capture will succeed.
This device has no usable camera: the iOS Simulator, a desktop without one.
Denied
The permission was refused, or the OS restricts it, so the session cannot start.
Error(String)
The native side failed; the text is its message.
Implementations§
Source§impl CameraState
impl CameraState
Sourcepub fn from_report(num: f64, text: &str) -> Option<CameraState>
pub fn from_report(num: f64, text: &str) -> Option<CameraState>
The state a native report means. report::PHOTO is not a state and maps to None.
Trait Implementations§
Source§impl Clone for CameraState
impl Clone for CameraState
Source§impl Debug for CameraState
impl Debug for CameraState
Source§impl Default for CameraState
impl Default for CameraState
impl Eq for CameraState
Source§impl PartialEq for CameraState
impl PartialEq for CameraState
impl StructuralPartialEq for CameraState
Auto Trait Implementations§
impl Freeze for CameraState
impl RefUnwindSafe for CameraState
impl Send for CameraState
impl Sync for CameraState
impl Unpin for CameraState
impl UnsafeUnpin for CameraState
impl UnwindSafe for CameraState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more