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

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

Methods

impl<'a, T> ResourceManager<'a, T>[src]

pub const unsafe fn from_static(
    free_queue: &'a *mut AtomicU32,
    buffer: &'a *mut ResourceData<T>,
    capacity: u32
) -> ResourceManager<'a, T>
[src]

pub fn store(&self, obj: T) -> ResourceHandle[src]

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

pub fn free(&self, handle: ResourceHandle) -> 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<'a, T: Sync> ResourceManager<'a, T>[src]

pub fn release(&self, resource: ResourceRef<'a, T>)[src]

Release a reference previously allocated from the resource manager.

pub fn clone(&'a self, resource: &ResourceRef<'a, T>) -> ResourceRef<'a, T>[src]

Clones a reference, incrementing the reference count.

pub fn get(&'a self, resource: &'a ResourceRef<'a, T>) -> &'a T[src]

pub fn retain(&'a self, handle: ResourceHandle) -> Option<ResourceRef<'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<'a, T> Send for ResourceManager<'a, T> where
    T: Send + Sync

impl<'a, T> Unpin for ResourceManager<'a, T> where
    T: Unpin

impl<'a, T> Sync for ResourceManager<'a, T> where
    T: Sync

impl<'a, T> UnwindSafe for ResourceManager<'a, T> where
    T: RefUnwindSafe + UnwindSafe

impl<'a, T> RefUnwindSafe for ResourceManager<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

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

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> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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