#[non_exhaustive]pub struct PkgContextInfo {
pub notes: Vec<Note>,
pub unmodelled: Vec<String>,
/* private fields */
}Expand description
A parsed pkgContextInfo.json.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.notes: Vec<Note>Fields that were present but wrongly typed, and so skipped.
unmodelled: Vec<String>JSON paths of fields this model has no place for.
Implementations§
Source§impl PkgContextInfo
impl PkgContextInfo
Sourcepub fn packages(&self) -> &[PkgContext]
pub fn packages(&self) -> &[PkgContext]
Every package, sorted by name.
Sourcepub fn get(&self, name: &str) -> Option<&PkgContext>
pub fn get(&self, name: &str) -> Option<&PkgContext>
The package code refers to as name.
Sourcepub fn locate<'r>(&self, record: &'r str) -> Option<RecordOwner<'_, 'r>>
pub fn locate<'r>(&self, record: &'r str) -> Option<RecordOwner<'_, 'r>>
Split a normalized record name (&@ohos/crypto-js/src/main/js/aes&2.0.0)
and find the package it belongs to: the longest package name that
is a whole-segment prefix of the part between the &s. Import
requests work too once their @normalized:N&<module>& head is cut
off.
None for names without two & (the bundle/module/ets/… form)
and for packages missing from the table.
Sourcepub fn summary_lines(&self) -> Vec<String>
pub fn summary_lines(&self) -> Vec<String>
One package line per package, sorted by name, then unmodelled
and note lines.
Sourcepub fn summary(&self) -> String
pub fn summary(&self) -> String
PkgContextInfo::summary_lines joined, each line
newline-terminated.
Trait Implementations§
Source§impl Clone for PkgContextInfo
impl Clone for PkgContextInfo
Source§impl Debug for PkgContextInfo
impl Debug for PkgContextInfo
Source§impl PartialEq for PkgContextInfo
impl PartialEq for PkgContextInfo
impl StructuralPartialEq for PkgContextInfo
Auto Trait Implementations§
impl Forget for PkgContextInfo
impl Freeze for PkgContextInfo
impl Move for PkgContextInfo
impl RefUnwindSafe for PkgContextInfo
impl Send for PkgContextInfo
impl Sync for PkgContextInfo
impl Unpin for PkgContextInfo
impl UnsafeUnpin for PkgContextInfo
impl UnwindSafe for PkgContextInfo
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