pub struct HeaderEvidence { /* private fields */ }Expand description
A tally of the files whose extension names their language outright, used to
settle the bare .h headers whose extension does not.
The rule is the plain reading of a mixed tree: a project written mostly in
C++ spells its headers .h because the extension is conventional, not
because those headers are C. A project written mostly in C means C.
Only unambiguous extensions count, so the headers being settled never vote on their own language, and the verdict does not depend on how many of them there are.
Implementations§
Source§impl HeaderEvidence
impl HeaderEvidence
Sourcepub const fn observe(&mut self, classification: Classification)
pub const fn observe(&mut self, classification: Classification)
Count one classified file, ignoring the ones that prove nothing:
Rust sources, and the .h headers awaiting this verdict.
Sourcepub const fn verdict(self) -> Option<Language>
pub const fn verdict(self) -> Option<Language>
The language to read bare .h headers as, when the tree says.
C++ only when the tree holds strictly more unambiguous C++ files than C
ones. None when it holds neither, which is not a tie to be broken
but a question this tally cannot answer: a header-only library has no
files outside the headers, so there is nothing here to read the headers
against.
Trait Implementations§
Source§impl Clone for HeaderEvidence
impl Clone for HeaderEvidence
Source§fn clone(&self) -> HeaderEvidence
fn clone(&self) -> HeaderEvidence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HeaderEvidence
Source§impl Debug for HeaderEvidence
impl Debug for HeaderEvidence
Source§impl Default for HeaderEvidence
impl Default for HeaderEvidence
Source§fn default() -> HeaderEvidence
fn default() -> HeaderEvidence
impl Eq for HeaderEvidence
Source§impl PartialEq for HeaderEvidence
impl PartialEq for HeaderEvidence
impl StructuralPartialEq for HeaderEvidence
Auto Trait Implementations§
impl Freeze for HeaderEvidence
impl RefUnwindSafe for HeaderEvidence
impl Send for HeaderEvidence
impl Sync for HeaderEvidence
impl Unpin for HeaderEvidence
impl UnsafeUnpin for HeaderEvidence
impl UnwindSafe for HeaderEvidence
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.