pub struct ArgSchema {
pub args: Vec<ArgSpec>,
pub allow_extra: bool,
}Expand description
Static args schema for a handler.
Fields§
§args: Vec<ArgSpec>§allow_extra: boolImplementations§
Source§impl ArgSchema
impl ArgSchema
pub fn new() -> Self
pub fn strict() -> Self
pub fn required(self, name: impl Into<String>, arg_type: ArgType) -> Self
pub fn optional(self, name: impl Into<String>, arg_type: ArgType) -> Self
pub fn allow_extra(self, allow_extra: bool) -> Self
pub fn get(&self, name: &str) -> Option<&ArgSpec>
pub fn has_required_args(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ArgSchema
impl<'de> Deserialize<'de> for ArgSchema
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
impl Eq for ArgSchema
impl StructuralPartialEq for ArgSchema
Auto Trait Implementations§
impl Freeze for ArgSchema
impl RefUnwindSafe for ArgSchema
impl Send for ArgSchema
impl Sync for ArgSchema
impl Unpin for ArgSchema
impl UnsafeUnpin for ArgSchema
impl UnwindSafe for ArgSchema
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.