pub struct InternedString { /* private fields */ }Expand description
A binary-stable, transparent representation of fxt::InternedString.
This structure has the exact same memory layout as the C++ fxt::InternedString
(which is a single const char* pointer pointing to a null-terminated string).
Placing instances of this structure in the special linker section __fxt_interned_string_table
allows them to sit contiguous alongside C++’s own interned strings in the global
string table segment, meaning their trace-ID calculations (this - section_begin)
are safe, exact, and valid.
Implementations§
Source§impl InternedString
impl InternedString
Sourcepub const unsafe fn new_raw(ptr: *const u8) -> InternedString
pub const unsafe fn new_raw(ptr: *const u8) -> InternedString
Creates a new InternedString from a raw pointer.
§Safety
The caller must ensure that the pointer points to a null-terminated string with static storage duration (’static).
Trait Implementations§
impl Send for InternedString
impl Sync for InternedString
Auto Trait Implementations§
impl Freeze for InternedString
impl RefUnwindSafe for InternedString
impl Unpin for InternedString
impl UnsafeUnpin for InternedString
impl UnwindSafe for InternedString
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Init<T> for T
impl<T> Init<T> for T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more§impl<T> ToMutPtr for Twhere
T: ?Sized,
impl<T> ToMutPtr for Twhere
T: ?Sized,
§fn to_mut_ptr(&self) -> *mut T
fn to_mut_ptr(&self) -> *mut T
Casts the reference to a mutable raw pointer.