This commit is contained in:
Dion Dokter 2022-06-16 12:36:39 +02:00
parent 12a6ddfbcd
commit 03996583a1

View File

@ -25,7 +25,9 @@ pub struct PubSubChannel<M: RawMutex, T: Clone, const CAP: usize, const SUBS: us
inner: Mutex<M, RefCell<PubSubState<T, CAP, SUBS, PUBS>>>,
}
impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usize> PubSubChannel<M, T, CAP, SUBS, PUBS> {
impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usize>
PubSubChannel<M, T, CAP, SUBS, PUBS>
{
/// Create a new channel
pub const fn new() -> Self {
Self {
@ -354,7 +356,6 @@ impl<'a, T: Clone> ImmediatePublisher<'a, T> {
pub fn try_publish(&self, message: T) -> Result<(), T> {
self.channel.try_publish(message)
}
}
/// Error type for the [PubSubChannel]
@ -480,8 +481,8 @@ pub enum WaitResult<T> {
#[cfg(test)]
mod tests {
use crate::blocking_mutex::raw::NoopRawMutex;
use super::*;
use crate::blocking_mutex::raw::NoopRawMutex;
#[futures_test::test]
async fn all_subscribers_receive() {
@ -586,5 +587,4 @@ mod tests {
drop(sub0);
}
}