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).
A row is not document state: it has no history, no undo and nothing to
sync, so it can never carry a document mutation. A change to the
document is the resource’s Action through the
Dispatcher, bound to a row’s item through
ResourceSurface::bound_declarations
or the resource’s children.
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.
Implementations§
Source§impl LiveRow
impl LiveRow
Sourcepub fn new(
id: impl Into<String>,
kind: impl Into<String>,
label: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, kind: impl Into<String>, label: impl Into<String>, ) -> Self
A row with a stable id (unique within the resource, and naming the
same entity for as long as it lives: a process id with its start
time, a container id), a kind tag and a human label.
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 from_resource(resource: Resource) -> Self
pub fn from_resource(resource: Resource) -> Self
resource, an entity the surface already describes as a resource
(a search hit, a catalogue entry), as a row: its presentation,
views, operations and children. Its document actions are dropped at
any depth: the resource’s own publication carries them.
Sourcepub fn operation(self, operation: ActionSpec) -> Self
pub fn operation(self, operation: ActionSpec) -> Self
Offer a view or effect operation on the row.
§Panics
In a debug build, when operation is a document mutation; a release
build drops it.
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 effect<E: Effect>(self, effect: &E) -> Self
pub fn effect<E: Effect>(self, effect: &E) -> Self
Offer effect, bound to this row’s entity (stop this process):
invoked here, it reaches the surface’s or view’s handler of E as
that value, under the effect’s declared contract.
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.
Sourcepub fn into_resource(self) -> Resource
pub fn into_resource(self) -> Resource
The row as the published tree carries it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LiveRow
impl !RefUnwindSafe for LiveRow
impl Send for LiveRow
impl Sync for LiveRow
impl Unpin for LiveRow
impl UnsafeUnpin for LiveRow
impl !UnwindSafe 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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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