pub struct Placement<S, M, C = ArenaMoveCursor<S, M>>{
pub entity_ref: EntityReference,
/* private fields */
}Expand description
A placement represents an entity that needs a value assigned, along with the candidate moves to assign values.
§Type Parameters
S- The planning solution typeM- The move type
Fields§
§entity_ref: EntityReferenceImplementations§
Source§impl<S, M, C> Placement<S, M, C>
impl<S, M, C> Placement<S, M, C>
pub fn new(entity_ref: EntityReference, candidates: C) -> Self
pub fn with_keep_current_legal(self, legal: bool) -> Self
pub fn keep_current_legal(&self) -> bool
pub fn candidates(&self) -> &C
pub fn candidates_mut(&mut self) -> &mut C
pub fn take_move(&mut self, candidate_id: CandidateId) -> M
Trait Implementations§
Auto Trait Implementations§
impl<S, M, C> Freeze for Placement<S, M, C>where
C: Freeze,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: Freeze,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: Freeze,
PhantomData<fn() -> (S, M)>: Freeze,
impl<S, M, C> RefUnwindSafe for Placement<S, M, C>where
C: RefUnwindSafe,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: RefUnwindSafe,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: RefUnwindSafe,
PhantomData<fn() -> (S, M)>: RefUnwindSafe,
impl<S, M, C> Send for Placement<S, M, C>where
C: Send,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: Send,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: Send,
PhantomData<fn() -> (S, M)>: Send,
impl<S, M, C> Sync for Placement<S, M, C>where
C: Sync,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: Sync,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: Sync,
PhantomData<fn() -> (S, M)>: Sync,
impl<S, M, C> Unpin for Placement<S, M, C>where
C: Unpin,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: Unpin,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: Unpin,
PhantomData<fn() -> (S, M)>: Unpin,
impl<S, M, C> UnsafeUnpin for Placement<S, M, C>where
C: UnsafeUnpin,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: UnsafeUnpin,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: UnsafeUnpin,
PhantomData<fn() -> (S, M)>: UnsafeUnpin,
impl<S, M, C> UnwindSafe for Placement<S, M, C>where
C: UnwindSafe,
fn(&C, CandidateId) -> Option<&ConstructionTarget>: UnwindSafe,
Vec<(CandidateId, <S as PlanningSolution>::Score)>: UnwindSafe,
PhantomData<fn() -> (S, M)>: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more