LiveSystemProvider

Struct LiveSystemProvider 

Source
pub struct LiveSystemProvider { /* private fields */ }
Expand description

Provides an implementation of FileProvider that enumerates the required files at the correct paths on a live macOS system. These files are only present on macOS Sierra (10.12) and above. The implemented methods emit error log messages if any are encountered while enumerating files or creating readers, but are otherwise infallible.

§Example

   use macos_unifiedlogs::filesystem::LiveSystemProvider;
   let provider = LiveSystemProvider::default();

Implementations§

Trait Implementations§

Source§

impl Debug for LiveSystemProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LiveSystemProvider

Source§

fn default() -> LiveSystemProvider

Returns the “default value” for a type. Read more
Source§

impl FileProvider for LiveSystemProvider

Source§

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.
Source§

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.
Source§

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.
Source§

fn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>

Check our cached UUIDText data for strings
Source§

fn update_uuid(&mut self, uuid: &str, uuid2: &str)

Update our cached UUIDText data
Source§

fn update_dsc(&mut self, uuid: &str, uuid2: &str)

Update our cached SharedCacheStrings data
Source§

fn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>

Check our cached SharedCacheStrings for strings
Source§

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.
Source§

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.
Source§

fn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>

Provides an iterator of .timesync files from the /var/db/diagnostics/timesync subdirectory.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.