Enum nu_protocol::value::primitive::Primitive [−][src]
pub enum Primitive {
}
Expand description
The most fundamental of structured values in Nu are the Primitive values. These values represent types like integers, strings, booleans, dates, etc that are then used as the building blocks of more complex structures.
Primitives also include marker values BeginningOfStream and EndOfStream which denote a change of condition in the stream
Variants
An empty value
Int(i64)
A common integer
Tuple Fields of Int
0: i64
BigInt(BigInt)
A “big int”, an integer with arbitrarily large size (aka not limited to 64-bit)
Tuple Fields of BigInt
0: BigInt
Decimal(BigDecimal)
A “big decimal”, an decimal number with arbitrarily large size (aka not limited to 64-bit)
Tuple Fields of Decimal
0: BigDecimal
Filesize(u64)
A count in the number of bytes, used as a filesize
Tuple Fields of Filesize
0: u64
String(String)
A string value
Tuple Fields of String
0: String
ColumnPath(ColumnPath)
A path to travel to reach a value in a table
Tuple Fields of ColumnPath
0: ColumnPath
GlobPattern(String)
A glob pattern, eg foo*
Tuple Fields of GlobPattern
0: String
Boolean(bool)
A boolean value
Tuple Fields of Boolean
0: bool
Date(DateTime<FixedOffset>)
A date value
Tuple Fields of Date
0: DateTime<FixedOffset>
Duration(BigInt)
A count in the number of nanoseconds
Tuple Fields of Duration
0: BigInt
A range of values
FilePath(PathBuf)
A file path
Tuple Fields of FilePath
0: PathBuf
A vector of raw binary data
Beginning of stream marker, a pseudo-value not intended for tables
End of stream marker, a pseudo-value not intended for tables
Implementations
Converts a primitive value to a char, if possible. Uses a span to build an error if the conversion isn’t possible.
Converts a primitive value to a u64, if possible. Uses a span to build an error if the conversion isn’t possible.
Converts a primitive value to a u64, if possible. Uses a span to build an error if the conversion isn’t possible.
Converts a primitive value to a f64, if possible. Uses a span to build an error if the conversion isn’t possible.
Converts a primitive value to a i64, if possible. Uses a span to build an error if the conversion isn’t possible.
Converts a primitive value to a u32, if possible. Uses a span to build an error if the conversion isn’t possible.
Trait Implementations
fn 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
Helper to convert from decimals to a Primitive value
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
Get a Primitive value ready to be pretty-printed
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
Find the type of the Value and prepare it for pretty-printing
Auto Trait Implementations
impl RefUnwindSafe for Primitive
impl UnwindSafe for Primitive
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.