pub struct FileReplayer { /* private fields */ }
Expand description
A replayer that reads events from a recording file.
The serialization format is determined by the file extension.
Supported extensions are .bin
for Bincode and .json
for JSON.
Implementations§
Source§impl FileReplayer
impl FileReplayer
Sourcepub async fn new(path: &Path) -> Result<FileReplayer, MuseError>
pub async fn new(path: &Path) -> Result<FileReplayer, MuseError>
Creates a new FileReplayer
.
§Arguments
path
: The file path to read recordings from.
§Errors
Returns a MuseError::Replaying
if the file cannot be opened.
Trait Implementations§
Source§impl Replayer for FileReplayer
impl Replayer for FileReplayer
fn next_event<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RecordedEventWithTime>, MuseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileReplayer: 'async_trait,
Auto Trait Implementations§
impl !Freeze for FileReplayer
impl !RefUnwindSafe for FileReplayer
impl Send for FileReplayer
impl Sync for FileReplayer
impl Unpin for FileReplayer
impl !UnwindSafe for FileReplayer
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