Struct Talck
pub struct Talck<R, O>where
R: RawMutex,
O: OomHandler,{ /* private fields */ }Expand description
Implementations§
§impl<R, O> Talck<R, O>where
R: RawMutex,
O: OomHandler,
impl<R, O> Talck<R, O>where
R: RawMutex,
O: OomHandler,
pub fn lock(&self) -> MutexGuard<'_, R, Talc<O>>
pub fn lock(&self) -> MutexGuard<'_, R, Talc<O>>
Lock the mutex and access the inner Talc.
pub fn try_lock(&self) -> Option<MutexGuard<'_, R, Talc<O>>>
pub fn try_lock(&self) -> Option<MutexGuard<'_, R, Talc<O>>>
Try to lock the mutex and access the inner Talc.
pub fn into_inner(self) -> Talc<O>
pub fn into_inner(self) -> Talc<O>
Retrieve the inner Talc.
Trait Implementations§
§impl<R, O> Allocator for Talck<R, O>where
R: RawMutex,
O: OomHandler,
Available on crate features allocator or allocator-api2 only.
impl<R, O> Allocator for Talck<R, O>where
R: RawMutex,
O: OomHandler,
Available on crate features
allocator or allocator-api2 only.§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Attempts to allocate a block of memory. Read more
§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates the memory referenced by
ptr. Read more§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to extend the memory block. Read more
§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read more§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to shrink the memory block. Read more
§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read more§impl<R, O> GlobalAlloc for Talck<R, O>where
R: RawMutex,
O: OomHandler,
impl<R, O> GlobalAlloc for Talck<R, O>where
R: RawMutex,
O: OomHandler,
§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreAuto Trait Implementations§
impl<R, O> !Freeze for Talck<R, O>
impl<R, O> !RefUnwindSafe for Talck<R, O>
impl<R, O> Send for Talck<R, O>
impl<R, O> Sync for Talck<R, O>
impl<R, O> Unpin for Talck<R, O>
impl<R, O> UnsafeUnpin for Talck<R, O>where
R: UnsafeUnpin,
O: UnsafeUnpin,
impl<R, O> UnwindSafe for Talck<R, O>where
R: UnwindSafe,
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more