pub struct LogFile(/* private fields */);
Implementations§
Source§impl LogFile
impl LogFile
Sourcepub fn open(filename: &str) -> Option<Self>
pub fn open(filename: &str) -> Option<Self>
Examples found in repository?
examples/parse_log.rs (line 6)
5fn main() {
6 let log_file = LogFile::open(&env::args().nth(1).expect("Couldn't not get argument."))
7 .expect("Could not open file");
8
9 let log_info = log_file
10 .info()
11 .expect("Couldn't get information about the log");
12 println!("{:#?}", log_info);
13
14 println!("Buffers:");
15 for (index, buffer_info) in log_file.into_iter().enumerate() {
16 let buffer_info = buffer_info.expect("Couldn't get info about buffer {index}.");
17 println!("{:#?}", buffer_info);
18
19 log_file
20 .parse_static(index as i32, my_callback)
21 .expect("LogFile::parse_static() failed");
22 }
23}
Sourcepub fn info(&self) -> Result<LogInfo, i32>
pub fn info(&self) -> Result<LogInfo, i32>
Examples found in repository?
examples/parse_log.rs (line 10)
5fn main() {
6 let log_file = LogFile::open(&env::args().nth(1).expect("Couldn't not get argument."))
7 .expect("Could not open file");
8
9 let log_info = log_file
10 .info()
11 .expect("Couldn't get information about the log");
12 println!("{:#?}", log_info);
13
14 println!("Buffers:");
15 for (index, buffer_info) in log_file.into_iter().enumerate() {
16 let buffer_info = buffer_info.expect("Couldn't get info about buffer {index}.");
17 println!("{:#?}", buffer_info);
18
19 log_file
20 .parse_static(index as i32, my_callback)
21 .expect("LogFile::parse_static() failed");
22 }
23}
pub fn buffer_info(&self, buffer_index: i32) -> Result<BufferInfo, i32>
Sourcepub fn parse_static<F>(&self, buffer_index: i32, callback: F) -> Result<(), i32>
pub fn parse_static<F>(&self, buffer_index: i32, callback: F) -> Result<(), i32>
Examples found in repository?
examples/parse_log.rs (line 20)
5fn main() {
6 let log_file = LogFile::open(&env::args().nth(1).expect("Couldn't not get argument."))
7 .expect("Could not open file");
8
9 let log_info = log_file
10 .info()
11 .expect("Couldn't get information about the log");
12 println!("{:#?}", log_info);
13
14 println!("Buffers:");
15 for (index, buffer_info) in log_file.into_iter().enumerate() {
16 let buffer_info = buffer_info.expect("Couldn't get info about buffer {index}.");
17 println!("{:#?}", buffer_info);
18
19 log_file
20 .parse_static(index as i32, my_callback)
21 .expect("LogFile::parse_static() failed");
22 }
23}
pub fn parse_dynamic<F>( &self, buffer_index: i32, callback: F, ) -> Result<(), i32>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogFile
impl RefUnwindSafe for LogFile
impl !Send for LogFile
impl !Sync for LogFile
impl Unpin for LogFile
impl UnwindSafe for LogFile
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