pub struct MayaRawShellItem {
pub kind: MayaRawShellItemKind,
pub span: TextRange,
/* private fields */
}Expand description
Lossless raw shell item captured from a command-style invocation.
Fields§
§kind: MayaRawShellItemKindSurface classification for this shell item.
span: TextRangeLossless source span for the full raw item surface as it appeared in the command.
Implementations§
Source§impl MayaRawShellItem
impl MayaRawShellItem
Sourcepub fn text_range(&self) -> Option<TextRange>
pub fn text_range(&self) -> Option<TextRange>
Returns the lexical text span used to derive Self::value_text, when this item kind has one.
This range is distinct from Self::span: span covers the full raw item surface,
while text_range points at the slice that backs value extraction for literal-like words.
Sourcepub fn source_text<'a>(&self, source: SourceView<'a>) -> &'a str
pub fn source_text<'a>(&self, source: SourceView<'a>) -> &'a str
Returns the lossless source text for the full raw item surface.
Sourcepub fn value_text<'a>(&self, source: SourceView<'a>) -> Option<&'a str>
pub fn value_text<'a>(&self, source: SourceView<'a>) -> Option<&'a str>
Returns the lexical value text for literal-like words.
This accessor uses Self::text_range and may further normalize the sliced text by kind,
such as stripping the surrounding quotes from quoted strings.
Sourcepub fn preferred_text<'a>(&self, source: SourceView<'a>) -> &'a str
pub fn preferred_text<'a>(&self, source: SourceView<'a>) -> &'a str
Returns the preferred consumer-facing text for this shell item.
Literal-like words use Self::value_text so downstream consumers can read decoded
values without stripping quotes manually. Other shell surfaces fall back to full
source-preserving text.
Trait Implementations§
Source§impl Clone for MayaRawShellItem
impl Clone for MayaRawShellItem
Source§fn clone(&self) -> MayaRawShellItem
fn clone(&self) -> MayaRawShellItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more