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
BigInt(BigInt)A “big int”, an integer with arbitrarily large size (aka not limited to 64-bit)
Decimal(BigDecimal)A “big decimal”, an decimal number with arbitrarily large size (aka not limited to 64-bit)
Filesize(u64)A count in the number of bytes, used as a filesize
String(String)A string value
ColumnPath(ColumnPath)A path to travel to reach a value in a table
GlobPattern(String)A glob pattern, eg foo*
Boolean(bool)A boolean value
Date(DateTime<FixedOffset>)A date value
Duration(BigInt)A count in the number of nanoseconds
A range of values
FilePath(PathBuf)A file path
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 Primitiveimpl UnwindSafe for PrimitiveBlanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder