pub struct GeneratedPackage { /* private fields */ }Expand description
Everything one generator run produces.
A models-only run has no children and behaves exactly like the single file
it has always written. A run with operations adds the children, and the root
becomes a facade of #[path] module declarations and re-exports.
Implementations§
Source§impl GeneratedPackage
impl GeneratedPackage
Sourcepub fn new(root: impl Into<String>, children: Vec<GeneratedFile>) -> Self
pub fn new(root: impl Into<String>, children: Vec<GeneratedFile>) -> Self
Build a package from the root source and its companion files.
Sourcepub fn root_source(&self) -> &str
pub fn root_source(&self) -> &str
The source of the file at the configured output path.
Sourcepub fn children(&self) -> &[GeneratedFile]
pub fn children(&self) -> &[GeneratedFile]
The companion module files, relative to the root file’s directory.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
How many files a write produces.
Sourcepub fn combined_source(&self) -> String
pub fn combined_source(&self) -> String
Every file’s body behind one header, for a scan that has to see all of the generated code at once.
Dependency detection and the empty-output check both read the code as text. Splitting the output across files must not change what either one concludes, so both read this instead of any single file.
Trait Implementations§
Source§impl Clone for GeneratedPackage
impl Clone for GeneratedPackage
Source§fn clone(&self) -> GeneratedPackage
fn clone(&self) -> GeneratedPackage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeneratedPackage
impl Debug for GeneratedPackage
impl Eq for GeneratedPackage
Source§impl PartialEq for GeneratedPackage
impl PartialEq for GeneratedPackage
impl StructuralPartialEq for GeneratedPackage
Auto Trait Implementations§
impl Freeze for GeneratedPackage
impl RefUnwindSafe for GeneratedPackage
impl Send for GeneratedPackage
impl Sync for GeneratedPackage
impl Unpin for GeneratedPackage
impl UnsafeUnpin for GeneratedPackage
impl UnwindSafe for GeneratedPackage
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,
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.