[][src]Enum nu_protocol::PositionalType

pub enum PositionalType {
    Mandatory(StringSyntaxShape),
    Optional(StringSyntaxShape),
}

The type of positional arguments

Variants

Mandatory(StringSyntaxShape)

A mandatory positional argument with the expected shape of the value

Optional(StringSyntaxShape)

An optional positional argument with the expected shape of the value

Implementations

impl 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]

Helper to create a mandatory positional argument with an "any" type

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]

Helper to create a optional positional argument type

pub fn optional_any(name: &str) -> PositionalType[src]

Helper to create a optional positional argument with an "any" type

pub fn name(&self) -> &str[src]

Gets the name of the positional argument

pub fn syntax_type(&self) -> SyntaxShape[src]

Gets the expected type of a positional argument

Trait Implementations

impl Clone for PositionalType[src]

impl Debug for PositionalType[src]

impl<'de> Deserialize<'de> for PositionalType[src]

impl Eq for PositionalType[src]

impl PartialEq<PositionalType> for PositionalType[src]

impl PrettyDebug for PositionalType[src]

fn pretty(&self) -> DebugDocBuilder[src]

Prepare the PositionalType for pretty-printing

impl Serialize for PositionalType[src]

impl StructuralEq for PositionalType[src]

impl StructuralPartialEq for PositionalType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> PrettyDebugWithSource for T where
    T: PrettyDebug
[src]

impl<T> SpannedItem for T[src]

impl<T> TaggedItem for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.