Skip to main content

RecordScoped

Trait RecordScoped 

pub trait RecordScoped: Widget {
    // Provided methods
    fn record_intent(&self) -> Option<RecordCheckout> { ... }
    fn set_record_scope(&mut self, _record: &RecordId) { ... }
    fn release_record_scope(&mut self) -> Result<(), String> { ... }
}
Expand description

A root that picks and releases its record.

Provided Methods§

fn record_intent(&self) -> Option<RecordCheckout>

Which record this widget’s document should be, so opening a second file checks out a different document instead of overwriting the first. None keeps the default package-level document.

fn set_record_scope(&mut self, _record: &RecordId)

Inverse of Self::record_intent. A widget that publishes presence must fold this into its presence key: two instances of one app are two records, and a key that only names the field collides.

fn release_record_scope(&mut self) -> Result<(), String>

Detach every receiver, queued result and deferred document write owned by the current record before a host retains this root under another record owner. Ok(()) certifies no later callback applies old-owner work to a replacement document.

§Errors

Returns a refusal when the widget cannot yet detach every continuation.

Implementors§

§

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