[−][src]Struct bookkeeping::Book
Entry point to the API and retains ownership of accounts, units and moves.
A reference to a book is an argument in any call to create a new account, unit or move.
The new entity is both registered in the book and returned in an std::rc::Rc.
Since the book retains an Rc
of that entity, the returned Rc
may be dropped.
Implementations
impl<T: Metadata> Book<T>
[src]
impl<T: Metadata> Book<T>
[src]
pub fn set_metadata(&self, meta: T::Book)
[src]
Sets the metadata value on this entity.
pub fn get_metadata(&self) -> Ref<'_, T::Book>
[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 Book<T>
[src]
impl<T: Default + Metadata> Default for Book<T> where
T::Book: Default,
[src]
T::Book: Default,
impl<T: Metadata> Drop for Book<T>
[src]
impl<T: Metadata> PartialEq<Book<T>> for Book<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Book<T>
impl<T> !Send for Book<T>
impl<T> !Sync for Book<T>
impl<T> Unpin for Book<T> where
<T as Metadata>::Book: Unpin,
<T as Metadata>::Book: Unpin,
impl<T> !UnwindSafe for Book<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>,