cmd_args/arg/
descriptor.rs

1use crate::arg::Type;
2
3/// Descriptor for anticipated arguments.
4pub struct Descriptor {
5    /// Anticipated value type for the argument.
6    value_type: Type,
7
8    /// Description of the argument.
9    description: String,
10}
11
12impl Descriptor {
13    /// Create a new argument descriptor.
14    pub fn new(value_type: Type, description: &str) -> Self {
15        Descriptor {
16            value_type,
17            description: String::from(description),
18        }
19    }
20
21    /// Get the type of the argument value.
22    pub fn value_type(&self) -> &Type {
23        &self.value_type
24    }
25
26    /// Get the description of the argument.
27    pub fn description(&self) -> &String {
28        &self.description
29    }
30}