[][src]Enum polyhorn_core::Element

pub enum Element<P: ?Sized> where
    P: Platform
{ 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

impl<P: ?Sized> Element<P> where
    P: Platform
[src]

pub fn new(
    key: Key,
    component: P::Component,
    children: Element<P>
) -> Element<P>
[src]

pub fn builtin(
    key: Key,
    builtin: impl Builtin<P> + 'static,
    children: Element<P>,
    reference: Option<WeakReference<P, Option<P::ContainerID>>>
) -> Element<P>
[src]

pub fn context<T>(key: Key, value: Rc<T>, children: Element<P>) -> Element<P> where
    T: Any
[src]

pub fn empty() -> Element<P>[src]

pub fn fragment(key: Key, elements: Vec<Element<P>>) -> Element<P>[src]

pub fn string(value: &str) -> Element<P>[src]

pub fn key(&self) -> &Key[src]

pub fn to_vec(&self) -> Vec<&Element<P>>[src]

pub fn at(&self, index: usize) -> Option<&Element<P>>[src]

Trait Implementations

impl<P: ?Sized> Clone for Element<P> where
    P: Platform
[src]

impl<P: ?Sized> Default for Element<P> where
    P: Platform
[src]

impl<P: ?Sized, '_> From<&'_ str> for Element<P> where
    P: Platform
[src]

impl<P: ?Sized, '_> From<Option<&'_ Element<P>>> for Element<P> where
    P: Platform
[src]

impl<P: ?Sized> From<Option<Element<P>>> for Element<P> where
    P: Platform
[src]

impl<P: ?Sized> From<String> for Element<P> where
    P: Platform
[src]

impl<P: ?Sized> From<Vec<Element<P>, Global>> for Element<P> where
    P: Platform
[src]

Auto Trait Implementations

impl<P> !RefUnwindSafe for Element<P>

impl<P> !Send for Element<P>

impl<P> !Sync for Element<P>

impl<P: ?Sized> Unpin for Element<P> where
    <P as Platform>::Component: Unpin,
    <P as Platform>::ContainerID: Unpin

impl<P> !UnwindSafe for Element<P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.