pub struct Item {
pub id: Value,
pub name: Option<String>,
pub docs: Option<String>,
pub attrs: Vec<Value>,
pub deprecation: Option<Deprecation>,
pub inner: Value,
pub span: Option<Span>,
pub visibility: Option<Value>,
pub links: Option<HashMap<String, Value>>,
}Expand description
A single item in the rustdoc JSON index.
Fields§
§id: Value§name: Option<String>§docs: Option<String>§attrs: Vec<Value>§deprecation: Option<Deprecation>§inner: ValueTagged union: {“function”: {…}}, {“struct”: {…}}, {“module”: {…}}, etc.
span: Option<Span>§visibility: Option<Value>§links: Option<HashMap<String, Value>>Implementations§
Source§impl Item
impl Item
Sourcepub fn kind(&self) -> Option<&str>
pub fn kind(&self) -> Option<&str>
Returns the kind string from inner, e.g. “function”, “struct”, “module”.
Sourcepub fn inner_for(&self, kind: &str) -> Option<&Value>
pub fn inner_for(&self, kind: &str) -> Option<&Value>
Returns inner[kind] for a given kind string.
Sourcepub fn attr_strings(&self) -> Vec<String>
pub fn attr_strings(&self) -> Vec<String>
Extract attribute strings from the v57 attrs array.
Each element is {"other": "#[...]"} — returns the inner string values.
Sourcepub fn doc_summary(&self) -> String
pub fn doc_summary(&self) -> String
Doc summary: first non-empty line of the doc comment.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Item
impl<'de> Deserialize<'de> for Item
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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