#[non_exhaustive]pub struct ReadsContract {
pub required: &'static [&'static str],
pub exactly_one_of: &'static [&'static [&'static str]],
pub optional: &'static [&'static str],
pub with_field_requires: &'static [(&'static str, &'static str)],
pub lists: &'static [ListInput],
}Expand description
What an action requires of its step’s reads: map.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.required: &'static [&'static str]Inputs every step of this action must name.
exactly_one_of: &'static [&'static [&'static str]]Groups from which exactly one input must be named. Each group holds the alternatives in the order they should be listed to the author.
optional: &'static [&'static str]Inputs a step may name and the action reads when it does.
Listed so that a key the action would never look at is refused rather
than dropped: a reads: entry that nothing reads is a step running
without what its author gave it.
with_field_requires: &'static [(&'static str, &'static str)]with: fields that mean nothing unless the step also names a given
input, as (field, input) pairs.
Where an action offers two paths over one operation, a parameter can belong to only one of them. On the other path it would be parsed and never read, so the step would run without whatever the parameter asked for. This says which parameter needs which input.
lists: &'static [ListInput]Inputs that hold a list of references rather than one, each with the fewest entries a step may give.
For an action that takes a set whose size the ceremony chooses, such as the shares of a split. Every other input named in this contract holds one reference, and the resolver reports a list where one is expected as it reports one where a list is.
Implementations§
Source§impl ReadsContract
impl ReadsContract
Sourcepub const fn required(fields: &'static [&'static str]) -> Self
pub const fn required(fields: &'static [&'static str]) -> Self
The contract of an action that requires these inputs and offers no alternatives between them.
Sourcepub fn is_list(&self, key: &str) -> bool
pub fn is_list(&self, key: &str) -> bool
Whether the input named key holds a list under this contract.
Trait Implementations§
Source§impl Clone for ReadsContract
impl Clone for ReadsContract
impl Copy for ReadsContract
Source§impl Debug for ReadsContract
impl Debug for ReadsContract
impl Eq for ReadsContract
Source§impl PartialEq for ReadsContract
impl PartialEq for ReadsContract
impl StructuralPartialEq for ReadsContract
Auto Trait Implementations§
impl Freeze for ReadsContract
impl RefUnwindSafe for ReadsContract
impl Send for ReadsContract
impl Sync for ReadsContract
impl Unpin for ReadsContract
impl UnsafeUnpin for ReadsContract
impl UnwindSafe for ReadsContract
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.