pub trait FileProvider {
// Required methods
fn tracev3_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>;
fn uuidtext_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>;
fn read_uuidtext(&self, uuid: &str) -> Result<UUIDText, Error>;
fn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>;
fn update_uuid(&mut self, uuid: &str, uuid2: &str);
fn dsc_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>;
fn read_dsc_uuid(&self, uuid: &str) -> Result<SharedCacheStrings, Error>;
fn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>;
fn update_dsc(&mut self, uuid: &str, uuid2: &str);
fn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>;
}Expand description
Implementing this trait allows library consumers to provide the files required by the parser in arbitrary formats, as long as they are provided as an iterator of items that implement [Read].
For help mapping files to the correct filetype, see the
LogFileType enum’s
From<&Path> implementation.
Required Methods§
Sourcefn tracev3_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn tracev3_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of .tracev3 files from the
/private/var/db/diagnostics/((HighVolume|Signpost|Trace|Special)/, plus the
livedata.LogData.tracev3 file if it was collected via log collect.
Sourcefn uuidtext_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn uuidtext_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of UUIDText string files from the /var/db/uuidtext/XX/ directories,
where the XX is any two uppercase hex characters, along with the filename (i.e., the
filename from the source file. This should be a 30-character name containing only hex
digits. This should be a 30-character name containing only hex digits. It is important that
this is. accurate, or else strings will not be able to be referenced from the source file.
Sourcefn read_uuidtext(&self, uuid: &str) -> Result<UUIDText, Error>
fn read_uuidtext(&self, uuid: &str) -> Result<UUIDText, Error>
Reads a provided UUID file at runtime.
The UUID is obtaind by parsing the tracev3 files. Reads will fail if the UUID does not exist
This avoids having to read all UUIDText files into memory.
Sourcefn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>
fn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>
Check our cached UUIDText data for strings
Sourcefn update_uuid(&mut self, uuid: &str, uuid2: &str)
fn update_uuid(&mut self, uuid: &str, uuid2: &str)
Update our cached UUIDText data
Sourcefn dsc_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn dsc_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of shared string files from the /var/db/uuidtext/dsc subdirectory,
along with the filename (i.e., the filename from the source file). This should be a
30-character name containing only hex digits. It is important that this is. accurate, or
else strings will not be able to be referenced from the source file.
Sourcefn read_dsc_uuid(&self, uuid: &str) -> Result<SharedCacheStrings, Error>
fn read_dsc_uuid(&self, uuid: &str) -> Result<SharedCacheStrings, Error>
Reads a provided UUID file at runtime.
The UUID is obtaind by parsing the tracev3 files. Reads will fail if the UUID does not exist
This avoids having to read all SharedCacheStrings files into memory.
Sourcefn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>
fn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>
Check our cached SharedCacheStrings for strings
Sourcefn update_dsc(&mut self, uuid: &str, uuid2: &str)
fn update_dsc(&mut self, uuid: &str, uuid2: &str)
Update our cached SharedCacheStrings data
Sourcefn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of .timesync files from the /var/db/diagnostics/timesync subdirectory.