pub union ArchivedStringRepr {
/* private fields */
}Expand description
An archived string representation that can inline short strings.
Implementations§
Source§impl ArchivedStringRepr
impl ArchivedStringRepr
Sourcepub unsafe fn out_of_line_offset(&self) -> isize
pub unsafe fn out_of_line_offset(&self) -> isize
Sourcepub fn as_mut_ptr(this: Seal<'_, Self>) -> *mut u8
pub fn as_mut_ptr(this: Seal<'_, Self>) -> *mut u8
Returns a mutable pointer to the bytes of the string.
Sourcepub fn as_str_ptr(&self) -> *const str
pub fn as_str_ptr(&self) -> *const str
Returns a pointer to the string as a str.
Sourcepub fn as_bytes_seal(this: Seal<'_, Self>) -> Seal<'_, [u8]>
pub fn as_bytes_seal(this: Seal<'_, Self>) -> Seal<'_, [u8]>
Returns a mutable slice of the bytes of the string.
Sourcepub fn as_str_seal(this: Seal<'_, Self>) -> Seal<'_, str>
pub fn as_str_seal(this: Seal<'_, Self>) -> Seal<'_, str>
Returns a mutable reference to the string as a str.
Sourcepub unsafe fn emplace_inline(value: &str, out: *mut Self)
pub unsafe fn emplace_inline(value: &str, out: *mut Self)
Emplaces a new inline representation for the given str.
This function is guaranteed not to write any uninitialized bytes to
out.
§Safety
- The length of
valuemust be less than or equal toINLINE_CAPACITY. outmust point to a valid location to write the inline representation.
Sourcepub unsafe fn try_emplace_out_of_line<E: Source>(
value: &str,
target: usize,
out: Place<Self>,
) -> Result<(), E>
pub unsafe fn try_emplace_out_of_line<E: Source>( value: &str, target: usize, out: Place<Self>, ) -> Result<(), E>
Emplaces a new out-of-line representation for the given str.
§Safety
The length of str must be greater than INLINE_CAPACITY and less
than or equal to OUT_OF_LINE_CAPACITY.
Sourcepub unsafe fn emplace_out_of_line(value: &str, target: usize, out: Place<Self>)
pub unsafe fn emplace_out_of_line(value: &str, target: usize, out: Place<Self>)
Emplaces a new out-of-line representation for the given str.
§Panics
- The offset calculated for the repr does not fit in an
isize - The offset calculated for the repr exceeds the offset storage
§Safety
The length of str must be greater than INLINE_CAPACITY and less
than or equal to OUT_OF_LINE_CAPACITY.
Trait Implementations§
Source§impl<C> CheckBytes<C> for ArchivedStringRepr
impl<C> CheckBytes<C> for ArchivedStringRepr
impl Portable for ArchivedStringRepr
Auto Trait Implementations§
impl Freeze for ArchivedStringRepr
impl RefUnwindSafe for ArchivedStringRepr
impl Send for ArchivedStringRepr
impl Sync for ArchivedStringRepr
impl !Unpin for ArchivedStringRepr
impl !UnsafeUnpin for ArchivedStringRepr
impl UnwindSafe for ArchivedStringRepr
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.