[][src]Struct blackboard::BlackBoard

pub struct BlackBoard<'a, Section: Hash + Eq, Type> { /* fields omitted */ }

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]

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]

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]

Trait Implementations

impl<'a, Section, Type> Drop for BlackBoard<'a, Section, Type> where
    Section: Hash + Eq
[src]

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

impl<'a, Section, Type> !UnwindSafe for BlackBoard<'a, Section, Type>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.