Struct ProposalAccept
pub struct ProposalAccept<R>where
R: Resource,{ /* private fields */ }Expand description
Accepting one proposal: the field edit it writes, and the change it is.
The edit is the resource’s own field edit,
held as the action to submit (tilo_resource::Invoke): applying it is
one action on the record — one change, one version in History, one undo
step — and a peer replays it for what it was.
Implementations§
§impl<R> ProposalAccept<R>where
R: Resource,
impl<R> ProposalAccept<R>where
R: Resource,
pub fn decision(&self) -> ProposalDecision
pub fn decision(&self) -> ProposalDecision
What this accept wrote, for a caller that synced the document itself.
pub fn refusal(&self) -> Option<&str>
pub fn refusal(&self) -> Option<&str>
Why this accept writes nothing: the answer is not the field’s own type, so it is refused rather than stored as something else.
pub fn refusal_over(&self, now: &str) -> Option<String>
pub fn refusal_over(&self, now: &str) -> Option<String>
Why this accept must not be written over the field holding now, or
None when it still writes what the model answered about.
The characters an answer replaces are checked as the field stands: if the person typed inside or before them while the model ran, they moved, and the answer would land on letters it never saw. Refused, it is never written and the person keeps their text.
pub fn selection(&self) -> Option<(usize, usize)>
pub fn selection(&self) -> Option<(usize, usize)>
The characters this accept replaces, when it replaces a selection.
pub fn invoke(&self) -> Result<Invoke<R>, String>
pub fn invoke(&self) -> Result<Invoke<R>, String>
The action to submit through the app’s own door — cx .dispatcher().submit(...), or app.invoke(...) in a test — which
applies it as the record’s one field edit: one change, one History
row, one undo step, and the refusal the door gives when the field
moved on while the model ran.
§Errors
Why the answer cannot be written at all — see
Self::refusal — so a caller says it instead of writing.
Trait Implementations§
§impl<R> Clone for ProposalAccept<R>where
R: Resource,
impl<R> Clone for ProposalAccept<R>where
R: Resource,
§fn clone(&self) -> ProposalAccept<R>
fn clone(&self) -> ProposalAccept<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<R> Freeze for ProposalAccept<R>
impl<R> RefUnwindSafe for ProposalAccept<R>
impl<R> Send for ProposalAccept<R>
impl<R> Sync for ProposalAccept<R>
impl<R> Unpin for ProposalAccept<R>
impl<R> UnsafeUnpin for ProposalAccept<R>
impl<R> UnwindSafe for ProposalAccept<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>
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