pub struct Param {
pub name: &'static str,
pub kind: Kind,
pub required: bool,
pub about: &'static str,
}Expand description
A typed parameter declared in a const/static command table:
Param::int_in("width", 1, 16384).required().about("pixels").
Fields§
§name: &'static str§kind: Kind§required: bool§about: &'static strImplementations§
Source§impl Param
impl Param
pub const fn new(name: &'static str, kind: Kind) -> Self
pub const fn bool(name: &'static str) -> Self
pub const fn int(name: &'static str) -> Self
pub const fn int_in(name: &'static str, min: i64, max: i64) -> Self
pub const fn float(name: &'static str) -> Self
pub const fn float_in(name: &'static str, min: f64, max: f64) -> Self
pub const fn string(name: &'static str) -> Self
pub const fn one_of(name: &'static str, values: &'static [&'static str]) -> Self
pub const fn json(name: &'static str) -> Self
pub const fn required(self) -> Self
pub const fn about(self, about: &'static str) -> Self
Trait Implementations§
impl Copy for Param
impl StructuralPartialEq for Param
Auto Trait Implementations§
impl Freeze for Param
impl RefUnwindSafe for Param
impl Send for Param
impl Sync for Param
impl Unpin for Param
impl UnsafeUnpin for Param
impl UnwindSafe for Param
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