Struct convo::Link[][src]

pub struct Link {
    pub to_key: String,
    pub dialogue: String,
}
Expand description

A Link is a uni-directional path to a Node with descriptor dialogue.

Fields

to_key: String

A key to the node being linked. This should be identical to an existing Node#key.

dialogue: String

The dialogue used to describe this link.

Implementations

Returns a Link which maps to a Node with descriptor dialogue.

Arguments

  • to_key - A string type that holds an identical Node#key to which this Link corresponds.
  • dialogue - A string type that holds associated descriptor dialogue.

Examples

use convo::Link;
let link = Link::new("end", "Goodbye!");

Link two Nodes together by creating a Link with descriptor dialogue.

Arguments

  • from - A Node which will prompt the link
  • to - A Node which will be the target of the link
  • dialogue - A string type that holds associated dialogue

Examples

use convo::{Node, Link};
let mut node1 = Node::new("root", "I am the root node!");
let node2 = Node::new("end", "I am the last node!");
Link::link(&mut node1, &node2, "I link start to end!");

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into #41263)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.