pub struct CodecDecision {
pub codec: CodecProfile,
pub exact_fallback: bool,
pub degradation_budget: f64,
pub receipt: CodecReceipt,
}Expand description
Outcome of policy evaluation containing selected codec and metadata.
Fields§
§codec: CodecProfileSelected codec profile
exact_fallback: boolTrue if exact fallback was triggered (compressed to raw)
degradation_budget: f64Allowed degradation budget for this decision
receipt: CodecReceiptReceipt containing detailed tracking information
Implementations§
Source§impl CodecDecision
impl CodecDecision
Sourcepub fn direct(codec: CodecProfile, degradation_budget: f64) -> Self
pub fn direct(codec: CodecProfile, degradation_budget: f64) -> Self
Create a direct codec decision without fallback.
Sourcepub fn with_exact_fallback(
codec: CodecProfile,
degradation_budget: f64,
receipt: ExactFallbackReceipt,
) -> Self
pub fn with_exact_fallback( codec: CodecProfile, degradation_budget: f64, receipt: ExactFallbackReceipt, ) -> Self
Create a codec decision with exact fallback.
Sourcepub fn with_degradation(
codec: CodecProfile,
degradation_budget: f64,
receipt: DegradationReceipt,
) -> Self
pub fn with_degradation( codec: CodecProfile, degradation_budget: f64, receipt: DegradationReceipt, ) -> Self
Create a codec decision with degradation between profiles.
Sourcepub fn had_fallback(&self) -> bool
pub fn had_fallback(&self) -> bool
Returns true if this decision involved any form of fallback.
Sourcepub fn effective_profile(&self) -> CodecProfile
pub fn effective_profile(&self) -> CodecProfile
Returns the effective profile after any fallback.
Trait Implementations§
Source§impl Clone for CodecDecision
impl Clone for CodecDecision
Source§fn clone(&self) -> CodecDecision
fn clone(&self) -> CodecDecision
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 CodecDecision
impl Debug for CodecDecision
Source§impl Default for CodecDecision
impl Default for CodecDecision
Source§impl<'de> Deserialize<'de> for CodecDecision
impl<'de> Deserialize<'de> for CodecDecision
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 CodecDecision
impl RefUnwindSafe for CodecDecision
impl Send for CodecDecision
impl Sync for CodecDecision
impl Unpin for CodecDecision
impl UnsafeUnpin for CodecDecision
impl UnwindSafe for CodecDecision
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