pub struct Controller {
pub component: Component,
pub state: State,
pub appearances: Appearances,
pub focus_top: bool,
pub bubble_trap: InputMask,
/* private fields */
}Expand description
A component that holds control bindings and interaction state.
Controllers handle the translation of view::Input events to interface
Actions via Control bindings.
Fields§
§component: Component§state: StateDefines behavior and appearance
appearances: AppearancesView appearance selection for each state
focus_top: boolControls whether the node will be moved to the last sibling position
(“top”) when processed by a Focus action (either as the target node or
an ancestor of the target node).
Defaults to false. Note that some widget builders may set this to true
unless overridden (e.g. free frame widgets).
bubble_trap: InputMaskControls whether unhandled input is bubbled up to parent: when true unhandled input will be trapped (not bubbled), when false unhandled input will be passed to the parent node.
Defaults to InputMask::empty()
Implementations§
Source§impl Controller
impl Controller
pub fn with_bindings<A: Application>(bindings: &Bindings<A>) -> Self
pub fn get_appearance(&self) -> &Appearance
pub fn get_bindings<A: Application>(&self) -> Bindings<A>
Sourcepub fn set_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
pub fn set_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
Replaces all existing bindings
Sourcepub fn add_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
pub fn add_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
Must be new bindings or else panics
Sourcepub fn insert_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
pub fn insert_bindings<A: Application>(&mut self, bindings: &Bindings<A>)
Replaces existing bindings; should not fail
Sourcepub fn remove_bindings(&mut self, controls: &Controls)
pub fn remove_bindings(&mut self, controls: &Controls)
Remove matching controls
pub fn remove_system(&mut self)
pub fn remove_text(&mut self)
pub fn remove_motion(&mut self)
pub fn remove_pointer(&mut self)
pub fn clear_bindings(&mut self)
Trait Implementations§
Source§impl AsRef<Controller> for Element
impl AsRef<Controller> for Element
Source§fn as_ref(&self) -> &Controller
fn as_ref(&self) -> &Controller
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Controller
impl Debug for Controller
Source§impl Default for Controller
impl Default for Controller
Source§fn default() -> Controller
fn default() -> Controller
Auto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnwindSafe for Controller
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().