Skip to main content

NodeMut

Struct NodeMut 

Source
pub struct NodeMut<'a, Msg> { /* private fields */ }
Expand description

Adjusts the node just added. Every method changes the node in place, so the result can be ignored or chained.

Implementations§

Source§

impl<'a, Msg> NodeMut<'a, Msg>

Source

pub fn id(self, name: impl Into<String>) -> Self

Names the node. Name widgets whose position among their siblings can change (list rows, optional widgets) so their state and focus follow them.

Source

pub fn width(self, width: Length) -> Self

Sets the width.

Source

pub fn height(self, height: Length) -> Self

Sets the height.

Source

pub fn fill(self) -> Self

Takes all space left in both directions.

Source

pub fn fill_width(self) -> Self

Takes all width left.

Source

pub fn fill_height(self) -> Self

Takes all height left.

Source

pub fn padding(self, padding: Padding) -> Self

Keeps padding free inside the node.

Source

pub fn gap(self, cells: u16) -> Self

Leaves cells between the children of a row or column.

Source

pub fn justify(self, align: Align) -> Self

Places children along the main axis of a row or column (both axes of a stack).

Source

pub fn selectable(self, selectable: bool) -> Self

Whether a mouse drag may select text in this node. Nothing is selectable unless asked: true makes the node a selection region, so a drag that starts inside it selects text within the node only (widgets such as CodeView and Markdown are regions by themselves). false keeps selection out of the node and everything inside it, also out of regions within it, e.g. for a secret shown inside a selectable log.

Source

pub fn align(self, align: Align) -> Self

Places children across the main axis of a row or column.

Auto Trait Implementations§

§

impl<'a, Msg> !RefUnwindSafe for NodeMut<'a, Msg>

§

impl<'a, Msg> !Send for NodeMut<'a, Msg>

§

impl<'a, Msg> !Sync for NodeMut<'a, Msg>

§

impl<'a, Msg> !UnwindSafe for NodeMut<'a, Msg>

§

impl<'a, Msg> Freeze for NodeMut<'a, Msg>
where &'a mut Node<Msg>: Freeze,

§

impl<'a, Msg> Unpin for NodeMut<'a, Msg>
where &'a mut Node<Msg>: Unpin,

§

impl<'a, Msg> UnsafeUnpin for NodeMut<'a, Msg>
where &'a mut Node<Msg>: UnsafeUnpin,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.