pub struct SymbolRef<'s>(/* private fields */);
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> PartialOrd for SymbolRef<'s>
impl<'s> PartialOrd for SymbolRef<'s>
impl<'s> Copy for SymbolRef<'s>
impl<'s> Eq for SymbolRef<'s>
impl<'s> StructuralPartialEq for SymbolRef<'s>
Auto Trait Implementations§
impl<'s> Freeze for SymbolRef<'s>
impl<'s> RefUnwindSafe for SymbolRef<'s>
impl<'s> Send for SymbolRef<'s>
impl<'s> Sync for SymbolRef<'s>
impl<'s> Unpin for SymbolRef<'s>
impl<'s> UnwindSafe for SymbolRef<'s>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more