pub struct DosageResult {
pub exceeded: bool,
pub pruned_artifacts: Vec<ArtifactId>,
pub tokens_trimmed: i32,
pub warnings: Vec<String>,
}Expand description
Result of applying dosage limits.
Fields§
§exceeded: boolWhether limits were exceeded
pruned_artifacts: Vec<ArtifactId>Artifacts that were pruned (if any)
tokens_trimmed: i32Tokens that were trimmed
warnings: Vec<String>Warning messages
Implementations§
Source§impl DosageResult
impl DosageResult
Sourcepub fn within_limits() -> Self
pub fn within_limits() -> Self
Create a result indicating no limits were exceeded.
Sourcepub fn exceeded_limits() -> Self
pub fn exceeded_limits() -> Self
Create a result indicating limits were exceeded.
Sourcepub fn add_pruned(&mut self, artifact_id: ArtifactId)
pub fn add_pruned(&mut self, artifact_id: ArtifactId)
Add a pruned artifact.
Sourcepub fn add_warning(&mut self, warning: String)
pub fn add_warning(&mut self, warning: String)
Add a warning.
Trait Implementations§
Source§impl Clone for DosageResult
impl Clone for DosageResult
Source§fn clone(&self) -> DosageResult
fn clone(&self) -> DosageResult
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 DosageResult
impl Debug for DosageResult
Source§impl<'de> Deserialize<'de> for DosageResult
impl<'de> Deserialize<'de> for DosageResult
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 PartialEq for DosageResult
impl PartialEq for DosageResult
Source§impl Serialize for DosageResult
impl Serialize for DosageResult
impl StructuralPartialEq for DosageResult
Auto Trait Implementations§
impl Freeze for DosageResult
impl RefUnwindSafe for DosageResult
impl Send for DosageResult
impl Sync for DosageResult
impl Unpin for DosageResult
impl UnwindSafe for DosageResult
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