pub struct ParserMetadata {
pub description: &'static str,
pub file_patterns: &'static [&'static str],
pub package_type: &'static str,
pub primary_language: &'static str,
pub documentation_url: Option<&'static str>,
}Expand description
Registered detection-surface metadata for auto-generating documentation.
This module provides the ParserMetadata type used by parser metadata()
trait methods and by bin/generate_supported_formats.rs to automatically
generate docs/SUPPORTED_FORMATS.md.
Fields are used by the xtask but not in library code, so we allow dead_code warnings for library builds.
Fields§
§description: &'static strHuman-readable description (e.g., “npm package.json manifest”)
file_patterns: &'static [&'static str]File patterns this parser matches (e.g., ["**/package.json"]).
Documentation of the intended surface, not an executable contract, and
deliberately not asserted against is_match. The two cannot be held
equal: many parsers gate on content or path context rather than the
filename alone — an .apk is claimed only if its magic bytes match, a
METADATA only inside a wheel’s dist-info — so a pattern describes what
a user should expect to be recognised, while is_match decides whether a
specific file on disk actually is.
Two consequences worth knowing when editing these:
- A pattern here can be broader than
is_match, and legitimately so. Keep it recognisable to a user readingdocs/SUPPORTED_FORMATS.mdrather than mechanically exact. - A surface that is not expressible as a glob at all — detector-driven,
scanner-gated, or resolved relative to the scan root — uses the
<...>convention instead (e.g."<compiled Go binaries with Go build info>"), which the generated table renders as prose. Prefer that over a glob that would advertise files the parser declines.
package_type: &'static strPackage type identifier (e.g., “npm”, “pypi”, “maven”)
primary_language: &'static strPrimary programming language (e.g., “JavaScript”, “Python”)
documentation_url: Option<&'static str>Optional documentation URL
Trait Implementations§
Source§impl Clone for ParserMetadata
impl Clone for ParserMetadata
Source§fn clone(&self) -> ParserMetadata
fn clone(&self) -> ParserMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ParserMetadata
impl RefUnwindSafe for ParserMetadata
impl Send for ParserMetadata
impl Sync for ParserMetadata
impl Unpin for ParserMetadata
impl UnsafeUnpin for ParserMetadata
impl UnwindSafe for ParserMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.