mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-28 13:00:26 +00:00
Merge #326
326: Recover StableDeref trait for pool::object::Object and pool::boxed::Box r=korken89 a=qwerty19106 I add ReadBuffer and WriteBuffer to pool::object::Object and pool::box::Box. It allows to use embedded DMA of HAL crates, such as [stm32f4xx_hal::dma::Transfer](https://docs.rs/stm32f4xx-hal/latest/stm32f4xx_hal/dma/struct.Transfer.html). Co-authored-by: Роман Кривенков <qwerty19106@gmail.com>
This commit is contained in:
commit
8cc8cceef5
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Added an object pool API. see the `pool::object` module level doc for details
|
||||
- Add `HistoryBuffer::as_slices()`
|
||||
- Implemented `retain` for `IndexMap` and `IndexSet`.
|
||||
- Recover `StableDeref` trait for `pool::object::Object` and `pool::boxed::Box`.
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -84,6 +84,8 @@ use core::{
|
||||
ops, ptr,
|
||||
};
|
||||
|
||||
use stable_deref_trait::StableDeref;
|
||||
|
||||
use super::treiber::{NonNullPtr, Stack, UnionNode};
|
||||
|
||||
/// Creates a new `BoxPool` singleton with the given `$name` that manages the specified `$data_type`
|
||||
@ -212,6 +214,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<P> StableDeref for Box<P> where P: BoxPool {}
|
||||
|
||||
impl<A> fmt::Display for Box<A>
|
||||
where
|
||||
A: BoxPool,
|
||||
|
@ -71,6 +71,8 @@ use core::{
|
||||
ops, ptr,
|
||||
};
|
||||
|
||||
use stable_deref_trait::StableDeref;
|
||||
|
||||
use super::treiber::{AtomicPtr, NonNullPtr, Stack, StructNode};
|
||||
|
||||
/// Creates a new `ObjectPool` singleton with the given `$name` that manages the specified
|
||||
@ -220,6 +222,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<A> StableDeref for Object<A> where A: ObjectPool {}
|
||||
|
||||
impl<A> fmt::Display for Object<A>
|
||||
where
|
||||
A: ObjectPool,
|
||||
|
Loading…
x
Reference in New Issue
Block a user