Skip to main content

PlayerInputFlags

Struct PlayerInputFlags 

Source
pub struct PlayerInputFlags(/* private fields */);

Implementations§

Source§

impl PlayerInputFlags

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u8) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u8

Convert into bits.

Source

pub const fn forward(&self) -> bool

Bits: 0..1

Source

pub const fn with_forward_checked(self, value: bool) -> Result<Self, ()>

Bits: 0..1

Source

pub const fn with_forward(self, value: bool) -> Self

Bits: 0..1

Source

pub const fn set_forward(&mut self, value: bool)

Bits: 0..1

Source

pub const fn set_forward_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 0..1

Source

pub const fn back(&self) -> bool

Bits: 1..2

Source

pub const fn with_back_checked(self, value: bool) -> Result<Self, ()>

Bits: 1..2

Source

pub const fn with_back(self, value: bool) -> Self

Bits: 1..2

Source

pub const fn set_back(&mut self, value: bool)

Bits: 1..2

Source

pub const fn set_back_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 1..2

Source

pub const fn left(&self) -> bool

Bits: 2..3

Source

pub const fn with_left_checked(self, value: bool) -> Result<Self, ()>

Bits: 2..3

Source

pub const fn with_left(self, value: bool) -> Self

Bits: 2..3

Source

pub const fn set_left(&mut self, value: bool)

Bits: 2..3

Source

pub const fn set_left_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 2..3

Source

pub const fn right(&self) -> bool

Bits: 3..4

Source

pub const fn with_right_checked(self, value: bool) -> Result<Self, ()>

Bits: 3..4

Source

pub const fn with_right(self, value: bool) -> Self

Bits: 3..4

Source

pub const fn set_right(&mut self, value: bool)

Bits: 3..4

Source

pub const fn set_right_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 3..4

Source

pub const fn jump(&self) -> bool

Bits: 4..5

Source

pub const fn with_jump_checked(self, value: bool) -> Result<Self, ()>

Bits: 4..5

Source

pub const fn with_jump(self, value: bool) -> Self

Bits: 4..5

Source

pub const fn set_jump(&mut self, value: bool)

Bits: 4..5

Source

pub const fn set_jump_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 4..5

Source

pub const fn sneak(&self) -> bool

Bits: 5..6

Source

pub const fn with_sneak_checked(self, value: bool) -> Result<Self, ()>

Bits: 5..6

Source

pub const fn with_sneak(self, value: bool) -> Self

Bits: 5..6

Source

pub const fn set_sneak(&mut self, value: bool)

Bits: 5..6

Source

pub const fn set_sneak_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 5..6

Source

pub const fn sprint(&self) -> bool

Bits: 6..7

Source

pub const fn with_sprint_checked(self, value: bool) -> Result<Self, ()>

Bits: 6..7

Source

pub const fn with_sprint(self, value: bool) -> Self

Bits: 6..7

Source

pub const fn set_sprint(&mut self, value: bool)

Bits: 6..7

Source

pub const fn set_sprint_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 6..7

Trait Implementations§

Source§

impl Clone for PlayerInputFlags

Source§

fn clone(&self) -> PlayerInputFlags

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 Debug for PlayerInputFlags

Source§

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

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

impl<'a> Decode<'a> for PlayerInputFlags

Source§

fn decode(_r: &mut &'a [u8]) -> Result<Self>

Reads this object from the provided byte slice. Read more
Source§

impl Default for PlayerInputFlags

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Encode for PlayerInputFlags

Source§

fn encode(&self, _w: impl Write) -> Result<()>

Writes this object to the provided writer. Read more
§

fn encode_slice(slice: &[Self], w: impl Write) -> Result<(), Error>
where Self: Sized,

Like [Encode::encode], except that a whole slice of values is encoded. Read more
Source§

impl From<PlayerInputFlags> for u8

Source§

fn from(v: PlayerInputFlags) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for PlayerInputFlags

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PlayerInputFlags

Source§

fn eq(&self, other: &PlayerInputFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PlayerInputFlags

Source§

impl Eq for PlayerInputFlags

Source§

impl StructuralPartialEq for PlayerInputFlags

Auto Trait Implementations§

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

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

§

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.
§

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.
§

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.
§

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.
§

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

§

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.
§

impl<T> DynEq for T
where T: Any + Eq,

§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

§

type Template = T

The [Template] for this type.
§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using default().

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoResult<T> for T

§

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

Converts this type into the system output type.
§

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

§

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<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Template for T
where T: Clone + Default + Unpin,

§

type Output = T

The type of value produced by this [Template].
§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a [Template::Output].
§

fn clone_template(&self) -> T

Clones this template. See Clone.
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.
§

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

§

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

Creates a type-erased clone of this value.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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