pub struct Flip { /* private fields */ }Expand description
A handle to one element’s slide, keyed by semantic id.
Cheap to clone and to rebuild: the state lives in an application global, so
both a RenderOnce builder and a Render view can ask for the same handle
on every frame.
Implementations§
Source§impl Flip
impl Flip
pub fn id(&self) -> &SharedString
Sourcepub fn offset(&self) -> Point<Pixels>
pub fn offset(&self) -> Point<Pixels>
The offset currently painted, in pixels.
This is where the element is drawn, not where it is: the layout, the hit target and the semantic tree all report the settled position. It exists so a test or an inspector can watch a slide without treating a value in flight as a fact about the interface.
Sourcepub fn size(&self) -> Option<Size<Pixels>>
pub fn size(&self) -> Option<Size<Pixels>>
The size currently painted, once an element has opted into animating
its size with Flipping::flip_size.
Unlike Flip::offset, this one is what the layout and the semantic
tree report, because a size animation is a real layout change.
Sourcepub fn target_size(&self) -> Option<Size<Pixels>>
pub fn target_size(&self) -> Option<Size<Pixels>>
The size layout would give the element if nothing were animating.
Sourcepub fn is_contended(&self) -> bool
pub fn is_contended(&self) -> bool
Whether two elements are currently sharing this id.
A contested id does not animate at all.
pub fn is_animating(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Flip
impl !Send for Flip
impl !Sync for Flip
impl !UnwindSafe for Flip
impl Freeze for Flip
impl Unpin for Flip
impl UnsafeUnpin for Flip
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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