pub struct SliverGeometry {
pub scroll_extent: f64,
pub paint_extent: f64,
pub paint_origin: f64,
pub layout_extent: f64,
pub max_paint_extent: f64,
pub hit_test_extent: f64,
pub visible: bool,
pub has_visual_overflow: bool,
pub scroll_offset_correction: Option<f64>,
pub cache_extent: f64,
}Expand description
The sliver protocol a scrolling viewport lays its children out with —
a widget implements SliverWidget and overrides
Widget::as_sliver to answer SliverConstraints with a
SliverGeometry; a viewport lays such a child out through
ChildPod::layout_sliver_child. Lifted so an app’s own sliver needs no
direct frust-core dependency.
What a sliver reports from layout (Flutter’s SliverGeometry), in logical
px along the constraints’ axis.
Fields§
§scroll_extent: f64The (estimated) total scrollable extent.
paint_extent: f64The visible size along the axis.
paint_origin: f64First visible pixel relative to the layout position; negative paints over an earlier sliver.
layout_extent: f64Distance to the next sliver’s first pixel; usually paint_extent.
max_paint_extent: f64The (estimated) paint extent given unlimited paint space.
hit_test_extent: f64Extent of the hit region from the paint start; usually paint_extent.
visible: bool§has_visual_overflow: boolThe sliver painted outside its paint extent; the viewport must clip.
scroll_offset_correction: Option<f64>A non-zero scroll-offset adjustment after which the viewport re-runs layout, when an earlier extent estimate was wrong.
cache_extent: f64Cache extent consumed; at least layout_extent.
Implementations§
Source§impl SliverGeometry
impl SliverGeometry
Sourcepub const ZERO: SliverGeometry
pub const ZERO: SliverGeometry
An empty, invisible sliver.
Sourcepub fn new(
scroll_extent: f64,
paint_extent: f64,
max_paint_extent: f64,
) -> SliverGeometry
pub fn new( scroll_extent: f64, paint_extent: f64, max_paint_extent: f64, ) -> SliverGeometry
Flutter’s constructor defaults: layout, hit-test and cache extents equal
paint_extent, visible is paint_extent > 0, the rest zero.
Sourcepub fn debug_assert_valid(&self, constraints: &SliverConstraints)
pub fn debug_assert_valid(&self, constraints: &SliverConstraints)
Flutter’s SliverGeometry.debugAssertIsValid plus the paint-extent check
against constraints; nothing without debug_assertions.
Trait Implementations§
Source§impl Clone for SliverGeometry
impl Clone for SliverGeometry
Source§fn clone(&self) -> SliverGeometry
fn clone(&self) -> SliverGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SliverGeometry
Source§impl Debug for SliverGeometry
impl Debug for SliverGeometry
Source§impl PartialEq for SliverGeometry
impl PartialEq for SliverGeometry
impl StructuralPartialEq for SliverGeometry
Auto Trait Implementations§
impl Freeze for SliverGeometry
impl RefUnwindSafe for SliverGeometry
impl Send for SliverGeometry
impl Sync for SliverGeometry
impl Unpin for SliverGeometry
impl UnsafeUnpin for SliverGeometry
impl UnwindSafe for SliverGeometry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.