pub struct ConversionOutcome { /* private fields */ }Expand description
One subject-level conversion decision.
Implementations§
Source§impl ConversionOutcome
impl ConversionOutcome
Sourcepub fn exact(subject: impl Into<String>) -> Self
pub fn exact(subject: impl Into<String>) -> Self
Creates an exact outcome with no loss diagnostic.
Sourcepub fn loss(
subject: impl Into<String>,
kind: ConversionKind,
diagnostic: DiagnosticCode,
) -> Result<Self, PlanError>
pub fn loss( subject: impl Into<String>, kind: ConversionKind, diagnostic: DiagnosticCode, ) -> Result<Self, PlanError>
Creates a non-exact outcome linked to a structured diagnostic.
§Errors
Returns PlanError::ExactOutcomeHasDiagnostic if kind is exact.
Sourcepub fn with_origin(self, origin: Provenance) -> Self
pub fn with_origin(self, origin: Provenance) -> Self
Adds a source origin that contributed to this decision.
Sourcepub const fn kind(&self) -> ConversionKind
pub const fn kind(&self) -> ConversionKind
Returns the decision fidelity.
Sourcepub const fn diagnostic(&self) -> Option<&DiagnosticCode>
pub const fn diagnostic(&self) -> Option<&DiagnosticCode>
Returns the required diagnostic code for a non-exact decision.
Sourcepub fn origins(&self) -> &[Provenance]
pub fn origins(&self) -> &[Provenance]
Returns contributing source origins in discovery order.
Trait Implementations§
Source§impl Clone for ConversionOutcome
impl Clone for ConversionOutcome
Source§fn clone(&self) -> ConversionOutcome
fn clone(&self) -> ConversionOutcome
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 ConversionOutcome
impl Debug for ConversionOutcome
impl Eq for ConversionOutcome
Source§impl PartialEq for ConversionOutcome
impl PartialEq for ConversionOutcome
impl StructuralPartialEq for ConversionOutcome
Auto Trait Implementations§
impl Freeze for ConversionOutcome
impl RefUnwindSafe for ConversionOutcome
impl Send for ConversionOutcome
impl Sync for ConversionOutcome
impl Unpin for ConversionOutcome
impl UnsafeUnpin for ConversionOutcome
impl UnwindSafe for ConversionOutcome
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