Struct bitcoin_support::SecureAllocator
source · pub struct SecureAllocator {}Expand description
| Allocator that locks its contents from | being paged out of memory and clears | its contents before deletion. |
Implementations§
source§impl SecureAllocator
impl SecureAllocator
pub fn new(_a: &SecureAllocator) -> Self
Trait Implementations§
source§impl Allocator for SecureAllocator
impl Allocator for SecureAllocator
source§fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to allocate a block of memory. Read more
source§unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout)
unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout)
🔬This is a nightly-only experimental API. (
allocator_api)Deallocates the memory referenced by
ptr. Read moresource§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moresource§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>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to extend the memory block. Read more
source§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>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moresource§impl Clone for SecureAllocator
impl Clone for SecureAllocator
source§fn clone(&self) -> SecureAllocator
fn clone(&self) -> SecureAllocator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Default for SecureAllocator
impl Default for SecureAllocator
source§fn default() -> SecureAllocator
fn default() -> SecureAllocator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for SecureAllocator
impl Send for SecureAllocator
impl Sync for SecureAllocator
impl Unpin for SecureAllocator
impl UnwindSafe for SecureAllocator
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more