Struct FlapState
pub struct FlapState { /* private fields */ }Expand description
The reveal shared by every flap. See the module docs.
Implementations§
§impl FlapState
impl FlapState
pub fn open_when_docked() -> FlapState
pub fn open_when_docked() -> FlapState
A flap that is open when docked (the common navigation sidebar).
pub fn closed_by_default() -> FlapState
pub fn closed_by_default() -> FlapState
A flap that is closed even when docked — summoned on demand.
pub fn from_input(&mut self, source: MotionSource)
pub fn from_input(&mut self, source: MotionSource)
Say what input the next choice comes from: a shortcut lands at once.
pub fn is_open(&self, layout: SplitLayout) -> bool
pub fn is_open(&self, layout: SplitLayout) -> bool
Whether the flap is currently open in layout, resolving the
person’s choice against the layout default.
pub fn toggle(&mut self, layout: SplitLayout)
pub fn toggle(&mut self, layout: SplitLayout)
Flip the flap relative to its resolved openness in layout.
pub fn open(&mut self)
pub fn open(&mut self)
Open the flap in the current layout.
pub fn close(&mut self)
pub fn close(&mut self)
Close the flap in the current layout (scrim, Esc, a choice made in a drawer).
pub fn settle(&mut self, layout: SplitLayout)
pub fn settle(&mut self, layout: SplitLayout)
Jump the reveal to the resolved openness without recording a choice.
pub fn advance(
&mut self,
layout: SplitLayout,
now: Instant,
motion: EffectiveMotion,
) -> bool
pub fn advance( &mut self, layout: SplitLayout, now: Instant, motion: EffectiveMotion, ) -> bool
Follow the resolved state to now (the frame’s time) on the panel
slide motion allows. Returns whether it is still moving.
pub fn reconcile(&mut self, layout: SplitLayout)
pub fn reconcile(&mut self, layout: SplitLayout)
Note the layout the flap is laid out in. The first call settles the reveal (the constructor guessed before any width was known); a later change drops a transient overlay choice and settles to the new layout’s resolved state, so a resize is a structural jump, never a slide.
pub fn reveal(&self) -> f64
pub fn reveal(&self) -> f64
The reveal in 0..=1 as of the last frame: the docked width share,
the overlay slide and the scrim strength.
pub fn is_animating(&self, layout: SplitLayout) -> bool
pub fn is_animating(&self, layout: SplitLayout) -> bool
Whether the reveal is still moving toward the resolved state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlapState
impl RefUnwindSafe for FlapState
impl Send for FlapState
impl Sync for FlapState
impl Unpin for FlapState
impl UnsafeUnpin for FlapState
impl UnwindSafe for FlapState
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
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