pub enum Element<P>{
Builtin(ElementBuiltin<P>),
Component(ElementComponent<P>),
Context(ElementContext<P>),
Fragment(ElementFragment<P>),
String(String),
}
Variants§
Builtin(ElementBuiltin<P>)
Component(ElementComponent<P>)
Context(ElementContext<P>)
Fragment(ElementFragment<P>)
String(String)
Implementations§
Source§impl<P> Element<P>
impl<P> Element<P>
pub fn new( key: Key, component: P::Component, children: Element<P>, ) -> Element<P>
pub fn builtin( key: Key, builtin: impl Builtin<P> + 'static, children: Element<P>, reference: Option<WeakReference<P, Option<P::ContainerID>>>, ) -> Element<P>
pub fn context<T>(key: Key, value: Rc<T>, children: Element<P>) -> Element<P>where
T: Any,
pub fn empty() -> Element<P>
pub fn fragment(key: Key, elements: Vec<Element<P>>) -> Element<P>
pub fn string(value: &str) -> Element<P>
pub fn key(&self) -> &Key
pub fn to_vec(&self) -> Vec<&Element<P>>
pub fn at(&self, index: usize) -> Option<&Element<P>>
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Element<P>
impl<P> !RefUnwindSafe for Element<P>
impl<P> !Send for Element<P>
impl<P> !Sync for Element<P>
impl<P> Unpin for Element<P>
impl<P> !UnwindSafe for Element<P>
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