pub struct TypedPrompt<'a, T>{ /* private fields */ }Expand description
Typed builder for extras: .default_val, .validate, .message.
Implementations§
Source§impl<'a, T> TypedPrompt<'a, T>
impl<'a, T> TypedPrompt<'a, T>
Sourcepub fn default_val(self, val: T) -> Self
pub fn default_val(self, val: T) -> Self
Provide a typed default (não precisa parsear).
Sourcepub fn get(self) -> Result<T, Error>
pub fn get(self) -> Result<T, Error>
read and return T using stdin/stdout.
Examples found in repository?
More examples
pub fn get_with_io<R, W>( self, reader: &mut R, writer: &mut W, ) -> Result<T, Error>
Auto Trait Implementations§
impl<'a, T> Freeze for TypedPrompt<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for TypedPrompt<'a, T>
impl<'a, T> !Send for TypedPrompt<'a, T>
impl<'a, T> !Sync for TypedPrompt<'a, T>
impl<'a, T> Unpin for TypedPrompt<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for TypedPrompt<'a, T>
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