heapless::pool::arc

Trait ArcPool

Source
pub trait ArcPool: Sized {
    type Data: 'static;

    // Provided methods
    fn alloc(value: Self::Data) -> Result<Arc<Self>, Self::Data> { ... }
    fn manage(block: &'static mut ArcBlock<Self::Data>) { ... }
}
Expand description

A singleton that manages pool::arc::Arc smart pointers

Required Associated Types§

Source

type Data: 'static

The data type managed by the memory pool

Provided Methods§

Source

fn alloc(value: Self::Data) -> Result<Arc<Self>, Self::Data>

Allocate a new Arc smart pointer initialized to the given value

manage should be called at least once before calling alloc

§Errors

The Error variant is returned when the memory pool has run out of memory blocks

Source

fn manage(block: &'static mut ArcBlock<Self::Data>)

Add a statically allocated memory block to the memory pool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§