Skip to main content

Ordinal

Struct Ordinal 

Source
pub struct Ordinal<N, NE, E, SE, S, SW, W, NW> {
    pub north: N,
    pub north_east: NE,
    pub east: E,
    pub south_east: SE,
    pub south: S,
    pub south_west: SW,
    pub west: W,
    pub north_west: NW,
}
Available on crate feature input_bei and (crate features input_bei or input_native or leafwing) only.
Expand description

A preset to 8 map buttons as 2-dimensional input.

Fields§

§north: N§north_east: NE§east: E§south_east: SE§south: S§south_west: SW§west: W§north_west: NW

Implementations§

Source§

impl Ordinal<Binding, Binding, Binding, Binding, Binding, Binding, Binding, Binding>

Source

pub fn numpad() -> Ordinal<Binding, Binding, Binding, Binding, Binding, Binding, Binding, Binding>

Maps numpad keys as 2-dimensional input.

Source

pub fn new( north: impl Into<Binding>, north_east: impl Into<Binding>, east: impl Into<Binding>, south_east: impl Into<Binding>, south: impl Into<Binding>, south_west: impl Into<Binding>, west: impl Into<Binding>, north_west: impl Into<Binding>, ) -> Ordinal<Binding, Binding, Binding, Binding, Binding, Binding, Binding, Binding>

Maps 8 bindings as 2-dimensional input.

NW  N   NE
  🡴 🡱 🡵
W 🡰 · 🡲 E
  🡷 🡳 🡶
SW  S   SE
Source

pub fn with_mod_keys( self, mod_keys: ModKeys, ) -> Ordinal<Binding, Binding, Binding, Binding, Binding, Binding, Binding, Binding>

Applies keyboard modifiers to all bindings.

Trait Implementations§

Source§

impl<N, NE, E, SE, S, SW, W, NW> Clone for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Clone, NE: Clone, E: Clone, SE: Clone, S: Clone, SW: Clone, W: Clone, NW: Clone,

Source§

fn clone(&self) -> Ordinal<N, NE, E, SE, S, SW, W, NW>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N, NE, E, SE, S, SW, W, NW> Copy for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Copy, NE: Copy, E: Copy, SE: Copy, S: Copy, SW: Copy, W: Copy, NW: Copy,

Source§

impl<N, NE, E, SE, S, SW, W, NW> Debug for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Debug, NE: Debug, E: Debug, SE: Debug, S: Debug, SW: Debug, W: Debug, NW: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<N, NE, E, SE, S, SW, W, NW> SpawnableList<BindingOf> for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Bundle, NE: Bundle, E: Bundle, SE: Bundle, S: Bundle, SW: Bundle, W: Bundle, NW: Bundle,

Source§

fn spawn( this: MovingPtr<'_, Ordinal<N, NE, E, SE, S, SW, W, NW>>, world: &mut World, entity: Entity, )

Spawn this list of changes in a given World and relative to a given Entity. This is generally used for spawning “related” entities, such as children.
Source§

fn size_hint(&self) -> usize

Returns a size hint, which is used to reserve space for this list in a RelationshipTarget. This should be less than or equal to the actual size of the list. When in doubt, just use 0.
Source§

impl<N, NE, E, SE, S, SW, W, NW, T> WithBundle<T> for Ordinal<N, NE, E, SE, S, SW, W, NW>
where T: Clone,

Source§

type Output = Ordinal<(N, T), (NE, T), (E, T), (SE, T), (S, T), (SW, T), (W, T), (NW, T)>

Source§

fn with( self, bundle: T, ) -> <Ordinal<N, NE, E, SE, S, SW, W, NW> as WithBundle<T>>::Output

Returns a new instance in which the given bundle is added to each entity spawned by the preset. Read more

Auto Trait Implementations§

§

impl<N, NE, E, SE, S, SW, W, NW> Freeze for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Freeze, NE: Freeze, E: Freeze, SE: Freeze, S: Freeze, SW: Freeze, W: Freeze, NW: Freeze,

§

impl<N, NE, E, SE, S, SW, W, NW> RefUnwindSafe for Ordinal<N, NE, E, SE, S, SW, W, NW>

§

impl<N, NE, E, SE, S, SW, W, NW> Send for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Send, NE: Send, E: Send, SE: Send, S: Send, SW: Send, W: Send, NW: Send,

§

impl<N, NE, E, SE, S, SW, W, NW> Sync for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Sync, NE: Sync, E: Sync, SE: Sync, S: Sync, SW: Sync, W: Sync, NW: Sync,

§

impl<N, NE, E, SE, S, SW, W, NW> Unpin for Ordinal<N, NE, E, SE, S, SW, W, NW>
where N: Unpin, NE: Unpin, E: Unpin, SE: Unpin, S: Unpin, SW: Unpin, W: Unpin, NW: Unpin,

§

impl<N, NE, E, SE, S, SW, W, NW> UnsafeUnpin for Ordinal<N, NE, E, SE, S, SW, W, NW>

§

impl<N, NE, E, SE, S, SW, W, NW> UnwindSafe for Ordinal<N, NE, E, SE, S, SW, W, NW>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> Captures<U> for T
where T: ?Sized,

Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Channel for T
where T: Send + Sync + 'static,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> Message for T
where T: Send + Sync + 'static,

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Send for T
where T: Send,

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Sync for T
where T: Sync,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.