[−][src]Struct tweep::StoryPassages
A parsed Twee story, that stores the full Passage
object of each field
For more information, see the Story
struct.
Fields
title: Option<Passage>
StoryTitle
passage
data: Option<Passage>
StoryData
passage
passages: HashMap<String, Passage>
Map from passage name to Passage
for any non-special passages
scripts: Vec<Passage>
List of passages tagged with script
stylesheets: Vec<Passage>
List of passages tagged with stylesheet
Methods
impl StoryPassages
[src]
pub fn from_string(input: String) -> Output<Result<Self, ErrorList>>
[src]
Parses an input String
and returns the result or a list of errors,
along with a list of any Warning
s
pub fn from_slice(input: &[&str]) -> Output<Result<Self, ErrorList>>
[src]
Parses an input &[&str]
and returns the result or a list of errors,
along with a list of any Warning
s
pub fn from_path<P: AsRef<Path>>(input: P) -> Output<Result<Self, ErrorList>>
[src]
Parses a StoryPassages
from the given Path
. If the given path is
a file, parses that file and returns the StoryPassages
. If it is a
directory, it looks for any files with .tw
or .twee
extensions and
parses them. Returns the parsed output or a list of errors, along with a
list of any Warning
s
pub fn from_paths<P: AsRef<Path>>(
input: &[P]
) -> Output<Result<Self, ErrorList>>
[src]
input: &[P]
) -> Output<Result<Self, ErrorList>>
Parses a StoryPassages
from the given Path
s. See from_path
for
additional information on how directories are handled.
pub fn merge_from(&mut self, other: Self) -> Vec<Warning>
[src]
Merges the given StoryPassages
into this one, producing a possible
list of Warning
s in the process.
Warnings
Produces a warning if a duplicate StoryTitle
or StoryData
is found.
The duplicate is ignored and the existing one is kept.
pub fn check(&self) -> Vec<Warning>
[src]
Performs a set of post-parse checks and returns a list of any warnings
Warnings
MissingStoryTitle
- NoStoryTitle
passage foundMissingStoryData
- NoStoryData
passage foundDeadLink
- Found a link to a non-existent passageMissingStartPassage
- NoStart
passage found and no alternate passage set inStoryData
DeadStartPassage
- Alternate start passage set inStoryData
, but no such passage found in parsing
Trait Implementations
impl Default for StoryPassages
[src]
fn default() -> StoryPassages
[src]
impl From<StoryPassages> for Story
[src]
fn from(s: StoryPassages) -> Story
[src]
impl<'a> Parser<'a> for StoryPassages
[src]
type Output = Output<Result<Self, ErrorList>>
The type produced by this parser
type Input = [&'a str]
The type accepted by this parser
fn parse(input: &'a Self::Input) -> Self::Output
[src]
impl Positional for StoryPassages
[src]
fn set_file(&mut self, file: String)
[src]
fn get_position(&self) -> &Position
[src]
fn mut_position(&mut self) -> &mut Position
[src]
fn get_column(&self) -> Option<usize>
[src]
fn set_column(&mut self, col: usize)
[src]
fn offset_column(&mut self, offset: usize)
[src]
fn get_row(&self) -> Option<usize>
[src]
fn set_row(&mut self, row: usize)
[src]
fn offset_row(&mut self, offset: usize)
[src]
fn get_file(&self) -> Option<&str>
[src]
fn with_offset_row(self, offset: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_offset_column(self, offset: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_column(self, col: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_row(self, row: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_file(self, file: String) -> Self where
Self: Sized,
[src]
Self: Sized,
Auto Trait Implementations
impl RefUnwindSafe for StoryPassages
impl Send for StoryPassages
impl Sync for StoryPassages
impl Unpin for StoryPassages
impl UnwindSafe for StoryPassages
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>,