Struct Posting

Source
pub struct Posting<'i, Deco: Decoration> {
    pub account: Deco::Decorated<Cow<'i, str>>,
    pub clear_state: ClearState,
    pub amount: Option<PostingAmount<'i, Deco>>,
    pub balance: Option<Deco::Decorated<ValueExpr<'i>>>,
    pub metadata: Vec<Metadata<'i>>,
}
Expand description

Posting in a transaction to represent a particular account amount increase / decrease.

Fields§

§account: Deco::Decorated<Cow<'i, str>>

Account of the post target.

§clear_state: ClearState

Posting specific ClearState.

§amount: Option<PostingAmount<'i, Deco>>

Amount of the posting.

§balance: Option<Deco::Decorated<ValueExpr<'i>>>

Balance after the transaction of the specified account.

§metadata: Vec<Metadata<'i>>

Metadata information such as comment or tag.

Implementations§

Source§

impl<'i> Posting<'i, Ident>

Source

pub fn new_untracked<T>(account: T) -> Self
where T: Into<Cow<'i, str>>,

Source§

impl<'i, Deco: Decoration> Posting<'i, Deco>

Source

pub fn new(account: Deco::Decorated<Cow<'i, str>>) -> Self

Trait Implementations§

Source§

impl<'i, Deco: Decoration> AsUndecorated<Posting<'i, Deco>> for Posting<'i, Deco>

Source§

fn as_undecorated(&self) -> &Posting<'i, Deco>

Source§

impl<'i, Deco: Decoration> Debug for Posting<'i, Deco>

Source§

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

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

impl<'i, Deco: Decoration> PartialEq for Posting<'i, Deco>

Source§

fn eq(&self, __other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'i, Deco: Decoration> Eq for Posting<'i, Deco>

Auto Trait Implementations§

§

impl<'i, Deco> Freeze for Posting<'i, Deco>
where <Deco as Decoration>::Decorated<Cow<'i, str>>: Freeze, <Deco as Decoration>::Decorated<ValueExpr<'i>>: Freeze, <Deco as Decoration>::Decorated<Exchange<'i>>: Freeze,

§

impl<'i, Deco> RefUnwindSafe for Posting<'i, Deco>

§

impl<'i, Deco> Send for Posting<'i, Deco>
where <Deco as Decoration>::Decorated<Cow<'i, str>>: Send, <Deco as Decoration>::Decorated<ValueExpr<'i>>: Send, <Deco as Decoration>::Decorated<Exchange<'i>>: Send,

§

impl<'i, Deco> Sync for Posting<'i, Deco>
where <Deco as Decoration>::Decorated<Cow<'i, str>>: Sync, <Deco as Decoration>::Decorated<ValueExpr<'i>>: Sync, <Deco as Decoration>::Decorated<Exchange<'i>>: Sync,

§

impl<'i, Deco> Unpin for Posting<'i, Deco>
where <Deco as Decoration>::Decorated<Cow<'i, str>>: Unpin, <Deco as Decoration>::Decorated<ValueExpr<'i>>: Unpin, <Deco as Decoration>::Decorated<Exchange<'i>>: Unpin,

§

impl<'i, Deco> UnwindSafe for Posting<'i, Deco>

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> 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, 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.