pub struct AliasesMap<P, V> { /* private fields */ }
Expand description
Map of symbol and function aliases.
Implementations§
Source§impl<P, V> AliasesMap<P, V>
impl<P, V> AliasesMap<P, V>
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<V>,
) -> Result<(), P::Error>where
P: AliasDeclarationParser,
pub fn insert(
&mut self,
decl: impl AsRef<str>,
defn: impl Into<V>,
) -> 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, V: Clone> Clone for AliasesMap<P, V>
impl<P: Clone, V: Clone> Clone for AliasesMap<P, V>
Source§fn clone(&self) -> AliasesMap<P, V>
fn clone(&self) -> AliasesMap<P, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<P, V> Freeze for AliasesMap<P, V>where
P: Freeze,
impl<P, V> RefUnwindSafe for AliasesMap<P, V>where
P: RefUnwindSafe,
V: RefUnwindSafe,
impl<P, V> Send for AliasesMap<P, V>
impl<P, V> Sync for AliasesMap<P, V>
impl<P, V> Unpin for AliasesMap<P, V>
impl<P, V> UnwindSafe for AliasesMap<P, V>where
P: UnwindSafe,
V: 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§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