pub enum EitherOf4<A, B, C, D> {
A(A),
B(B),
C(C),
D(D),
}Expand description
A view that is one of four statically-typed arms. Arm swaps behave as for Either: the old arm is torn down, the new one built fresh, and LAYOUT | PAINT is reported. See the module docs.
Variants§
Trait Implementations§
Source§impl<State: 'static, A: View<State>, B: View<State>, C: View<State>, D: View<State>> View<State> for EitherOf4<A, B, C, D>
impl<State: 'static, A: View<State>, B: View<State>, C: View<State>, D: View<State>> View<State> for EitherOf4<A, B, C, D>
Source§type Element = EitherOf4Widget<<A as View<State>>::Element, <B as View<State>>::Element, <C as View<State>>::Element, <D as View<State>>::Element>
type Element = EitherOf4Widget<<A as View<State>>::Element, <B as View<State>>::Element, <C as View<State>>::Element, <D as View<State>>::Element>
The retained widget this view produces.
Source§fn build(&self, ctx: &mut BuildCtx<'_>) -> Self::Element
fn build(&self, ctx: &mut BuildCtx<'_>) -> Self::Element
Materialise a fresh widget for this view.
Source§fn rebuild(
&self,
prev: &Self,
element: &mut Self::Element,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut Self::Element, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
Reconcile
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl<A, B, C, D> Freeze for EitherOf4<A, B, C, D>
impl<A, B, C, D> RefUnwindSafe for EitherOf4<A, B, C, D>
impl<A, B, C, D> Send for EitherOf4<A, B, C, D>
impl<A, B, C, D> Sync for EitherOf4<A, B, C, D>
impl<A, B, C, D> Unpin for EitherOf4<A, B, C, D>
impl<A, B, C, D> UnsafeUnpin for EitherOf4<A, B, C, D>
impl<A, B, C, D> UnwindSafe for EitherOf4<A, B, C, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.