Struct ChannelSettings
pub struct ChannelSettings { /* private fields */ }Expand description
The settings source a launched app reads through its channel.
Implementations§
§impl ChannelSettings
impl ChannelSettings
pub fn new(app_id: &str) -> ChannelSettings
pub fn linked(&self)
pub fn linked(&self)
A new link to the shell: its revisions start again.
pub fn disconnected(&self)
pub fn dictionary_snapshot(&self) -> Result<Snapshot, Error>
pub fn dictionary_edit(&self, revision: u64, edit: Edit) -> Result<(), Error>
pub fn received(&self, revision: u64, view: Map<String, Value>) -> bool
pub fn received(&self, revision: u64, view: Map<String, Value>) -> bool
The shell’s view at revision arrived or changed. Returns whether
what this process reads changed.
pub fn take_outbox(&self) -> Vec<(String, Map<String, Value>, Option<String>)>
pub fn take_outbox(&self) -> Vec<(String, Map<String, Value>, Option<String>)>
Writes for the worker to send, in order; each is answered with
Self::answered.
Trait Implementations§
§impl SettingsSource for ChannelSettings
impl SettingsSource for ChannelSettings
§fn take_deferred_failures(&self) -> Vec<DeferredFailure>
fn take_deferred_failures(&self) -> Vec<DeferredFailure>
The failures of writes this source accepted before they were made
durable, each once, oldest first: the changes were reverted in the
document.
§fn update_section_by(
&self,
name: &str,
values: Map<String, Value>,
origin: &ChangeOrigin,
) -> Result<(), Error>
fn update_section_by( &self, name: &str, values: Map<String, Value>, origin: &ChangeOrigin, ) -> Result<(), Error>
[
Self::update_section], recording origin with every leaf it
changes. A source without a history ignores the origin. Read more§fn changes(&self) -> &ChangeSignal
fn changes(&self) -> &ChangeSignal
Rings every time [
Self::revision] changes, so a reader waiting for
a change wakes at once instead of looking again and again.§fn update_section_with(
&self,
name: &str,
origin: &ChangeOrigin,
change: &mut dyn FnMut(&Map<String, Value>) -> Map<String, Value>,
) -> Result<(), Error>
fn update_section_with( &self, name: &str, origin: &ChangeOrigin, change: &mut dyn FnMut(&Map<String, Value>) -> Map<String, Value>, ) -> Result<(), Error>
Read section
name and merge what change makes of it, recording
origin, as one step no other write to this source lands inside.
This is the read-modify-write behind [crate::Key::update]: a toggle
pressed twice in quick succession flips twice. Read more§fn flush_pending(&self)
fn flush_pending(&self)
Wait until every change this source accepted is durable. Sources
whose writes are durable when they return have nothing to do.
§fn compare_update_section(
&self,
_name: &str,
_expected: &Map<String, Value>,
_values: Map<String, Value>,
) -> Result<ConditionalUpdate, Error>
fn compare_update_section( &self, _name: &str, _expected: &Map<String, Value>, _values: Map<String, Value>, ) -> Result<ConditionalUpdate, Error>
Merge only if the current section still equals
expected, under the
same lock that protects persistence and external-write adoption.
Superseded means a newer document replaced the caller’s intent.§fn compare_display_update(
&self,
_update: DisplayUpdate,
) -> Result<ConditionalUpdate, Error>
fn compare_display_update( &self, _update: DisplayUpdate, ) -> Result<ConditionalUpdate, Error>
Atomically compare and merge display transaction/profile intent in
its single device record.
§fn compare_display_transaction(
&self,
expected: Option<&Value>,
transaction: Map<String, Value>,
) -> Result<(), Error>
fn compare_display_transaction( &self, expected: Option<&Value>, transaction: Map<String, Value>, ) -> Result<(), Error>
Compare a host-owned display transaction, including an absent section.
Main’s atomic display update also protects the observed profile state.
§fn store(&self) -> Option<&Store>
fn store(&self) -> Option<&Store>
The profile’s documents themselves, where this source is them: what
a change that needs the document’s history (a section’s undo) is
made through.
None for a source that keeps only the values (an
app’s channel to the session’s settings).§fn dictionary_service(&self) -> Option<Arc<Service>>
fn dictionary_service(&self) -> Option<Arc<Service>>
Host-owned personal vocabulary. App/profile sources provide no host
authority; the authenticated settings capability projects scoped reads.
Auto Trait Implementations§
impl !Freeze for ChannelSettings
impl RefUnwindSafe for ChannelSettings
impl Send for ChannelSettings
impl Sync for ChannelSettings
impl Unpin for ChannelSettings
impl UnsafeUnpin for ChannelSettings
impl UnwindSafe for ChannelSettings
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
Mutably borrows from an owned value. Read more
§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>
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>
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)
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)
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 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>
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>
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)
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)
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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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 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>
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