Struct tramex_tools::interface::interface_file::file_handler::File
source · pub struct File {
pub file_path: PathBuf,
pub file_content: Vec<String>,
pub full_read: bool,
pub available: bool,
/* private fields */
}
Expand description
Data structure to store the file.
Fields§
§file_path: PathBuf
Path of the file.
file_content: Vec<String>
Content of the file.
full_read: bool
Full read status of the file.
available: bool
Available
Implementations§
source§impl File
impl File
sourcepub fn new_file_content(file_path: PathBuf, file_content: String) -> Self
pub fn new_file_content(file_path: PathBuf, file_content: String) -> Self
set file mode using a path and content
sourcepub fn change_nb_read(&mut self, toread: usize)
pub fn change_nb_read(&mut self, toread: usize)
To update the number of log to read per batch
sourcepub fn process(&mut self) -> (Vec<Trace>, Vec<TramexError>)
pub fn process(&mut self) -> (Vec<Trace>, Vec<TramexError>)
To process the file and parse a batch of log
sourcepub fn process_string(
lines: &Vec<String>,
nb_to_read: usize,
ix: &mut usize
) -> (Vec<Trace>, Vec<TramexError>)
pub fn process_string( lines: &Vec<String>, nb_to_read: usize, ix: &mut usize ) -> (Vec<Trace>, Vec<TramexError>)
To process a string passed in argument, with index and batch to read
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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