pub enum ConversionError {
InvalidDate(String),
InvalidNumber(String),
InvalidFlag(String),
BookedCostInvariantViolated(BookedCostInvariantError),
PerUnitFromTotalMissingUnits {
per_unit: Decimal,
total: Decimal,
},
SpanOverflow(String),
}Expand description
Error returned when converting a wrapper back to a directive fails.
Variants§
InvalidDate(String)
Invalid date format.
InvalidNumber(String)
Invalid number format. Use for parse failures only — for a pair
of valid numbers that fail a cross-field invariant, see
Self::BookedCostInvariantViolated.
InvalidFlag(String)
Invalid flag format.
BookedCostInvariantViolated(BookedCostInvariantError)
A PerUnitFromTotal cost spec carries a (per_unit, total)
pair that doesn’t agree with the posting’s units. Returned by
the plugin egress and FFI input bridges when a plugin author
or JSON client supplies the post-booking shape with
inconsistent values — e.g. mutates per_unit without updating
total. The inner rustledger_core::BookedCostInvariantError
carries the supplied values, the derived total, and the
tolerance for plugin-author diagnostics.
PerUnitFromTotalMissingUnits
A plugin emitted a PerUnitFromTotal cost spec without
supplying the posting’s units. The post-booking shape is
undefined without units (per_unit = total / |units| requires
them) — a plugin emitting it untouched should keep the units
the host gave it; a plugin emitting a fresh post-booking spec
must include matching units. Distinct from
Self::BookedCostInvariantViolated because “missing” is a
different category from “inconsistent” — plugin authors fix
each with different actions (forgot vs miscalculated).
Fields
SpanOverflow(String)
A SourceSpan byte offset from the plugin wire format does not
fit in usize on the host. This is effectively impossible in
practice — SourceSpan is u64 and the host is 64-bit on every
platform rustledger supports today, so the only way to surface
this variant is to run the host on a 32-bit target with source
files larger than 4 GiB. If you see it: please file a bug
report; the offset is almost certainly corrupt.
Trait Implementations§
Source§impl Clone for ConversionError
impl Clone for ConversionError
Source§fn clone(&self) -> ConversionError
fn clone(&self) -> ConversionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConversionError
impl Debug for ConversionError
Source§impl Display for ConversionError
impl Display for ConversionError
Source§impl Error for ConversionError
impl Error for ConversionError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BookedCostInvariantError> for ConversionError
impl From<BookedCostInvariantError> for ConversionError
Source§fn from(source: BookedCostInvariantError) -> Self
fn from(source: BookedCostInvariantError) -> Self
Auto Trait Implementations§
impl Freeze for ConversionError
impl RefUnwindSafe for ConversionError
impl Send for ConversionError
impl Sync for ConversionError
impl Unpin for ConversionError
impl UnsafeUnpin for ConversionError
impl UnwindSafe for ConversionError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.