pub struct Scene {
pub number: usize,
pub heading: String,
pub page: Option<u32>,
pub body: String,
}Expand description
A single scene in the screenplay.
Scenes are delimited by Scene Heading paragraphs. Everything between
two consecutive headings belongs to the first scene.
§Example
let xml = r#"<?xml version="1.0" encoding="UTF-8"?>
<document type="Open Screenplay Format document" version="40">
<info/><settings/><styles/>
<paragraphs>
<para page_number="3" number="5">
<style basestyle="Scene Heading"/>
<text>EXT. ROOFTOP - NIGHT</text>
</para>
<para><style basestyle="Action"/><text>Wind howls.</text></para>
<para><style basestyle="Character"/><text>MAYA</text></para>
<para><style basestyle="Dialogue"/><text>We have to jump.</text></para>
</paragraphs>
<titlepage/><lists/>
</document>"#;
let doc = osf::parse(xml.as_bytes()).unwrap();
let scene = &doc.scenes[0];
assert_eq!(scene.number, 5);
assert_eq!(scene.heading, "EXT. ROOFTOP - NIGHT");
assert_eq!(scene.page, Some(3));
assert!(scene.body.contains("MAYA"));Fields§
§number: usizeScene number. Uses the explicit number from the XML if present, otherwise falls back to sequential numbering.
heading: StringThe scene heading text (e.g., "INT. COFFEE SHOP - DAY").
page: Option<u32>Page number where the scene starts, if available.
body: StringThe scene body — all paragraphs formatted as screenplay text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more