Struct nu_protocol::value::Value [−][src]
pub struct Value { pub value: UntaggedValue, pub tag: Tag, }
The fundamental structured value that flows through the pipeline, with associated metadata
Fields
value: UntaggedValue
tag: Tag
Implementations
impl Value
[src]
pub fn new(untagged_value: UntaggedValue, the_tag: Tag) -> Self
[src]
Helper to create a Value
pub fn anchor(&self) -> Option<AnchorLocation>
[src]
Get the corresponding anchor (originating location) for the Value
pub fn anchor_name(&self) -> Option<String>
[src]
Get the name (url, filepath, etc) behind an anchor for the Value
pub fn tag(&self) -> Tag
[src]
Get the metadata for the Value
pub fn error(e: ShellError) -> Value
[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]
View the Value as a FilePath (PathBuf), if possible
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]
View the Value as a Filesize (BigInt), if possible
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]
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]
View into the borrowed string contents of a Value, if possible
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]
View the Value as a Primitive value, if possible
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]
View the Value as char, if possible
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]
View the Value as unsigned 64-bit, if possible
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]
View the Value as unsigned 32-bit, if possible
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]
View the Value as signed 16-bit, if possible
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]
Notable traits for TableValueIter<'a>
impl<'a> Iterator for TableValueIter<'a> type Item = &'a Value;
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]
Notable traits for RowValueIter<'a>
impl<'a> Iterator for RowValueIter<'a> type Item = (&'a String, &'a Value);
Returns an iterator of the value’s cells
pub fn is_empty(&self) -> bool
[src]
Returns true if the value is empty
pub fn nothing() -> Value
[src]
Methods from Deref<Target = UntaggedValue>
pub fn data_descriptors(&self) -> Vec<String>
[src]
Get the corresponding descriptors (column names) associated with this value
pub fn is_true(&self) -> bool
[src]
Returns true if this value represents boolean true
pub fn is_filesize(&self) -> bool
[src]
Returns true if this value represents a filesize
pub fn is_duration(&self) -> bool
[src]
Returns true if this value represents a duration
pub fn is_table(&self) -> bool
[src]
Returns true if this value represents a table
pub fn is_row(&self) -> bool
[src]
Returns true if this value represents a row
pub fn is_string(&self) -> bool
[src]
Returns true if this value represents a string
pub fn is_some(&self) -> bool
[src]
Returns true if the value represents something other than Nothing
pub fn is_none(&self) -> bool
[src]
Returns true if the value represents Nothing
pub fn is_error(&self) -> bool
[src]
Returns true if the value represents an error
pub fn expect_error(&self) -> ShellError
[src]
Expect this value to be an error and return it
pub fn expect_string(&self) -> &str
[src]
Expect this value to be a string and return it
pub fn expect_int(&self) -> i64
[src]
Expect this value to be an integer and return it
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl Deref for Value
[src]
Overload deferencing to give back the UntaggedValue inside of a Value
type Target = UntaggedValue
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'de> Deserialize<'de> for Value
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Value
[src]
impl From<&'_ str> for Value
[src]
impl<'a> From<&'a Value> for &'a UntaggedValue
[src]
Convert a borrowed Value into a borrowed UntaggedValue
impl From<String> for Value
[src]
impl From<TaggedDictBuilder> for Value
[src]
fn from(input: TaggedDictBuilder) -> Value
[src]
Convert a builder into a tagged Value
impl From<UntaggedValue> for Value
[src]
fn from(value: UntaggedValue) -> Value
[src]
Convert an UntaggedValue into a Value with a default tag
impl From<Value> for ReturnValue
[src]
impl From<Value> for UntaggedValue
[src]
fn from(v: Value) -> UntaggedValue
[src]
Convert a Value into an UntaggedValue
impl From<bool> for Value
[src]
impl HasSpan for Value
[src]
impl Hash for Value
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Value
[src]
fn cmp(&self, other: &Value) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Value> for Dictionary
[src]
fn eq(&self, other: &Value) -> bool
[src]
Test a dictionary against a Value for equality
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Value> for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PrettyDebug for &Value
[src]
fn pretty(&self) -> DebugDocBuilder
[src]
Get a borrowed Value ready to be pretty-printed
pub fn to_doc(&self) -> DebugDoc
[src]
pub fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
pub fn pretty_builder(
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
[src]
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
pub fn display(&self) -> String
[src]
pub fn plain_string(&self, width: usize) -> String
[src]
pub fn colored_string(&self, width: usize) -> String
[src]
impl PrettyDebug for Value
[src]
fn pretty(&self) -> DebugDocBuilder
[src]
Get a Value ready to be pretty-printed
pub fn to_doc(&self) -> DebugDoc
[src]
pub fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
[src]
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
pub fn pretty_builder(
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
[src]
&self
) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
pub fn display(&self) -> String
[src]
pub fn plain_string(&self, width: usize) -> String
[src]
pub fn colored_string(&self, width: usize) -> String
[src]
impl Serialize for Value
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl ShellTypeName for Value
[src]
impl StructuralEq for Value
[src]
impl<'a> TryFrom<&'a Value> for &'a Dictionary
[src]
type Error = ShellError
The type returned in the event of a conversion error.
fn try_from(value: &'a Value) -> Result<&'a Dictionary, ShellError>
[src]
Convert to a dictionary, if possible
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> HasFallibleSpan for T where
T: HasSpan,
[src]
T: HasSpan,
pub fn maybe_span(&self) -> Option<Span>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSpanned for T where
T: HasFallibleSpan,
[src]
T: HasFallibleSpan,
type Output = T
pub fn into_spanned(self, _span: impl Into<Span>) -> <T as IntoSpanned>::Output
[src]
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
[src]
T: PrettyDebug,
pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder
[src]
pub fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
[src]
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
pub fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
[src]
Self: Clone,
pub fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
[src]
impl<T> SpannedItem for T
[src]
pub fn spanned(self, span: impl Into<Span>) -> Spanned<Self>
[src]
pub fn spanned_unknown(self) -> Spanned<Self>
[src]
impl<T> TaggedItem for T
[src]
pub fn tagged(self, tag: impl Into<Tag>) -> Tagged<Self>
[src]
pub fn tagged_unknown(self) -> Tagged<Self>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,