#[repr(C)]pub struct WeightUpdate {
pub source: TileVertexId,
pub target: TileVertexId,
pub new_weight: FixedWeight,
pub mode: u8,
pub _reserved: u8,
}Expand description
Weight update delta
Fields§
§source: TileVertexIdSource vertex (tile-local ID)
target: TileVertexIdTarget vertex (tile-local ID)
new_weight: FixedWeightNew weight (fixed-point)
mode: u8Delta mode: 0 = absolute, 1 = relative add, 2 = relative multiply
_reserved: u8Reserved padding
Implementations§
Source§impl WeightUpdate
impl WeightUpdate
Sourcepub const MODE_ABSOLUTE: u8 = 0u8
pub const MODE_ABSOLUTE: u8 = 0u8
Absolute weight update mode
Sourcepub const MODE_MULTIPLY: u8 = 2u8
pub const MODE_MULTIPLY: u8 = 2u8
Relative multiply mode (fixed-point: value/100)
Sourcepub const fn absolute(
source: TileVertexId,
target: TileVertexId,
weight: FixedWeight,
) -> Self
pub const fn absolute( source: TileVertexId, target: TileVertexId, weight: FixedWeight, ) -> Self
Create an absolute weight update
Sourcepub const fn add(
source: TileVertexId,
target: TileVertexId,
delta: FixedWeight,
) -> Self
pub const fn add( source: TileVertexId, target: TileVertexId, delta: FixedWeight, ) -> Self
Create a relative weight addition
Trait Implementations§
Source§impl Clone for WeightUpdate
impl Clone for WeightUpdate
Source§fn clone(&self) -> WeightUpdate
fn clone(&self) -> WeightUpdate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightUpdate
impl Debug for WeightUpdate
Source§impl Default for WeightUpdate
impl Default for WeightUpdate
Source§fn default() -> WeightUpdate
fn default() -> WeightUpdate
Returns the “default value” for a type. Read more
impl Copy for WeightUpdate
Auto Trait Implementations§
impl Freeze for WeightUpdate
impl RefUnwindSafe for WeightUpdate
impl Send for WeightUpdate
impl Sync for WeightUpdate
impl Unpin for WeightUpdate
impl UnwindSafe for WeightUpdate
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