#[non_exhaustive]pub struct Script {
pub steps: Vec<Step>,
}Expand description
Steps played in order.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.steps: Vec<Step>The steps, in order.
Implementations§
Source§impl Script
impl Script
Sourcepub fn check(&self) -> Result<(), String>
pub fn check(&self) -> Result<(), String>
Whether every step can be played (Step::check); an error names
the step (step 3: keys: …).
Sourcepub fn play<G>(&self, h: &mut Harness<G>)where
G: GameData,
pub fn play<G>(&self, h: &mut Harness<G>)where
G: GameData,
Plays the steps in h, each frame FRAME_DT long: the frames of
frames with the game’s keymap and the Harness’s pad, and a crank
step with Harness::crank.
§Panics
On a step Step::check refuses, an action the game has no key or
button for, and a wait longer than harness::MAX_WAIT.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Script
impl<'de> Deserialize<'de> for Script
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Script, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Script, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Script
impl JsonSchema for Script
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for Script
impl Serialize for Script
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Script
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnsafeUnpin for Script
impl UnwindSafe for Script
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