[][src]Trait turtle_graphics::Turtle

pub trait Turtle {
    fn forward<T: Into<Distance>>(&mut self, distance: T);
fn move_forward<T: Into<Distance>>(&mut self, distance: T);
fn rotate<T: Into<Degree>>(&mut self, angle: T);
fn is_pen_down(&self) -> bool;
fn pen_down(&mut self);
fn pen_up(&mut self);
fn goto(&mut self, pos: Position);
fn push(&mut self);
fn pop(&mut self); fn backward<T: Into<Distance>>(&mut self, distance: T) { ... }
fn right<T: Into<Degree>>(&mut self, angle: T) { ... }
fn left<T: Into<Degree>>(&mut self, angle: T) { ... }
fn is_pen_up(&self) -> bool { ... }
fn home(&mut self) { ... } }

Required methods

fn forward<T: Into<Distance>>(&mut self, distance: T)

Move turtle forward by specified distance.

fn move_forward<T: Into<Distance>>(&mut self, distance: T)

Move turtle forward by specified distance without drawing.

fn rotate<T: Into<Degree>>(&mut self, angle: T)

Rotate around angle. If angle is positive, the turtle is turned to the left, if negative, to the right.

fn is_pen_down(&self) -> bool

Returns true if pen is down.

fn pen_down(&mut self)

Put the pen down.

fn pen_up(&mut self)

Put the pen up.

fn goto(&mut self, pos: Position)

fn push(&mut self)

Push current turtle state on stack.

fn pop(&mut self)

Restore previously saved turtle state.

Loading content...

Provided methods

fn backward<T: Into<Distance>>(&mut self, distance: T)

Move turtle backward by specified distance.

fn right<T: Into<Degree>>(&mut self, angle: T)

Turn turtle right by angle degree.

fn left<T: Into<Degree>>(&mut self, angle: T)

Turn turtle left by angle degree.

fn is_pen_up(&self) -> bool

Returns true if pen is up.

fn home(&mut self)

Loading content...

Implementors

impl Turtle for Canvas[src]

fn forward<T: Into<Distance>>(&mut self, distance: T)[src]

Move turtle forward by specified distance.

fn pen_down(&mut self)[src]

Put the pen down.

fn pen_up(&mut self)[src]

Put the pen up.

fn goto(&mut self, position: Position)[src]

Positions the turtle exactly at position.

fn push(&mut self)[src]

Push current turtle state on stack.

fn pop(&mut self)[src]

Restore previously saved turtle state.

fn backward<T: Into<Distance>>(&mut self, distance: T)[src]

fn right<T: Into<Degree>>(&mut self, angle: T)[src]

fn left<T: Into<Degree>>(&mut self, angle: T)[src]

fn is_pen_up(&self) -> bool[src]

fn home(&mut self)[src]

Loading content...