pub struct MazeSolution {
pub path: MazePath,
}Expand description
Represents a maze solution
Fields§
§path: MazePathSolution path
Implementations§
Source§impl MazeSolution
impl MazeSolution
Sourcepub fn new(path: MazePath) -> MazeSolution
pub fn new(path: MazePath) -> MazeSolution
Creates a maze solution instance with the given solution path
§Arguments
path- Solution path
§Returns
A new solution instance
§Examples
use data_model::MazePoint;
use maze::{MazePath, MazeSolution};
let path = MazePath {
points: vec![
MazePoint { row: 0, col: 1 },
MazePoint { row: 0, col: 0 },
MazePoint { row: 1, col: 0 },
],
};
let s = MazeSolution::new(path);
assert_eq!(s.path.points.len(), 3);Trait Implementations§
Source§impl ComposeSchema for MazeSolution
impl ComposeSchema for MazeSolution
Source§impl Debug for MazeSolution
impl Debug for MazeSolution
Source§impl<'de> Deserialize<'de> for MazeSolution
impl<'de> Deserialize<'de> for MazeSolution
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MazeSolution
impl PartialEq for MazeSolution
Source§impl Serialize for MazeSolution
impl Serialize for MazeSolution
Source§impl ToSchema for MazeSolution
impl ToSchema for MazeSolution
impl StructuralPartialEq for MazeSolution
Auto Trait Implementations§
impl Freeze for MazeSolution
impl RefUnwindSafe for MazeSolution
impl Send for MazeSolution
impl Sync for MazeSolution
impl Unpin for MazeSolution
impl UnwindSafe for MazeSolution
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