# Trait turtle::Turtle [−] [src]

```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.

Put the pen up.

### `fn push(&mut self)`

Push current turtle state on stack.

### `fn pop(&mut self)`

Restore previously saved turtle state.

## 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.

## Implementors

• `impl Turtle for Canvas`