pub struct FlagSchema {
pub long: String,
pub short: Option<char>,
pub description: String,
pub value_type: ValueType,
pub expects_value: bool,
pub default: Option<String>,
pub choices: Option<Vec<String>>,
pub required: bool,
pub hidden: bool,
}Expand description
Schema for a single flag/option
Fields§
§long: String§short: Option<char>§description: String§value_type: ValueType§expects_value: bool§default: Option<String>§choices: Option<Vec<String>>§required: boolImplementations§
Source§impl FlagSchema
impl FlagSchema
pub fn new(long: &str) -> FlagSchema
pub fn boolean(long: &str) -> FlagSchema
pub fn with_short(self, short: char) -> FlagSchema
pub fn with_description(self, desc: &str) -> FlagSchema
pub fn with_default(self, default: &str) -> FlagSchema
pub fn with_choices(self, choices: &[&str]) -> FlagSchema
pub fn required(self) -> FlagSchema
Trait Implementations§
Source§impl Clone for FlagSchema
impl Clone for FlagSchema
Source§fn clone(&self) -> FlagSchema
fn clone(&self) -> FlagSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FlagSchema
impl RefUnwindSafe for FlagSchema
impl Send for FlagSchema
impl Sync for FlagSchema
impl Unpin for FlagSchema
impl UnsafeUnpin for FlagSchema
impl UnwindSafe for FlagSchema
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request