pub struct LiveRow { /* private fields */ }Expand description
One live external entity a surface publishes beneath its resource, with the view and effect operations it offers (inspect a process, stop a container).
Rows are merged by id into the resource’s published children: a row with the id of a document child adds its operations to that child instead of publishing a second resource under the same id.
A row is shared, not copied: a surface that keeps the rows it made while what they show holds hands the same rows to every publication, and the publication reuses what it built from each one instead of building it again.
LiveRow::typed is the one way to publish a row: it is an item of a
declared RowType, saying what it is to search
and offering the type’s effects, so a press on it is one of the type’s
actions or open.
Implementations§
Source§impl LiveRow
impl LiveRow
Sourcepub fn typed<R: RowType>(
id: impl Into<String>,
label: impl Into<String>,
) -> Self
pub fn typed<R: RowType>( id: impl Into<String>, label: impl Into<String>, ) -> Self
A row of the declared type R (a resource type of R’s kind), whose
noun its type publishes, of the app the type is declared in: its
id, its label, the ResourceType
search matches “videos of …” against, and the effects the type offers
on it (RowType::effects, each
bound to id). A row an app declares as an item of a #[resource]
type publishes (Video, Channel) is one of these, so what it is is
the type’s and the search’s, nothing the app writes.
Sourcepub fn typed_with<R: RowType>(
id: impl Into<String>,
label: impl Into<String>,
bindings: &RowBindings,
) -> Self
pub fn typed_with<R: RowType>( id: impl Into<String>, label: impl Into<String>, bindings: &RowBindings, ) -> Self
A row of the declared type R, offering the effects bindings
names among the type’s (RowType::effects_with),
each bound to what the row’s own state knows: unlike Self::typed,
which offers every effect the type declares on its rows with only the
id bound, this one leaves out the effects that do not apply (a network
with no proxy) and sets the arguments the row holds (the profile, the
direction of a toggle).
Sourcepub fn semantic_identity(self, identity: ResourceSemanticIdentity) -> Self
pub fn semantic_identity(self, identity: ResourceSemanticIdentity) -> Self
Attach the stable source-domain identity used to find this row across live dispatch aliases. It is descriptive metadata only and grants no permission or authority. Invalid identities are omitted at this publication boundary.
Sourcepub fn declared(resource: ResourceSpec) -> Self
pub fn declared(resource: ResourceSpec) -> Self
resource, an entity a declaration shaped — a document’s child, a
search hit’s place, a tree a declared type’s verbs built — as a row:
its presentation, views, operations and children, its document
actions dropped at any depth (the resource’s own publication carries
them). The entity says what it is (its type’s words), so search names
it by that and its type’s effects are the ones it offers.
§Panics
When resource names no declared type: an entity no declaration
shaped has no words to be searched by and no type whose effects it
offers, so it is not a row. Publish it as one with
Self::typed instead.
Sourcepub fn vocabulary<E: Effect>(self) -> Self
pub fn vocabulary<E: Effect>(self) -> Self
Offer a view or effect operation on the row.
Offer every effect of the vocabulary E the resource itself offers
(Effect::specs), as it publishes them: what a
window’s own row offers (navigate, show settings), beside the effects
its row types declare.
Sourcepub fn presentation(self, presentation: ResourcePresentation) -> Self
pub fn presentation(self, presentation: ResourcePresentation) -> Self
How the entity stands right now (a process’s CPU use, what a timer has left), shown beside its label. A row merged into a document child that has no presentation of its own lends it this one.
Sourcepub fn labelled<E, A>(
self,
effect: ActionRef<E, A>,
label: impl Into<String>,
) -> Self
pub fn labelled<E, A>( self, effect: ActionRef<E, A>, label: impl Into<String>, ) -> Self
Offer the row’s effect effect as label here, where the row can say
what it is more exactly than its type can (a container’s row opens
this container by name). The effect’s contract is its declaration’s;
only what the row reads it by is the row’s.
Sourcepub fn prefilled<R, A, I, K>(self, effect: ActionRef<R, A>, values: I) -> Self
pub fn prefilled<R, A, I, K>(self, effect: ActionRef<R, A>, values: I) -> Self
Offer effect with values already in its parameters’ fields, each
still asked: what the row’s state knows the effect would act with
unless its caller says otherwise (a calendar’s current colour, a
switch’s next state). Published as the parameters’ defaults, so a
surface fills the field and an agent reads it, and the invocation
binds whatever is finally given. The contract stays the declaration’s.
Sourcepub fn view(self, view: ResourceViewSpec) -> Self
pub fn view(self, view: ResourceViewSpec) -> Self
Offer view of the row’s entity: a way to show it (a message in
its conversation, a range of its text) that a link or an agent
navigates to, opened by one of the row’s own operations.
Offer the row’s operation effect as unavailable, with code a
program reads and reason a person reads.
Sourcepub fn describe(self, effect: &str, description: impl Into<String>) -> Self
pub fn describe(self, effect: &str, description: impl Into<String>) -> Self
Say what the row’s operation effect does on this row, where only
the row can say it.
pub fn id(&self) -> &str
Sourcepub fn find(&self, id: &str) -> Option<Self>
pub fn find(&self, id: &str) -> Option<Self>
The row id names, this one or one nested beneath it, as a row of its own: what a
control showing that entity binds to.
Sourcepub fn operations(&self) -> &[ActionSpec]
pub fn operations(&self) -> &[ActionSpec]
The operations the row offers, as it publishes them.
Sourcepub fn into_resource(self) -> ResourceSpec
pub fn into_resource(self) -> ResourceSpec
The row as the published tree carries it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LiveRow
impl !Send for LiveRow
impl !Sync for LiveRow
impl !UnwindSafe for LiveRow
impl Forget for LiveRow
impl Freeze for LiveRow
impl Move for LiveRow
impl Unpin for LiveRow
impl UnsafeUnpin for LiveRow
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more