pub struct BlackBoard<'a, Section: Hash + Eq, Type> { /* private fields */ }
Expand description
Represents a blackboard where processes can post and get items in sections, and also subscribe for changes in a specific section.
Implementations§
Source§impl<'a, Section, Type> BlackBoard<'a, Section, Type>
impl<'a, Section, Type> BlackBoard<'a, Section, Type>
Sourcepub fn get_sections(&self) -> Vec<&Section>
pub fn get_sections(&self) -> Vec<&Section>
Returns a list of all the sections present right now in the BlackBoard
Sourcepub fn post(&mut self, section: Section, what: Type)
pub fn post(&mut self, section: Section, what: Type)
Posts data on the desired section. Note that data is consumed
Sourcepub fn subscribe(
&mut self,
section: Section,
subscriptor: impl Subscriptor<Type> + 'a,
)
pub fn subscribe( &mut self, section: Section, subscriptor: impl Subscriptor<Type> + 'a, )
Suscribes a function to the specified section. When a post to that section occurs, the function passed in is called with the newly posted value as argument
pub fn subscribe_rc( &mut self, section: Section, subscriptor: &Rc<impl Subscriptor<Type> + 'a>, )
Trait Implementations§
Auto Trait Implementations§
impl<'a, Section, Type> Freeze for BlackBoard<'a, Section, Type>
impl<'a, Section, Type> !RefUnwindSafe for BlackBoard<'a, Section, Type>
impl<'a, Section, Type> !Send for BlackBoard<'a, Section, Type>
impl<'a, Section, Type> !Sync for BlackBoard<'a, Section, Type>
impl<'a, Section, Type> Unpin for BlackBoard<'a, Section, Type>
impl<'a, Section, Type> !UnwindSafe for BlackBoard<'a, Section, Type>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more