Struct ActionProposalView
pub struct ActionProposalView<R>where
R: Resource,{ /* private fields */ }Expand description
A proposal on screen: its title, the model’s note, the change as a diff (or a value’s before and after), which model answered and where it ran, exactly what is sent, and Accept and Reject.
Implementations§
§impl<R> ActionProposalView<R>where
R: Resource,
impl<R> ActionProposalView<R>where
R: Resource,
pub fn new(
proposal: ActionProposal,
target: ProposalTarget<R>,
) -> ActionProposalView<R>
pub fn new( proposal: ActionProposal, target: ProposalTarget<R>, ) -> ActionProposalView<R>
The proposal proposal in front of the person, which accepting
writes at target.
pub fn proposal(&self) -> &ActionProposal
pub fn proposal(&self) -> &ActionProposal
The proposal on screen.
pub fn decision(&self) -> Option<&ProposalDecision>
pub fn decision(&self) -> Option<&ProposalDecision>
What the person decided through this view, once they did.
pub fn accepted(&self) -> Option<ProposalAccept<R>>
pub fn accepted(&self) -> Option<ProposalAccept<R>>
The one action accepting runs, once the person has accepted.
pub fn invoke(&self) -> Result<Option<Invoke<R>>, String>
pub fn invoke(&self) -> Result<Option<Invoke<R>>, String>
The action that writes what the person accepted, to submit through
the app’s own door — cx.dispatcher().submit(...) — as the record’s
one field edit: one change, one History row, one undo step. Ok(None)
when nothing was accepted, so rejecting submits nothing at all.
§Errors
Why the answer cannot be written, when it cannot.
pub fn with_decisions(
self,
on_decision: impl FnMut(ProposalDecision) + 'static,
) -> ActionProposalView<R>
pub fn with_decisions( self, on_decision: impl FnMut(ProposalDecision) + 'static, ) -> ActionProposalView<R>
Put Accept and Reject under the proposal. on_decision runs once,
from whichever the person picks.
pub fn into_widget(self) -> Box<dyn Widget>
pub fn into_widget(self) -> Box<dyn Widget>
The laid-out sheet itself, for a dialog or a page to hold.
Auto Trait Implementations§
impl<R> Freeze for ActionProposalView<R>
impl<R> !RefUnwindSafe for ActionProposalView<R>
impl<R> !Send for ActionProposalView<R>
impl<R> !Sync for ActionProposalView<R>
impl<R> Unpin for ActionProposalView<R>
impl<R> UnsafeUnpin for ActionProposalView<R>
impl<R> !UnwindSafe for ActionProposalView<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