Struct panoramix::elements::ElementList [−][src]
A list of elements of the same type.
Events
Doesn’t emit events.
About keys
ElementList stores a Vec of (String, Child)
, where the string must be a unique key.
Keys help Panoramix figure out element identity, and maintain widget persistence. For instance, if your element list before update looks like:
[
("foo-1", MyComponent("foo")),
("foo-2", MyComponent("foo")),
("bar-3", MyComponent("bar")),
];
and your element list post-update looks like:
[
("foo-1", MyComponent("foo")),
("bar-3", MyComponent("bar")),
];
Panoramix will figure out that the element at foo-2
has been removed, and will remove it from the underlying widget tree, as well as perform any necessary cleanup.
Fields
children: Vec<(String, Child)>
_comp_state: PhantomData<CpState>
_comp_event: PhantomData<CpEvent>
Implementations
impl<CpEvent, CpState, Child: Element<CpEvent, CpState>> ElementList<Child, CpEvent, CpState>
[src]
pub fn from_pairs(pairs: impl IntoIterator<Item = (String, Child)>) -> Self
[src]
Build a list by providing an iterator of (Key, Element)
pairs.
pub fn from_keys_elems(
keys: impl IntoIterator<Item = String>,
elems: impl IntoIterator<Item = Child>
) -> Self
[src]
keys: impl IntoIterator<Item = String>,
elems: impl IntoIterator<Item = Child>
) -> Self
Build a list by providing keys and elements as separate iterators.
Trait Implementations
impl<Child: Element<CpEvent, CpState>, CpEvent, CpState> Clone for ElementList<Child, CpEvent, CpState> where
Child: Clone,
[src]
Child: Clone,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Child: Element<CpEvent, CpState>, CpEvent, CpState> Debug for ElementList<Child, CpEvent, CpState>
[src]
impl<Child: Element<CpEvent, CpState>, CpEvent, CpState> Default for ElementList<Child, CpEvent, CpState>
[src]
impl<CpEvent, CpState, Child: Element<CpEvent, CpState>> Element<CpEvent, CpState> for ElementList<Child, CpEvent, CpState>
[src]
type Event = NoEvent
The type of events this element can raise. Read more
type AggregateChildrenState = Vec<(String, Child::AggregateChildrenState)>
type BuildOutput = ElementListData<Child::BuildOutput, CpEvent, CpState>
fn build(
self,
prev_state: Self::AggregateChildrenState
) -> (Self::BuildOutput, Self::AggregateChildrenState)
[src]
self,
prev_state: Self::AggregateChildrenState
) -> (Self::BuildOutput, Self::AggregateChildrenState)
impl<Child: Eq + Element<CpEvent, CpState>, CpEvent: Eq, CpState: Eq> Eq for ElementList<Child, CpEvent, CpState>
[src]
impl<Child: Hash + Element<CpEvent, CpState>, CpEvent: Hash, CpState: Hash> Hash for ElementList<Child, CpEvent, CpState>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Child: PartialEq + Element<CpEvent, CpState>, CpEvent: PartialEq, CpState: PartialEq> PartialEq<ElementList<Child, CpEvent, CpState>> for ElementList<Child, CpEvent, CpState>
[src]
fn eq(&self, other: &ElementList<Child, CpEvent, CpState>) -> bool
[src]
fn ne(&self, other: &ElementList<Child, CpEvent, CpState>) -> bool
[src]
impl<Child: Element<CpEvent, CpState>, CpEvent, CpState> StructuralEq for ElementList<Child, CpEvent, CpState>
[src]
impl<Child: Element<CpEvent, CpState>, CpEvent, CpState> StructuralPartialEq for ElementList<Child, CpEvent, CpState>
[src]
Auto Trait Implementations
impl<Child, CpEvent, CpState> RefUnwindSafe for ElementList<Child, CpEvent, CpState> where
Child: RefUnwindSafe,
CpEvent: RefUnwindSafe,
CpState: RefUnwindSafe,
Child: RefUnwindSafe,
CpEvent: RefUnwindSafe,
CpState: RefUnwindSafe,
impl<Child, CpEvent, CpState> Send for ElementList<Child, CpEvent, CpState> where
Child: Send,
CpEvent: Send,
CpState: Send,
Child: Send,
CpEvent: Send,
CpState: Send,
impl<Child, CpEvent, CpState> Sync for ElementList<Child, CpEvent, CpState> where
Child: Sync,
CpEvent: Sync,
CpState: Sync,
Child: Sync,
CpEvent: Sync,
CpState: Sync,
impl<Child, CpEvent, CpState> Unpin for ElementList<Child, CpEvent, CpState> where
Child: Unpin,
CpEvent: Unpin,
CpState: Unpin,
Child: Unpin,
CpEvent: Unpin,
CpState: Unpin,
impl<Child, CpEvent, CpState> UnwindSafe for ElementList<Child, CpEvent, CpState> where
Child: UnwindSafe,
CpEvent: UnwindSafe,
CpState: UnwindSafe,
Child: UnwindSafe,
CpEvent: UnwindSafe,
CpState: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: Any + PartialEq<T>,
T: Any + PartialEq<T>,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
pub fn as_any(&self) -> &(dyn Any + 'static)
impl<T> AnyState for T where
T: Clone + Default + Debug + PartialEq<T> + 'static,
[src]
T: Clone + Default + Debug + PartialEq<T> + 'static,
pub fn as_any(&Self) -> &(dyn Any + 'static)
[src]
pub fn as_mut_any(&mut Self) -> &mut (dyn Any + 'static)
[src]
pub fn dyn_clone(&Self) -> Box<dyn AnyState + 'static, Global>
[src]
pub fn dyn_eq(&Self, &Box<dyn AnyState + 'static, Global>) -> bool
[src]
fn print_type(&self)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,