Skip to main content

Publishes

Struct Publishes 

Source
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>

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Source§

impl<R: Resource> Default for Publishes<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

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

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

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

Convert 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>

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

Convert &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)

Convert &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 T
where T: Any,

§

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

Converts 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>

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

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,