pub struct WeightedContribution {
pub source: SourceId,
pub priority: Priority,
pub actual_tokens: usize,
pub contribution: Contribution,
pub source_index: usize,
}Expand description
One contribution as the budget layer sees it: the original
Contribution, the source that produced it, the ground-truth
actual_tokens count from the crate::tokenizer::Tokenizer, and the
source’s priority at admission time.
actual_tokens is the value the budget uses for ceiling enforcement —
Contribution::estimated_tokens is a hint only.
Fields§
§source: SourceIdSource that produced the contribution.
priority: PrioritySource’s priority at admission time.
actual_tokens: usizeGround-truth token count from the active tokenizer.
contribution: ContributionThe contribution itself.
source_index: usizeStable index inside the source’s contribution list. Used by
apply_budget to preserve source-defined order within priority.
Trait Implementations§
Source§impl Clone for WeightedContribution
impl Clone for WeightedContribution
Source§fn clone(&self) -> WeightedContribution
fn clone(&self) -> WeightedContribution
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 moreAuto Trait Implementations§
impl Freeze for WeightedContribution
impl RefUnwindSafe for WeightedContribution
impl Send for WeightedContribution
impl Sync for WeightedContribution
impl Unpin for WeightedContribution
impl UnsafeUnpin for WeightedContribution
impl UnwindSafe for WeightedContribution
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