pub struct Log {
header: Vec<String>,
entries: Vec<Entry>,
clock: fn() -> i64,
path: Option<PathBuf>,
file: Option<File>,
}Fields§
§header: Vec<String>§entries: Vec<Entry>§clock: fn() -> i64§path: Option<PathBuf>§file: Option<File>Implementations§
Source§impl Log
impl Log
Sourcepub fn create(header: Vec<String>, path: Option<PathBuf>) -> Log
pub fn create(header: Vec<String>, path: Option<PathBuf>) -> Log
header heads the file and not the pane: it is what support asks for
first, which a user reading along does not need. A file that cannot be
opened leaves a log without one.
Sourcepub fn with_clock(
header: Vec<String>,
path: Option<PathBuf>,
clock: fn() -> i64,
) -> Log
pub fn with_clock( header: Vec<String>, path: Option<PathBuf>, clock: fn() -> i64, ) -> Log
create, telling the time by clock, so a test can name the moment.
Sourcepub fn attach(&mut self, path: PathBuf)
pub fn attach(&mut self, path: PathBuf)
Points the log at a file, writing out the header and everything said so far, since the game folder it belongs in is only known partway through the run; a second call follows the run to another folder.
Sourcepub fn line(&mut self, text: impl Into<String>)
pub fn line(&mut self, text: impl Into<String>)
Flushed at once, so a run that dies still leaves the line saying what it was doing.
Sourcepub fn lines(&self) -> impl Iterator<Item = &str>
pub fn lines(&self) -> impl Iterator<Item = &str>
As the pane shows them: without the times, which only the file needs.
Sourcepub fn path(&self) -> Option<&Path>
pub fn path(&self) -> Option<&Path>
None when no file was written, so the summary never points at one that does not exist.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for Log
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnsafeUnpin for Log
impl UnwindSafe for Log
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