Struct vrp_core::construction::heuristics::RouteState
source · pub struct RouteState { /* private fields */ }
Expand description
Provides the way to associate arbitrary data within route or/and activity.
NOTE: do not put any state which is not refreshed after accept_route_state
call: it will be
wiped out at some point.
Implementations§
source§impl RouteState
impl RouteState
sourcepub fn get_route_state<T: Send + Sync + 'static>(
&self,
key: StateKey
) -> Option<&T>
pub fn get_route_state<T: Send + Sync + 'static>( &self, key: StateKey ) -> Option<&T>
Gets value associated with key converted to given type.
sourcepub fn get_activity_state<T: Send + Sync + 'static>(
&self,
key: StateKey,
activity_idx: usize
) -> Option<&T>
pub fn get_activity_state<T: Send + Sync + 'static>( &self, key: StateKey, activity_idx: usize ) -> Option<&T>
Gets value associated with key converted to given type.
sourcepub fn get_activity_states<T: Send + Sync + 'static>(
&self,
key: StateKey
) -> Option<&Vec<T>>
pub fn get_activity_states<T: Send + Sync + 'static>( &self, key: StateKey ) -> Option<&Vec<T>>
Gets values associated with key and activities.
sourcepub fn put_route_state<T: Send + Sync + 'static>(
&mut self,
key: StateKey,
value: T
)
pub fn put_route_state<T: Send + Sync + 'static>( &mut self, key: StateKey, value: T )
Puts value associated with key.
Trait Implementations§
source§impl Clone for RouteState
impl Clone for RouteState
source§fn clone(&self) -> RouteState
fn clone(&self) -> RouteState
Returns a copy 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 Default for RouteState
impl Default for RouteState
source§fn default() -> RouteState
fn default() -> RouteState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RouteState
impl Send for RouteState
impl Sync for RouteState
impl Unpin for RouteState
impl !UnwindSafe for RouteState
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