pub struct ClientContext {
pub device_type: DeviceType,
pub network: NetworkQuality,
pub hw_decode_codecs: Vec<VideoCodec>,
}Expand description
Client context for dynamic score adjustment.
Fields§
§device_type: DeviceTypeDevice type affects resolution preference.
network: NetworkQualityNetwork condition affects bitrate tolerance.
hw_decode_codecs: Vec<VideoCodec>Hardware-supported video codecs on the client.
Implementations§
Source§impl ClientContext
impl ClientContext
Sourcepub fn adjust_score(
&self,
scores: QualityScores,
file_video_codec: Option<VideoCodec>,
) -> QualityScores
pub fn adjust_score( &self, scores: QualityScores, file_video_codec: Option<VideoCodec>, ) -> QualityScores
Applies context-aware multipliers to the quality scores.
Returns the adjusted final score.
Trait Implementations§
Source§impl Clone for ClientContext
impl Clone for ClientContext
Source§fn clone(&self) -> ClientContext
fn clone(&self) -> ClientContext
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 ClientContext
impl Debug for ClientContext
Source§impl Default for ClientContext
impl Default for ClientContext
Source§impl<'de> Deserialize<'de> for ClientContext
impl<'de> Deserialize<'de> for ClientContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ClientContext
impl RefUnwindSafe for ClientContext
impl Send for ClientContext
impl Sync for ClientContext
impl Unpin for ClientContext
impl UnsafeUnpin for ClientContext
impl UnwindSafe for ClientContext
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