#[non_exhaustive]pub struct Files<'a> {
pub sound: &'a dyn Fn(&str) -> Bytes,
pub sound_shown: &'a dyn Fn(&str) -> String,
pub sound_left_out: &'a dyn Fn(&str) -> bool,
pub music_dir: &'a str,
pub music: Option<&'a dyn Fn(&str) -> Bytes>,
}Expand description
How to read the referenced files, and how errors name them. music is
None where the music folder can’t be seen (the game itself, which
does no file I/O). Build it with Files::new (ADR-0039).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sound: &'a dyn Fn(&str) -> BytesReads a sound file, by its name in the manifest (e.g. sfx/x.wav).
sound_shown: &'a dyn Fn(&str) -> StringA sound file’s name as errors show it, by its name in the manifest
(e.g. base/audio/sfx/x.wav).
sound_left_out: &'a dyn Fn(&str) -> boolWhether this build leaves a sound file out on purpose, by its name
in the manifest (a bundle’s left_out): it is then not checked.
music_dir: &'a strThe music folder’s name as errors show it (e.g. music).
music: Option<&'a dyn Fn(&str) -> Bytes>Reads a file in the music folder.
Implementations§
Source§impl<'a> Files<'a>
impl<'a> Files<'a>
Sourcepub const fn new(
sound: &'a dyn Fn(&str) -> Bytes,
sound_shown: &'a dyn Fn(&str) -> String,
sound_left_out: &'a dyn Fn(&str) -> bool,
music_dir: &'a str,
) -> Self
pub const fn new( sound: &'a dyn Fn(&str) -> Bytes, sound_shown: &'a dyn Fn(&str) -> String, sound_left_out: &'a dyn Fn(&str) -> bool, music_dir: &'a str, ) -> Self
Sound files read by sound, named in errors by sound_shown, left
out where sound_left_out says, and a music folder shown as
music_dir that can’t be seen (music is None:
with_music changes it).