pub struct ArgSpec {
pub name: String,
pub help: String,
pub kind: ArgKind,
pub optional: bool,
pub rest: bool,
pub source: Option<String>,
}Fields§
§name: String§help: String§kind: ArgKind§optional: boolMay be left out. Only trailing arguments can be optional.
rest: boolTakes every remaining word, joined with spaces. Only the last argument
can be rest.
source: Option<String>Where its values come from, so the settings panel offers them in a
menu: output, control-center-page, audio-target, app,
player, … The command line takes any word as before.
Implementations§
Source§impl ArgSpec
impl ArgSpec
pub fn string(name: impl Into<String>, help: impl Into<String>) -> Self
pub fn int(name: impl Into<String>, help: impl Into<String>) -> Self
pub fn float(name: impl Into<String>, help: impl Into<String>) -> Self
pub fn bool(name: impl Into<String>, help: impl Into<String>) -> Self
pub fn choice<I, S>( name: impl Into<String>, help: impl Into<String>, values: I, ) -> Self
pub fn optional(self) -> Self
pub fn rest(self) -> Self
Sourcepub fn source(self, source: impl Into<String>) -> Self
pub fn source(self, source: impl Into<String>) -> Self
Where its values come from: see ArgSpec::source.
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
impl Eq 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 UnsafeUnpin 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