pub struct LoanedItem<T> {
pub account: Arc<Account>,
pub cost: usize,
pub item: T,
}
Expand description
A LoanedItem<T>
is a T
with an associated cost
recorded
against it in the ledger of a given Account
. The cost is
repaid automatically when the LoanedItem<T>
is Drop
ped.
LoanedItem
s are part of the flow control mechanism - see the
module-level documentation for more.
The account against which this loan is recorded.
The cost of this particular T
.
The underlying item itself.
Construct a new LoanedItem<T>
containing item
, recording
cost
work items against account
.
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the current Span
, returning an
Instrumented
wrapper. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.