[][src]Struct gdl::elements::Triangle

pub struct Triangle {
    pub x1: i32,
    pub y1: i32,
    pub x2: i32,
    pub y2: i32,
    pub x3: i32,
    pub y3: i32,
    // some fields omitted
}

Triangle struct, which represents the color and co-ordinates of a Triangle.

Fields

x1: i32y1: i32x2: i32y2: i32x3: i32y3: i32

Methods

impl Triangle[src]

pub fn new(
    background_color: Rgb,
    x1: i32,
    y1: i32,
    x2: i32,
    y2: i32,
    x3: i32,
    y3: i32
) -> Triangle
[src]

Create a new Triangle, with specified co-ordinates for its 3 points, and a background color.

pub fn background_color(self) -> Rgb[src]

Get the background colour of the Triangle.

pub fn x1(self) -> i32[src]

Get the x1 co-ordinate of the Triangle.

pub fn x2(self) -> i32[src]

Get the x1 value of the Triangle.

pub fn y1(self) -> i32[src]

Get the y1 value of the Triangle.

pub fn y2(self) -> i32[src]

Get the y2 value of the Triangle.

Trait Implementations

impl From<Triangle> for JsValue[src]

impl Debug for Triangle[src]

impl RefFromWasmAbi for Triangle[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, Triangle>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more

impl FromWasmAbi for Triangle[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl IntoWasmAbi for Triangle[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl WasmDescribe for Triangle[src]

impl OptionFromWasmAbi for Triangle[src]

impl OptionIntoWasmAbi for Triangle[src]

impl RefMutFromWasmAbi for Triangle[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, Triangle>

Same as RefFromWasmAbi::Anchor

Auto Trait Implementations

impl Send for Triangle

impl Sync for Triangle

impl Unpin for Triangle

impl UnwindSafe for Triangle

impl RefUnwindSafe for Triangle

Blanket Implementations

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

impl<T> From<T> for 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> SetParameter for T

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<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> ConvUtil for T

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

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.

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]