pub struct StreamingUxValidator { /* private fields */ }Expand description
Streaming UX validator for real-time audio/video interfaces
§Example
use std::time::Duration;
use jugar_probar::validators::{StreamingUxValidator, StreamingMetric};
let mut validator = StreamingUxValidator::new()
.with_max_latency(Duration::from_millis(100))
.with_buffer_underrun_threshold(3);
// Simulate streaming metrics
validator.record_metric(StreamingMetric::Latency(Duration::from_millis(50)));
validator.record_metric(StreamingMetric::FrameRendered { timestamp: 1000 });
assert!(validator.validate().is_ok());Implementations§
Source§impl StreamingUxValidator
impl StreamingUxValidator
Sourcepub fn with_max_latency(self, latency: Duration) -> Self
pub fn with_max_latency(self, latency: Duration) -> Self
Set maximum acceptable latency
Sourcepub fn with_buffer_underrun_threshold(self, threshold: usize) -> Self
pub fn with_buffer_underrun_threshold(self, threshold: usize) -> Self
Set buffer underrun threshold
Sourcepub fn with_max_dropped_frames(self, max: usize) -> Self
pub fn with_max_dropped_frames(self, max: usize) -> Self
Set maximum dropped frames
Sourcepub fn with_min_fps(self, fps: f64) -> Self
pub fn with_min_fps(self, fps: f64) -> Self
Set minimum FPS
Sourcepub fn with_ttfb_timeout(self, timeout: Duration) -> Self
pub fn with_ttfb_timeout(self, timeout: Duration) -> Self
Set time-to-first-byte timeout
Sourcepub fn record_metric(&mut self, metric: StreamingMetric)
pub fn record_metric(&mut self, metric: StreamingMetric)
Record a streaming metric
Sourcepub fn state(&self) -> StreamingState
pub fn state(&self) -> StreamingState
Get current state
Sourcepub fn buffer_underruns(&self) -> usize
pub fn buffer_underruns(&self) -> usize
Get buffer underrun count
Sourcepub fn dropped_frames(&self) -> usize
pub fn dropped_frames(&self) -> usize
Get dropped frame count
Sourcepub fn average_fps(&self) -> f64
pub fn average_fps(&self) -> f64
Calculate average FPS from recorded frames
Sourcepub fn validate(
&self,
) -> Result<StreamingValidationResult, StreamingValidationError>
pub fn validate( &self, ) -> Result<StreamingValidationResult, StreamingValidationError>
Sourcepub fn validate_all(&self) -> Vec<StreamingValidationError>
pub fn validate_all(&self) -> Vec<StreamingValidationError>
Get all validation errors (for comprehensive reporting)
Sourcepub fn state_history(&self) -> &[(StreamingState, Instant)]
pub fn state_history(&self) -> &[(StreamingState, Instant)]
Get state history for debugging
Trait Implementations§
Source§impl Clone for StreamingUxValidator
impl Clone for StreamingUxValidator
Source§fn clone(&self) -> StreamingUxValidator
fn clone(&self) -> StreamingUxValidator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StreamingUxValidator
impl Debug for StreamingUxValidator
Auto Trait Implementations§
impl Freeze for StreamingUxValidator
impl RefUnwindSafe for StreamingUxValidator
impl Send for StreamingUxValidator
impl Sync for StreamingUxValidator
impl Unpin for StreamingUxValidator
impl UnsafeUnpin for StreamingUxValidator
impl UnwindSafe for StreamingUxValidator
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().