pub struct RegistryWriteGuard { /* private fields */ }
Expand description
Symbol registry write lock guard
Implementations§
Source§impl RegistryWriteGuard
impl RegistryWriteGuard
pub fn get(&self, string: &str) -> Option<Symbol>
Sourcepub fn get_by_address(&self, address: u64) -> Option<Symbol>
pub fn get_by_address(&self, address: u64) -> Option<Symbol>
Check if a symbol has been registered at address
(i.e., it has been
produced by Symbol::to_ffi()
), and return the symbol if so.
This can be used to verify symbols that have made a round-trip over an FFI boundary.
Sourcepub fn get_or_insert(&mut self, string: &str) -> Symbol
pub fn get_or_insert(&mut self, string: &str) -> Symbol
Get the existing symbol for string
, or insert a new one.
Sourcepub fn get_or_insert_static(&mut self, string: &'static &'static str) -> Symbol
pub fn get_or_insert_static(&mut self, string: &'static &'static str) -> Symbol
Get the existing symbol for string
, or insert a new one.
This variant is slightly more efficient than
get_or_insert()
, because it can reuse the
storage of string
directly for this symbol. In other words, if this
call inserted the symbol, the returned Symbol
will be backed by
string
, and no additional allocations will have happened.
Auto Trait Implementations§
impl Freeze for RegistryWriteGuard
impl RefUnwindSafe for RegistryWriteGuard
impl !Send for RegistryWriteGuard
impl Sync for RegistryWriteGuard
impl Unpin for RegistryWriteGuard
impl UnwindSafe for RegistryWriteGuard
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