pub struct Member(/* private fields */);Expand description
One mounted component’s side of the bus (a handle).
Implementations§
Source§impl Member
impl Member
Sourcepub fn framed(&self, name: &str, uses: &[String], within: bool) -> Member
pub fn framed(&self, name: &str, uses: &[String], within: bool) -> Member
COMPS-2: a frame’s member — what a page or component this member
frames (bus.frame) calls through: a member of the same bus named
name, its calls held to uses. within: a page the framer wrote
({ html }), whose uses the framer declares, so only what the
framer’s own uses names is kept — a framer gives no more than it
holds; not within: a stored component ({ component }), whose
uses is its own manifest entry’s. Either way the call goes over the
page’s one socket as the viewer, so the service’s gate holds it to
the viewer’s grants too.
GAMMA-5: a frame never holds an open entry (things.*): its own
are dropped, and a page keeps a method only where the framer names
it exactly — a framer’s open entry gives a framed page nothing.
Sourcepub fn holds(&self, method: &str) -> bool
pub fn holds(&self, method: &str) -> bool
COMPS-2: whether method is one this member may call — named in its
uses, or GAMMA-5: under one of its open entries.
Sourcepub fn call(
&self,
method: &str,
params: Value,
sink: Sink,
) -> Result<CallId, BusRefusal>
pub fn call( &self, method: &str, params: Value, sink: Sink, ) -> Result<CallId, BusRefusal>
method through the page’s socket, its items into sink; refused
before the socket when uses does not name it.
Sourcepub fn stream(
&self,
method: &str,
params: Value,
on: impl FnMut(StreamEvent) + 'static,
done: impl FnOnce(StreamEnd) + 'static,
) -> Result<Streaming, BusRefusal>
pub fn stream( &self, method: &str, params: Value, on: impl FnMut(StreamEvent) + 'static, done: impl FnOnce(StreamEnd) + 'static, ) -> Result<Streaming, BusRefusal>
GAMMA-6: method through the page’s socket as a stream — on hears
each data event’s content as it arrives, then how it ended
(StreamEnd), once; done hears the end alone. Held to uses as
Self::call is (refused before the socket). Streaming::stop
closes the call on the wire; a member that leaves closes every stream
it holds, done told stopped and on nothing more. Never sent
again: a drop under it is its end (dropped).
Sourcepub fn live(&self, spec: &LiveSpec) -> Result<Reader, BusRefusal>
pub fn live(&self, spec: &LiveSpec) -> Result<Reader, BusRefusal>
The page’s collection for spec, shared; its snapshot and changes
methods held to uses.
Sourcepub fn emit(&self, topic: &str, data: Value) -> Result<(), BusRefusal>
pub fn emit(&self, topic: &str, data: Value) -> Result<(), BusRefusal>
data on topic to every other member listening; plexus.…
refused. A member that left reaches no one.
Sourcepub fn emit_sticky(&self, topic: &str, data: Value) -> Result<(), BusRefusal>
pub fn emit_sticky(&self, topic: &str, data: Value) -> Result<(), BusRefusal>
FRAME-53: Self::emit, the event kept as the topic’s last — what a
member that listens later with Self::on_last hears at once.
Sourcepub fn last(&self, topic: &str) -> Option<Value>
pub fn last(&self, topic: &str) -> Option<Value>
FRAME-53: topic’s kept event (the page’s, whoever said it).
Sourcepub fn on_last(&self, topic: &str, f: impl Fn(&Value) + 'static) -> Listening
pub fn on_last(&self, topic: &str, f: impl Fn(&Value) + 'static) -> Listening
FRAME-53: Self::on, and first the topic’s kept event, if any,
at once — in the bus’s turn: now when nothing is under way, else
right after what is. Not the member’s own, and not when an event of
the topic reached f first (a newer one than the kept).
Sourcepub fn on(&self, topic: &str, f: impl Fn(&Value) + 'static) -> Listening
pub fn on(&self, topic: &str, f: impl Fn(&Value) + 'static) -> Listening
f on every topic another member emits, until the Listening is
dropped or the member leaves.
Moves the page to route.
Sourcepub fn slots_set(
&self,
layout: &str,
slot: &str,
component: &str,
version: Option<&str>,
sink: Sink,
) -> Result<CallId, BusRefusal>
pub fn slots_set( &self, layout: &str, slot: &str, component: &str, version: Option<&str>, sink: Sink, ) -> Result<CallId, BusRefusal>
ui.slots.set { layout, slot, component, version } (the live
version when none is named) — a call held to uses.
Sourcepub fn follow(&self, spec: ModuleSpec) -> Result<ModuleLive, BusRefusal>
pub fn follow(&self, spec: ModuleSpec) -> Result<ModuleLive, BusRefusal>
FRAME-19: a module’s collection for spec — when and
debounce_ms held by the registry as rhx’s are, the module moving
its params with ModuleLive::update; its methods held to uses.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Member
impl !Send for Member
impl !Sync for Member
impl !UnwindSafe for Member
impl Forget for Member
impl Freeze for Member
impl Move for Member
impl Unpin for Member
impl UnsafeUnpin for Member
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.