pub struct VersionCheckResult<'a> {
pub objects: Box<[&'a ObjectData]>,
pub libs: Box<[&'a Library]>,
pub index: Option<&'a AssetIndex>,
pub client: Option<&'a DownloadData>,
}Expand description
Result of a version check operation containing references to problematic files.
This structure holds references to objects and libraries that were identified as having errors or inconsistencies during the verification process. The lifetime parameter ’a ensures that the references remain valid as long as the original data in the InstallationVerifier exists.
§Fields
- objects - References to problematic object data files
- libs - References to problematic library files
§Example Usage
let verifier = InstallationVerifier::new(path);
let result = verifier.verify_version();
// Process problematic objects
for object in result.objects.iter() {
println!("Problematic object: {:?}", object);
}
// Check problematic libs...Fields§
§objects: Box<[&'a ObjectData]>§libs: Box<[&'a Library]>§index: Option<&'a AssetIndex>§client: Option<&'a DownloadData>Implementations§
Source§impl VersionCheckResult<'_>
impl VersionCheckResult<'_>
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true if the verification found no problems.
This is a convenience method that checks if both the objects and libraries arrays are empty, indicating a successful verification.
§Returns
true if no problematic objects or libraries were found, false
otherwise.
§Example
let result = verifier.verify_version();
if result.is_valid() {
println!("Installation is clean!");
}Sourcepub fn total_problems(&self) -> usize
pub fn total_problems(&self) -> usize
Returns the total number of problematic items found.
This combines the count of problematic objects and libraries into a single number for quick assessment of verification results.
§Returns
The total count of problematic files.
Sourcepub fn object_count(&self) -> usize
pub fn object_count(&self) -> usize
Auto Trait Implementations§
impl<'a> Freeze for VersionCheckResult<'a>
impl<'a> RefUnwindSafe for VersionCheckResult<'a>
impl<'a> Send for VersionCheckResult<'a>
impl<'a> Sync for VersionCheckResult<'a>
impl<'a> Unpin for VersionCheckResult<'a>
impl<'a> UnwindSafe for VersionCheckResult<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more