pub struct Wrap<'a, Message, Direction, Theme = Theme, Renderer = Renderer> {
pub elements: Vec<Element<'a, Message, Theme, Renderer>>,
pub alignment: Alignment,
pub width: Length,
pub height: Length,
pub max_width: f32,
pub max_height: f32,
pub padding: Padding,
pub spacing: Pixels,
pub line_spacing: Pixels,
pub line_minimal_length: f32,
/* private fields */
}Expand description
A container that distributes its contents horizontally.
Fields§
§elements: Vec<Element<'a, Message, Theme, Renderer>>The elements to distribute.
alignment: AlignmentThe alignment of the Wrap.
width: LengthThe width of the Wrap.
height: LengthThe height of the Wrap.
max_width: f32The maximum width of the Wrap.
max_height: f32The maximum height of the Wrap.
padding: PaddingThe padding of each element of the Wrap.
spacing: PixelsThe spacing between each element of the Wrap.
line_spacing: PixelsThe spacing between each line of the Wrap.
line_minimal_length: f32The minimal length of each line of the Wrap.
Implementations§
Source§impl<'a, Message, Theme, Renderer> Wrap<'a, Message, Horizontal, Theme, Renderer>
impl<'a, Message, Theme, Renderer> Wrap<'a, Message, Horizontal, Theme, Renderer>
Source§impl<'a, Message, Theme, Renderer> Wrap<'a, Message, Vertical, Theme, Renderer>
impl<'a, Message, Theme, Renderer> Wrap<'a, Message, Vertical, Theme, Renderer>
Sourcepub fn new_vertical() -> Self
pub fn new_vertical() -> Self
Creates an empty vertical Wrap.
Source§impl<'a, Message, Renderer, Direction, Theme> Wrap<'a, Message, Direction, Theme, Renderer>
impl<'a, Message, Renderer, Direction, Theme> Wrap<'a, Message, Direction, Theme, Renderer>
Sourcepub fn line_spacing(self, spacing: impl Into<Pixels>) -> Self
pub fn line_spacing(self, spacing: impl Into<Pixels>) -> Self
Sets the spacing of the lines of the Wrap.
Sourcepub const fn line_minimal_length(self, units: f32) -> Self
pub const fn line_minimal_length(self, units: f32) -> Self
Sets the minimal length of the lines of the Wrap.
Sourcepub fn padding(self, padding: impl Into<Padding>) -> Self
pub fn padding(self, padding: impl Into<Padding>) -> Self
Sets the padding of the elements in the Wrap.
Sourcepub const fn width_items(self, width: Length) -> Self
pub const fn width_items(self, width: Length) -> Self
Sets the width of the Wrap.
Sourcepub const fn height_items(self, height: Length) -> Self
pub const fn height_items(self, height: Length) -> Self
Sets the height of the Wrap.
Sourcepub const fn max_height(self, max_height: f32) -> Self
pub const fn max_height(self, max_height: f32) -> Self
Sets the maximum height of the Wrap.
Sourcepub const fn align_items(self, align: Alignment) -> Self
pub const fn align_items(self, align: Alignment) -> Self
Sets the alignment of the Wrap.
Trait Implementations§
Source§impl<Message, Renderer, Direction, Theme> Default for Wrap<'_, Message, Direction, Theme, Renderer>
impl<Message, Renderer, Direction, Theme> Default for Wrap<'_, Message, Direction, Theme, Renderer>
Source§impl<'a, Message, Theme, Renderer> From<Wrap<'a, Message, Horizontal, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>where
Renderer: 'a + Renderer,
Message: 'a,
Theme: 'a,
impl<'a, Message, Theme, Renderer> From<Wrap<'a, Message, Horizontal, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>where
Renderer: 'a + Renderer,
Message: 'a,
Theme: 'a,
Source§fn from(wrap: Wrap<'a, Message, Horizontal, Theme, Renderer>) -> Self
fn from(wrap: Wrap<'a, Message, Horizontal, Theme, Renderer>) -> Self
Converts to this type from the input type.
Source§impl<'a, Message, Theme, Renderer> From<Wrap<'a, Message, Vertical, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>where
Renderer: 'a + Renderer,
Message: 'a,
Theme: 'a,
impl<'a, Message, Theme, Renderer> From<Wrap<'a, Message, Vertical, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>where
Renderer: 'a + Renderer,
Message: 'a,
Theme: 'a,
Source§impl<Message, Renderer, Direction, Theme> Widget<Message, Theme, Renderer> for Wrap<'_, Message, Direction, Theme, Renderer>where
Self: WrapLayout<Renderer>,
Renderer: Renderer,
impl<Message, Renderer, Direction, Theme> Widget<Message, Theme, Renderer> for Wrap<'_, Message, Direction, Theme, Renderer>where
Self: WrapLayout<Renderer>,
Renderer: Renderer,
Source§fn update(
&mut self,
state: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
)
fn update( &mut self, state: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, )
Source§fn overlay<'b>(
&'b mut self,
tree: &'b mut Tree,
layout: Layout<'b>,
renderer: &Renderer,
viewport: &Rectangle,
translation: Vector,
) -> Option<Element<'b, Message, Theme, Renderer>>
fn overlay<'b>( &'b mut self, tree: &'b mut Tree, layout: Layout<'b>, renderer: &Renderer, viewport: &Rectangle, translation: Vector, ) -> Option<Element<'b, Message, Theme, Renderer>>
Returns the overlay of the
Widget, if there is any.Source§fn mouse_interaction(
&self,
state: &Tree,
layout: Layout<'_>,
cursor: Cursor,
viewport: &Rectangle,
renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, state: &Tree, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, renderer: &Renderer, ) -> Interaction
Source§fn draw(
&self,
state: &Tree,
renderer: &mut Renderer,
theme: &Theme,
style: &Style,
layout: Layout<'_>,
cursor: Cursor,
viewport: &Rectangle,
)
fn draw( &self, state: &Tree, renderer: &mut Renderer, theme: &Theme, style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, )
Draws the
Widget using the associated Renderer.Source§impl<'a, Message, Theme, Renderer> WrapLayout<Renderer> for Wrap<'a, Message, Horizontal, Theme, Renderer>where
Renderer: Renderer + 'a,
impl<'a, Message, Theme, Renderer> WrapLayout<Renderer> for Wrap<'a, Message, Horizontal, Theme, Renderer>where
Renderer: Renderer + 'a,
Auto Trait Implementations§
impl<'a, Message, Direction, Theme, Renderer> Freeze for Wrap<'a, Message, Direction, Theme, Renderer>
impl<'a, Message, Direction, Theme = Theme, Renderer = Renderer<Renderer, Renderer>> !RefUnwindSafe for Wrap<'a, Message, Direction, Theme, Renderer>
impl<'a, Message, Direction, Theme = Theme, Renderer = Renderer<Renderer, Renderer>> !Send for Wrap<'a, Message, Direction, Theme, Renderer>
impl<'a, Message, Direction, Theme = Theme, Renderer = Renderer<Renderer, Renderer>> !Sync for Wrap<'a, Message, Direction, Theme, Renderer>
impl<'a, Message, Direction, Theme, Renderer> Unpin for Wrap<'a, Message, Direction, Theme, Renderer>where
Direction: Unpin,
impl<'a, Message, Direction, Theme = Theme, Renderer = Renderer<Renderer, Renderer>> !UnwindSafe for Wrap<'a, Message, Direction, Theme, Renderer>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().