Trait heapless::pool::arc::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

Object Safety§

This trait is not object safe.

Implementors§