#[non_exhaustive]pub struct Module {
pub doc: Vec<String>,
pub uses: Vec<String>,
pub derives: Vec<Derive>,
pub items: Vec<Item>,
pub root: Root,
}Expand description
A module to generate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.doc: Vec<String>Module doc lines, without //!, written after the // @generated marker.
const COMMAND: &str = "cargo codegen";
Module::new(vec![]).with_doc(vec![
"The block catalogue.".into(),
String::new(),
format!("Regenerate with `{COMMAND}`. Edit `codegen/src/spec.rs`."),
String::new(),
"Source: reference manual, revision 4, 2025-10-09.".into(),
]);uses: Vec<String>use lines, each written as use <line>;.
derives: Vec<Derive>Extra derives for every struct and enum, after Debug, Clone, PartialEq.
Derives that name a cfg follow in one #[cfg_attr(..)] per predicate.
items: Vec<Item>The items, in output order.
root: RootThe runtime path and prelude spelling.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Send for Module
impl !Sync for Module
impl Freeze for Module
impl RefUnwindSafe for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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