Struct amethyst_input::Bindings
source · Expand description
Used for saving and loading input settings.
Implementations
sourceimpl<AX, AC> Bindings<AX, AC>where
AX: Hash + Eq + Clone,
AC: Hash + Eq + Clone,
impl<AX, AC> Bindings<AX, AC>where
AX: Hash + Eq + Clone,
AC: Hash + Eq + Clone,
sourcepub fn insert_axis<A: Into<AX>>(&mut self, id: A, axis: Axis) -> Option<Axis>
pub fn insert_axis<A: Into<AX>>(&mut self, id: A, axis: Axis) -> Option<Axis>
Assign an axis to an ID value
This will insert a new axis if no entry for this id exists. If one does exist this will replace the axis at that id and return it.
sourcepub fn remove_axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<Axis>where
AX: Borrow<A>,
pub fn remove_axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<Axis>where
AX: Borrow<A>,
Removes an axis, this will return the removed axis if successful.
sourcepub fn axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<&Axis>where
AX: Borrow<A>,
pub fn axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<&Axis>where
AX: Borrow<A>,
Returns a reference to an axis.
sourcepub fn insert_action_binding<A>(&mut self, id: A, binding: Button)where
A: Hash + Eq + Into<AC>,
AC: Borrow<A>,
pub fn insert_action_binding<A>(&mut self, id: A, binding: Button)where
A: Hash + Eq + Into<AC>,
AC: Borrow<A>,
Add a button to an action.
This will insert a new binding between this action and the button.
sourcepub fn remove_action_binding<T: Hash + Eq + ?Sized>(
&mut self,
id: &T,
binding: Button
)where
AC: Borrow<T>,
pub fn remove_action_binding<T: Hash + Eq + ?Sized>(
&mut self,
id: &T,
binding: Button
)where
AC: Borrow<T>,
Removes an action binding that was assigned previously.
Trait Implementations
sourceimpl<'de, AX, AC> Deserialize<'de> for Bindings<AX, AC>where
AX: Hash + Eq,
AC: Hash + Eq,
AX: Deserialize<'de>,
AC: Deserialize<'de>,
impl<'de, AX, AC> Deserialize<'de> for Bindings<AX, AC>where
AX: Hash + Eq,
AC: Hash + Eq,
AX: Deserialize<'de>,
AC: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<AX, AC> RefUnwindSafe for Bindings<AX, AC>where
AC: RefUnwindSafe,
AX: RefUnwindSafe,
impl<AX, AC> Send for Bindings<AX, AC>where
AC: Send,
AX: Send,
impl<AX, AC> Sync for Bindings<AX, AC>where
AC: Sync,
AX: Sync,
impl<AX, AC> Unpin for Bindings<AX, AC>where
AC: Unpin,
AX: Unpin,
impl<AX, AC> UnwindSafe for Bindings<AX, AC>where
AC: UnwindSafe,
AX: UnwindSafe,
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize + Default,
impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize + Default,
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
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
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moreimpl<T> Pointable for T
impl<T> Pointable for T
impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.