pub enum CameraIndex {
Index(u32),
String(String),
}Expand description
Describes the index of the camera.
- Index: A numbered index
- String: A string, used for
IPCameras.
Variants§
Implementations§
Source§impl CameraIndex
impl CameraIndex
Sourcepub fn as_index(&self) -> Result<u32, NokhwaError>
pub fn as_index(&self) -> Result<u32, NokhwaError>
Turns this value into a number. If it is a string, it will attempt to parse it as a u32.
§Errors
Fails if the value is not a number.
Sourcepub fn as_string(&self) -> String
pub fn as_string(&self) -> String
Turns this value into a String. If it is a number, it will be automatically converted.
Sourcepub fn is_index(&self) -> bool
pub fn is_index(&self) -> bool
Returns true if this CameraIndex contains an CameraIndex::Index
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if this CameraIndex contains an CameraIndex::String
Trait Implementations§
Source§impl Clone for CameraIndex
impl Clone for CameraIndex
Source§fn clone(&self) -> CameraIndex
fn clone(&self) -> CameraIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraIndex
impl Debug for CameraIndex
Source§impl Default for CameraIndex
impl Default for CameraIndex
Source§fn default() -> CameraIndex
fn default() -> CameraIndex
Returns the “default value” for a type. Read more
Source§impl Display for CameraIndex
impl Display for CameraIndex
Source§impl Hash for CameraIndex
impl Hash for CameraIndex
Source§impl Ord for CameraIndex
impl Ord for CameraIndex
Source§fn cmp(&self, other: &CameraIndex) -> Ordering
fn cmp(&self, other: &CameraIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CameraIndex
impl PartialEq for CameraIndex
Source§impl PartialOrd for CameraIndex
impl PartialOrd for CameraIndex
impl Eq for CameraIndex
impl StructuralPartialEq for CameraIndex
Auto Trait Implementations§
impl Freeze for CameraIndex
impl RefUnwindSafe for CameraIndex
impl Send for CameraIndex
impl Sync for CameraIndex
impl Unpin for CameraIndex
impl UnsafeUnpin for CameraIndex
impl UnwindSafe for CameraIndex
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