Crate spacetoken

Source
Expand description

Space can be used to track how much has been reserved of a (limited) amount of space.

The idea is that the Space is decoupled from the actual storage space it is meant to represent. (It can refer to persistent disk storage, in-process memory, or any other sized storage).

§Usage

An application creates a Space object, passing into it the amount of total space it can hold.

Once the Space object has been created (representing the total amount of space), the application can reserve space from this pool using:

All of the reservation functions return a SpaceToken instance, which represents the allocated space. This is returned to the Space context when the SpaceToken is dropped.

Structs§

ReserveFuture
Space
A representation of a limited storage space that can be reserved.
SpaceToken
Representation of space reserved from a Space context.

Enums§

Error