Struct Site

Source
#[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

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.