Union rkyv::string::repr::ArchivedStringRepr
source · 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_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_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.
Trait Implementations§
source§impl<C: Fallible + ?Sized> CheckBytes<C> for ArchivedStringRepr
impl<C: Fallible + ?Sized> CheckBytes<C> for ArchivedStringRepr
Auto Trait Implementations§
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
§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<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
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>
Gets the layout of the type.