Skip to main content

Expect

Struct Expect 

Source
pub struct Expect {
Show 20 fields pub query: String, pub from: Option<String>, pub to: Option<String>, pub as_of: Option<String>, pub entry: Option<usize>, pub event: Option<usize>, pub asset: Option<String>, pub schedule: Option<String>, pub party: Option<String>, pub project: Option<String>, pub basis: Option<String>, pub payee: Option<String>, pub after: Option<usize>, pub code: Option<String>, pub name: Option<String>, pub category: Option<String>, pub account: Option<AccountSpec>, pub accepted: Option<bool>, pub refused: Option<String>, pub values: Option<Values>,
}
Expand description

One expectation: a query, the dates or things it asks about, and what it expects.

Fields§

§query: String

The query’s name (QUERIES).

§from: Option<String>

A period query’s first day, YYYY-MM-DD.

§to: Option<String>

A period query’s last day.

§as_of: Option<String>

An as-of query’s day.

§entry: Option<usize>

The event whose entry an entry or party_part query asks about.

§event: Option<usize>

The run_depreciation event a run query asks about.

§asset: Option<String>

The fixed asset a disposal, depreciation_schedule, register_row or asset_basis query asks about.

§schedule: Option<String>

The schedule a schedule_plan query asks about.

§party: Option<String>

The party a party_part, party_totals or party_tin_last4 query asks about.

§project: Option<String>

The project a project query asks about.

§basis: Option<String>

party_totals’ basis: cash or all (B-35 item 4).

§payee: Option<String>

The payee a vendor_1099 query asks about.

§after: Option<usize>

The books after event N, not after the last (a format query may not name it).

§code: Option<String>

The account a command names, by code.

§name: Option<String>

The new name a rename_account command gives.

§category: Option<String>

The category a set_tax_category command sets (absent: it clears the account’s).

§account: Option<AccountSpec>

The account an add_account command adds.

§accepted: Option<bool>

A command the engine accepts: true (never false).

§refused: Option<String>

A command, or a period, the engine refuses: why, in the examples’ words.

§values: Option<Values>

What the query expects.

Implementations§

Source§

impl Expect

Source

pub fn values(&self, id: &str) -> &Values

The values the query expects; panics when it gives none.

Source

pub fn figures(&self, id: &str) -> &BTreeMap<String, String>

The figures the query expects; panics on lines or rows.

Source

pub fn query(&self) -> Query

The question this expectation asks, as the engine receives it.

Trait Implementations§

Source§

impl Clone for Expect

Source§

fn clone(&self) -> Expect

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 Expect

Source§

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

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

impl<'de> Deserialize<'de> for Expect

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 Expect

Source§

fn eq(&self, other: &Expect) -> 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 Expect

Auto Trait Implementations§

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.