Struct nu_protocol::value::column_path::ColumnPath
source · [−]pub struct ColumnPath { /* private fields */ }
Expand description
The fundamental path primitive to describe how to navigate through a table to get to a sub-item. A path member can be either a word or a number. Words/strings are taken to mean a column name, and numbers are the row number. Taken together they describe which column or row to narrow to in order to get data.
Rows must follow column names, they can’t come first. eg) foo.1
is valid where 1.foo
is not.
Implementations
sourceimpl ColumnPath
impl ColumnPath
sourceimpl ColumnPath
impl ColumnPath
sourcepub fn new(members: Vec<PathMember>) -> Self
pub fn new(members: Vec<PathMember>) -> Self
Constructs a new ColumnPath
.
sourceimpl ColumnPath
impl ColumnPath
sourcepub fn iter(&self) -> impl Iterator<Item = &PathMember>
pub fn iter(&self) -> impl Iterator<Item = &PathMember>
Iterate over the members of the column path
pub fn is_empty(&self) -> bool
sourcepub fn split_last(&self) -> Option<(&PathMember, &[PathMember])>
pub fn split_last(&self) -> Option<(&PathMember, &[PathMember])>
Returns the last member and a slice of the remaining members
sourcepub fn last(&self) -> Option<&PathMember>
pub fn last(&self) -> Option<&PathMember>
Returns the last member
pub fn path(&self) -> String
pub fn build(text: &Spanned<String>) -> ColumnPath
pub fn with_head(text: &Spanned<String>) -> Option<(String, ColumnPath)>
Trait Implementations
sourceimpl Clone for ColumnPath
impl Clone for ColumnPath
sourcefn clone(&self) -> ColumnPath
fn clone(&self) -> ColumnPath
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 ColumnPath
impl Debug for ColumnPath
sourceimpl<'de> Deserialize<'de> for ColumnPath
impl<'de> Deserialize<'de> for ColumnPath
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 HasFallibleSpan for ColumnPath
impl HasFallibleSpan for ColumnPath
sourcefn maybe_span(&self) -> Option<Span>
fn maybe_span(&self) -> Option<Span>
Creates a span that will cover the column path, if possible
sourceimpl Hash for ColumnPath
impl Hash for ColumnPath
sourceimpl<'a> IntoIterator for &'a ColumnPath
impl<'a> IntoIterator for &'a ColumnPath
type Item = &'a PathMember
type Item = &'a PathMember
The type of the elements being iterated over.
type IntoIter = Iter<'a, PathMember>
type IntoIter = Iter<'a, PathMember>
Which kind of iterator are we turning this into?
sourceimpl Ord for ColumnPath
impl Ord for ColumnPath
sourceimpl PartialEq<ColumnPath> for ColumnPath
impl PartialEq<ColumnPath> for ColumnPath
sourcefn eq(&self, other: &ColumnPath) -> bool
fn eq(&self, other: &ColumnPath) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ColumnPath) -> bool
fn ne(&self, other: &ColumnPath) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ColumnPath> for ColumnPath
impl PartialOrd<ColumnPath> for ColumnPath
sourcefn partial_cmp(&self, other: &ColumnPath) -> Option<Ordering>
fn partial_cmp(&self, other: &ColumnPath) -> 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 ColumnPath
impl PrettyDebug for ColumnPath
sourcefn pretty(&self) -> DebugDocBuilder
fn pretty(&self) -> DebugDocBuilder
Gets the ColumnPath ready to be pretty-printed
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
sourceimpl Serialize for ColumnPath
impl Serialize for ColumnPath
impl Eq for ColumnPath
impl StructuralEq for ColumnPath
impl StructuralPartialEq for ColumnPath
Auto Trait Implementations
impl RefUnwindSafe for ColumnPath
impl Send for ColumnPath
impl Sync for ColumnPath
impl Unpin for ColumnPath
impl UnwindSafe for ColumnPath
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> IntoSpanned for T where
T: HasFallibleSpan,
impl<T> IntoSpanned for T where
T: HasFallibleSpan,
type Output = T
pub fn into_spanned(self, _span: impl Into<Span>) -> <T as IntoSpanned>::Output
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