Skip to main content

Event

Struct Event 

Source
pub struct Event {
Show 17 fields pub date: Option<String>, pub description: Option<String>, pub lines: Vec<LineSpec>, pub reverses: Option<usize>, pub close: Option<CloseSpec>, pub bill: Option<BillSpec>, pub invoice: Option<InvoiceSpec>, pub write_off: Option<WriteOffSpec>, pub run_depreciation: Option<RunSpec>, pub dispose_asset: Option<DisposeSpec>, pub run_schedules: Option<RunSchedulesSpec>, pub register_schedule: Option<ScheduleSpec>, pub refused: Option<String>, pub payee: Option<String>, pub parties: Vec<ShareSpec>, pub instrument: Option<String>, pub older: bool,
}
Expand description

One event: an entry, a reversal, a close, a bill, an invoice, a command that posts what is due, or a schedule’s registration.

Fields§

§date: Option<String>

The day of an entry, a reversal, a close, a bill, an invoice or a disposal; the other commands date their own entries.

§description: Option<String>

An entry’s, a reversal’s, a close’s or a bill’s; a command writes its own.

§lines: Vec<LineSpec>

An entry’s lines.

§reverses: Option<usize>

The event (1-based) whose entry this one reverses.

§close: Option<CloseSpec>

A close of a period.

§bill: Option<BillSpec>

A bill.

§invoice: Option<InvoiceSpec>

An invoice.

§write_off: Option<WriteOffSpec>

A bad-debt write-off of an earlier invoice.

§run_depreciation: Option<RunSpec>

A depreciation run.

§dispose_asset: Option<DisposeSpec>

A disposal.

§run_schedules: Option<RunSchedulesSpec>

A run of every schedule due through a day.

§register_schedule: Option<ScheduleSpec>

A schedule registered by an event.

§refused: Option<String>

The engine refuses the event, for this reason in the examples’ words (refusal_reasons); it changes nothing.

§payee: Option<String>

The payee (a setup.payees name) the entry paid.

§parties: Vec<ShareSpec>

The parties (a setup.parties name) the entry is with, and their shares.

§instrument: Option<String>

The payment method (a setup.instruments label) it was paid with.

§older: bool

An entry as an earlier version could write it and this version’s commands refuse (the control guard, B-38): posted as replay posts it, since books that hold it must still read right.

Implementations§

Source§

impl Event

Source

pub fn kind(&self) -> Result<EventKind, String>

Which of the event’s kinds it is, or why it is not exactly one.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.