pub struct ConversionPlan<T> { /* private fields */ }Expand description
Validated target candidate, decisions, and structured diagnostics.
Implementations§
Source§impl<T> ConversionPlan<T>
impl<T> ConversionPlan<T>
Sourcepub fn new(
candidate: Option<T>,
outcomes: Vec<ConversionOutcome>,
diagnostics: Vec<Diagnostic>,
) -> Result<Self, PlanError>
pub fn new( candidate: Option<T>, outcomes: Vec<ConversionOutcome>, diagnostics: Vec<Diagnostic>, ) -> Result<Self, PlanError>
Creates a plan and verifies that every loss has its referenced diagnostic.
§Errors
Returns PlanError::MissingDiagnostic when a non-exact outcome has no
matching structured diagnostic.
Sourcepub fn outcomes(&self) -> &[ConversionOutcome]
pub fn outcomes(&self) -> &[ConversionOutcome]
Returns all subject outcomes.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Returns all diagnostics.
Applies a caller-selected loss policy without changing the candidate bytes.
Trait Implementations§
Source§impl<T: Clone> Clone for ConversionPlan<T>
impl<T: Clone> Clone for ConversionPlan<T>
Source§fn clone(&self) -> ConversionPlan<T>
fn clone(&self) -> ConversionPlan<T>
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<T: Debug> Debug for ConversionPlan<T>
impl<T: Debug> Debug for ConversionPlan<T>
impl<T: Eq> Eq for ConversionPlan<T>
Source§impl<T: PartialEq> PartialEq for ConversionPlan<T>
impl<T: PartialEq> PartialEq for ConversionPlan<T>
impl<T: PartialEq> StructuralPartialEq for ConversionPlan<T>
Auto Trait Implementations§
impl<T> Freeze for ConversionPlan<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConversionPlan<T>where
T: RefUnwindSafe,
impl<T> Send for ConversionPlan<T>where
T: Send,
impl<T> Sync for ConversionPlan<T>where
T: Sync,
impl<T> Unpin for ConversionPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConversionPlan<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConversionPlan<T>where
T: UnwindSafe,
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