Trait runa_core::server::traits::GlobalStore
source · pub trait GlobalStore<G>: EventSource<GlobalsUpdate<G>> {
type Iter<'a>: Iterator<Item = (u32, &'a Rc<G>)>
where Self: 'a,
G: 'a;
type InsertFut<'a, IntoG>: Future<Output = u32> + 'a
where Self: 'a,
IntoG: 'a + Into<G>;
type RemoveFut<'a>: Future<Output = bool> + 'a
where Self: 'a;
// Required methods
fn insert<'a, IntoG: Into<G> + 'a>(
&'a mut self,
global: IntoG
) -> Self::InsertFut<'a, IntoG>;
fn get(&self, id: u32) -> Option<&Rc<G>>;
fn remove(&mut self, id: u32) -> Self::RemoveFut<'_>;
fn iter(&self) -> Self::Iter<'_>;
}
Expand description
A global store
Required Associated Types§
sourcetype Iter<'a>: Iterator<Item = (u32, &'a Rc<G>)>
where
Self: 'a,
G: 'a
type Iter<'a>: Iterator<Item = (u32, &'a Rc<G>)> where Self: 'a, G: 'a
Type of iterator returned by Self::iter
.
sourcetype InsertFut<'a, IntoG>: Future<Output = u32> + 'a
where
Self: 'a,
IntoG: 'a + Into<G>
type InsertFut<'a, IntoG>: Future<Output = u32> + 'a where Self: 'a, IntoG: 'a + Into<G>
Type of future returned by Self::insert
.
sourcetype RemoveFut<'a>: Future<Output = bool> + 'a
where
Self: 'a
type RemoveFut<'a>: Future<Output = bool> + 'a where Self: 'a
Type of future returned by Self::remove
.
Required Methods§
Implementors§
source§impl<G: 'static> GlobalStore<G> for GlobalStore<G>
impl<G: 'static> GlobalStore<G> for GlobalStore<G>
GlobalStore will notify listeners when globals are added or removed. The notification will be sent to the slot registered as “wl_registry”.