Struct jj_lib::dsl_util::AliasesMap
source · pub struct AliasesMap<P> { /* private fields */ }
Expand description
Map of symbol and function aliases.
Implementations§
source§impl<P> AliasesMap<P>
impl<P> AliasesMap<P>
sourcepub fn new() -> Selfwhere
P: Default,
pub fn new() -> Selfwhere
P: Default,
Creates an empty aliases map with default-constructed parser.
sourcepub fn insert(
&mut self,
decl: impl AsRef<str>,
defn: impl Into<String>,
) -> Result<(), P::Error>where
P: AliasDeclarationParser,
pub fn insert(
&mut self,
decl: impl AsRef<str>,
defn: impl Into<String>,
) -> Result<(), P::Error>where
P: AliasDeclarationParser,
Adds new substitution rule decl = defn
.
Returns error if decl
is invalid. The defn
part isn’t checked. A bad
defn
will be reported when the alias is substituted.
sourcepub fn symbol_names(&self) -> impl Iterator<Item = &str>
pub fn symbol_names(&self) -> impl Iterator<Item = &str>
Iterates symbol names in arbitrary order.
sourcepub fn function_names(&self) -> impl Iterator<Item = &str>
pub fn function_names(&self) -> impl Iterator<Item = &str>
Iterates function names in arbitrary order.
Trait Implementations§
source§impl<P: Clone> Clone for AliasesMap<P>
impl<P: Clone> Clone for AliasesMap<P>
source§fn clone(&self) -> AliasesMap<P>
fn clone(&self) -> AliasesMap<P>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<P: Debug> Debug for AliasesMap<P>
impl<P: Debug> Debug for AliasesMap<P>
source§impl<P: Default> Default for AliasesMap<P>
impl<P: Default> Default for AliasesMap<P>
source§fn default() -> AliasesMap<P>
fn default() -> AliasesMap<P>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<P> Freeze for AliasesMap<P>where
P: Freeze,
impl<P> RefUnwindSafe for AliasesMap<P>where
P: RefUnwindSafe,
impl<P> Send for AliasesMap<P>where
P: Send,
impl<P> Sync for AliasesMap<P>where
P: Sync,
impl<P> Unpin for AliasesMap<P>where
P: Unpin,
impl<P> UnwindSafe for AliasesMap<P>where
P: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more