[−][src]Struct tweep::TwineContent
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]
pub fn get_links(&self) -> &Vec<TwineLink>
[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]
fn from(p: TwineContent) -> PassageContent
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TwineContent
impl !Send for TwineContent
impl !Sync for TwineContent
impl Unpin for TwineContent
impl UnwindSafe for TwineContent
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,