[][src]Struct gtp::EntityBuilder

pub struct EntityBuilder { /* fields omitted */ }

Helper class for constructing an Entity data structure.

Use it like this:

use gtp;
let mut eb = gtp::EntityBuilder::new();
eb.v((19, 19));
assert_eq!(eb.build().to_string(), "T19");

Alternatively you can use the entity function:

use gtp;
let ent = gtp::entity(|eb| eb.v((19, 19)));
assert_eq!(ent.to_string(), "T19");

Methods

impl EntityBuilder[src]

pub fn new() -> EntityBuilder[src]

Constructs a new entity builder.

Please note there are helper functions like entity Or args of Command.

pub fn i(&mut self, i: u32) -> &mut Self[src]

pub fn f(&mut self, f: f32) -> &mut Self[src]

pub fn s(&mut self, s: &str) -> &mut Self[src]

pub fn v_pass(&mut self) -> &mut Self[src]

pub fn v(&mut self, v: (i32, i32)) -> &mut Self[src]

pub fn w(&mut self) -> &mut Self[src]

pub fn b(&mut self) -> &mut Self[src]

pub fn bool(&mut self, b: bool) -> &mut Self[src]

pub fn color(&mut self, b: bool) -> &mut Self[src]

pub fn mv_w(&mut self, v: (i32, i32)) -> &mut Self[src]

pub fn mv_b(&mut self, v: (i32, i32)) -> &mut Self[src]

pub fn mv(&mut self, color: bool, v: (i32, i32)) -> &mut Self[src]

pub fn list(&mut self) -> &mut Self[src]

pub fn build(&self) -> Entity[src]

Trait Implementations

impl PartialEq<EntityBuilder> for EntityBuilder[src]

impl Clone for EntityBuilder[src]

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

Performs copy-assignment from source. Read more

impl Default for EntityBuilder[src]

impl Debug for EntityBuilder[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, 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> 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]