Skip to main content

Subviews

Struct Subviews 

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

The children, as SwiftUI hands them over.

Borrowed for the duration of one callback: the pointer is SwiftUI’s and is not valid after the call returns, which is why this carries a lifetime and is never stored.

Implementations§

Source§

impl Subviews<'_>

Source

pub fn len(&self) -> usize

How many children there are.

Source

pub fn is_empty(&self) -> bool

Whether there are none.

Source

pub fn size_that_fits(&self, i: usize, proposal: Proposal) -> (f64, f64)

The size child i would like, given a proposal.

Asking is the point of a two-pass layout: a child that is offered nothing reports its ideal size, and a layout that never asks can only place things blindly.

Source

pub fn place(&self, i: usize, x: f64, y: f64)

Put child i at (x, y), its top-left corner there.

Source

pub fn place_proposed(&self, i: usize, x: f64, y: f64, proposal: Proposal)

The same, offering the child a size.

Auto Trait Implementations§

§

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

§

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

§

impl<'a> Freeze for Subviews<'a>

§

impl<'a> RefUnwindSafe for Subviews<'a>

§

impl<'a> Unpin for Subviews<'a>

§

impl<'a> UnsafeUnpin for Subviews<'a>

§

impl<'a> UnwindSafe for Subviews<'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 = !

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.