[−][src]Struct ico_memory::mem::ResourceManager
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]
free_queue: &'a *mut AtomicU32,
buffer: &'a *mut ResourceData<T>,
capacity: u32
) -> ResourceManager<'a, T>
pub fn store(&self, obj: T) -> Option<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,
T: Send + Sync,
impl<'a, T> Unpin for ResourceManager<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> Sync for ResourceManager<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> UnwindSafe for ResourceManager<'a, T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
impl<'a, T> RefUnwindSafe for ResourceManager<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,