[][src]Struct tweep::TwineContent

pub struct TwineContent {
    pub content: String,
    pub pid: usize,
    // some fields omitted
}

The contents of a Twine passage.

Contains the content of the passage along with the Position. The get_links method can be used to retrieve all Twine links that were parsed out of the passage.

Parse Errors

None

Parse Warnings

  • UnclosedLink - An unclosed Twine link such as `[[Passage Name``
  • WhitespaceInLink - Errant whitespace in link such as [[Display Text-> Passage Name]]

Notes

Currently, the supported formats for links are the following:

[[Passge Name]]
[[Display Text|Passage Name]]
[[Display Text->Passage Name]]
[[Passage Name<-Display Text]]

Examples

use tweep::{FullContext, Position, TwineContent, TwineLink};
let input = r#"This is a Twine content passage. It has a [[link]]
And some [[other link->Another passage]]
"#.to_string();
let out = TwineContent::parse(FullContext::from(None, input));

Fields

content: String

The content of the passage

pid: usize

The pid (Passage ID) of the passage

Implementations

impl TwineContent[src]

Gets a Vec of all the links contained within this content

pub fn parse(context: FullContext) -> Output<Result<Self, ErrorList>>[src]

Parses a TwineContent out of the given context

Trait Implementations

impl Debug for TwineContent[src]

impl From<TwineContent> for PassageContent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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.