pub struct CachedId { /* private fields */ }Expand description
A lazily-initialized, cached Id for use as a static.
Avoids repeated interner write-lock acquisition by storing the interned Id
on first access and returning the cached copy on all subsequent calls.
§Example
use vortex_session::registry::{CachedId, Id};
static MY_ID: CachedId = CachedId::new("my.encoding");
fn get_id() -> Id {
*MY_ID
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CachedId
impl RefUnwindSafe for CachedId
impl Send for CachedId
impl Sync for CachedId
impl Unpin for CachedId
impl UnsafeUnpin for CachedId
impl UnwindSafe for CachedId
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