pub struct TranslationReport { /* private fields */ }Expand description
What one translation changed.
Implementations§
Source§impl TranslationReport
impl TranslationReport
Sourcepub const fn new(target: ProtocolVersion) -> Self
pub const fn new(target: ProtocolVersion) -> Self
A report for a translation to target, with nothing changed yet.
Sourcepub fn record(&mut self, rule: DegradeRule)
pub fn record(&mut self, rule: DegradeRule)
Records a rule firing.
Sourcepub fn steps(&self) -> &[TranslationStep]
pub fn steps(&self) -> &[TranslationStep]
The steps, in the order they were applied.
Sourcepub fn worst_loss(&self) -> Loss
pub fn worst_loss(&self) -> Loss
The worst loss any step caused.
None when nothing fired, so an empty report is lossless rather than
accidentally alarming.
Sourcepub fn is_lossless_or_flagged(&self) -> bool
pub fn is_lossless_or_flagged(&self) -> bool
Whether every step was one a caller could accept as “lossless or flagged”.
Sourcepub fn is_lossless(&self) -> bool
pub fn is_lossless(&self) -> bool
Whether the translation was lossless.
Sourcepub fn lost_features(&self) -> Vec<Feature>
pub fn lost_features(&self) -> Vec<Feature>
The features that were given up, deduplicated.
Skips reductions, which name no feature — a caller asking “which features did this cost me” wants the answerable half, and a reduction has no feature because no revision forced it.
Trait Implementations§
Source§impl Clone for TranslationReport
impl Clone for TranslationReport
Source§impl Debug for TranslationReport
impl Debug for TranslationReport
Source§impl Default for TranslationReport
impl Default for TranslationReport
impl Eq for TranslationReport
Source§impl PartialEq for TranslationReport
impl PartialEq for TranslationReport
impl StructuralPartialEq for TranslationReport
Auto Trait Implementations§
impl Freeze for TranslationReport
impl RefUnwindSafe for TranslationReport
impl Send for TranslationReport
impl Sync for TranslationReport
impl Unpin for TranslationReport
impl UnsafeUnpin for TranslationReport
impl UnwindSafe for TranslationReport
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