[][src]Struct coffee::ui::core::Node

pub struct Node(_);

The visual requirements of a Widget and its children.

When there have been changes and the Layout needs to be recomputed, the runtime obtains a Node by calling Widget::node.

Methods

impl Node[src]

pub fn new(style: Style) -> Node[src]

Creates a new Node with the given Style.

pub fn with_measure<F>(style: Style, measure: F) -> Node where
    F: 'static + Fn(Size<Number>) -> Size<f32>, 
[src]

Creates a new Node with the given Style and a measure function.

This type of node cannot have any children.

You should use this when your Widget can adapt its contents to the size of its container. The measure function will receive the container size as a parameter and must compute the size of the Node inside the given bounds (if the Number for a dimension is Undefined it means that it has no boundary).

Trait Implementations

impl Debug for Node[src]

Auto Trait Implementations

impl !RefUnwindSafe for Node

impl !Send for Node

impl !Sync for Node

impl Unpin for Node

impl !UnwindSafe for Node

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> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,