pub struct RawVec { /* private fields */ }Implementations§
Source§impl RawVec
impl RawVec
pub fn new(val_size: usize, align: usize, dangling: *mut u8) -> Self
pub fn with_capacity( val_size: usize, align: usize, capacity: usize, dangling: *mut u8, ) -> Self
Sourcepub unsafe fn from_raw_parts(
ptr: *mut u8,
length: usize,
capacity: usize,
val_size: usize,
align: usize,
) -> Self
pub unsafe fn from_raw_parts( ptr: *mut u8, length: usize, capacity: usize, val_size: usize, align: usize, ) -> Self
Creates a RawVec directly from a pointer, a length, and a capacity.
§Safety
ptrmust be a valid pointer tocapacityallocated bytes of whichlengthare validval_sizemust be the size of the elements in the vectoralignmust be the alignment of the elements in the vectorlengthmust be less than or equal tocapacity
pub const fn len(&self) -> usize
pub fn spare_capacity(&self) -> usize
pub fn has_spare_capacity(&self) -> bool
Sourcepub unsafe fn set_len(&mut self, new_len: usize)
pub unsafe fn set_len(&mut self, new_len: usize)
Sets the current vector’s length to new_len
§Safety
new_lenmust be less than or equal toself.capacity().- The elements at
old_len..new_lenmust be initialized.
pub const fn is_empty(&self) -> bool
pub const fn capacity(&self) -> usize
pub const fn as_ptr(&self) -> *const u8
pub fn as_mut_ptr(&mut self) -> *mut u8
pub fn reserve(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
pub fn clear(&mut self, drop_slice_in_place: &dyn Fn(*mut u8, usize))
pub fn index(&self, idx: usize) -> *const u8
pub fn index_mut(&mut self, idx: usize) -> *mut u8
Sourcepub unsafe fn index_unchecked(&self, idx: usize) -> *const u8
pub unsafe fn index_unchecked(&self, idx: usize) -> *const u8
§Safety
idxmust be less than the length of the vector
Sourcepub unsafe fn index_mut_unchecked(&mut self, idx: usize) -> *mut u8
pub unsafe fn index_mut_unchecked(&mut self, idx: usize) -> *mut u8
§Safety
idxmust be less than the length of the vector
pub fn range<R>(&self, range: R) -> (*const u8, usize)where
R: RangeBounds<usize>,
pub fn range_mut<R>(&mut self, range: R) -> (*mut u8, usize)where
R: RangeBounds<usize>,
Sourcepub unsafe fn push_raw(&mut self, value: *const u8)
pub unsafe fn push_raw(&mut self, value: *const u8)
Push a value to the current vector
§Safety
value must be a valid pointer to an instance of the current vector’s
type
Sourcepub unsafe fn push_unchecked(&mut self, value: *const u8)
pub unsafe fn push_unchecked(&mut self, value: *const u8)
§Safety
valuemust be a valid pointer to an instance of the current vector’s type- the vector must have available capacity greater than zero
Sourcepub unsafe fn append_raw_range(&mut self, start: *const u8, length: usize)
pub unsafe fn append_raw_range(&mut self, start: *const u8, length: usize)
§Safety
startmust be a valid pointer to a slice of lengthlengthof the current vector’s type
pub fn eq( &self, other: &Self, eq_func: &dyn Fn(*const u8, *const u8) -> bool, ) -> bool
pub fn cmp( &self, other: &Self, cmp_func: &dyn Fn(*const u8, *const u8) -> Ordering, ) -> Ordering
pub fn hash(&self, hash_func: &mut dyn FnMut(*const u8))
pub fn size_of_children( &self, context: &mut Context, size_of_children_func: &mut dyn Fn(*const u8, &mut Context), )
pub fn debug( &self, f: &mut Formatter<'_>, debug_func: &dyn Fn(*const u8, &mut Formatter<'_>) -> Result, ) -> Result
pub fn dedup_starting_at( &mut self, starting_point: usize, same_bucket: &mut dyn FnMut(*mut u8, *mut u8) -> bool, drop_in_place: &mut dyn FnMut(*mut u8), )
Source§impl RawVec
impl RawVec
pub fn shrink_to_fit(&mut self)
Auto Trait Implementations§
impl Freeze for RawVec
impl RefUnwindSafe for RawVec
impl !Send for RawVec
impl !Sync for RawVec
impl Unpin for RawVec
impl UnsafeUnpin for RawVec
impl UnwindSafe for RawVec
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.