Struct ActionProposal
pub struct ActionProposal {
pub title: String,
pub note: Option<String>,
pub context: ProposalContext,
pub change: ProposalChange,
pub model: ModelPass,
}Expand description
One model call’s answer, shown before it is written.
Fields§
§title: StringThe key the person reads what they asked for under: its title.
note: Option<String>The model’s own prose about the answer, when it wrote any.
context: ProposalContext§change: ProposalChange§model: ModelPassImplementations§
§impl ActionProposal
impl ActionProposal
pub fn new(
title: impl Into<String>,
context: ProposalContext,
change: ProposalChange,
model: ModelPass,
) -> ActionProposal
pub fn new( title: impl Into<String>, context: ProposalContext, change: ProposalChange, model: ModelPass, ) -> ActionProposal
A proposal title names, from model, over what context sends,
making change.
pub fn with_note(self, note: impl Into<String>) -> ActionProposal
pub fn prompt(&self) -> String
pub fn prompt(&self) -> String
The prompt a model is sent (ProposalContext::prompt).
pub fn refusal(&self) -> Option<String>
pub fn refusal(&self) -> Option<String>
Why this may not be sent (ProposalContext::refusal).
pub fn accept_action<R, T>(
&self,
target: ProposalTarget<R, T>,
) -> ProposalAccept<R>where
R: Resource,
T: Settable + DeserializeOwned,
pub fn accept_action<R, T>(
&self,
target: ProposalTarget<R, T>,
) -> ProposalAccept<R>where
R: Resource,
T: Settable + DeserializeOwned,
Accepting this writes target: the resource’s own field edit, which
is one action on the record — one change, one History row, one undo
step — and a peer replays for what it was.
A ProposalChange::Text splice the characters target names — the
selection’s, or the whole field’s — and a ProposalChange::Value
writes the field as the value the answer reads as.
pub fn reject(&self) -> ProposalDecision
pub fn reject(&self) -> ProposalDecision
The person rejected the answer: nothing is written, and no part of it outlives this value.
Trait Implementations§
§impl Clone for ActionProposal
impl Clone for ActionProposal
§fn clone(&self) -> ActionProposal
fn clone(&self) -> ActionProposal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ActionProposal
impl Debug for ActionProposal
§impl PartialEq for ActionProposal
impl PartialEq for ActionProposal
impl Eq for ActionProposal
impl StructuralPartialEq for ActionProposal
Auto Trait Implementations§
impl Freeze for ActionProposal
impl RefUnwindSafe for ActionProposal
impl Send for ActionProposal
impl Sync for ActionProposal
impl Unpin for ActionProposal
impl UnsafeUnpin for ActionProposal
impl UnwindSafe for ActionProposal
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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