pub struct EpsilonRawVec<'gc, T> { /* private fields */ }
Expand description
The raw representation of a vector in the “epsilon” collector
Implementations
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> EpsilonRawVec<'gc, T>
sourcepub fn iter(&self) -> RawVecIter<'gc, T, Self>ⓘNotable traits for RawVecIter<'gc, T, V>impl<'gc, T: GcSafe<'gc, V::Id> + Copy, V: GcRawVec<'gc, T>> Iterator for RawVecIter<'gc, T, V> type Item = T;
where
T: Copy,
pub fn iter(&self) -> RawVecIter<'gc, T, Self>ⓘNotable traits for RawVecIter<'gc, T, V>impl<'gc, T: GcSafe<'gc, V::Id> + Copy, V: GcRawVec<'gc, T>> Iterator for RawVecIter<'gc, T, V> type Item = T;
where
T: Copy,
See GcRawVec::iter
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> EpsilonRawVec<'gc, T>
sourcepub fn with_capacity_in(capacity: usize, ctx: &'gc EpsilonContext) -> Self
pub fn with_capacity_in(capacity: usize, ctx: &'gc EpsilonContext) -> Self
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
See IGcVec::len
sourcepub unsafe fn set_len(&mut self, len: usize)
pub unsafe fn set_len(&mut self, len: usize)
See IGcVec::set_len
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
See IGcVec::capacity
sourcepub fn reserve_in_place(
&mut self,
_additional: usize
) -> Result<(), ReallocFailedError>
pub fn reserve_in_place(
&mut self,
_additional: usize
) -> Result<(), ReallocFailedError>
sourcepub unsafe fn as_ptr(&self) -> *const T
pub unsafe fn as_ptr(&self) -> *const T
See IGcVec::as_ptr
sourcepub fn context(&self) -> &'gc EpsilonContext
pub fn context(&self) -> &'gc EpsilonContext
See IGcVec::context
sourcepub unsafe fn as_mut_ptr(&mut self) -> *mut T
pub unsafe fn as_mut_ptr(&mut self) -> *mut T
sourcepub fn replace(&mut self, index: usize, val: T) -> T
pub fn replace(&mut self, index: usize, val: T) -> T
See IGcVec::replace
sourcepub fn set(&mut self, index: usize, val: T)
pub fn set(&mut self, index: usize, val: T)
See IGcVec::set
sourcepub fn extend_from_slice(&mut self, src: &[T]) where
T: Copy,
pub fn extend_from_slice(&mut self, src: &[T]) where
T: Copy,
sourcepub fn push(&mut self, val: T)
pub fn push(&mut self, val: T)
See IGcVec::push
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
See IGcVec::pop
sourcepub fn swap_remove(&mut self, index: usize) -> T
pub fn swap_remove(&mut self, index: usize) -> T
sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
See IGcVec::reserve
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
See IGcVec::is_empty
sourcepub fn new_in(ctx: &'gc EpsilonContext) -> Self
pub fn new_in(ctx: &'gc EpsilonContext) -> Self
See IGcVec::new_in
sourcepub fn copy_from_slice(src: &[T], ctx: &'gc EpsilonContext) -> Self where
T: Copy,
pub fn copy_from_slice(src: &[T], ctx: &'gc EpsilonContext) -> Self where
T: Copy,
sourcepub fn from_vec(src: Vec<T>, ctx: &'gc EpsilonContext) -> Self
pub fn from_vec(src: Vec<T>, ctx: &'gc EpsilonContext) -> Self
See IGcVec::from_vec
Trait Implementations
sourceimpl<'gc, T> Clone for EpsilonRawVec<'gc, T>
impl<'gc, T> Clone for EpsilonRawVec<'gc, T>
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> Extend<T> for EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> Extend<T> for EpsilonRawVec<'gc, T>
sourcefn extend<E: IntoIterator<Item = T>>(&mut self, iter: E)
fn extend<E: IntoIterator<Item = T>>(&mut self, iter: E)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> GcRawVec<'gc, T> for EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> GcRawVec<'gc, T> for EpsilonRawVec<'gc, T>
sourceunsafe fn steal_as_array_unchecked(self) -> GcArray<'gc, T, EpsilonCollectorId>
unsafe fn steal_as_array_unchecked(self) -> GcArray<'gc, T, EpsilonCollectorId>
Steal ownership of this vector, converting it into a [GcArray]. Read more
sourcefn iter(&self) -> RawVecIter<'gc, T, Self>ⓘNotable traits for RawVecIter<'gc, T, V>impl<'gc, T: GcSafe<'gc, V::Id> + Copy, V: GcRawVec<'gc, T>> Iterator for RawVecIter<'gc, T, V> type Item = T;
where
T: Copy,
fn iter(&self) -> RawVecIter<'gc, T, Self>ⓘNotable traits for RawVecIter<'gc, T, V>impl<'gc, T: GcSafe<'gc, V::Id> + Copy, V: GcRawVec<'gc, T>> Iterator for RawVecIter<'gc, T, V> type Item = T;
where
T: Copy,
Iterate over the elements of the vectors Read more
sourceimpl<'gc, 'new_gc, T: GcSafe<'gc, EpsilonCollectorId>> GcRebrand<'new_gc, EpsilonCollectorId> for EpsilonRawVec<'gc, T> where
T: GcRebrand<'new_gc, EpsilonCollectorId>,
T::Branded: Sized,
impl<'gc, 'new_gc, T: GcSafe<'gc, EpsilonCollectorId>> GcRebrand<'new_gc, EpsilonCollectorId> for EpsilonRawVec<'gc, T> where
T: GcRebrand<'new_gc, EpsilonCollectorId>,
T::Branded: Sized,
type Branded = EpsilonRawVec<'new_gc, T::Branded>
type Branded = EpsilonRawVec<'new_gc, T::Branded>
This type with all garbage collected lifetimes
changed to 'new_gc
Read more
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> GcSafe<'gc, EpsilonCollectorId> for EpsilonRawVec<'gc, T> where
T: GcSafe<'gc, EpsilonCollectorId>,
T: Trace,
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> GcSafe<'gc, EpsilonCollectorId> for EpsilonRawVec<'gc, T> where
T: GcSafe<'gc, EpsilonCollectorId>,
T: Trace,
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> IGcVec<'gc, T> for EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> IGcVec<'gc, T> for EpsilonRawVec<'gc, T>
type Id = EpsilonCollectorId
type Id = EpsilonCollectorId
The id of the collector
sourcefn with_capacity_in(capacity: usize, ctx: &'gc EpsilonContext) -> Self
fn with_capacity_in(capacity: usize, ctx: &'gc EpsilonContext) -> Self
Allocate a new vector with the specified capacity, using the specified context. Read more
sourcefn capacity(&self) -> usize
fn capacity(&self) -> usize
The total amount of space that is available without needing reallocation. Read more
sourcefn reserve_in_place(
&mut self,
_additional: usize
) -> Result<(), ReallocFailedError>
fn reserve_in_place(
&mut self,
_additional: usize
) -> Result<(), ReallocFailedError>
Attempt to reallocate the vector in-place, without moving the underlying pointer. Read more
sourcefn context(&self) -> &'gc EpsilonContext
fn context(&self) -> &'gc EpsilonContext
sourcefn from_vec(src: Vec<T>, ctx: &'gc <Self::Id as CollectorId>::Context) -> Self
fn from_vec(src: Vec<T>, ctx: &'gc <Self::Id as CollectorId>::Context) -> Self
Copy the specified elements into a new vector, allocating it in the specified context Read more
sourcefn copy_from_slice(
src: &[T],
ctx: &'gc <Self::Id as CollectorId>::Context
) -> Self where
T: Copy,
fn copy_from_slice(
src: &[T],
ctx: &'gc <Self::Id as CollectorId>::Context
) -> Self where
T: Copy,
Copy the specified elements into a new vector, allocating it in the specified context Read more
sourcefn new_in(ctx: &'gc <Self::Id as CollectorId>::Context) -> Self
fn new_in(ctx: &'gc <Self::Id as CollectorId>::Context) -> Self
Allocate a new vector inside the specified context
sourcefn pop(&mut self) -> Option<T>
fn pop(&mut self) -> Option<T>
Pop an element of the end of the vector,
returning None
if empty. Read more
sourcefn swap_remove(&mut self, index: usize) -> T
fn swap_remove(&mut self, index: usize) -> T
Removes an element from the vector and returns it. Read more
sourcefn extend_from_slice(&mut self, src: &[T]) where
T: Copy,
fn extend_from_slice(&mut self, src: &[T]) where
T: Copy,
Extend the vector with elements copied from the specified slice
sourcefn get(&self, idx: usize) -> Option<T> where
T: Copy,
fn get(&self, idx: usize) -> Option<T> where
T: Copy,
Get the item at the specified index,
or None
if it is out of bounds. Read more
sourcefn replace(&mut self, index: usize, val: T) -> T
fn replace(&mut self, index: usize, val: T) -> T
Replace the item at the specified index, returning the old value. Read more
sourceunsafe fn as_mut_ptr(&mut self) -> *mut T
unsafe fn as_mut_ptr(&mut self) -> *mut T
Get a mutable pointer to the vector’s underlying data. Read more
sourceimpl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> Trace for EpsilonRawVec<'gc, T> where
T: Trace,
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> Trace for EpsilonRawVec<'gc, T> where
T: Trace,
sourceconst NEEDS_TRACE: bool
const NEEDS_TRACE: bool
Whether this type needs to be traced by the garbage collector. Read more
sourceconst NEEDS_DROP: bool
const NEEDS_DROP: bool
If this type needs a destructor run. Read more
impl<'gc, T> Copy for EpsilonRawVec<'gc, T>
impl<'gc, T: GcSafe<'gc, EpsilonCollectorId>> TrustedDrop for EpsilonRawVec<'gc, T> where
T: TrustedDrop,
Auto Trait Implementations
impl<'gc, T> !RefUnwindSafe for EpsilonRawVec<'gc, T>
impl<'gc, T> !Send for EpsilonRawVec<'gc, T>
impl<'gc, T> !Sync for EpsilonRawVec<'gc, T>
impl<'gc, T> Unpin for EpsilonRawVec<'gc, T>
impl<'gc, T> !UnwindSafe for EpsilonRawVec<'gc, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more