[][src]Struct bookkeeping::Account

pub struct Account<T: Metadata> { /* fields omitted */ }

Represents an account.

Implementations

impl<T: Metadata> Account<T>[src]

pub fn new(book: &Book<T>, meta: T::Account) -> Rc<Self>[src]

Creates a new account.

impl<T: Metadata> Account<T>[src]

pub fn set_metadata(&self, meta: T::Account)[src]

Sets the metadata value on this entity.

pub fn get_metadata(&self) -> Ref<'_, T::Account>[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?

Trait Implementations

impl<T: Metadata> Debug for Account<T>[src]

impl<T: Metadata> Eq for Account<T>[src]

impl<T: Metadata> Ord for Account<T>[src]

impl<T: Metadata> PartialEq<Account<T>> for Account<T>[src]

impl<T: Metadata> PartialOrd<Account<T>> for Account<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Account<T>

impl<T> !Send for Account<T>

impl<T> !Sync for Account<T>

impl<T> Unpin for Account<T> where
    <T as Metadata>::Account: Unpin

impl<T> !UnwindSafe for Account<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.