Skip to main content

Rule

Struct Rule 

Source
pub struct Rule<'a> { /* private fields */ }
Expand description

Display a horizontal or vertical rule for dividing content.

Implementations§

Source§

impl<'a> Rule<'a>

Source

pub fn horizontal(height: u16) -> Rule<'a>

Creates a horizontal Rule with the given height.

Source

pub fn vertical(width: u16) -> Rule<'a>

Creates a vertical Rule with the given width.

Source

pub fn style(self, style_sheet: impl Into<Box<dyn StyleSheet + 'a>>) -> Rule<'a>

Sets the style of the Rule.

Trait Implementations§

Source§

impl<'a, Message, Renderer> Into<Element<'a, Message, Renderer>> for Rule<'a>
where Renderer: Renderer + 'a,

Source§

fn into(self) -> Element<'a, Message, Renderer>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, Message, Renderer> Widget<Message, Renderer> for Rule<'a>
where Renderer: Renderer,

Source§

fn width(&self) -> Length

Returns the width of the Widget.
Source§

fn height(&self) -> Length

Returns the height of the Widget.
Source§

fn layout(&self, _renderer: &Renderer, limits: &Limits) -> Node

Returns the Node of the Widget. Read more
Source§

fn draw( &self, renderer: &mut Renderer, _style: &Style, layout: Layout<'_>, _cursor_position: Point, _viewport: &Rectangle, )

Draws the Widget using the associated Renderer.
Source§

fn on_event( &mut self, _event: Event, _layout: Layout<'_>, _cursor_position: Point, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, _shell: &mut Shell<'_, Message>, ) -> Status

Processes a runtime Event. Read more
Source§

fn mouse_interaction( &self, _layout: Layout<'_>, _cursor_position: Point, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction

Returns the current mouse::Interaction of the Widget. Read more
Source§

fn overlay( &mut self, _layout: Layout<'_>, _renderer: &Renderer, ) -> Option<Element<'_, Message, Renderer>>

Returns the overlay of the Widget, if there is any.
Source§

impl<'a, Message, Renderer> Widget<Message, Renderer> for Rule<'a>
where Renderer: Renderer,

Source§

fn width(&self) -> Length

Returns the width of the Widget.
Source§

fn height(&self) -> Length

Returns the height of the Widget.
Source§

fn layout(&self, renderer: &Renderer, limits: &Limits) -> Node

Returns the layout::Node of the Widget. Read more
Source§

fn on_event( &mut self, _state: &mut Tree, event: Event, layout: Layout<'_>, cursor_position: Point, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, ) -> Status

Processes a runtime Event. Read more
Source§

fn draw( &self, _tree: &Tree, renderer: &mut Renderer, style: &Style, layout: Layout<'_>, cursor_position: Point, viewport: &Rectangle, )

Draws the Widget using the associated Renderer.
Source§

fn mouse_interaction( &self, _state: &Tree, layout: Layout<'_>, cursor_position: Point, viewport: &Rectangle, renderer: &Renderer, ) -> Interaction

Returns the current mouse::Interaction of the Widget. Read more
Source§

fn tag(&self) -> Tag

Returns the Tag of the Widget.
Source§

fn state(&self) -> State

Returns the State of the Widget.
Source§

fn children(&self) -> Vec<Tree>

Returns the state Tree of the children of the Widget.
Source§

fn diff(&self, _tree: &mut Tree)

Reconciliates the Widget with the provided Tree.
Source§

fn overlay<'a>( &'a self, _state: &'a mut Tree, _layout: Layout<'_>, _renderer: &Renderer, ) -> Option<Element<'a, Message, Renderer>>

Returns the overlay of the Widget, if there is any.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Rule<'a>

§

impl<'a> !Send for Rule<'a>

§

impl<'a> !Sync for Rule<'a>

§

impl<'a> !UnwindSafe for Rule<'a>

§

impl<'a> Freeze for Rule<'a>

§

impl<'a> Unpin for Rule<'a>

§

impl<'a> UnsafeUnpin for Rule<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.