Skip to main content

SolutionShape

Trait SolutionShape 

Source
pub trait SolutionShape<SolId: Id, SInfo: SolInfo>:
    Linked
    + HasId<SolId>
    + HasSolInfo<SInfo>
    + Debug
    + Sized
where Self: Serialize + for<'a> Deserialize<'a>,
{ type SolObj: Solution<SolId, Self::Obj, SInfo>; type SolOpt: Solution<SolId, Self::Opt, SInfo>; // Required methods fn get_sobj(&self) -> &Self::SolObj; fn get_sopt(&self) -> &Self::SolOpt; fn get_mut_sobj(&mut self) -> &mut Self::SolObj; fn get_mut_sopt(&mut self) -> &mut Self::SolOpt; fn extract_sobj(self) -> Self::SolObj; fn extract_sopt(self) -> Self::SolOpt; fn _clone_shape(&self) -> Self; }
Expand description

Trait linking objective- and optimizer-side solutions with a shared Id.

Required Associated Types§

Source

type SolObj: Solution<SolId, Self::Obj, SInfo>

Objective-side solution type.

Source

type SolOpt: Solution<SolId, Self::Opt, SInfo>

Optimizer-side solution type.

Required Methods§

Source

fn get_sobj(&self) -> &Self::SolObj

Get a reference to the objective-side solution.

Source

fn get_sopt(&self) -> &Self::SolOpt

Get a reference to the optimizer-side solution.

Source

fn get_mut_sobj(&mut self) -> &mut Self::SolObj

Get a mutable reference to the objective-side solution.

Source

fn get_mut_sopt(&mut self) -> &mut Self::SolOpt

Get a mutable reference to the optimizer-side solution.

Source

fn extract_sobj(self) -> Self::SolObj

Extract the objective-side solution, consuming the shape.

Source

fn extract_sopt(self) -> Self::SolOpt

Extract the optimizer-side solution, consuming the shape.

Source

fn _clone_shape(&self) -> Self

Creates a clone of this shape with the same solutions, metadata, and Id, used for Accumulator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<SolId, SInfo, Obj, SolObj> SolutionShape<SolId, SInfo> for Lone<SolObj, SolId, Obj, SInfo>
where SolId: Id, SInfo: SolInfo, Obj: Domain, SolObj: Solution<SolId, Obj, SInfo>,

Source§

type SolObj = SolObj

Source§

type SolOpt = SolObj

Source§

impl<SolObj, SolOpt, SolId, Obj, Opt, SInfo> SolutionShape<SolId, SInfo> for Pair<SolObj, SolOpt, SolId, Obj, Opt, SInfo>
where SolId: Id, Obj: Domain, Opt: Domain, SInfo: SolInfo, SolObj: Solution<SolId, Obj, SInfo>, SolOpt: Solution<SolId, Opt, SInfo>,

Source§

type SolObj = SolObj

Source§

type SolOpt = SolOpt