[−][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
Implementations
impl StoryPassages
[src]
pub fn from_string(input: String) -> Output<Result<StoryPassages, 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_path<P: AsRef<Path>>(
input: P
) -> Output<Result<StoryPassages, ErrorList>>
[src]
input: P
) -> Output<Result<StoryPassages, ErrorList>>
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<StoryPassages, ErrorList>>
[src]
input: &[P]
) -> Output<Result<StoryPassages, 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
pub fn get_start_passage_name(&self) -> Option<&str>
[src]
If a start passage is configured in the StoryData, return the name of that passage. If no start passage is configured, check for the presence of a passage called "Start". If that passage exists, return that name, otherwise return None
Trait Implementations
impl Default for StoryPassages
[src]
fn default() -> StoryPassages
[src]
impl From<StoryPassages> for Story
[src]
fn from(s: StoryPassages) -> Story
[src]
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>,