pub struct FileRecorder { /* private fields */ }
Expand description
A recorder that writes events to a file.
The serialization format is determined by the file extension.
Supported extensions are .bin
for Bincode and .json
for JSON.
Implementations§
Source§impl FileRecorder
impl FileRecorder
Sourcepub fn new(path: &Path) -> MuseResult<Self>
pub fn new(path: &Path) -> MuseResult<Self>
Creates a new FileRecorder
.
§Arguments
path
: The file path to write recordings to.
§Errors
Returns a MuseError::Recording
if the file cannot be opened.
Trait Implementations§
Source§impl Recorder for FileRecorder
impl Recorder for FileRecorder
Source§fn record<'life0, 'async_trait>(
&'life0 mut self,
event: RecordedEventWithTime,
) -> Pin<Box<dyn Future<Output = MuseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record<'life0, 'async_trait>(
&'life0 mut self,
event: RecordedEventWithTime,
) -> Pin<Box<dyn Future<Output = MuseResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Records an event to the file.
§Arguments
event
: The [RecordedEvent
] to record.
§Errors
Returns a MuseError::Recording
if serialization fails.
Auto Trait Implementations§
impl Freeze for FileRecorder
impl RefUnwindSafe for FileRecorder
impl Send for FileRecorder
impl Sync for FileRecorder
impl Unpin for FileRecorder
impl UnwindSafe for FileRecorder
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