pub struct MazePath {
pub points: Vec<MazePoint>,
}Expand description
Represents a maze path composed of a sequence of maze points
Fields§
§points: Vec<MazePoint>Vector of successive points within the path
Implementations§
Source§impl MazePath
impl MazePath
Sourcepub fn new(points: Vec<MazePoint>) -> MazePath
pub fn new(points: Vec<MazePoint>) -> MazePath
Creates a new path instance for the given set of points
§Arguments
points- Sequence of points defining the path
§Returns
A new path
§Examples
use data_model::MazePoint;
use maze::MazePath;
let points = vec![
MazePoint { row: 0, col: 1 },
MazePoint { row: 0, col: 0 },
MazePoint { row: 1, col: 0 },
];
let p = MazePath::new(points);
assert_eq!(p.points.len(), 3);Trait Implementations§
Source§impl<'de> Deserialize<'de> for MazePath
impl<'de> Deserialize<'de> for MazePath
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
impl StructuralPartialEq for MazePath
Auto Trait Implementations§
impl Freeze for MazePath
impl RefUnwindSafe for MazePath
impl Send for MazePath
impl Sync for MazePath
impl Unpin for MazePath
impl UnwindSafe for MazePath
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