Trait NodeContent

Source
pub trait NodeContent {
    // Required methods
    fn new(content: &str) -> Option<Self>
       where Self: Sized;
    fn get_val(&self) -> &str;
    fn gen_content(&self) -> String;
}
Expand description

Trait to define structs that model a node content.

Required Methods§

Source

fn new(content: &str) -> Option<Self>
where Self: Sized,

Constructor.

§Arguments
  • content - Node content.
§Return
  • An Option with the node content.
Source

fn get_val(&self) -> &str

Get node value.

§Return
  • Node value.
Source

fn gen_content(&self) -> String

Generate node content.

Use by serializers to create back the string of a node that is parsed by a NodeContent implementer.

§Return
  • Node content.

Implementors§