Struct webrender::freelist::FreeList

source ·
pub struct FreeList<T, M> {
    slots: Vec<Slot<T>>,
    free_list_head: Option<u32>,
    active_count: usize,
    _marker: PhantomData<M>,
}

Fields§

§slots: Vec<Slot<T>>§free_list_head: Option<u32>§active_count: usize§_marker: PhantomData<M>

Implementations§

source§

impl<T, M> FreeList<T, M>

source

pub fn new() -> Self

Mints a new FreeList with no entries.

Triggers a 1-entry allocation.

source

pub fn clear(&mut self)

source

pub fn get(&self, id: &FreeListHandle<M>) -> &T

source

pub fn get_mut(&mut self, id: &FreeListHandle<M>) -> &mut T

source

pub fn get_opt(&self, id: &WeakFreeListHandle<M>) -> Option<&T>

source

pub fn get_opt_mut(&mut self, id: &WeakFreeListHandle<M>) -> Option<&mut T>

source

pub fn insert(&mut self, item: T) -> FreeListHandle<M>

source

pub fn free(&mut self, id: FreeListHandle<M>) -> T

source

pub fn len(&self) -> usize

Trait Implementations§

source§

impl<T: Debug, M: Debug> Debug for FreeList<T, M>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, M> MallocSizeOf for FreeList<T, M>

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl<T, M> Serialize for FreeList<T, M>
where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<T, M> Freeze for FreeList<T, M>

§

impl<T, M> RefUnwindSafe for FreeList<T, M>

§

impl<T, M> Send for FreeList<T, M>
where M: Send, T: Send,

§

impl<T, M> Sync for FreeList<T, M>
where M: Sync, T: Sync,

§

impl<T, M> Unpin for FreeList<T, M>
where M: Unpin, T: Unpin,

§

impl<T, M> UnwindSafe for FreeList<T, M>
where M: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.