pub enum HelperAttr {
ChapterNum(usize),
ChapterNumSlug(Vec<usize>),
ChapterName(String),
ChapterNameSlug(Vec<String>),
ChapterBlurb(String),
}
Expand description
Attribute helpers
When written in snake case (eg. ChapterNum -> chapter_num), the variants of this enum correspond to the
- helper attributes supported by the
user_doc_item
derive macro:
ⓘ
#[derive(user_doc_item)]
// This line will NOT be in the produced documentation.
struct SomeStruct {
#[chapter_name("A chapter")]
#[chapter_num(333)]
// This line will be in the produced documentation.
some_field: u8
}
- arguments supported by the
user_doc_fn
attribute macro:
ⓘ
#[user_doc_fn(chapter_name("A chapter"), chapter_num(333))]
// This line will be in the produced documentation.
fn some_fn() -> () {}
The preceding examples both produce the same user-facing documentation. If both examples occurred in the same project, however, one would overwrite the other.
Variants§
ChapterNum(usize)
Number of this chapter
ChapterNumSlug(Vec<usize>)
Number-path up to and including this chapter
ChapterName(String)
Name of this chapter
ChapterNameSlug(Vec<String>)
Name-path up to and including this chapter
ChapterBlurb(String)
A blurb to add to the page for the chapter
Implementations§
Source§impl HelperAttr
impl HelperAttr
Sourcepub fn from_attribute_args(
a: &Vec<NestedMeta>,
) -> Result<Vec<HelperAttr>, Error>
pub fn from_attribute_args( a: &Vec<NestedMeta>, ) -> Result<Vec<HelperAttr>, Error>
Instantiate from an AttributeArgs (Vec
Sourcepub fn from_attribute(a: &Attribute) -> Result<HelperAttr, Error>
pub fn from_attribute(a: &Attribute) -> Result<HelperAttr, Error>
Instantiate from an Attribute if said Attribute represents a valid HelperAttr
Trait Implementations§
Source§impl AsRef<str> for HelperAttr
impl AsRef<str> for HelperAttr
Source§impl Clone for HelperAttr
impl Clone for HelperAttr
Source§fn clone(&self) -> HelperAttr
fn clone(&self) -> HelperAttr
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HelperAttr
impl Debug for HelperAttr
Source§impl IntoEnumIterator for HelperAttr
impl IntoEnumIterator for HelperAttr
type Iterator = HelperAttrIter
fn iter() -> HelperAttrIter ⓘ
Source§impl Ord for HelperAttr
impl Ord for HelperAttr
Source§fn cmp(&self, other: &HelperAttr) -> Ordering
fn cmp(&self, other: &HelperAttr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for HelperAttr
impl PartialEq for HelperAttr
Source§impl PartialOrd for HelperAttr
impl PartialOrd for HelperAttr
impl Eq for HelperAttr
impl StructuralPartialEq for HelperAttr
Auto Trait Implementations§
impl Freeze for HelperAttr
impl RefUnwindSafe for HelperAttr
impl Send for HelperAttr
impl Sync for HelperAttr
impl Unpin for HelperAttr
impl UnwindSafe for HelperAttr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key
and return true
if they are equal.