#[non_exhaustive]pub enum StreamType {
Video,
Audio,
Sub,
Other,
Font,
Attach,
}Expand description
A type of stream.
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.
Implementations§
Source§impl StreamType
impl StreamType
Sourcepub const fn is_audio(&self) -> bool
pub const fn is_audio(&self) -> bool
Returns true if stream is Audio.
use mux_media::StreamType;
assert!(StreamType::Audio.is_audio());
assert!(!StreamType::Sub.is_audio());
assert!(!StreamType::Video.is_audio());
assert!(!StreamType::Other.is_audio());
assert!(!StreamType::Font.is_audio());
assert!(!StreamType::Attach.is_audio());Sourcepub const fn is_sub(&self) -> bool
pub const fn is_sub(&self) -> bool
Returns true if stream is Sub.
use mux_media::StreamType;
assert!(StreamType::Sub.is_sub());
assert!(!StreamType::Audio.is_sub());
assert!(!StreamType::Video.is_sub());
assert!(!StreamType::Other.is_sub());
assert!(!StreamType::Font.is_sub());
assert!(!StreamType::Attach.is_sub());Sourcepub const fn is_video(&self) -> bool
pub const fn is_video(&self) -> bool
Returns true if stream is Video.
use mux_media::StreamType;
assert!(StreamType::Video.is_video());
assert!(!StreamType::Audio.is_video());
assert!(!StreamType::Sub.is_video());
assert!(!StreamType::Other.is_video());
assert!(!StreamType::Font.is_video());
assert!(!StreamType::Attach.is_video());Sourcepub const fn is_other(&self) -> bool
pub const fn is_other(&self) -> bool
Returns true if stream is Other.
use mux_media::StreamType;
assert!(StreamType::Other.is_other());
assert!(!StreamType::Audio.is_other());
assert!(!StreamType::Sub.is_other());
assert!(!StreamType::Video.is_other());
assert!(!StreamType::Font.is_other());
assert!(!StreamType::Attach.is_other());Sourcepub const fn is_font(&self) -> bool
pub const fn is_font(&self) -> bool
Returns true if stream is Font.
use mux_media::StreamType;
assert!(StreamType::Font.is_font());
assert!(!StreamType::Audio.is_font());
assert!(!StreamType::Sub.is_font());
assert!(!StreamType::Video.is_font());
assert!(!StreamType::Other.is_font());
assert!(!StreamType::Attach.is_font());Sourcepub const fn is_attach(&self) -> bool
pub const fn is_attach(&self) -> bool
Returns true if stream is Attach.
use mux_media::StreamType;
assert!(StreamType::Attach.is_attach());
assert!(!StreamType::Audio.is_attach());
assert!(!StreamType::Sub.is_attach());
assert!(!StreamType::Video.is_attach());
assert!(!StreamType::Other.is_attach());
assert!(!StreamType::Font.is_attach());Sourcepub const fn is_track(&self) -> bool
pub const fn is_track(&self) -> bool
Returns true if stream is Audio, Sub, or Video.
use mux_media::StreamType;
assert!(StreamType::Audio.is_track());
assert!(StreamType::Sub.is_track());
assert!(StreamType::Video.is_track());
assert!(!StreamType::Other.is_track());
assert!(!StreamType::Font.is_track());
assert!(!StreamType::Attach.is_track());Sourcepub const fn is_an_attach(&self) -> bool
pub const fn is_an_attach(&self) -> bool
Returns true if stream is Font or Attach.
use mux_media::StreamType;
assert!(StreamType::Font.is_an_attach());
assert!(StreamType::Attach.is_an_attach());
assert!(!StreamType::Audio.is_an_attach());
assert!(!StreamType::Sub.is_an_attach());
assert!(!StreamType::Video.is_an_attach());
assert!(!StreamType::Other.is_an_attach());Trait Implementations§
Source§impl AsRef<str> for StreamType
impl AsRef<str> for StreamType
Source§impl Clone for StreamType
impl Clone for StreamType
Source§fn clone(&self) -> StreamType
fn clone(&self) -> StreamType
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 StreamType
impl Debug for StreamType
Source§impl Enum for StreamType
impl Enum for StreamType
Source§impl<V> EnumArray<V> for StreamType
impl<V> EnumArray<V> for StreamType
Source§impl FromStr for StreamType
impl FromStr for StreamType
Source§impl IntoEnumIterator for StreamType
impl IntoEnumIterator for StreamType
Source§impl Ord for StreamType
impl Ord for StreamType
Source§fn cmp(&self, other: &StreamType) -> Ordering
fn cmp(&self, other: &StreamType) -> 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 StreamType
impl PartialEq for StreamType
Source§impl PartialOrd for StreamType
impl PartialOrd for StreamType
impl Copy for StreamType
impl Eq for StreamType
impl StructuralPartialEq for StreamType
Auto Trait Implementations§
impl Freeze for StreamType
impl RefUnwindSafe for StreamType
impl Send for StreamType
impl Sync for StreamType
impl Unpin for StreamType
impl UnwindSafe for StreamType
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,
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