Skip to main content

Reservation

Struct Reservation 

Source
pub struct Reservation<P: Platform>
where P::Queue: Send,
{ /* private fields */ }
Expand description

Space set aside for provisioning under one tag. Regions provisioned from it can never fail for lack of space; whatever is left when it is dropped returns to the free pool.

Implementations§

Source§

impl<P: Platform> Reservation<P>
where P::Queue: Send,

Source

pub fn tag(&self) -> u32

The reservation’s tag.

Source

pub fn remaining(&self) -> u64

Bytes still reserved. A region uses its data size plus two header blocks (see Store::extent_of).

Source

pub fn provision_append_region( &mut self, name: &str, size: u64, ) -> Result<AppendRegion<P>, Error>

Provisions an append region from this reservation.

§Errors

As Store::provision_append_region; NoSpace if the reservation is too small.

Source

pub fn provision_append_region_with( &mut self, name: &str, opts: RegionOptions, ) -> Result<AppendRegion<P>, Error>

Provisions an append region from this reservation as opts say (a capped region takes its whole capacity from it).

§Errors

As Store::provision_append_region_with; NoSpace if the reservation is too small.

Source

pub fn provision_page_region( &mut self, name: &str, size: u64, ) -> Result<PageRegion<P>, Error>

Provisions a page region from this reservation.

§Errors

As Store::provision_page_region; NoSpace if the reservation is too small.

Source

pub fn provision_append_region_default( &mut self, name: &str, ) -> Result<AppendRegion<P>, Error>

Provisions an append region from this reservation with the store’s StoreOptions::region_defaults.

§Errors

As Store::provision_append_region_default; NoSpace if the reservation is too small.

Source

pub fn provision_page_region_default( &mut self, name: &str, ) -> Result<PageRegion<P>, Error>

Provisions a page region from this reservation with the store’s StoreOptions::region_defaults.

§Errors

As Self::provision_append_region_default.

Source

pub fn provision_page_region_with( &mut self, name: &str, opts: RegionOptions, ) -> Result<PageRegion<P>, Error>

Provisions a page region from this reservation as opts say.

§Errors

As Self::provision_append_region_with.

Source

pub fn provision_slot(&mut self, name: &str) -> Result<Slot<P>, Error>

Provisions a small-object slot from this reservation.

§Errors

As Store::provision_slot; NoSpace if the reservation is too small.

Trait Implementations§

Source§

impl<P: Platform> Debug for Reservation<P>
where P::Queue: Send,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Platform> Drop for Reservation<P>
where P::Queue: Send,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<P> !RefUnwindSafe for Reservation<P>

§

impl<P> !UnwindSafe for Reservation<P>

§

impl<P> Forget for Reservation<P>

§

impl<P> Freeze for Reservation<P>
where Store<P>: Freeze,

§

impl<P> Move for Reservation<P>

§

impl<P> Send for Reservation<P>
where Store<P>: Send,

§

impl<P> Sync for Reservation<P>
where Store<P>: Sync,

§

impl<P> Unpin for Reservation<P>
where Store<P>: Unpin,

§

impl<P> UnsafeUnpin for Reservation<P>
where Store<P>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.