Trait nuit_core::View

source ·
pub trait View: Bind {
    type Body: View = !;

    // Provided methods
    fn body(&self) -> Self::Body { ... }
    fn render(&mut self, context: &Context) -> Id<Primitive> { ... }
}
Expand description

The primary view trait. Represents a lightweight UI component.

Provided Associated Types§

source

type Body: View = !

Provided Methods§

source

fn body(&self) -> Self::Body

source

fn render(&mut self, context: &Context) -> Id<Primitive>

Implementations on Foreign Types§

source§

impl<T, U, V> View for (T, U, V)where T: View, U: View, V: View,

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

source§

impl View for ()

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

source§

impl<T, U> View for (T, U)where T: View, U: View,

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

source§

impl<T, U, V, W> View for (T, U, V, W)where T: View, U: View, V: View, W: View,

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

source§

impl View for !

source§

impl<T, U, V, W, X> View for (T, U, V, W, X)where T: View, U: View, V: View, W: View, X: View,

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

source§

impl<T> View for (T,)where T: View,

§

type Body = <T as View>::Body

source§

fn body(&self) -> Self::Body

source§

fn render(&mut self, context: &Context) -> Id<Primitive>

Implementors§

source§

impl View for Text

source§

impl View for TextField

source§

impl<T> View for HStack<T>where T: View,

source§

impl<T> View for VStack<T>where T: View,

source§

impl<T> View for ZStack<T>where T: View,

source§

impl<T, F> View for Button<T, F>where T: View, F: Fn() + 'static,