[−][src]Struct bookkeeping::Move
Implementations
impl<T: Metadata> Move<T>
[src]
pub fn set_metadata(&self, meta: T::Move)
[src]
Sets the metadata value on this entity.
pub fn get_metadata(&self) -> Ref<'_, T::Move>
[src]
Gets the metadata value on this entity.
Internally, the field that holds metadata is an std::cell::RefCell. Ideally, I would not like to leak this detail through the public API by returning std::cell::Ref here. Yet, I'm not sure what the alternative is. Perhaps returning a clone?
impl<T: Metadata> Move<T>
[src]
pub fn new(
debit_account: &Rc<Account<T>>,
credit_account: &Rc<Account<T>>,
sum: &Sum<T>,
meta: T::Move
) -> Rc<Self>
[src]
debit_account: &Rc<Account<T>>,
credit_account: &Rc<Account<T>>,
sum: &Sum<T>,
meta: T::Move
) -> Rc<Self>
Creates a new move.
Panics
pub fn balance_in(
&self,
account: &Rc<Account<T>>,
cmp: impl Fn(&T::Move, &T::Move) -> Ordering
) -> Balance<T>
[src]
&self,
account: &Rc<Account<T>>,
cmp: impl Fn(&T::Move, &T::Move) -> Ordering
) -> Balance<T>
Calculates the balance that is the result of this move in an account according to a provided order of moves.
Panics
account
is not debit nor credit in this move.
Trait Implementations
impl<T: Debug + Metadata> Debug for Move<T> where
T::Move: Debug,
[src]
T::Move: Debug,
impl<T: Metadata> Eq for Move<T>
[src]
impl<T: Metadata> Ord for Move<T>
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: Metadata> PartialEq<Move<T>> for Move<T>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Metadata> PartialOrd<Move<T>> for Move<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Move<T>
impl<T> !Send for Move<T>
impl<T> !Sync for Move<T>
impl<T> Unpin for Move<T> where
<T as Metadata>::Move: Unpin,
<T as Metadata>::Move: Unpin,
impl<T> !UnwindSafe for Move<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,