Struct rosu_storyboard::Storyboard
source · pub struct Storyboard {
pub format_version: i32,
pub use_skin_sprites: bool,
pub background_file: String,
pub breaks: Vec<BreakPeriod>,
pub layers: HashMap<String, Layer>,
/* private fields */
}
Expand description
The storyboard of a beatmap.
Fields§
§format_version: i32
§use_skin_sprites: bool
§background_file: String
§breaks: Vec<BreakPeriod>
§layers: HashMap<String, Layer>
Implementations§
source§impl Storyboard
impl Storyboard
sourcepub fn encode_to_path<P: AsRef<Path>>(&self, path: P) -> IoResult<()>
pub fn encode_to_path<P: AsRef<Path>>(&self, path: P) -> IoResult<()>
Encode a Storyboard
into content of a .osb
file and store it at
the given path.
sourcepub fn encode_to_string(&self) -> IoResult<String>
pub fn encode_to_string(&self) -> IoResult<String>
Encode a Storyboard
into content of a .osb
file and store it into
a String
.
source§impl Storyboard
impl Storyboard
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
sourcepub fn get_layer(&mut self, name: &str) -> &mut Layer
pub fn get_layer(&mut self, name: &str) -> &mut Layer
Return the Layer
with the given name.
If no layer has that name, a new one is created.
sourcepub fn try_get_layer(&self, name: &str) -> Option<&Layer>
pub fn try_get_layer(&self, name: &str) -> Option<&Layer>
Return the Layer
with the given name.
If no layer has that name, return None
.
pub fn earliest_event_time(&self) -> Option<f64>
pub fn latest_event_time(&self) -> Option<f64>
pub fn has_drawable(&self) -> bool
Trait Implementations§
source§impl Clone for Storyboard
impl Clone for Storyboard
source§fn clone(&self) -> Storyboard
fn clone(&self) -> Storyboard
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Storyboard
impl Debug for Storyboard
source§impl DecodeBeatmap for Storyboard
impl DecodeBeatmap for Storyboard
§type Error = ParseStoryboardError
type Error = ParseStoryboardError
Error type in case something goes wrong while parsing. Read more
§type State = StoryboardState
type State = StoryboardState
The parsing state which will be updated on each line and turned into
Self
at the end.source§fn should_skip_line(line: &str) -> bool
fn should_skip_line(line: &str) -> bool
Whether a line should not be forwarded to the parsing methods.
source§fn parse_general(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
fn parse_general(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[General]
section.source§fn parse_editor(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_editor(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[Editor]
section.source§fn parse_metadata(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_metadata(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[Metadata]
section.source§fn parse_difficulty(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_difficulty(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[Difficulty]
section.source§fn parse_events(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
fn parse_events(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[Events]
section.source§fn parse_timing_points(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_timing_points(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[TimingPoints]
section.source§fn parse_colors(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_colors(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[Colours]
section.source§fn parse_hit_objects(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_hit_objects(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[HitObjects]
section.source§fn parse_variables(
state: &mut Self::State,
line: &str
) -> Result<(), Self::Error>
fn parse_variables( state: &mut Self::State, line: &str ) -> Result<(), Self::Error>
Update the state based on a line of the
[Variables]
section.source§fn parse_catch_the_beat(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_catch_the_beat(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
Update the state based on a line of the
[CatchTheBeat]
section.source§impl Default for Storyboard
impl Default for Storyboard
source§impl From<StoryboardState> for Storyboard
impl From<StoryboardState> for Storyboard
source§fn from(state: StoryboardState) -> Self
fn from(state: StoryboardState) -> Self
Converts to this type from the input type.
source§impl FromStr for Storyboard
impl FromStr for Storyboard
source§impl PartialEq for Storyboard
impl PartialEq for Storyboard
source§fn eq(&self, other: &Storyboard) -> bool
fn eq(&self, other: &Storyboard) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Storyboard
Auto Trait Implementations§
impl RefUnwindSafe for Storyboard
impl Send for Storyboard
impl Sync for Storyboard
impl Unpin for Storyboard
impl UnwindSafe for Storyboard
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