pub struct MagmaDocumentation {
pub ident: Ident,
pub generics: Generics,
pub doc: Option<String>,
pub fields: Vec<MagmaField>,
}Expand description
Holds the parsed structure data required to generate the API docs.
Fields§
§ident: Ident§generics: Generics§doc: Option<String>§fields: Vec<MagmaField>Implementations§
Source§impl MagmaDocumentation
impl MagmaDocumentation
Sourcepub fn from_item(s: &ItemStruct, doc_rec: DocRec) -> Result<Self>
pub fn from_item(s: &ItemStruct, doc_rec: DocRec) -> Result<Self>
Phase 1: Parse the Item into our intermediate representation.
Sourcepub fn generate(&self, import_location: &Path) -> Result<TokenStream>
pub fn generate(&self, import_location: &Path) -> Result<TokenStream>
Phase 2: Generate the TokenStream from the intermediate representation.
Sourcepub fn generate_for_ref(&self, import_location: &Path) -> Result<TokenStream>
pub fn generate_for_ref(&self, import_location: &Path) -> Result<TokenStream>
Same as generate, but implements TypeableRow for FooRef<'_> instead of Foo.
The schema content (fields, types, docs) is identical — only the implementor differs.
Auto Trait Implementations§
impl !Send for MagmaDocumentation
impl !Sync for MagmaDocumentation
impl Freeze for MagmaDocumentation
impl RefUnwindSafe for MagmaDocumentation
impl Unpin for MagmaDocumentation
impl UnsafeUnpin for MagmaDocumentation
impl UnwindSafe for MagmaDocumentation
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