[][src]Struct dcc_lsystem::turtle::BaseTurtle

pub struct BaseTurtle { /* fields omitted */ }

Methods

impl BaseTurtle[src]

pub fn new() -> Self[src]

Creates a new BaseTurtle instance.

pub fn x(&self) -> i32[src]

Returns the current x coordinate of the turtle.

pub fn y(&self) -> i32[src]

Returns the current y coordinate of the turtle.

pub fn lines(&self) -> &[(i32, i32, i32, i32)][src]

Returns a slice containing all the lines (x1, y1, x2, y2) traversed by the turtle.

pub fn set_position(&mut self, x: i32, y: i32)[src]

Set the current position of this turtle to (x,y).

pub fn delta_move(&mut self, dx: i32, dy: i32)[src]

Moves the turtle by (dx,dy).

pub fn bounds(&self) -> (u32, u32, i32, i32)[src]

Returns (total_width, total_height, min_x, min_y), where total_width (respectively total_height) is the largest horizontal (respectively vertical) distance between any two points that the turtle visited, min_x(respectivelymin_y`) is the smallest horizontal (respectively vertical) position that the turtle visited.

This is useful for converting from turtle coordinates to a new coordinate system starting at (0,0) with width total_width, height total_height, and all positions have positive x and y coordinates.

pub fn pen_down(&mut self)[src]

Puts the turtles pen down.

pub fn pen_up(&mut self)[src]

Pulls the turtles pen up.

Trait Implementations

impl Clone for BaseTurtle[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for BaseTurtle[src]

impl Debug for BaseTurtle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme, 

type Err = NoError

The error type produced by a failed conversion.

impl<T> ConvUtil for T

fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
    Self: ApproxInto<Dst, DefaultApprox>, 

Approximate the subject to a given type with the default scheme.

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
    Scheme: ApproxScheme,
    Self: ApproxInto<Dst, Scheme>, 

Approximate the subject to a given type with a specific scheme.

fn into_as<Dst>(self) -> Dst where
    Self: Into<Dst>, 

Convert the subject to a given type.

fn try_as<Dst>(self) -> Result<Dst, Self::Err> where
    Self: TryInto<Dst>, 

Attempt to convert the subject to a given type.

fn value_as<Dst>(self) -> Result<Dst, Self::Err> where
    Self: ValueInto<Dst>, 

Attempt a value conversion of the subject to a given type.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme, 

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<Src> ValueFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

impl<T, Dst> ConvAsUtil<Dst> for T

fn approx(self) -> Result<Dst, Self::Err> where
    Self: ApproxInto<Dst, DefaultApprox>, 

Approximate the subject with the default scheme.

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
    Scheme: ApproxScheme,
    Self: ApproxInto<Dst, Scheme>, 

Approximate the subject with a specific scheme.

impl<Src> TryFrom<Src> for Src

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.