#[non_exhaustive]pub struct InputLog {
pub config: ControllerConfig,
pub seed: Option<StallMemorySnapshot>,
pub inputs: Vec<Input>,
}Expand description
A complete, self-describing input log: the controller configuration, the optional stall-memory seed, and the inputs in call 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.config: ControllerConfigConfiguration the controller was built from.
seed: Option<StallMemorySnapshot>Stall-memory seed the controller was built with.
inputs: Vec<Input>The recorded calls, in order.
Implementations§
Source§impl InputLog
impl InputLog
Sourcepub fn new(
config: ControllerConfig,
seed: Option<StallMemorySnapshot>,
inputs: Vec<Input>,
) -> Self
pub fn new( config: ControllerConfig, seed: Option<StallMemorySnapshot>, inputs: Vec<Input>, ) -> Self
A log of inputs for a controller built from config and seed.
Sourcepub fn write(&self, out: &mut impl Write) -> Result
pub fn write(&self, out: &mut impl Write) -> Result
Writes the header, the config rows, the seed row if any, then one row per input, each
line ending in a newline.
§Errors
Whatever out reports.
Sourcepub fn parse(text: &str) -> Result<Self, InputLogError>
pub fn parse(text: &str) -> Result<Self, InputLogError>
Parses a log written by InputLog::write.
§Errors
InputLogError for a bad row, or Reason::NoConfig when the log has no config rows.
Sourcepub fn parse_with_config(
text: &str,
fallback: ControllerConfig,
) -> Result<Self, InputLogError>
pub fn parse_with_config( text: &str, fallback: ControllerConfig, ) -> Result<Self, InputLogError>
Parses a log; fallback is used when it has no config rows (logs recorded before
config rows existed). Recorded config rows win over fallback.
§Errors
InputLogError for a bad row.
Sourcepub fn controller(&self) -> Result<BufferController, Error>
pub fn controller(&self) -> Result<BufferController, Error>
Trait Implementations§
impl Eq for InputLog
impl StructuralPartialEq for InputLog
Auto Trait Implementations§
impl Forget for InputLog
impl Freeze for InputLog
impl RefUnwindSafe for InputLog
impl Send for InputLog
impl Sync for InputLog
impl Unpin for InputLog
impl UnsafeUnpin for InputLog
impl UnwindSafe for InputLog
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