Skip to main content

ElementRenderCx

Struct ElementRenderCx 

Source
pub struct ElementRenderCx<'a, 'ctx, 'scope> {
    pub id: UiId,
    pub scope: &'scope UiScope,
    pub context: &'ctx UiRenderContext<'a>,
    pub children: Vec<UiElement>,
    /* private fields */
}

Fields§

§id: UiId§scope: &'scope UiScope§context: &'ctx UiRenderContext<'a>§children: Vec<UiElement>

Implementations§

Source§

impl ElementRenderCx<'_, '_, '_>

Source

pub fn auto_id(&self) -> UiId

Returns a unique auto-generated child ID within the current scope. Use this instead of manually calling cx.scope.id(format!(...)).

Source

pub fn use_context<T>(&self) -> T
where T: Clone + 'static,

Source

pub fn try_use_context<T>(&self) -> Option<T>
where T: Clone + 'static,

Source§

impl ElementRenderCx<'_, '_, '_>

Source

pub fn animation_value(&self, property: AnimProperty) -> f32

Source

pub fn compile(&self, element: Element) -> UiElement

Source

pub fn compile_deferred_children(&mut self) -> Vec<UiElement>

Auto Trait Implementations§

§

impl<'a, 'ctx, 'scope> !Freeze for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> !RefUnwindSafe for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> !Send for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> !Sync for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> !UnwindSafe for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> Unpin for ElementRenderCx<'a, 'ctx, 'scope>

§

impl<'a, 'ctx, 'scope> UnsafeUnpin for ElementRenderCx<'a, 'ctx, 'scope>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.