pub struct Publishes<R: Resource> { /* private fields */ }Expand description
What a part of a view publishes beside the resource. Each source is read
whenever the resource is published or searched, so it reads the view’s
LocalStates and settings as they are then.
Implementations§
Source§impl<R: Resource> Publishes<R>
impl<R: Resource> Publishes<R>
pub fn new() -> Self
Sourcepub fn live_rows(self, rows: impl Fn() -> Vec<LiveRow> + 'static) -> Self
pub fn live_rows(self, rows: impl Fn() -> Vec<LiveRow> + 'static) -> Self
The live external entities the view shows, published as children of
the resource and merged by id with its document children. Keep it to
what fits a published tree (the rows on screen, a bounded page) and
resolve the rest with Self::live_row.
Sourcepub fn live_row(self, row: impl Fn(&str) -> Option<LiveRow> + 'static) -> Self
pub fn live_row(self, row: impl Fn(&str) -> Option<LiveRow> + 'static) -> Self
The live row with an id Self::live_rows leaves out, so an action
addressed to any entity the view knows still reaches it.
Sourcepub fn live_row_pending(self, pending: impl Fn(&str) -> bool + 'static) -> Self
pub fn live_row_pending(self, pending: impl Fn(&str) -> bool + 'static) -> Self
Whether the live row id, which Self::live_row does not know
now, may be known once what the view is reading lands: an agent
addressing it is answered then. Start that read here if it has not
started; the window must be woken when it lands.
Sourcepub fn row_edits(
self,
edits: impl Fn(&str) -> Vec<ActionDecl<R>> + 'static,
) -> Self
pub fn row_edits( self, edits: impl Fn(&str) -> Vec<ActionDecl<R>> + 'static, ) -> Self
Edits of the resource bound to the live row row (rename this
file, invite this person): typed builders of the resource’s
actions, published on that row and applied through the same
permission check, confirmation and undo as the resource’s own
declarations. A row itself carries only view and effect operations;
this is how it offers a document change.
Sourcepub fn availability(
self,
statuses: impl Fn() -> Vec<EffectStatus> + 'static,
) -> Self
pub fn availability( self, statuses: impl Fn() -> Vec<EffectStatus> + 'static, ) -> Self
The resource’s own actions that differ from their declaration right now, as the view’s live state says (a mode switch unavailable while recording, with why). Read whenever the resource is published, so the palette, agents and the door follow the view: an action unavailable here is refused with its reason.
Sourcepub fn search_entries(
self,
entries: impl Fn() -> Vec<SearchEntry> + 'static,
) -> Self
pub fn search_entries( self, entries: impl Fn() -> Vec<SearchEntry> + 'static, ) -> Self
Search entries for what the view shows that the resource does not hold (a vault’s items, a page’s text), indexed with the resource’s own as the app’s one search source. Read whenever someone searches, so keep it to what the view already has at hand.
Sourcepub fn search_entries_while_running(self) -> Self
pub fn search_entries_while_running(self) -> Self
Say that the system’s search index forgets Self::search_entries
once the app closes: entries that are the machine’s state of the
moment (the processes running) or a catalogue the system searches by
itself. They are found only while the app runs, and a closed app
leaves none behind to open into something that is gone.
Sourcepub fn secrets_unlocked(
self,
unlocked: impl Fn() -> Option<bool> + 'static,
) -> Self
pub fn secrets_unlocked( self, unlocked: impl Fn() -> Option<bool> + 'static, ) -> Self
Whether the secrets behind the view’s secret-bearing search entries
(SearchEntry::secret_bearing) are unlocked now: a vault that
opened and found its key. The system’s search index finds those
entries only while the app last said Some(true); None says
nothing.
Sourcepub fn search_query(self, query: impl FnMut(&SearchQuery) + 'static) -> Self
pub fn search_query(self, query: impl FnMut(&SearchQuery) + 'static) -> Self
Look up what the platform search asks for beyond what the view holds
(a server’s catalogue, a mailbox not yet fetched), and offer what
comes back through Self::search_entries. query gets the latest
query on the UI thread before the view syncs; queries asked between
frames are coalesced. Never asked of a past version.
Sourcepub fn search_pending(self, pending: impl Fn() -> bool + 'static) -> Self
pub fn search_pending(self, pending: impl Fn() -> bool + 'static) -> Self
Whether the results for the latest Self::search_query are still
coming (a server is still looking). A search already showing waits
for them and shows them once this turns false, without anyone typing
again. Read after every sync.
Sourcepub fn host_intents(
self,
intents: impl FnMut() -> Option<AppHostIntent> + 'static,
) -> Self
pub fn host_intents( self, intents: impl FnMut() -> Option<AppHostIntent> + 'static, ) -> Self
What the view asks of the host, one at a time, taken after every frame: a document chosen here to open in its own app, the platform search to show.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Publishes<R>
impl<R> !RefUnwindSafe for Publishes<R>
impl<R> !Send for Publishes<R>
impl<R> !Sync for Publishes<R>
impl<R> Unpin for Publishes<R>
impl<R> UnsafeUnpin for Publishes<R>
impl<R> !UnwindSafe for Publishes<R>
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<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> 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>, which can then be
downcast into Box<dyn 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>, which 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> 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