Trait shakmaty::FromSetup [−][src]
pub trait FromSetup: Sized {
fn from_setup(
setup: &dyn Setup,
mode: CastlingMode
) -> Result<Self, PositionError<Self>>;
}
Expand description
Validate and set up an arbitrary position. All provided chess variants support this.
Required methods
fn from_setup(
setup: &dyn Setup,
mode: CastlingMode
) -> Result<Self, PositionError<Self>>
fn from_setup(
setup: &dyn Setup,
mode: CastlingMode
) -> Result<Self, PositionError<Self>>
Set up a position.
Errors
Returns PositionError
if the setup does not meet basic validity
requirements. Meeting the requirements does not imply that the position
is actually reachable with a series of legal moves from the starting
position.