pub struct CheckAverageCostPlugin { /* private fields */ }Expand description
Plugin that validates reducing postings against the running average cost
for accounts opened with the NONE booking method.
When an account is opened with NONE booking, the ledger author is responsible
for lot matching — there is no booker to enforce it. This plugin is a safety net
for that case: it verifies that the cost basis used on any reducing leg is within
tolerance of the running average cost basis in the account.
Accounts opened with any other booking method (STRICT, STRICT_WITH_SIZE,
FIFO, LIFO, HIFO, AVERAGE, …) are skipped — their booker already validates
lot matching, so re-checking here would produce false positives (see issue #907).
This matches Python beancount’s beancount.plugins.check_average_cost behavior.
Implementations§
Source§impl CheckAverageCostPlugin
impl CheckAverageCostPlugin
Sourcepub const fn with_tolerance(tolerance: Decimal) -> Self
pub const fn with_tolerance(tolerance: Decimal) -> Self
Create with custom tolerance.
Trait Implementations§
Source§impl Default for CheckAverageCostPlugin
impl Default for CheckAverageCostPlugin
Source§impl NativePlugin for CheckAverageCostPlugin
impl NativePlugin for CheckAverageCostPlugin
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Source§fn process(&self, input: PluginInput) -> PluginOutput
fn process(&self, input: PluginInput) -> PluginOutput
Auto Trait Implementations§
impl Freeze for CheckAverageCostPlugin
impl RefUnwindSafe for CheckAverageCostPlugin
impl Send for CheckAverageCostPlugin
impl Sync for CheckAverageCostPlugin
impl Unpin for CheckAverageCostPlugin
impl UnsafeUnpin for CheckAverageCostPlugin
impl UnwindSafe for CheckAverageCostPlugin
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> 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.