Struct Showing
pub struct Showing<L, P = u64> {
pub scroll: Vec2,
pub clip: Rect,
pub transform: Affine,
pub look: L,
pub overlays: Vec<Rect>,
pub pieces: Vec<Piece<P>>,
pub fixed: Vec<Piece<P>>,
}Expand description
A scroller’s frame as most scrollers describe it (Shown).
Fields§
§scroll: Vec2How far the content is scrolled (Shown::scroll).
clip: RectWhere the content paints, in logical pixels.
transform: AffineThe transform the content landed on screen with
(super::on_screen).
look: LWhat the whole view’s paint depends on (a zoom, a theme’s colours, a selection painted across pieces): another look repaints it.
overlays: Vec<Rect>What paints over the content without moving with it.
pieces: Vec<Piece<P>>The pieces of content in view, by ascending key.
fixed: Vec<Piece<P>>What paints beside or over the content at fixed places (a thumb in a
bar, a strip of thumbnails), by ascending key, rect on screen.
Implementations§
§impl Showing<Around, Painted>
impl Showing<Around, Painted>
pub fn painted(
scroll: Vec2,
clip: Rect,
transform: Affine,
look: Around,
pieces: Vec<Piece<Painted>>,
fixed: Vec<Piece<Painted>>,
) -> Option<Showing<Around, Painted>>
pub fn painted( scroll: Vec2, clip: Rect, transform: Affine, look: Around, pieces: Vec<Piece<Painted>>, fixed: Vec<Piece<Painted>>, ) -> Option<Showing<Around, Painted>>
A frame of the content pieces, each rect where it stands on
screen this frame, scrolled scroll and shown in clip landing with
transform (super::on_screen); fixed stands over or beside it
where it is (a bar, an edge fade, a field open over a row). None
when two pieces share a key or a box is not finite: nothing then
says which pixels changed.
Trait Implementations§
§impl<L, P> Shown for Showing<L, P>
impl<L, P> Shown for Showing<L, P>
§fn scroll(&self) -> Vec2
fn scroll(&self) -> Vec2
§fn transform(&self) -> Affine
fn transform(&self) -> Affine
super::on_screen).§fn same_view(&self, other: &Showing<L, P>) -> bool
fn same_view(&self, other: &Showing<L, P>) -> bool
self shows the content as other does but for the scroll
and what the scroller damages in place itself: the same zoom, the
same content size, the same look.§fn overlays(&self, out: &mut Vec<Rect>)
fn overlays(&self, out: &mut Vec<Rect>)
Self::clip that
does not move with it (a scroll bar’s lane, an edge fade, a banner).§fn same_content(&self, _other: &Self) -> bool
fn same_content(&self, _other: &Self) -> bool
other shows it, so a scroll
between the two only moves it. A scroller whose content changed in
place repaints a scrolled frame.impl<L, P> StructuralPartialEq for Showing<L, P>
Auto Trait Implementations§
impl<L, P> Freeze for Showing<L, P>where
L: Freeze,
impl<L, P> RefUnwindSafe for Showing<L, P>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<L, P> Send for Showing<L, P>
impl<L, P> Sync for Showing<L, P>
impl<L, P> Unpin for Showing<L, P>
impl<L, P> UnsafeUnpin for Showing<L, P>where
L: UnsafeUnpin,
impl<L, P> UnwindSafe for Showing<L, P>where
L: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more