Core traits.
This commit is contained in:
@ -3,13 +3,25 @@ mod output;
|
||||
|
||||
pub use physical::transducer::*;
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
// ----- Publisher ------------------------
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
use embassy_sync::blocking_mutex::raw::RawMutex;
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
use embassy_sync::pubsub;
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
use embassy_sync::pubsub::Subscriber;
|
||||
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
pub trait Publisher {
|
||||
type Value: Copy;
|
||||
type Mutex: RawMutex;
|
||||
const CAPACITY: usize;
|
||||
const NUM_SUBS: usize;
|
||||
const NUM_PUBS: usize;
|
||||
|
||||
|
||||
fn subscribe() -> SubT;
|
||||
}
|
||||
fn subscribe(
|
||||
&self,
|
||||
) -> Result<
|
||||
Subscriber<Self::Mutex, Self::Value, Self::CAPACITY, Self::NUM_SUBS, Self::NUM_PUBS>,
|
||||
pubsub::Error,
|
||||
>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user