pub struct RTCStatsReport { /* private fields */ }Expand description
A collection of statistics objects returned by getStats().
This type implements the W3C RTCStatsReport interface, providing map-like access to statistics objects keyed by their unique IDs.
§Example
ⓘ
use rtc::statistics::StatsSelector;
let report = peer_connection.get_stats(Instant::now(), StatsSelector::None);
// Iterate over all stats
for entry in report.iter() {
println!("{:?}: {:?}", entry.stats_type(), entry.id());
}
// Get a specific stat by ID
if let Some(entry) = report.get("RTCPeerConnection") {
println!("Found peer connection stats");
}
// Filter by type
for inbound in report.iter_by_type(RTCStatsType::InboundRTP) {
println!("Inbound RTP: {:?}", inbound.id());
}Implementations§
Source§impl RTCStatsReport
impl RTCStatsReport
Sourcepub fn get(&self, id: &str) -> Option<&RTCStatsReportEntry>
pub fn get(&self, id: &str) -> Option<&RTCStatsReportEntry>
Gets a stats entry by its unique ID.
Sourcepub fn contains(&self, id: &str) -> bool
pub fn contains(&self, id: &str) -> bool
Returns true if the report contains an entry with the given ID.
Sourcepub fn iter(&self) -> impl Iterator<Item = &RTCStatsReportEntry>
pub fn iter(&self) -> impl Iterator<Item = &RTCStatsReportEntry>
Returns an iterator over all stats entries.
Sourcepub fn iter_by_type(
&self,
typ: RTCStatsType,
) -> impl Iterator<Item = &RTCStatsReportEntry>
pub fn iter_by_type( &self, typ: RTCStatsType, ) -> impl Iterator<Item = &RTCStatsReportEntry>
Returns an iterator over stats entries of a specific type.
Sourcepub fn peer_connection(&self) -> Option<&RTCPeerConnectionStats>
pub fn peer_connection(&self) -> Option<&RTCPeerConnectionStats>
Returns the peer connection stats if present.
Sourcepub fn transport(&self) -> Option<&RTCTransportStats>
pub fn transport(&self) -> Option<&RTCTransportStats>
Returns the transport stats if present.
Sourcepub fn inbound_rtp_streams(
&self,
) -> impl Iterator<Item = &RTCInboundRtpStreamStats>
pub fn inbound_rtp_streams( &self, ) -> impl Iterator<Item = &RTCInboundRtpStreamStats>
Returns an iterator over all inbound RTP stream stats.
Sourcepub fn outbound_rtp_streams(
&self,
) -> impl Iterator<Item = &RTCOutboundRtpStreamStats>
pub fn outbound_rtp_streams( &self, ) -> impl Iterator<Item = &RTCOutboundRtpStreamStats>
Returns an iterator over all outbound RTP stream stats.
Sourcepub fn data_channels(&self) -> impl Iterator<Item = &RTCDataChannelStats>
pub fn data_channels(&self) -> impl Iterator<Item = &RTCDataChannelStats>
Returns an iterator over all data channel stats.
Sourcepub fn candidate_pairs(&self) -> impl Iterator<Item = &RTCIceCandidatePairStats>
pub fn candidate_pairs(&self) -> impl Iterator<Item = &RTCIceCandidatePairStats>
Returns an iterator over all ICE candidate pair stats.
Trait Implementations§
Source§impl Debug for RTCStatsReport
impl Debug for RTCStatsReport
Source§impl Default for RTCStatsReport
impl Default for RTCStatsReport
Source§fn default() -> RTCStatsReport
fn default() -> RTCStatsReport
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RTCStatsReport
impl RefUnwindSafe for RTCStatsReport
impl Send for RTCStatsReport
impl Sync for RTCStatsReport
impl Unpin for RTCStatsReport
impl UnsafeUnpin for RTCStatsReport
impl UnwindSafe for RTCStatsReport
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.