pub enum ItemKind {
Show 15 variants
Module,
Struct,
Enum,
Union,
Trait,
Function,
Method,
Constant,
Static,
TypeAlias,
Macro,
Field,
Variant,
AssociatedType,
AssociatedConstant,
}Expand description
What an item is, in the vocabulary rustdoc and the reference use. The kind decides what the policy may ask of an item, so it is recorded rather than inferred later.
Variants§
Module
A module: mod, inline or in its own file.
Struct
A struct.
Enum
An enum.
Union
A union.
Trait
A trait.
Function
A free function, or an associated function with no receiver.
Method
A method: an associated function taking a receiver.
Constant
A const.
Static
A static.
TypeAlias
A type alias.
Macro
A macro_rules! carrying #[macro_export].
Field
A field of a public struct.
Variant
A variant of a public enum.
AssociatedType
An associated type of a trait: type Output;.
Kept apart from ItemKind::AssociatedConstant because rustdoc keeps them apart:
one is anchored associatedtype. on its trait’s page and the other
associatedconstant., so a single kind could not say where either is documented.
AssociatedConstant
An associated constant of a trait: const LIMIT: usize;, with a default or without.
Implementations§
Source§impl ItemKind
impl ItemKind
Sourcepub fn noun(self) -> &'static str
pub fn noun(self) -> &'static str
The word a finding uses for an item of this kind.
use majordomus_cli::quality::source::ItemKind;
assert_eq!(ItemKind::Method.noun(), "method");
assert_eq!(ItemKind::TypeAlias.noun(), "type alias");Sourcepub fn carries_behaviour(self) -> bool
pub fn carries_behaviour(self) -> bool
Does an item of this kind carry behaviour a reader could be shown running?
A module, a type, a function, a method and an exported macro do. A field, a variant, a constant, a static, a type alias and an associated item are values and names: an example of one is an example of whatever uses it, and demanding one buys the placeholder this subsystem exists to refuse.
use majordomus_cli::quality::source::ItemKind;
assert!(ItemKind::Function.carries_behaviour());
assert!(!ItemKind::Constant.carries_behaviour());Trait Implementations§
impl Copy for ItemKind
Source§impl<'de> Deserialize<'de> for ItemKind
impl<'de> Deserialize<'de> for ItemKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ItemKind
Source§impl JsonSchema for ItemKind
impl JsonSchema for ItemKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for ItemKind
impl Ord for ItemKind
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ItemKind
impl PartialOrd for ItemKind
impl StructuralPartialEq for ItemKind
Auto Trait Implementations§
impl Freeze for ItemKind
impl RefUnwindSafe for ItemKind
impl Send for ItemKind
impl Sync for ItemKind
impl Unpin for ItemKind
impl UnsafeUnpin for ItemKind
impl UnwindSafe for ItemKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.