/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
usecrate::result::{Error, Result}; use log::{error, trace}; use std::ffi::CStr; use std::fs::File; use std::io::{Read, Result as IOResult, Seek, SeekFrom}; use std::path::Path;
pubmod result;
#[cfg(target_os = "windows")] mod windows;
#[cfg(any(target_os = "macos", target_os = "ios"))] mod macos;
// This does actually depend on the platform, so it's not in this // impl nor source file but in the platform-dependant modules listed at // the end of this file self.get_build_id_bytes(&buffer, note_name)
}
pubfn read_string_build_id(&mutself, note_name: &str) -> Result<String> {
trace!("BuildIdReader::read_string_build_id {}", note_name); let b = self.read_raw_build_id(note_name).map_err(|err| {
error!( "BuildIdReader::read_string_build_id failed to read raw build id with error {}",
err
);
err
})?; Self::string_from_bytes(&b)
}
#[cfg(any(target_os = "macos", target_os = "ios"))] /// SAFETY: Caller need to ensure that `T` is safe to cast to bytes pubunsafefn copy<T>(&mutself, offset: usize) -> Result<T> {
trace!("BuildIdReader::copy @{}", offset); self.copy_array(offset, 1)
.map(|v| v.into_iter().next().unwrap())
}
#[cfg(any(target_os = "macos", target_os = "ios"))] /// SAFETY: Caller need to ensure that `T` is safe to cast to bytes pubunsafefn copy_array<T>(&mutself, offset: usize, num: usize) -> Result<Vec<T>> {
trace!("BuildIdReader::copy_array @{} : {} num", offset, num); letmut uninit: Vec<std::mem::MaybeUninit<T>> = Vec::with_capacity(num); for _ in0..num {
uninit.push(std::mem::MaybeUninit::uninit());
} let slice = std::slice::from_raw_parts_mut(
uninit.as_mut_ptr() as *mut u8,
uninit.len() * std::mem::size_of::<T>(),
); self.copy_bytes_into(offset, slice)
.map_err(|source| Error::CopyBytes {
offset,
count: slice.len(),
source,
})?;
Ok(std::mem::transmute(uninit))
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.