Struct wolfram_expr::symbol::SymbolRef
source · pub struct SymbolRef<'s>(_);Expand description
Borrowed string containing a valid symbol.
Implementations§
source§impl<'s> SymbolRef<'s>
impl<'s> SymbolRef<'s>
sourcepub fn try_new(string: &'s str) -> Option<Self>
pub fn try_new(string: &'s str) -> Option<Self>
Attempt to parse string as an absolute symbol.
Examples
use wolfram_expr::symbol::SymbolRef;
assert!(matches!(SymbolRef::try_new("System`List"), Some(_)));
assert!(matches!(SymbolRef::try_new("List"), None));
assert!(matches!(SymbolRef::try_new("123"), None));sourcepub fn context(&self) -> ContextRef<'s>
pub fn context(&self) -> ContextRef<'s>
Get the context path part of a symbol as an ContextRef.
sourcepub fn symbol_name(&self) -> SymbolNameRef<'s>
pub fn symbol_name(&self) -> SymbolNameRef<'s>
Get the symbol name part of a symbol as a SymbolNameRef.
Trait Implementations§
source§impl<'s> Ord for SymbolRef<'s>
impl<'s> Ord for SymbolRef<'s>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'s> PartialEq<SymbolRef<'s>> for SymbolRef<'s>
impl<'s> PartialEq<SymbolRef<'s>> for SymbolRef<'s>
source§impl<'s> PartialOrd<SymbolRef<'s>> for SymbolRef<'s>
impl<'s> PartialOrd<SymbolRef<'s>> for SymbolRef<'s>
1.0.0 · source§fn 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