Struct syndicate::actor::LoanedItem[][src]

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

LoanedItems are part of the flow control mechanism - see the module-level documentation for more.

Fields

account: Arc<Account>

The account against which this loan is recorded.

cost: usize

The cost of this particular T.

item: T

The underlying item itself.

Implementations

Construct a new LoanedItem<T> containing item, recording cost work items against account.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.