[−][src]Struct gtp::EntityBuilder
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]
fn eq(&self, other: &EntityBuilder) -> bool
[src]
fn ne(&self, other: &EntityBuilder) -> bool
[src]
impl Clone for EntityBuilder
[src]
fn clone(&self) -> 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]
fn default() -> EntityBuilder
[src]
impl Debug for EntityBuilder
[src]
Auto Trait Implementations
impl Send for EntityBuilder
impl Sync for EntityBuilder
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,