pub enum Type {
Show 21 variants Nothing, Int, BigInt, Range(Box<RangeType>), Decimal, Filesize, String, Line, ColumnPath, GlobPattern, Boolean, Date, Duration, FilePath, Binary, Row(Row), Table(Vec<Type>), Block, Error, BeginningOfStream, EndOfStream,
}
Expand description

Representation of for the type of a value in Nu

Variants

Nothing

A value which has no value

Int

An integer-based value

BigInt

An big integer-based value

Range(Box<RangeType>)

A range between two values

Decimal

A decimal (floating point) value

Filesize

A filesize in bytes

String

A string of text

Line

A line of text (a string with trailing line ending)

ColumnPath

A path through a table

GlobPattern

A glob pattern (like foo*)

Boolean

A boolean value

Date

A date value (in UTC)

Duration

A data duration value

FilePath

A filepath value

Binary

A binary (non-text) buffer value

Row(Row)

A row of data

Table(Vec<Type>)

A full table of data

Block

A block of script (TODO)

Error

An error value (TODO)

BeginningOfStream

Beginning of stream marker (used as bookend markers rather than actual values)

EndOfStream

End of stream marker (used as bookend markers rather than actual values)

Implementations

Convert a Primitive into its corresponding Type

Convert a dictionary into its corresponding row Type

Convert a table into its corresponding Type

Convert a value into its corresponding Type

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Prepare Type for pretty-printing

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

Converts a value into a Spanned value

Converts a value into a Spanned value, using an unknown Span

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.