Struct lighthouse_protocol::Delta
source · pub struct Delta {
pub dx: i32,
pub dy: i32,
}
Expand description
A 2D vector on the lighthouse display.
Fields§
§dx: i32
§dy: i32
Implementations§
source§impl Delta
impl Delta
sourcepub fn random_cardinal_with(rng: &mut impl Rng) -> Self
pub fn random_cardinal_with(rng: &mut impl Rng) -> Self
Randomly one of the four cardinal directions with the given rng.
sourcepub fn random_cardinal() -> Self
pub fn random_cardinal() -> Self
Randomly one of the four cardinal directions with the thread-local rng.
Trait Implementations§
source§impl AddAssign<Delta> for Pos
impl AddAssign<Delta> for Pos
source§fn add_assign(&mut self, rhs: Delta)
fn add_assign(&mut self, rhs: Delta)
Performs the
+=
operation. Read moresource§impl PartialEq for Delta
impl PartialEq for Delta
source§impl SubAssign<Delta> for Pos
impl SubAssign<Delta> for Pos
source§fn sub_assign(&mut self, rhs: Delta)
fn sub_assign(&mut self, rhs: Delta)
Performs the
-=
operation. Read moreimpl Copy for Delta
impl Eq for Delta
impl StructuralPartialEq for Delta
Auto Trait Implementations§
impl Freeze for Delta
impl RefUnwindSafe for Delta
impl Send for Delta
impl Sync for Delta
impl Unpin for Delta
impl UnwindSafe for Delta
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
Mutably borrows from an owned value. Read more