pub struct PrioritizedFragment {
pub fragment_id: FragmentId,
pub priority: Priority,
pub importance: f32,
pub size: usize,
pub deadline_ms: Option<u64>,
pub created_at: u64,
}Expand description
A fragment with associated priority
Fields§
§fragment_id: FragmentIdFragment ID
priority: PriorityPriority level
importance: f32Importance score (0.0 - 1.0, from ML model)
size: usizeSize in bytes (for bandwidth planning)
deadline_ms: Option<u64>Deadline (if any)
created_at: u64Creation timestamp
Implementations§
Source§impl PrioritizedFragment
impl PrioritizedFragment
Sourcepub fn new(fragment_id: FragmentId, priority: Priority) -> Self
pub fn new(fragment_id: FragmentId, priority: Priority) -> Self
Create a new prioritized fragment
Sourcepub fn with_importance(self, importance: f32) -> Self
pub fn with_importance(self, importance: f32) -> Self
Set importance score
Sourcepub fn with_deadline(self, deadline_ms: u64) -> Self
pub fn with_deadline(self, deadline_ms: u64) -> Self
Set deadline
Sourcepub fn effective_priority(&self) -> f64
pub fn effective_priority(&self) -> f64
Compute effective priority score (lower = higher priority)
Trait Implementations§
Source§impl Clone for PrioritizedFragment
impl Clone for PrioritizedFragment
Source§fn clone(&self) -> PrioritizedFragment
fn clone(&self) -> PrioritizedFragment
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 PrioritizedFragment
impl Debug for PrioritizedFragment
Source§impl<'de> Deserialize<'de> for PrioritizedFragment
impl<'de> Deserialize<'de> for PrioritizedFragment
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
Source§impl Ord for PrioritizedFragment
impl Ord for PrioritizedFragment
Source§impl PartialEq for PrioritizedFragment
impl PartialEq for PrioritizedFragment
Source§impl PartialOrd for PrioritizedFragment
impl PartialOrd for PrioritizedFragment
Source§impl Serialize for PrioritizedFragment
impl Serialize for PrioritizedFragment
impl Eq for PrioritizedFragment
Auto Trait Implementations§
impl Freeze for PrioritizedFragment
impl RefUnwindSafe for PrioritizedFragment
impl Send for PrioritizedFragment
impl Sync for PrioritizedFragment
impl Unpin for PrioritizedFragment
impl UnwindSafe for PrioritizedFragment
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.