pub struct Pixel { /* private fields */ }Expand description
A Pixel!
It consist out of Coordinates which define where on the Grid it supposed to be and a Color which defines how it should look like. A Pixel can be send by clients to the server to draw it on the Grid.
§Example
let pixel: Pixel = "PX 1024 768 ff0f00".parse().unwrap();
assert_eq!(pixel, Pixel::new(Coordinate::new(1024, 768), Color::rgb(0xff, 0x0f, 0x00)));Implementations§
Source§impl Pixel
impl Pixel
Sourcepub fn new(coordinate: Coordinate, color: Color) -> Pixel
pub fn new(coordinate: Coordinate, color: Color) -> Pixel
Creates a new Pixel with the given Coordinate and Color.
Sourcepub fn coordinate(&self) -> &Coordinate
pub fn coordinate(&self) -> &Coordinate
Returns the Coordinates of this Pixel.
Trait Implementations§
impl Copy for Pixel
impl StructuralPartialEq for Pixel
Auto Trait Implementations§
impl Freeze for Pixel
impl RefUnwindSafe for Pixel
impl Send for Pixel
impl Sync for Pixel
impl Unpin for Pixel
impl UnwindSafe for Pixel
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