Skip to main content

SliverConstraints

Struct SliverConstraints 

Source
pub struct SliverConstraints {
    pub axis_direction: AxisDirection,
    pub growth_direction: GrowthDirection,
    pub user_scroll_direction: ScrollDirection,
    pub scroll_offset: f64,
    pub preceding_scroll_extent: f64,
    pub overlap: f64,
    pub remaining_paint_extent: f64,
    pub cross_axis_extent: f64,
    pub cross_axis_direction: AxisDirection,
    pub viewport_main_axis_extent: f64,
    pub remaining_cache_extent: f64,
    pub cache_origin: f64,
}
Expand description

Immutable layout constraints for RenderSliver layout.

Fields§

§axis_direction: AxisDirection

The direction in which scroll_offset and remaining_paint_extent increase.

§growth_direction: GrowthDirection

The direction in which the contents of slivers are ordered.

§user_scroll_direction: ScrollDirection

The direction in which the user is attempting to scroll.

§scroll_offset: f64

Scroll offset in this sliver’s coordinate system of the earliest visible part of this sliver.

§preceding_scroll_extent: f64

Scroll distance consumed by all slivers that came before this one.

§overlap: f64

Pixels from the painted scroll_offset up to the first pixel not yet painted by an earlier sliver.

§remaining_paint_extent: f64

Pixels of content the sliver should consider providing.

§cross_axis_extent: f64

Pixels in the cross-axis.

§cross_axis_direction: AxisDirection

Direction in which children should be placed in the cross axis.

§viewport_main_axis_extent: f64

Pixels the viewport can display in the main axis.

§remaining_cache_extent: f64

How much content the sliver should provide starting from cache_origin.

§cache_origin: f64

Where the cache area starts relative to the scroll_offset. Always negative or zero.

Implementations§

Source§

impl SliverConstraints

Source

pub const fn new( axis_direction: AxisDirection, growth_direction: GrowthDirection, user_scroll_direction: ScrollDirection, scroll_offset: f64, preceding_scroll_extent: f64, overlap: f64, remaining_paint_extent: f64, cross_axis_extent: f64, cross_axis_direction: AxisDirection, viewport_main_axis_extent: f64, remaining_cache_extent: f64, cache_origin: f64, ) -> SliverConstraints

Creates sliver constraints with the given information.

Source

pub const fn copy_with(self) -> SliverConstraints

Creates a copy of this object. Chain field replacements.

Source

pub const fn axis_direction(self, value: AxisDirection) -> SliverConstraints

Source

pub const fn growth_direction(self, value: GrowthDirection) -> SliverConstraints

Source

pub const fn user_scroll_direction( self, value: ScrollDirection, ) -> SliverConstraints

Source

pub const fn scroll_offset(self, value: f64) -> SliverConstraints

Source

pub const fn preceding_scroll_extent(self, value: f64) -> SliverConstraints

Source

pub const fn overlap(self, value: f64) -> SliverConstraints

Sets overlap.

Source

pub const fn remaining_paint_extent(self, value: f64) -> SliverConstraints

Source

pub const fn cross_axis_extent(self, value: f64) -> SliverConstraints

Source

pub const fn cross_axis_direction( self, value: AxisDirection, ) -> SliverConstraints

Source

pub const fn viewport_main_axis_extent(self, value: f64) -> SliverConstraints

Source

pub const fn remaining_cache_extent(self, value: f64) -> SliverConstraints

Source

pub const fn cache_origin(self, value: f64) -> SliverConstraints

Source

pub fn axis(self) -> Axis

The axis along which the scroll offset is measured.

Source

pub fn normalized_growth_direction(self) -> GrowthDirection

growth_direction as if the axis were down or right.

Source

pub fn as_box_constraints( self, min_extent: f64, max_extent: f64, cross_axis_extent: Option<f64>, ) -> BoxConstraints

BoxConstraints that reflect these sliver constraints.

Dart named defaults: min_extent 0, max_extent infinity, cross_axis_extent this sliver’s cross extent.

Trait Implementations§

Source§

impl Clone for SliverConstraints

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Constraints for SliverConstraints

Source§

fn is_tight(&self) -> bool

Whether there is exactly one size possible given these constraints.
Source§

fn is_normalized(&self) -> bool

Whether the constraint is expressed in a consistent manner.
Source§

fn debug_assert_is_valid(&self, is_applied_constraint: bool) -> bool

Asserts that the constraints are valid. Read more
Source§

impl Copy for SliverConstraints

Source§

impl Debug for SliverConstraints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SliverConstraints

Source§

fn eq(&self, other: &SliverConstraints) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,