pub struct FactoryVecDeque<Data>where
    Data: FactoryPrototype,{ /* private fields */ }
Expand description

A container similar to VecDeque that implements Factory.

Implementations§

source§

impl<Data> FactoryVecDeque<Data>where Data: FactoryPrototype,

source

pub fn new() -> Self

Create a new FactoryVecDeque.

source

pub fn from_vec_deque(data: VecDeque<Data>) -> Self

Initialize a new FactoryVecDeque with a normal VecDeque.

source

pub fn into_vec_deque(self) -> VecDeque<Data>

Get the internal data of the FactoryVecDeque.

source

pub fn clear(&mut self)

Remove all data from the FactoryVecDeque.

source

pub fn len(&self) -> usize

Returns the length as amount of elements stored in this type.

source

pub fn is_empty(&self) -> bool

Returns true if the length of this type is 0.

source

pub fn push_back(&mut self, data: Data)

Insert an element at the end of a FactoryVecDeque.

source

pub fn pop_back(&mut self) -> Option<Data>

Remove an element at the end of a FactoryVecDeque.

source

pub fn push_front(&mut self, data: Data)

Adds an element at the front.

source

pub fn pop_front(&mut self) -> Option<Data>

Removes an element from the front.

source

pub fn insert(&mut self, index: usize, data: Data)

Adds an element at a given index. All elements with indices greater than or equal to index will be shifted towards the back.

source

pub fn remove(&mut self, index: usize) -> Option<Data>

Removes an element at a given index.

source

pub fn get(&self, index: usize) -> Option<&Data>

Get a reference to data stored at index.

source

pub fn get_mut(&mut self, index: usize) -> Option<&mut Data>

Get a mutable reference to data stored at index.

Assumes that the data will be modified and the corresponding widget needs to be updated.

source§

impl<Data, View> FactoryVecDeque<Data>where Data: FactoryPrototype<Factory = Self, View = View>, View: FactoryView<Data::Root>,

source

pub fn iter(&self) -> Iter<'_, Data>

Get an immutable iterator for this type

Trait Implementations§

source§

impl<Data> Debug for FactoryVecDeque<Data>where Data: FactoryPrototype + Debug, Data::Widgets: Debug, Data::View: Debug, Data::Root: Debug,

source§

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

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

impl<Data> Default for FactoryVecDeque<Data>where Data: FactoryPrototype + Default, Data::Widgets: Default, Data::View: Default, Data::Root: Default,

source§

fn default() -> FactoryVecDeque<Data>

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

impl<Data, View> Factory<Data, View> for FactoryVecDeque<Data>where Data: FactoryPrototype<Factory = Self, View = View>, View: FactoryView<Data::Root> + FactoryListView<Data::Root>, <Data as FactoryPrototype>::Root: Clone,

§

type Key = DynamicIndex

Key that provides additional information for the FactoryPrototype functions.
source§

fn generate(&self, view: &View, sender: Sender<Data::Msg>)

Efficiently update the view according to data changes.

Auto Trait Implementations§

§

impl<Data> !RefUnwindSafe for FactoryVecDeque<Data>

§

impl<Data> !Send for FactoryVecDeque<Data>

§

impl<Data> !Sync for FactoryVecDeque<Data>

§

impl<Data> Unpin for FactoryVecDeque<Data>where Data: Unpin, <<Data as FactoryPrototype>::View as FactoryView<<Data as FactoryPrototype>::Root>>::Root: Unpin, <Data as FactoryPrototype>::Widgets: Unpin,

§

impl<Data> !UnwindSafe for FactoryVecDeque<Data>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.