Skip to main content

PublishesResources

Trait PublishesResources 

pub trait PublishesResources: Widget {
    // Provided methods
    fn resources(&self, _doc: &AutoCommit) -> Vec<ResourceSpec> { ... }
    fn caller_view_resources(&self, _doc: &AutoCommit) -> Vec<ResourceSpec> { ... }
    fn action_directory_resource_page(
        &self,
        _doc: &AutoCommit,
        _cursor: &[u8],
        _max_results: usize,
    ) -> Option<ActionDirectoryResourcePage> { ... }
    fn action_directory_revision(&self, _doc: &AutoCommit) -> Option<String> { ... }
    fn action_directory_invocation_domain(
        &self,
        _doc: &AutoCommit,
    ) -> ActionDirectoryInvocationDomain { ... }
    fn resource(&self, _doc: &AutoCommit, _id: &str) -> Option<ResourceSpec> { ... }
    fn resource_pending(&self, _id: &str) -> bool { ... }
    fn resources_for(
        &self,
        participant: Option<&ParticipantId>,
        doc: &AutoCommit,
    ) -> Vec<ResourceSpec> { ... }
    fn shared_resources_for(
        &self,
        participant: Option<&ParticipantId>,
        doc: &AutoCommit,
    ) -> Option<Vec<SharedResource>> { ... }
    fn resource_for(
        &self,
        participant: Option<&ParticipantId>,
        doc: &AutoCommit,
        id: &str,
    ) -> Option<ResourceSpec> { ... }
    fn action_directory_visibility(
        &self,
        _doc: &AutoCommit,
        _resource_id: &str,
    ) -> Option<ActionAddress> { ... }
    fn document_action_result(
        &self,
        _doc: &AutoCommit,
        _address: &ActionAddress,
        _changes: &[Patch],
    ) -> Option<Value> { ... }
}

Provided Methods§

fn resources(&self, _doc: &AutoCommit) -> Vec<ResourceSpec>

The tree of resources this widget currently has open, each with the actions it exports, e.g. a playing video plus its comments. doc lets a provider enumerate resources living in the document.

fn caller_view_resources(&self, _doc: &AutoCommit) -> Vec<ResourceSpec>

Explicit host-local presentation/request controls for the portable caller palette. Only View operations are accepted; shared effects remain broker-owned.

fn action_directory_resource_page( &self, _doc: &AutoCommit, _cursor: &[u8], _max_results: usize, ) -> Option<ActionDirectoryResourcePage>

One cursor-addressable page of resource roots safe to expose through the broker pull directory. max_results is a hard ceiling; a live provider must return a non-empty opaque cursor when it has a tail. None is the default: an unbounded contextual Self::resources snapshot must not be reached from a remote query or revision.

fn action_directory_revision(&self, _doc: &AutoCommit) -> Option<String>

Revision of non-document bounded directory roots; None when this widget has no independently mutable remote directory state.

fn action_directory_invocation_domain( &self, _doc: &AutoCommit, ) -> ActionDirectoryInvocationDomain

Continuity coverage for this owning subtree’s effective invocation domain. Returning a value is a semantic promise, not authority; unknown coverage stays closed.

fn resource(&self, _doc: &AutoCommit, _id: &str) -> Option<ResourceSpec>

Resolve an addressable resource omitted from the contextual snapshot.

fn resource_pending(&self, _id: &str) -> bool

Whether id, which resolves to nothing now, may resolve once what the widget is reading off the UI thread lands (a row of a list not read yet). A caller resolving it is answered then, never kept waiting on a blocking read nor told it is unknown before the read ends.

fn resources_for( &self, participant: Option<&ParticipantId>, doc: &AutoCommit, ) -> Vec<ResourceSpec>

The tree as one participant (an agent task) sees it, built from that participant’s own view state. None is this widget’s own view. Multi-participant widgets override this and Self::resource_for, and never put one participant’s selection into another’s tree.

fn shared_resources_for( &self, participant: Option<&ParticipantId>, doc: &AutoCommit, ) -> Option<Vec<SharedResource>>

Self::resources_for as a SharedResource forest whose unchanged subtrees are the very nodes of the last one, so consumers skip what they have seen. None, the default, has callers wrap Self::resources_for. An answer must equal it exactly once materialised (SharedResource::to_resource).

fn resource_for( &self, participant: Option<&ParticipantId>, doc: &AutoCommit, id: &str, ) -> Option<ResourceSpec>

Self::resource in participant’s tree.

fn action_directory_visibility( &self, _doc: &AutoCommit, _resource_id: &str, ) -> Option<ActionAddress>

Explicit disclosure authority for an actionless resource container in the broker pull directory. None means its label and hierarchy are not remotely discoverable unless the resource itself has a safe view action.

fn document_action_result( &self, _doc: &AutoCommit, _address: &ActionAddress, _changes: &[Patch], ) -> Option<Value>

The result of document action address, which has just applied to doc as changes: a compact summary of what it produced, so its caller needs no second read to see what happened. Asked only for an action whose contract declares a JSON result, which this value must satisfy.

Implementors§

Source§

impl PublishesResources for HostedActions

§

impl PublishesResources for ResourceActionHost

§

impl PublishesResources for Button

§

impl PublishesResources for Checkbox

§

impl PublishesResources for Dropdown

§

impl PublishesResources for EmptyState

§

impl PublishesResources for TextInput

§

impl PublishesResources for Toggle

§

impl PublishesResources for Card

§

impl PublishesResources for LiveUi

§

impl PublishesResources for NavList

§

impl PublishesResources for NavShell

A header button the shell hands to the window’s bar is not among the shell’s laid-out children, yet a press on it in the bar runs it: it publishes its action, and the operation the press starts reaches it.

§

impl PublishesResources for DataTableCore

§

impl PublishesResources for Breadcrumb

§

impl PublishesResources for Chip

§

impl PublishesResources for ColorSwatchPicker

§

impl PublishesResources for ContextMenu

§

impl PublishesResources for ControlRow

§

impl PublishesResources for DatePicker

§

impl PublishesResources for DropZone

§

impl PublishesResources for ListRow

§

impl PublishesResources for MediaCard

§

impl PublishesResources for MenuButton

The menu is drawn over the button and stands against it, not in the button’s subtree, so the rows it publishes are the button’s to publish and its rows’ operations the button’s to start.

§

impl PublishesResources for StatTile

§

impl PublishesResources for Stepper

§

impl PublishesResources for ToggleGroup

§

impl PublishesResources for Toolbar

§

impl<C> PublishesResources for ModalDialog<C>
where C: Widget + 'static,

§

impl<C> PublishesResources for Popover<C>
where C: Widget + 'static,

§

impl<K> PublishesResources for ModelView<K>
where K: PartialEq + 'static,

§

impl<M> PublishesResources for VirtualList<M>
where M: ListModel + 'static,