Skip to main content

PooledInlineList

Struct PooledInlineList 

Source
pub struct PooledInlineList<T: ?Sized> { /* private fields */ }
Expand description

A list of shared items that holds one item in place and more in a list.

Items are compared by reference, as in the original, whose items are reference types. The original rents the array of the list from the shared array pool; here the list owns a Vec.

Implementations§

Source§

impl<T: ?Sized> PooledInlineList<T>

Source

pub fn new() -> Self

Source

pub fn from_raw_state(raw_state: PooledInlineListRawState<T>) -> Self

For compositor serialization purposes only, takes the ownership of previously transferred state

Source

pub fn add(&mut self, item: Rc<T>)

Source

pub fn remove(&mut self, item: &Rc<T>) -> bool

Removes the item when it is the one the list holds in place.

As in the original, which tests the argument rather than its own state for being a list, an item of a list of several is not removed.

Source

pub fn ensure_capacity(&mut self, count: i32)

Source

pub fn dispose(&mut self)

Source

pub fn count(&self) -> i32

Source

pub fn get_enumerator(&self) -> PooledInlineListEnumerator<'_, T> ⓘ

Source

pub fn transfer_raw_state(&mut self) -> PooledInlineListRawState<T>

For compositor serialization purposes only, gives up the ownership of the internal state and returns it

Trait Implementations§

Source§

impl<T: ?Sized> Default for PooledInlineList<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, T: ?Sized> IntoIterator for &'a PooledInlineList<T>

Source§

type Item = &'a Rc<T>

The type of the elements being iterated over.
Source§

type IntoIter = PooledInlineListEnumerator<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T> !Send for PooledInlineList<T>

§

impl<T> !Sync for PooledInlineList<T>

§

impl<T> Freeze for PooledInlineList<T>
where ItemState<T>: Freeze, T: ?Sized,

§

impl<T> RefUnwindSafe for PooledInlineList<T>
where ItemState<T>: RefUnwindSafe, T: ?Sized,

§

impl<T> Unpin for PooledInlineList<T>
where ItemState<T>: Unpin, T: ?Sized,

§

impl<T> UnsafeUnpin for PooledInlineList<T>
where ItemState<T>: UnsafeUnpin, T: ?Sized,

§

impl<T> UnwindSafe for PooledInlineList<T>
where ItemState<T>: UnwindSafe, T: ?Sized,

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.