Skip to main content

FnLayout

Struct FnLayout 

Source
pub struct FnLayout<S, P> { /* private fields */ }
Expand description

A LayoutAlgorithm made of two closures.

layout builds one of these. It exists as a named type rather than a pair of boxes so that the trait has something to be implemented on — and so a caller who wants to keep the layout around can name its type.

Trait Implementations§

Source§

impl<S, P> LayoutAlgorithm for FnLayout<S, P>
where S: Fn(&Subviews<'_>, Proposal) -> (f64, f64) + Send + Sync + 'static, P: Fn(&Subviews<'_>, Rect, Proposal) + Send + Sync + 'static,

Source§

fn size_that_fits( &self, subviews: &Subviews<'_>, proposal: Proposal, ) -> (f64, f64)

How big this layout wants to be, given what the parent offers.
Source§

fn place_subviews( &self, subviews: &Subviews<'_>, bounds: Rect, proposal: Proposal, )

Where each child goes, inside bounds.

Auto Trait Implementations§

§

impl<S, P> Freeze for FnLayout<S, P>
where S: Freeze, P: Freeze,

§

impl<S, P> RefUnwindSafe for FnLayout<S, P>

§

impl<S, P> Send for FnLayout<S, P>
where S: Send, P: Send,

§

impl<S, P> Sync for FnLayout<S, P>
where S: Sync, P: Sync,

§

impl<S, P> Unpin for FnLayout<S, P>
where S: Unpin, P: Unpin,

§

impl<S, P> UnsafeUnpin for FnLayout<S, P>
where S: UnsafeUnpin, P: UnsafeUnpin,

§

impl<S, P> UnwindSafe for FnLayout<S, P>
where S: UnwindSafe, P: UnwindSafe,

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 = !

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.