pub struct Node<State> { /* private fields */ }Expand description
A layout tree node. Use methods in crate::nodes to create nodes.
Implementations§
source§impl<U> Node<U>
impl<U> Node<U>
sourcepub fn pad_leading(self, amount: f32) -> Node<U>
pub fn pad_leading(self, amount: f32) -> Node<U>
Adds padding to the node along the leading edge
sourcepub fn pad_x(self, amount: f32) -> Node<U>
pub fn pad_x(self, amount: f32) -> Node<U>
Adds horizontal padding to the node (leading & trailing)
sourcepub fn pad_trailing(self, amount: f32) -> Node<U>
pub fn pad_trailing(self, amount: f32) -> Node<U>
Adds padding to the node along the trailing edge
sourcepub fn pad_bottom(self, amount: f32) -> Node<U>
pub fn pad_bottom(self, amount: f32) -> Node<U>
Adds padding to the node along the bottom edge
sourcepub fn offset_x(self, amount: f32) -> Node<U>
pub fn offset_x(self, amount: f32) -> Node<U>
Offsets the node along the x axis. This is an absolute offset that simply shifts nodes away from their calculated position This won’t impact layout besides child nodes also being offset
sourcepub fn offset_y(self, amount: f32) -> Node<U>
pub fn offset_y(self, amount: f32) -> Node<U>
Offsets the node along the y axis. This is an absolute offset that simply shifts nodes away from their calculated position This won’t impact layout besides child nodes also being offset
sourcepub fn offset(self, offset_x: f32, offset_y: f32) -> Node<U>
pub fn offset(self, offset_x: f32, offset_y: f32) -> Node<U>
Offsets the node along the x & y axis. This is an absolute offset that simply shifts nodes away from their calculated position This won’t impact layout besides child nodes also being offset
sourcepub fn height_range<R>(self, range: R) -> Selfwhere
R: RangeBounds<f32>,
pub fn height_range<R>(self, range: R) -> Selfwhere
R: RangeBounds<f32>,
Specifies bounds on a node’s height
sourcepub fn width_range<R>(self, range: R) -> Selfwhere
R: RangeBounds<f32>,
pub fn width_range<R>(self, range: R) -> Selfwhere
R: RangeBounds<f32>,
Specifies bounds on a node’s width
sourcepub fn x_align(self, align: XAlign) -> Self
pub fn x_align(self, align: XAlign) -> Self
Specifies an alignment along the x axis.
This will only have an effect if the node is constrained to be smaller than the area that is available, otherwise, there’s no wiggle room.
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for Node<State>
impl<State> !RefUnwindSafe for Node<State>
impl<State> !Send for Node<State>
impl<State> !Sync for Node<State>
impl<State> Unpin for Node<State>
impl<State> !UnwindSafe for Node<State>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)