Enum nu_protocol::SyntaxShape
source · [−]pub enum SyntaxShape {
Show 16 variants
Any,
String,
ColumnPath,
FullColumnPath,
Number,
Range,
Int,
FilePath,
GlobPattern,
Block,
Table,
Filesize,
Duration,
Operator,
RowCondition,
MathExpression,
}
Expand description
The syntactic shapes that values must match to be passed into a command. You can think of this as the type-checking that occurs when you call a function.
Variants
Any
Any syntactic form is allowed
String
Strings and string-like bare words are allowed
ColumnPath
A dotted path to navigate the table
FullColumnPath
A dotted path to navigate the table (including variable)
Number
Only a numeric (integer or decimal) value is allowed
Range
A range is allowed (eg, 1..3
)
Int
Only an integer value is allowed
FilePath
A filepath is allowed
GlobPattern
A glob pattern is allowed, eg foo*
Block
A block is allowed, eg {start this thing}
Table
A table is allowed, eg [first second]
Filesize
A filesize value is allowed, eg 10kb
Duration
A duration value is allowed, eg 19day
Operator
An operator
RowCondition
A math expression which expands shorthand forms on the lefthand side, eg foo > 1
The shorthand allows us to more easily reach columns inside of the row being passed in
MathExpression
A general math expression, eg the 1 + 2
of = 1 + 2
Implementations
sourceimpl SyntaxShape
impl SyntaxShape
pub fn syntax_shape_name(&self) -> &str
Trait Implementations
sourceimpl Clone for SyntaxShape
impl Clone for SyntaxShape
sourcefn clone(&self) -> SyntaxShape
fn clone(&self) -> SyntaxShape
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SyntaxShape
impl Debug for SyntaxShape
sourceimpl<'de> Deserialize<'de> for SyntaxShape
impl<'de> Deserialize<'de> for SyntaxShape
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for SyntaxShape
impl Hash for SyntaxShape
sourceimpl PartialEq<SyntaxShape> for SyntaxShape
impl PartialEq<SyntaxShape> for SyntaxShape
sourceimpl PrettyDebug for SyntaxShape
impl PrettyDebug for SyntaxShape
sourcefn pretty(&self) -> DebugDocBuilder
fn pretty(&self) -> DebugDocBuilder
Prepare SyntaxShape for pretty-printing
fn to_doc(&self) -> DebugDoc
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
sourcefn display(&self) -> String
fn display(&self) -> String
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
fn colored_string(&self, width: usize) -> String
sourceimpl Serialize for SyntaxShape
impl Serialize for SyntaxShape
impl Copy for SyntaxShape
impl Eq for SyntaxShape
impl StructuralEq for SyntaxShape
impl StructuralPartialEq for SyntaxShape
Auto Trait Implementations
impl RefUnwindSafe for SyntaxShape
impl Send for SyntaxShape
impl Sync for SyntaxShape
impl Unpin for SyntaxShape
impl UnwindSafe for SyntaxShape
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
sourceimpl<T> SpannedItem for T
impl<T> SpannedItem for T
sourceimpl<T> TaggedItem for T
impl<T> TaggedItem for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more