Struct nu_protocol::value::Value [−][src]
pub struct Value {
pub value: UntaggedValue,
pub tag: Tag,
}Expand description
The fundamental structured value that flows through the pipeline, with associated metadata
Fields
value: UntaggedValuetag: TagImplementations
impl Value[src]
impl Value[src]pub fn new(untagged_value: UntaggedValue, the_tag: Tag) -> Self[src]
pub fn new(untagged_value: UntaggedValue, the_tag: Tag) -> Self[src]Helper to create a Value
pub fn anchor(&self) -> Option<AnchorLocation>[src]
pub fn anchor(&self) -> Option<AnchorLocation>[src]Get the corresponding anchor (originating location) for the Value
pub fn anchor_name(&self) -> Option<String>[src]
pub fn anchor_name(&self) -> Option<String>[src]Get the name (url, filepath, etc) behind an anchor for the Value
pub fn error(e: ShellError) -> Value[src]
pub fn as_string(&self) -> Result<String, ShellError>[src]
pub fn as_string(&self) -> Result<String, ShellError>[src]View the Value as a string, if possible
pub fn as_filepath(&self) -> Result<PathBuf, ShellError>[src]
pub fn as_filepath(&self) -> Result<PathBuf, ShellError>[src]View the Value as a FilePath (PathBuf), if possible
pub fn as_int(&self) -> Result<BigInt, ShellError>[src]
pub fn as_int(&self) -> Result<BigInt, ShellError>[src]View the Value as a Int (BigInt), if possible
pub fn as_filesize(&self) -> Result<BigInt, ShellError>[src]
pub fn as_filesize(&self) -> Result<BigInt, ShellError>[src]View the Value as a Filesize (BigInt), if possible
pub fn as_duration(&self) -> Result<BigInt, ShellError>[src]
pub fn as_duration(&self) -> Result<BigInt, ShellError>[src]View the Value as a Duration (BigInt), if possible
pub fn as_decimal(&self) -> Result<BigDecimal, ShellError>[src]
pub fn as_decimal(&self) -> Result<BigDecimal, ShellError>[src]View the Value as a Decimal (BigDecimal), if possible
pub fn convert_to_string(&self) -> String[src]
pub fn format(&self, fmt: &str) -> Result<String, ShellError>[src]
pub fn as_forgiving_string(&self) -> Result<&str, ShellError>[src]
pub fn as_forgiving_string(&self) -> Result<&str, ShellError>[src]View into the borrowed string contents of a Value, if possible
pub fn as_path(&self) -> Result<PathBuf, ShellError>[src]
pub fn as_path(&self) -> Result<PathBuf, ShellError>[src]View the Value as a path, if possible
pub fn as_primitive(&self) -> Result<Primitive, ShellError>[src]
pub fn as_primitive(&self) -> Result<Primitive, ShellError>[src]View the Value as a Primitive value, if possible
pub fn is_primitive(&self) -> bool[src]
pub fn is_primitive(&self) -> bool[src]View the Value as a Primitive value, if possible
pub fn as_char(&self) -> Result<char, ShellError>[src]
pub fn as_char(&self) -> Result<char, ShellError>[src]View the Value as char, if possible
pub fn as_usize(&self) -> Result<usize, ShellError>[src]
pub fn as_usize(&self) -> Result<usize, ShellError>[src]View the Value as unsigned size, if possible
pub fn as_u64(&self) -> Result<u64, ShellError>[src]
pub fn as_u64(&self) -> Result<u64, ShellError>[src]View the Value as unsigned 64-bit, if possible
pub fn as_i64(&self) -> Result<i64, ShellError>[src]
pub fn as_i64(&self) -> Result<i64, ShellError>[src]View the Value as signed 64-bit, if possible
pub fn as_u32(&self) -> Result<u32, ShellError>[src]
pub fn as_u32(&self) -> Result<u32, ShellError>[src]View the Value as unsigned 32-bit, if possible
pub fn as_i32(&self) -> Result<i32, ShellError>[src]
pub fn as_i32(&self) -> Result<i32, ShellError>[src]View the Value as signed 32-bit, if possible
pub fn as_i16(&self) -> Result<i16, ShellError>[src]
pub fn as_i16(&self) -> Result<i16, ShellError>[src]View the Value as signed 16-bit, if possible
pub fn as_bool(&self) -> Result<bool, ShellError>[src]
pub fn as_bool(&self) -> Result<bool, ShellError>[src]View the Value as boolean, if possible
pub fn table_entries(&self) -> TableValueIter<'_>ⓘNotable traits for TableValueIter<'a>
impl<'a> Iterator for TableValueIter<'a> type Item = &'a Value;[src]
pub fn table_entries(&self) -> TableValueIter<'_>ⓘNotable traits for TableValueIter<'a>
impl<'a> Iterator for TableValueIter<'a> type Item = &'a Value;[src]Returns an iterator of the values rows
pub fn row_entries(&self) -> RowValueIter<'_>ⓘNotable traits for RowValueIter<'a>
impl<'a> Iterator for RowValueIter<'a> type Item = (&'a String, &'a Value);[src]
pub fn row_entries(&self) -> RowValueIter<'_>ⓘNotable traits for RowValueIter<'a>
impl<'a> Iterator for RowValueIter<'a> type Item = (&'a String, &'a Value);[src]Returns an iterator of the value’s cells
pub fn nothing() -> Value[src]
Methods from Deref<Target = UntaggedValue>
pub fn data_descriptors(&self) -> Vec<String>[src]
pub fn data_descriptors(&self) -> Vec<String>[src]Get the corresponding descriptors (column names) associated with this value
pub fn is_filesize(&self) -> bool[src]
pub fn is_filesize(&self) -> bool[src]Returns true if this value represents a filesize
pub fn is_duration(&self) -> bool[src]
pub fn is_duration(&self) -> bool[src]Returns true if this value represents a duration
pub fn expect_error(&self) -> ShellError[src]
pub fn expect_error(&self) -> ShellError[src]Expect this value to be an error and return it
pub fn expect_string(&self) -> &str[src]
pub fn expect_string(&self) -> &str[src]Expect this value to be a string and return it
pub fn expect_int(&self) -> i64[src]
pub fn expect_int(&self) -> i64[src]Expect this value to be an integer and return it
Trait Implementations
impl Deref for Value[src]
impl Deref for Value[src]Overload deferencing to give back the UntaggedValue inside of a Value
type Target = UntaggedValue
type Target = UntaggedValueThe resulting type after dereferencing.
impl<'de> Deserialize<'de> for Value[src]
impl<'de> Deserialize<'de> for Value[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]Deserialize this value from the given Serde deserializer. Read more
impl<'a> From<&'a Value> for &'a UntaggedValue[src]
impl<'a> From<&'a Value> for &'a UntaggedValue[src]Convert a borrowed Value into a borrowed UntaggedValue
impl From<TaggedDictBuilder> for Value[src]
impl From<TaggedDictBuilder> for Value[src]fn from(input: TaggedDictBuilder) -> Value[src]
fn from(input: TaggedDictBuilder) -> Value[src]Convert a builder into a tagged Value
impl From<UntaggedValue> for Value[src]
impl From<UntaggedValue> for Value[src]fn from(value: UntaggedValue) -> Value[src]
fn from(value: UntaggedValue) -> Value[src]Convert an UntaggedValue into a Value with a default tag
impl From<Value> for UntaggedValue[src]
impl From<Value> for UntaggedValue[src]fn from(v: Value) -> UntaggedValue[src]
fn from(v: Value) -> UntaggedValue[src]Convert a Value into an UntaggedValue
impl Ord for Value[src]
impl Ord for Value[src]impl PartialEq<Value> for Dictionary[src]
impl PartialEq<Value> for Dictionary[src]impl PartialOrd<Value> for Value[src]
impl PartialOrd<Value> for Value[src]fn partial_cmp(&self, other: &Value) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl PrettyDebug for &Value[src]
impl PrettyDebug for &Value[src]fn pretty(&self) -> DebugDocBuilder[src]
fn pretty(&self) -> DebugDocBuilder[src]Get a borrowed Value ready to be pretty-printed
fn to_doc(&self) -> DebugDoc[src]
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>[src]
fn display(&self) -> String[src]
fn display(&self) -> String[src]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[src]
fn colored_string(&self, width: usize) -> String[src]
impl PrettyDebug for Value[src]
impl PrettyDebug for Value[src]fn pretty(&self) -> DebugDocBuilder[src]
fn pretty(&self) -> DebugDocBuilder[src]Get a Value ready to be pretty-printed
fn to_doc(&self) -> DebugDoc[src]
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>[src]
fn display(&self) -> String[src]
fn display(&self) -> String[src]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[src]
fn colored_string(&self, width: usize) -> String[src]
impl ShellTypeName for Value[src]
impl ShellTypeName for Value[src]impl<'a> TryFrom<&'a Value> for &'a Dictionary[src]
impl<'a> TryFrom<&'a Value> for &'a Dictionary[src]fn try_from(value: &'a Value) -> Result<&'a Dictionary, ShellError>[src]
fn try_from(value: &'a Value) -> Result<&'a Dictionary, ShellError>[src]Convert to a dictionary, if possible
type Error = ShellError
type Error = ShellErrorThe type returned in the event of a conversion error.
impl Eq for Value[src]
impl StructuralEq for Value[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
pub fn equivalent(&self, key: &K) -> bool[src]Compare self to key and return true if they are equal.
impl<T> HasFallibleSpan for T where
T: HasSpan, [src]
impl<T> HasFallibleSpan for T where
T: HasSpan, [src]pub fn maybe_span(&self) -> Option<Span>[src]
impl<T> IntoSpanned for T where
T: HasFallibleSpan, [src]
impl<T> IntoSpanned for T where
T: HasFallibleSpan, [src]impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug, [src]pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder[src]
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone, [src]
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>[src]
impl<T> SpannedItem for T[src]
impl<T> SpannedItem for T[src]impl<T> TaggedItem for T[src]
impl<T> TaggedItem for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,