pub struct LocalNames { /* private fields */ }
Implementations§
Source§impl<'a> LocalNames
impl<'a> LocalNames
Sourcepub fn exclude_globals(&mut self, globals: &[&str])
pub fn exclude_globals(&mut self, globals: &[&str])
provide known global identifier names to exclude from being assigned
Sourcepub fn create_once(&'a mut self, goal_name: &str) -> &'a str
pub fn create_once(&'a mut self, goal_name: &str) -> &'a str
get a unique identifier name for a string once (can’t be looked up again)
pub fn get<H: Hash>(&'a self, unique_id: H) -> &'a str
pub fn try_get<H: Hash>(&'a self, unique_id: H) -> Option<&'a str>
Sourcepub fn get_or_create<H: Hash>(
&'a mut self,
unique_id: H,
goal_name: &str,
) -> (&'a str, bool)
pub fn get_or_create<H: Hash>( &'a mut self, unique_id: H, goal_name: &str, ) -> (&'a str, bool)
Get or create a unique identifier for a string while storing the lookup by unique id
NOTE: we must be careful here to ensure that the object being hashed w/ a similar goal name
are the same hashable object – (ex. Id<T>
vs ResourceIndex
)
Trait Implementations§
Source§impl Default for LocalNames
impl Default for LocalNames
Source§fn default() -> LocalNames
fn default() -> LocalNames
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LocalNames
impl RefUnwindSafe for LocalNames
impl Send for LocalNames
impl Sync for LocalNames
impl Unpin for LocalNames
impl UnwindSafe for LocalNames
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