Skip to main content

Info

Struct Info 

Source
pub struct Info { /* private fields */ }
Expand description

A simple static widget, meant to just convey information

This is the most flexible of widgets, you can use it anywhere, just by pushing it around, or spawning it however you want, by making use of the PushSpecs, DynSpawnSpecs o StaticSpawnSpecs.

Implementations§

Source§

impl Info

Source

pub fn new(text: Text) -> Self

Returns a new Info widget

This is the only Widget in duat-base that can be acquired this way, since it’s supposed to be versatile in where you position it. Every other widget has to be placed in specific locations, so they don’t offer a new method, which could be used in order to place them willy nilly.

Source

pub fn set_text( pa: &mut Pass, info: &Handle<Self>, func: impl FnOnce(&mut Text), )

Mutate the Text of this Info.

This will also resize the widget to fit as much of it as possible.

Trait Implementations§

Source§

impl Widget for Info

Source§

fn text(&self) -> &Text

The text that this widget prints out
Source§

fn text_mut(&mut self) -> TextMut<'_>

A mutable reference to the Text that is printed
Source§

fn print_opts(&self) -> PrintOpts

The configuration for how to print Text Read more

Auto Trait Implementations§

§

impl Freeze for Info

§

impl !RefUnwindSafe for Info

§

impl Send for Info

§

impl Sync for Info

§

impl Unpin for Info

§

impl UnsafeUnpin for Info

§

impl !UnwindSafe for Info

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.