[−][src]Struct ico_memory::mem::resource_manager::ResourceManager
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]
slots: *mut AtomicU32,
reference_counts: *mut AtomicU32,
free_queue: *mut AtomicU32,
data: *mut T,
capacity: u32
) -> ResourceManager<T>
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]
&'a self,
resource: &Resource<'a, T>
) -> Resource<'a, T>
Clones a reference, incrementing the reference count.
pub unsafe fn retain_reference<'a>(
&'a self,
handle: u64
) -> Option<Resource<'a, T>>
[src]
&'a self,
handle: u64
) -> Option<Resource<'a, T>>
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,
T: Unpin,
impl<T> Send for ResourceManager<T> where
T: Send,
T: Send,
impl<T> Sync for ResourceManager<T> where
T: Sync,
T: Sync,
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,