pub enum ItemKind {
Show 14 variants
Module,
Struct,
Trait,
Enum,
Union,
Fn,
Type,
Constant,
Static,
Macro,
Attribute,
Derive,
Variant,
StructField,
}Expand description
Canonical rustdoc item kinds used by docs.rs HTML.
Variants§
Module
Module page.
Struct
Struct page.
Trait
Trait page.
Enum
Enum page.
Union
Union page.
Fn
Function or method page.
Type
Type alias page.
Constant
Constant page.
Static
Static page.
Macro
Macro page.
Attribute
Attribute macro page.
Derive
Derive macro page.
Variant
Enum variant — always a member of its enum, never its own page.
StructField
Struct or union field — always a member of its type, never its own page.
Implementations§
Source§impl ItemKind
impl ItemKind
Sourcepub fn owns_page(self) -> bool
pub fn owns_page(self) -> bool
Whether rustdoc emits a standalone {prefix}.{name}.html page for this kind.
Self::Variant and Self::StructField return false: rustdoc renders
them only as anchors inside the parent’s page. Asking for one without a
parent-qualified path must fail with that explanation, because the
alternative — falling through to the free-item branch — would build
variant.Some.html, a URL no rustdoc has ever served.
Sourcepub fn file_prefix(self) -> Option<&'static str>
pub fn file_prefix(self) -> Option<&'static str>
Filename prefix in rustdoc HTML (e.g. struct, fn, attr, constant).
None for kinds that own no page (Self::owns_page); callers building a
free-item URL must reject those before reaching here.
Modern rustdoc/docs.rs uses constant.NAME.html (not legacy const.NAME.html).
Sourcepub fn parse(input: &str) -> AppResult<Self>
pub fn parse(input: &str) -> AppResult<Self>
Parse CLI / filter aliases into canonical kind.
§Errors
Returns crate::error::ErrorKind::InvalidInput when input is not a known kind alias.
Sourcepub fn parse_with_echo(input: &str) -> AppResult<(Self, &'static str)>
pub fn parse_with_echo(input: &str) -> AppResult<(Self, &'static str)>
Parse kind for URL building plus the wire echo string for item_type.
method maps to ItemKind::Fn for rustdoc URLs but echoes as "method".
§Errors
Returns crate::error::ErrorKind::InvalidInput when input is not a known kind alias.
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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.