[−][src]Struct blackboard::BlackBoard
Represents a blackboard where processes can post and get items in sections, and also subscribe for changes in a specific section.
Implementations
impl<'a, Section, Type> BlackBoard<'a, Section, Type> where
Section: Hash + Eq,
[src]
Section: Hash + Eq,
pub fn new() -> Self
[src]
Generates a new, empty blackboard
pub fn get(&self, section: &Section) -> Option<&Vec<Type>>
[src]
Gets the section, if it exists.
pub fn get_sections(&self) -> Vec<&Section>
[src]
Returns a list of all the sections present right now in the BlackBoard
pub fn post(&mut self, section: Section, what: Type)
[src]
Posts data on the desired section. Note that data is consumed
pub fn subscribe(
&mut self,
section: Section,
subscriptor: impl Subscriptor<Type> + 'a
)
[src]
&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>
)
[src]
&mut self,
section: Section,
subscriptor: &Rc<impl Subscriptor<Type> + 'a>
)
Trait Implementations
impl<'a, Section, Type> Drop for BlackBoard<'a, Section, Type> where
Section: Hash + Eq,
[src]
Section: Hash + Eq,
Auto Trait Implementations
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> where
Section: Unpin,
Type: Unpin,
Section: Unpin,
Type: Unpin,
impl<'a, Section, Type> !UnwindSafe for BlackBoard<'a, Section, Type>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,