[][src]Struct ico_memory::mem::resource_manager::ResourceManager

pub struct ResourceManager<T> { /* fields omitted */ }

Methods

impl<T> ResourceManager<T>[src]

pub const unsafe fn from_static(
    slots: *mut AtomicU32,
    reference_counts: *mut AtomicU32,
    free_queue: *mut AtomicU32,
    data: *mut T,
    capacity: u32
) -> ResourceManager<T>
[src]

pub fn retain(&self, obj: T) -> Option<u64>[src]

Store a T in the resource manager. If space exists, this returns a handle to the object. Otherwise returns None.

pub fn release(&self, handle: u64) -> bool[src]

Release the local reference to the object stored at the handle location.
The object will not actually be dropped until all references are released, however no handles will return the object.

impl<T: Sync> ResourceManager<T>[src]

pub unsafe fn release_reference(&self, resource: Resource<T>)[src]

Release a reference previously allocated from the resource manager.

pub unsafe fn clone_reference<'a>(
    &'a self,
    resource: &Resource<'a, T>
) -> Resource<'a, T>
[src]

Clones a reference, incrementing the reference count.

pub unsafe fn retain_reference<'a>(
    &'a self,
    handle: u64
) -> Option<Resource<'a, T>>
[src]

Get a reference counted reference to the object based on a handle. Returns None if the handle points to empty space.

Auto Trait Implementations

impl<T> Unpin for ResourceManager<T> where
    T: Unpin

impl<T> Send for ResourceManager<T> where
    T: Send

impl<T> Sync for ResourceManager<T> where
    T: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]