pub struct ArgSpec {
pub name: Option<FieldName>,
pub req: Occurrences,
}
Expand description
Structure providing information about state inputs and outputs for an RGB operation.
Fields§
§name: Option<FieldName>
The name of the state field from the owned or global state fields
defined in the interface. Used only if this name is different from the
alias provided as ArgMap
key.
req: Occurrences
Maximal number of occurrences of the input or output of this type.
Implementations§
Source§impl ArgSpec
impl ArgSpec
pub fn new(req: Occurrences) -> Self
pub fn required() -> Self
pub fn optional() -> Self
pub fn non_empty() -> Self
pub fn many() -> Self
pub fn with(name: &'static str, req: Occurrences) -> Self
pub fn from_required(name: &'static str) -> Self
pub fn from_optional(name: &'static str) -> Self
pub fn from_non_empty(name: &'static str) -> Self
pub fn from_many(name: &'static str) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ArgSpec
impl<'de> Deserialize<'de> for ArgSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl StrictDecode for ArgSpec
impl StrictDecode for ArgSpec
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
Source§impl StrictEncode for ArgSpec
impl StrictEncode for ArgSpec
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
Source§impl StrictStruct for ArgSpec
impl StrictStruct for ArgSpec
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for ArgSpec
impl StrictType for ArgSpec
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB_STD
fn strict_name() -> Option<TypeName>
impl Eq for ArgSpec
impl StrictProduct for ArgSpec
impl StructuralPartialEq for ArgSpec
Auto Trait Implementations§
impl Freeze for ArgSpec
impl RefUnwindSafe for ArgSpec
impl Send for ArgSpec
impl Sync for ArgSpec
impl Unpin for ArgSpec
impl UnwindSafe for ArgSpec
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.