#[non_exhaustive]pub struct ConversionWarning {
pub kind: WarningKind,
pub message: String,
}Expand description
A non-fatal information loss recorded during conversion.
Conversions return Ok(ConversionOutput { warnings, .. }) for
lossy-but-successful runs; callers decide whether to fail on a
non-empty warning list. This keeps the strictness policy in the
caller’s hands rather than baking it into the converter.
Marked #[non_exhaustive] so additional diagnostic fields can be
appended in a follow-up PR without breaking downstream code that
currently constructs ConversionWarning values only via
ConversionWarning::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: WarningKindClass of information loss.
message: StringHuman-readable description of what was dropped or approximated.
Implementations§
Source§impl ConversionWarning
impl ConversionWarning
Sourcepub fn new(kind: WarningKind, message: impl Into<String>) -> Self
pub fn new(kind: WarningKind, message: impl Into<String>) -> Self
Constructs a warning with the given kind and message.
Trait Implementations§
Source§impl Clone for ConversionWarning
impl Clone for ConversionWarning
Source§fn clone(&self) -> ConversionWarning
fn clone(&self) -> ConversionWarning
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 ConversionWarning
impl Debug for ConversionWarning
Source§impl PartialEq for ConversionWarning
impl PartialEq for ConversionWarning
Source§fn eq(&self, other: &ConversionWarning) -> bool
fn eq(&self, other: &ConversionWarning) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ConversionWarning
impl StructuralPartialEq for ConversionWarning
Auto Trait Implementations§
impl Freeze for ConversionWarning
impl RefUnwindSafe for ConversionWarning
impl Send for ConversionWarning
impl Sync for ConversionWarning
impl Unpin for ConversionWarning
impl UnsafeUnpin for ConversionWarning
impl UnwindSafe for ConversionWarning
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