Skip to main content

ScrollBuilder

Trait ScrollBuilder 

Source
pub trait ScrollBuilder: Sized {
    // Required methods
    fn horizontal(self) -> Self;
    fn axis(self, axis: Axis) -> Self;
    fn scroll_target(self, target: impl Binding<Option<ScrollTarget>>) -> Self;
}
Expand description

Builder methods of Scroll, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.

Required Methods§

Source

fn horizontal(self) -> Self

Scroll horizontally instead of vertically (a filmstrip of cards, a chip row). The content is measured unconstrained on the horizontal axis and the native view scrolls sideways.

Source

fn axis(self, axis: Axis) -> Self

Set the scroll axis explicitly.

Source

fn scroll_target(self, target: impl Binding<Option<ScrollTarget>>) -> Self

Programmatic scrolling (docs/scroll.md): each Some(target) written to sig scrolls there (animated), then the signal resets to None. Write-and-forget, so the same target can be sent twice in a row.

ⓘ
let jump = Signal::new(None);
scroll(rows).scroll_target(jump);
button("Bottom").action(move || jump.set(Some(ScrollTarget::Bottom)));

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<DecoratedInner: ScrollBuilder + Piece> ScrollBuilder for Decorated<DecoratedInner>

Source§

impl<P: Piece> ScrollBuilder for Scroll<P>

Day API ↩ Guides· daybrite.dev