Enum nu_protocol::PositionalType [−][src]
pub enum PositionalType {
Mandatory(String, SyntaxShape),
Optional(String, SyntaxShape),
}Expand description
The type of positional arguments
Variants
Mandatory(String, SyntaxShape)Expand description
A mandatory positional argument with the expected shape of the value
Optional(String, SyntaxShape)Expand description
An optional positional argument with the expected shape of the value
Implementations
impl PositionalType[src]
impl PositionalType[src]pub fn mandatory(name: &str, ty: SyntaxShape) -> PositionalType[src]
pub fn mandatory(name: &str, ty: SyntaxShape) -> PositionalType[src]Helper to create a mandatory positional argument type
pub fn mandatory_any(name: &str) -> PositionalType[src]
pub fn mandatory_any(name: &str) -> PositionalType[src]Helper to create a mandatory positional argument with an “any” type
pub fn mandatory_block(name: &str) -> PositionalType[src]
pub fn mandatory_block(name: &str) -> PositionalType[src]Helper to create a mandatory positional argument with a block type
pub fn optional(name: &str, ty: SyntaxShape) -> PositionalType[src]
pub fn optional(name: &str, ty: SyntaxShape) -> PositionalType[src]Helper to create a optional positional argument type
pub fn optional_any(name: &str) -> PositionalType[src]
pub fn optional_any(name: &str) -> PositionalType[src]Helper to create a optional positional argument with an “any” type
pub fn syntax_type(&self) -> SyntaxShape[src]
pub fn syntax_type(&self) -> SyntaxShape[src]Gets the expected type of a positional argument
Trait Implementations
impl Clone for PositionalType[src]
impl Clone for PositionalType[src]fn clone(&self) -> PositionalType[src]
fn clone(&self) -> PositionalType[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for PositionalType[src]
impl Debug for PositionalType[src]impl<'de> Deserialize<'de> for PositionalType[src]
impl<'de> Deserialize<'de> for PositionalType[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<PositionalType> for PositionalType[src]
impl PartialEq<PositionalType> for PositionalType[src]fn eq(&self, other: &PositionalType) -> bool[src]
fn eq(&self, other: &PositionalType) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &PositionalType) -> bool[src]
fn ne(&self, other: &PositionalType) -> bool[src]This method tests for !=.
impl PrettyDebug for PositionalType[src]
impl PrettyDebug for PositionalType[src]fn pretty(&self) -> DebugDocBuilder[src]
fn pretty(&self) -> DebugDocBuilder[src]Prepare the PositionalType for pretty-printing
fn to_doc(&self) -> DebugDoc[src]
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>[src]
fn display(&self) -> String[src]
fn display(&self) -> String[src]A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
fn plain_string(&self, width: usize) -> String[src]
fn colored_string(&self, width: usize) -> String[src]
impl Serialize for PositionalType[src]
impl Serialize for PositionalType[src]impl Eq for PositionalType[src]
impl StructuralEq for PositionalType[src]
impl StructuralPartialEq for PositionalType[src]
Auto Trait Implementations
impl RefUnwindSafe for PositionalType
impl Send for PositionalType
impl Sync for PositionalType
impl Unpin for PositionalType
impl UnwindSafe for PositionalType
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
pub fn equivalent(&self, key: &K) -> bool[src]Compare self to key and return true if they are equal.
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder[src]
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone, [src]
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>[src]
impl<T> SpannedItem for T[src]
impl<T> SpannedItem for T[src]impl<T> TaggedItem for T[src]
impl<T> TaggedItem for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,