#[repr(C)]pub struct Site { /* private fields */ }
Expand description
Registration site for a static symbol created by the sym!()
macro in
stringleton
.
You should never need to construct this manually.
Implementations§
Source§impl Site
impl Site
Sourcepub unsafe fn get_string(&self) -> &'static &'static str
pub unsafe fn get_string(&self) -> &'static &'static str
§Safety
This must only be called from the registry’s static ctor, or after static ctors have finished running.
Sourcepub unsafe fn get_ref_after_ctor(&'static self) -> &'static Symbol
pub unsafe fn get_ref_after_ctor(&'static self) -> &'static Symbol
Get a reference to the symbol contained in this site.
§Safety
This MUST only be called when self
is part of the distributed slice
used by the ctor, and after static ctors have run. For example,
obtaining a &'static self
via Box::leak()
and calling this will not
work.
Sourcepub unsafe fn get_after_ctor(&'static self) -> Symbol
pub unsafe fn get_after_ctor(&'static self) -> Symbol
Get the deduplicated symbol value.
§Safety
This MUST only be called when self
is part of the distributed slice
used by the ctor, and after static ctors have run. For example,
obtaining a &'static self
via Box::leak()
and calling this will not
work.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Site
impl !RefUnwindSafe for Site
impl Send for Site
impl Unpin for Site
impl UnwindSafe for Site
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