Struct ActionArgs
pub struct ActionArgs { /* private fields */ }Expand description
Arguments for one invocation, already checked against the action’s declared parameters.
There is no way to build one except through bind or
none, so an action’s builder never has to re-validate: if it
holds an ActionArgs, every required parameter is present and every value
has the declared type. That is what keeps a bad call from becoming a
half-applied edit.
Implementations§
§impl ActionArgs
impl ActionArgs
pub fn none() -> ActionArgs
pub fn none() -> ActionArgs
The empty argument set — what a nullary action is invoked with.
pub fn bind(
params: &[ActionParam],
supplied: impl IntoIterator<Item = (String, ArgValue)>,
) -> Result<ActionArgs, ArgError>
pub fn bind( params: &[ActionParam], supplied: impl IntoIterator<Item = (String, ArgValue)>, ) -> Result<ActionArgs, ArgError>
Check supplied against params and bind it.
Fails on the first problem rather than accumulating: the caller has to fix them one at a time anyway, and a partial bind must never reach an action.
§Errors
Returns the first missing, unknown, wrong-typed, or disallowed argument.
pub fn bind_json(
params: &[ActionParam],
supplied: &Map<String, Value>,
) -> Result<ActionArgs, ArgError>
pub fn bind_json( params: &[ActionParam], supplied: &Map<String, Value>, ) -> Result<ActionArgs, ArgError>
pub fn number(&self, name: &str) -> Option<f64>
pub fn number(&self, name: &str) -> Option<f64>
The number bound to name, if any. An integer argument widens, matching
ArgValue::satisfies.
Trait Implementations§
§impl Clone for ActionArgs
impl Clone for ActionArgs
§fn clone(&self) -> ActionArgs
fn clone(&self) -> ActionArgs
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 ActionArgs
impl Debug for ActionArgs
§impl Default for ActionArgs
impl Default for ActionArgs
§fn default() -> ActionArgs
fn default() -> ActionArgs
§impl PartialEq for ActionArgs
impl PartialEq for ActionArgs
impl StructuralPartialEq for ActionArgs
Auto Trait Implementations§
impl Freeze for ActionArgs
impl RefUnwindSafe for ActionArgs
impl Send for ActionArgs
impl Sync for ActionArgs
impl Unpin for ActionArgs
impl UnsafeUnpin for ActionArgs
impl UnwindSafe for ActionArgs
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> 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