Struct vrp_core::models::FeatureBuilder
source · pub struct FeatureBuilder(/* private fields */);
Expand description
Provides a way to build feature with some checks.
Implementations§
source§impl FeatureBuilder
impl FeatureBuilder
sourcepub fn combine(
name: &str,
features: &[Feature]
) -> Result<Feature, GenericError>
pub fn combine( name: &str, features: &[Feature] ) -> Result<Feature, GenericError>
Combines multiple features into one.
sourcepub fn from_feature(feature: Feature) -> Self
pub fn from_feature(feature: Feature) -> Self
Creates a builder from another feature
sourcepub fn with_constraint<T: FeatureConstraint + Send + Sync + 'static>(
self,
constraint: T
) -> Self
pub fn with_constraint<T: FeatureConstraint + Send + Sync + 'static>( self, constraint: T ) -> Self
Adds given constraint.
sourcepub fn with_objective<T: FeatureObjective<Solution = InsertionContext> + Send + Sync + 'static>(
self,
objective: T
) -> Self
pub fn with_objective<T: FeatureObjective<Solution = InsertionContext> + Send + Sync + 'static>( self, objective: T ) -> Self
Adds given objective.
sourcepub fn with_state<T: FeatureState + Send + Sync + 'static>(
self,
state: T
) -> Self
pub fn with_state<T: FeatureState + Send + Sync + 'static>( self, state: T ) -> Self
Adds given state.
sourcepub fn build(self) -> Result<Feature, GenericError>
pub fn build(self) -> Result<Feature, GenericError>
Tries to builds a feature.
Trait Implementations§
source§impl Default for FeatureBuilder
impl Default for FeatureBuilder
source§fn default() -> FeatureBuilder
fn default() -> FeatureBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FeatureBuilder
impl Send for FeatureBuilder
impl Sync for FeatureBuilder
impl Unpin for FeatureBuilder
impl !UnwindSafe for FeatureBuilder
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