Struct sgf::sgf_node::SgfNode [] [src]

pub struct SgfNode {
    pub children: Vec<SgfNode>,
    // some fields omitted
}

SGF node with children. It means that a node also represents game tree. Access the field 'children' directly to traverse in its tree. To access SGF properties of the node, use various accessors below.

Fields

children

Methods

impl SgfNode

fn new(properties: HashMap<String, Vec<String>>) -> SgfNode

Constructor. Returns an SgfNode with given propertes. Properties should be stored in a HashMap in String name and a vector of String value.

fn leaf_mut(&mut self) -> &mut SgfNode

Returns a mutable reference of a leaf node in main line This is for the parser.

fn get_point(&self, id: &str) -> Result<SgfPoint, SgfError>

Returns a Result of id's value as SgfPoint.

fn set_point(&mut self, id: &str, value: SgfPoint) -> &mut Self

Sets an SgfpPoint value to property id.

fn get_number(&self, id: &str) -> Result<SgfNumber, SgfError>

Returns a Result of id's value as SgfNumber.

fn set_number(&mut self, id: &str, value: SgfNumber) -> &mut Self

Sets an SgfpNumber value to property id.

fn get_points(&self, id: &str) -> Result<Vec<SgfPoint>, SgfError>

Returns a Result of id's value as a vector of SgfPoint.

fn set_points(&mut self, id: &str, value: Vec<SgfPoint>) -> &mut Self

Sets an SgfPoint vector to property id.

fn get_color(&self, id: &str) -> Result<SgfColor, SgfError>

Returns a Result of id's value as SgfColor.

fn set_color(&mut self, id: &str, value: SgfColor) -> &mut Self

Sets an SgfColor to property id.

fn get_double(&self, id: &str) -> Result<SgfDouble, SgfError>

Returns a Result of id's value as SgfDouble.

fn set_double(&mut self, id: &str, value: SgfDouble) -> &mut Self

Sets an SgfDouble to property id.

fn get_text(&self, id: &str) -> Result<SgfText, SgfError>

Returns a Result of id's value as SgfText.

fn set_text(&mut self, id: &str, value: String) -> &mut Self

Sets an SgfText to property id.

fn get_simple_text(&self, id: &str) -> Result<SgfSimpleText, SgfError>

Returns a Result of id's value as SgfSimpleText.

fn set_simple_text(&mut self, id: &str, value: String) -> &mut Self

Sets an SgfSimpleText to property id.

fn get_real(&self, id: &str) -> Result<SgfReal, SgfError>

Returns a Result of id's value as SgfReal.

fn set_real(&mut self, id: &str, value: SgfReal) -> &mut Self

Sets an SgfReal to property id.

fn get_point_point(&self, id: &str) -> Result<(SgfPoint, SgfPoint), SgfError>

Returns a Result of id's value as Compose of SgfPoints.

fn set_point_point(&mut self, id: &str, value: (SgfPoint, SgfPoint)) -> &mut Self

Sets a compose of SgfPoints to property id.

fn get_point_simple_text(&self, id: &str) -> Result<(SgfPoint, SgfSimpleText), SgfError>

Returns a Result of id's value as Compose of SgfPoint and SgfSimpleText.

fn set_point_simple_text(&mut self, id: &str, value: (SgfPoint, SgfSimpleText)) -> &mut Self

Sets a compose of SgfPoint and SgfSimpleText to property id.

fn get_simple_text_simple_text(&self, id: &str) -> Result<(SgfSimpleText, SgfSimpleText), SgfError>

Returns a Result of id's value as Compose of SgfSimpleTexts.

fn set_simple_text_simple_text(&mut self, id: &str, value: (SgfSimpleText, SgfSimpleText)) -> &mut Self

Sets a compose of SgfSimpleTexts to property id.

fn get_number_number(&self, id: &str) -> Result<(SgfNumber, SgfNumber), SgfError>

Returns a Result of id's value as Compose of SgfNumbers.

fn set_number_number(&mut self, id: &str, value: (SgfNumber, SgfNumber)) -> &mut Self

Sets a compose of SgfNumbers to property id.

fn get_number_simple_text(&self, id: &str) -> Result<(SgfNumber, SgfSimpleText), SgfError>

Returns a Result of id's value as Compose of SgfNumber and SgfSimpleText.

fn set_number_simple_text(&mut self, id: &str, value: (SgfNumber, SgfSimpleText)) -> &mut Self

Sets a compose of SgfNumber and SgfSimpleText to property id.

Trait Implementations

impl Debug for SgfNode

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for SgfNode

fn fmt(&self, f: &mut Formatter) -> Result