Skip to main content

Member

Struct Member 

Source
pub struct Member(/* private fields */);
Expand description

One mounted component’s side of the bus (a handle).

Implementations§

Source§

impl Member

Source

pub fn name(&self) -> &str

The component’s name.

Source

pub fn bus(&self) -> &Bus

The bus it is a member of.

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn live(&self, spec: &LiveSpec) -> Result<Reader, BusRefusal>

The page’s collection for spec, shared; its snapshot and changes methods held to uses.

Source

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.

Source

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.

Source

pub fn last(&self, topic: &str) -> Option<Value>

FRAME-53: topic’s kept event (the page’s, whoever said it).

Source

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).

Source

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.

Source

pub fn navigate(&self, route: &str)

Moves the page to route.

Source

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.

Source

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.

Source

pub fn keys(&self, decls: Vec<(KeyDecl, KeyRun)>) -> KeysHeld

FRAME-36: the component’s shortcuts, each with what it runs, into the page’s registry until the answer is dropped or the member leaves (one that left binds nothing).

Source

pub fn leave(&self)

Leaves the bus: every listener of it stops, its keys go, and its emits reach no one. FRAME-53: what it kept goes too — every sticky topic whose last event it said is kept for no one until said again, and an emit of its still queued keeps nothing.

Trait Implementations§

Source§

impl Clone for Member

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Member

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Variant for T
where T: Any + Clone + SendSync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert this Variant trait object to &dyn Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert this Variant trait object to &mut dyn Any.
Source§

fn as_boxed_any(self: Box<T>) -> Box<dyn Any>

Convert this Variant trait object to Box<dyn Any>.
Source§

fn type_name(&self) -> &'static str

Get the name of this type.
Source§

fn clone_object(&self) -> Box<dyn Variant>

Clone this Variant trait object.