Enum nu_protocol::value::UntaggedValue
source · [−]pub enum UntaggedValue {
Primitive(Primitive),
Row(Dictionary),
Table(Vec<Value>),
Error(ShellError),
Block(Box<CapturedBlock>),
}
Expand description
The core structured values that flow through a pipeline
Variants
Primitive(Primitive)
A primitive (or fundamental) type of values
Row(Dictionary)
A table row
Table(Vec<Value>)
A full inner (or embedded) table
Error(ShellError)
An error value that represents an error that occurred as the values in the pipeline were built
Block(Box<CapturedBlock>)
A block of Nu code, eg { ls | get name ; echo "done" }
with its captured values
Implementations
sourceimpl UntaggedValue
impl UntaggedValue
sourcepub fn data_descriptors(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn data_descriptors(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get the corresponding descriptors (column names) associated with this value
sourcepub fn into_value(self, tag: impl Into<Tag>) -> Value
pub fn into_value(self, tag: impl Into<Tag>) -> Value
Convert this UntaggedValue to a Value with the given Tag
sourcepub fn into_untagged_value(self) -> Value
pub fn into_untagged_value(self) -> Value
Convert this UntaggedValue into a Value with an empty Tag
sourcepub fn is_filesize(&self) -> bool
pub fn is_filesize(&self) -> bool
Returns true if this value represents a filesize
sourcepub fn is_duration(&self) -> bool
pub fn is_duration(&self) -> bool
Returns true if this value represents a duration
sourcepub fn is_some(&self) -> bool
pub fn is_some(&self) -> bool
Returns true if the value represents something other than Nothing
sourcepub fn expect_error(&self) -> ShellError
pub fn expect_error(&self) -> ShellError
Expect this value to be an error and return it
sourcepub fn expect_string(&self) -> &str
pub fn expect_string(&self) -> &str
Expect this value to be a string and return it
sourcepub fn expect_int(&self) -> i64
pub fn expect_int(&self) -> i64
Expect this value to be an integer and return it
sourcepub fn string(s: impl Into<String>) -> UntaggedValue
pub fn string(s: impl Into<String>) -> UntaggedValue
Helper for creating string values
sourcepub fn column_path(s: &str, span: Span) -> UntaggedValue
pub fn column_path(s: &str, span: Span) -> UntaggedValue
Helper for creating column-path values
sourcepub fn int(i: impl Into<i64>) -> UntaggedValue
pub fn int(i: impl Into<i64>) -> UntaggedValue
Helper for creating integer values
sourcepub fn big_int(i: impl Into<BigInt>) -> UntaggedValue
pub fn big_int(i: impl Into<BigInt>) -> UntaggedValue
Helper for creating big integer values
sourcepub fn glob_pattern(s: impl Into<String>) -> UntaggedValue
pub fn glob_pattern(s: impl Into<String>) -> UntaggedValue
Helper for creating glob pattern values
sourcepub fn filepath(s: impl Into<PathBuf>) -> UntaggedValue
pub fn filepath(s: impl Into<PathBuf>) -> UntaggedValue
Helper for creating filepath values
sourcepub fn filesize(s: u64) -> UntaggedValue
pub fn filesize(s: u64) -> UntaggedValue
Helper for creating filesize values
sourcepub fn decimal(s: impl Into<BigDecimal>) -> UntaggedValue
pub fn decimal(s: impl Into<BigDecimal>) -> UntaggedValue
Helper for creating decimal values
sourcepub fn decimal_from_float(f: f64, span: Span) -> UntaggedValue
pub fn decimal_from_float(f: f64, span: Span) -> UntaggedValue
Helper for creating decimal values
sourcepub fn binary(binary: Vec<u8>) -> UntaggedValue
pub fn binary(binary: Vec<u8>) -> UntaggedValue
Helper for creating binary (non-text) buffer values
sourcepub fn range(
left: (Spanned<Primitive>, RangeInclusion),
right: (Spanned<Primitive>, RangeInclusion)
) -> UntaggedValue
pub fn range(
left: (Spanned<Primitive>, RangeInclusion),
right: (Spanned<Primitive>, RangeInclusion)
) -> UntaggedValue
Helper for creating range values
sourcepub fn boolean(b: impl Into<bool>) -> UntaggedValue
pub fn boolean(b: impl Into<bool>) -> UntaggedValue
Helper for creating boolean values
sourcepub fn duration(nanos: impl Into<BigInt>) -> UntaggedValue
pub fn duration(nanos: impl Into<BigInt>) -> UntaggedValue
Helper for creating date duration values
sourcepub fn system_date(s: SystemTime) -> UntaggedValue
pub fn system_date(s: SystemTime) -> UntaggedValue
Helper for creating datatime values
pub fn date(d: impl Into<DateTime<FixedOffset>>) -> UntaggedValue
sourcepub fn nothing() -> UntaggedValue
pub fn nothing() -> UntaggedValue
Helper for creating the Nothing value
Trait Implementations
sourceimpl Clone for UntaggedValue
impl Clone for UntaggedValue
sourcefn clone(&self) -> UntaggedValue
fn clone(&self) -> UntaggedValue
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 UntaggedValue
impl Debug for UntaggedValue
sourceimpl<'de> Deserialize<'de> for UntaggedValue
impl<'de> Deserialize<'de> for UntaggedValue
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<'a> From<&'a Value> for &'a UntaggedValue
impl<'a> From<&'a Value> for &'a UntaggedValue
Convert a borrowed Value into a borrowed UntaggedValue
sourceimpl From<ShellError> for UntaggedValue
impl From<ShellError> for UntaggedValue
sourcefn from(e: ShellError) -> Self
fn from(e: ShellError) -> Self
Performs the conversion.
sourceimpl<T> From<T> for UntaggedValue where
T: Into<Primitive>,
impl<T> From<T> for UntaggedValue where
T: Into<Primitive>,
sourcefn from(input: T) -> UntaggedValue
fn from(input: T) -> UntaggedValue
Convert a Primitive to an UntaggedValue
sourceimpl From<UntaggedValue> for Value
impl From<UntaggedValue> for Value
sourcefn from(value: UntaggedValue) -> Value
fn from(value: UntaggedValue) -> Value
Convert an UntaggedValue into a Value with a default tag
sourceimpl From<Value> for UntaggedValue
impl From<Value> for UntaggedValue
sourcefn from(v: Value) -> UntaggedValue
fn from(v: Value) -> UntaggedValue
Convert a Value into an UntaggedValue
sourceimpl Hash for UntaggedValue
impl Hash for UntaggedValue
sourceimpl Ord for UntaggedValue
impl Ord for UntaggedValue
sourceimpl PartialEq<UntaggedValue> for UntaggedValue
impl PartialEq<UntaggedValue> for UntaggedValue
sourcefn eq(&self, other: &UntaggedValue) -> bool
fn eq(&self, other: &UntaggedValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UntaggedValue) -> bool
fn ne(&self, other: &UntaggedValue) -> bool
This method tests for !=
.
sourceimpl PartialOrd<UntaggedValue> for UntaggedValue
impl PartialOrd<UntaggedValue> for UntaggedValue
sourcefn partial_cmp(&self, other: &UntaggedValue) -> Option<Ordering>
fn partial_cmp(&self, other: &UntaggedValue) -> 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 Serialize for UntaggedValue
impl Serialize for UntaggedValue
sourceimpl ShellTypeName for UntaggedValue
impl ShellTypeName for UntaggedValue
impl Eq for UntaggedValue
impl StructuralEq for UntaggedValue
impl StructuralPartialEq for UntaggedValue
Auto Trait Implementations
impl RefUnwindSafe for UntaggedValue
impl Send for UntaggedValue
impl Sync for UntaggedValue
impl Unpin for UntaggedValue
impl UnwindSafe for UntaggedValue
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> 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