Enum nu_protocol::Type
source · [−]pub enum Type {
}
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
sourceimpl Type
impl Type
sourcepub fn from_primitive(primitive: &Primitive) -> Type
pub fn from_primitive(primitive: &Primitive) -> Type
Convert a Primitive into its corresponding Type
sourcepub fn from_dictionary(dictionary: &Dictionary) -> Type
pub fn from_dictionary(dictionary: &Dictionary) -> Type
Convert a dictionary into its corresponding row Type
sourcepub fn from_table<'a>(table: impl IntoIterator<Item = &'a Value>) -> Type
pub fn from_table<'a>(table: impl IntoIterator<Item = &'a Value>) -> Type
Convert a table into its corresponding Type
sourcepub fn from_value<'a>(value: impl Into<&'a UntaggedValue>) -> Type
pub fn from_value<'a>(value: impl Into<&'a UntaggedValue>) -> Type
Convert a value into its corresponding Type
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
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 Ord for Type
impl Ord for Type
sourceimpl PartialOrd<Type> for Type
impl PartialOrd<Type> for Type
sourcefn partial_cmp(&self, other: &Type) -> Option<Ordering>
fn partial_cmp(&self, other: &Type) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PrettyDebug for Type
impl PrettyDebug for Type
sourcefn pretty(&self) -> DebugDocBuilder
fn pretty(&self) -> DebugDocBuilder
Prepare Type 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
impl Eq for Type
impl StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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