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(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable pointer to the bytes of the string.
Sourcepub fn as_mut_str(&mut self) -> &mut str
pub fn as_mut_str(&mut self) -> &mut 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
.
§Safety
- The length of
str
must be less than or equal toINLINE_CAPACITY
. out
must point to a valid location to write the inline representation.
Sourcepub unsafe fn emplace_out_of_line(
value: &str,
pos: usize,
target: usize,
out: *mut Self,
)
pub unsafe fn emplace_out_of_line( value: &str, pos: usize, target: usize, out: *mut Self, )
Emplaces a new out-of-line representation for the given str
.
§Safety
- The length of
str
must be greater thanINLINE_CAPACITY
. pos
must be the location of the representation within the archive.target
must be the location of the serialized bytes of the string.out
must point to a valid location to write the out-of-line representation.
Auto Trait Implementations§
impl Freeze for ArchivedStringRepr
impl RefUnwindSafe for ArchivedStringRepr
impl Send for ArchivedStringRepr
impl Sync for ArchivedStringRepr
impl !Unpin 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