pub struct NodeData<T: Clone> {
pub min_width: Option<f32>,
pub min_height: Option<f32>,
pub max_width: Option<f32>,
pub max_height: Option<f32>,
pub width: Option<f32>,
pub height: Option<f32>,
pub flex_direction: FlexDirection,
pub data: T,
}
Fields§
§min_width: Option<f32>
Minimum width of this node
min_height: Option<f32>
Minimum height of this node
max_width: Option<f32>
Maximum width of this node
max_height: Option<f32>
Maximum height of this node
width: Option<f32>
Width of the node (must be initialized for the root node)
height: Option<f32>
Width of the node. (must be initialized for the root node)
flex_direction: FlexDirection
What direction the children should flex to
data: T
Abstract data of the node, defined by the renderer / application (not inside this library)
Implementations§
Source§impl<T: Clone> NodeData<T>
impl<T: Clone> NodeData<T>
Sourcepub fn new(
min_width: Option<f32>,
min_height: Option<f32>,
max_width: Option<f32>,
max_height: Option<f32>,
width: Option<f32>,
height: Option<f32>,
flex_direction: FlexDirection,
data: T,
) -> Self
pub fn new( min_width: Option<f32>, min_height: Option<f32>, max_width: Option<f32>, max_height: Option<f32>, width: Option<f32>, height: Option<f32>, flex_direction: FlexDirection, data: T, ) -> Self
Creates a new node
Sourcepub fn empty(flex_direction: FlexDirection, data: T) -> Self
pub fn empty(flex_direction: FlexDirection, data: T) -> Self
Creates an empty node
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NodeData<T>where
T: Freeze,
impl<T> RefUnwindSafe for NodeData<T>where
T: RefUnwindSafe,
impl<T> Send for NodeData<T>where
T: Send,
impl<T> Sync for NodeData<T>where
T: Sync,
impl<T> Unpin for NodeData<T>where
T: Unpin,
impl<T> UnwindSafe for NodeData<T>where
T: UnwindSafe,
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