pub enum RemoteTrack {
Video(VideoTrack),
Audio(AudioTrack),
}Expand description
A track delivered by [PeerConnectionObserver::on_track] — media-typed,
so RemoteTrack::Video(v).on_frame(...) and RemoteTrack::Audio(a) .on_frame(...) each take the matching frame type and nothing else.
Variants§
Implementations§
Source§impl RemoteTrack
impl RemoteTrack
Sourcepub fn as_video(&self) -> Option<&VideoTrack>
pub fn as_video(&self) -> Option<&VideoTrack>
Some when this is a video track.
Sourcepub fn as_audio(&self) -> Option<&AudioTrack>
pub fn as_audio(&self) -> Option<&AudioTrack>
Some when this is an audio track.
Sourcepub fn into_video(self) -> VideoTrack
pub fn into_video(self) -> VideoTrack
Unwrap a video track (panics on audio tracks).
Sourcepub fn into_audio(self) -> AudioTrack
pub fn into_audio(self) -> AudioTrack
Unwrap an audio track (panics on video tracks).
Auto Trait Implementations§
impl !Freeze for RemoteTrack
impl RefUnwindSafe for RemoteTrack
impl Send for RemoteTrack
impl Sync for RemoteTrack
impl Unpin for RemoteTrack
impl UnsafeUnpin for RemoteTrack
impl UnwindSafe for RemoteTrack
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