Struct bevy_api_gen_lib::wrapper::WrappedItem
source · pub struct WrappedItem<'a> {
pub wrapper_name: String,
pub wrapped_type: &'a String,
pub path_components: Cow<'a, [String]>,
pub source: &'a Crate,
pub config: &'a Newtype,
pub item: &'a Item,
pub impl_items: IndexMap<&'a str, Vec<(&'a Impl, &'a Item)>>,
pub implemented_traits: IndexSet<String>,
pub self_impl: Option<&'a Impl>,
pub crates: &'a [Crate],
pub has_global_methods: bool,
}
Fields§
§wrapper_name: String
§wrapped_type: &'a String
§path_components: Cow<'a, [String]>
§source: &'a Crate
§config: &'a Newtype
§item: &'a Item
§impl_items: IndexMap<&'a str, Vec<(&'a Impl, &'a Item)>>
The items coming from all trait implementations
implemented_traits: IndexSet<String>
§self_impl: Option<&'a Impl>
§crates: &'a [Crate]
§has_global_methods: bool
If this type has some things which are “static” this is set to true later
Implementations§
source§impl WrappedItem<'_>
impl WrappedItem<'_>
sourcepub fn write_inline_full_path(&self, writer: &mut PrettyWriter, _: &Args)
pub fn write_inline_full_path(&self, writer: &mut PrettyWriter, _: &Args)
Writes full type path inline corresponding to Reflect::type_name
of each type
As:
ⓘ
this
|
|..........|
my_type_path::Type : Value :
UnaryOps( ...
sourcepub fn write_type_docstring(&self, writer: &mut PrettyWriter, _: &Args)
pub fn write_type_docstring(&self, writer: &mut PrettyWriter, _: &Args)
Writes the docstring for the type over multiple lines
As:
ⓘ
/// generated docstring
/// here
my_macro_key : Value :
UnaryOps(
...
)
+
...
sourcepub fn write_method_docstring(
&self,
id: &Id,
writer: &mut PrettyWriter,
_: &Args
)
pub fn write_method_docstring( &self, id: &Id, writer: &mut PrettyWriter, _: &Args )
Writes the docstring for the given auto method over multiple lines
As:
ⓘ
my_macro_key : Value :
Methods(
/// generated docstring
/// here
my_method(usize) -> u32
)
+
...
sourcepub fn write_impl_block_body(&self, writer: &mut PrettyWriter, _: &Args)
pub fn write_impl_block_body(&self, writer: &mut PrettyWriter, _: &Args)
sourcepub fn write_derive_flags_body(
&mut self,
config: &Config,
writer: &mut PrettyWriter,
args: &Args
)
pub fn write_derive_flags_body( &mut self, config: &Config, writer: &mut PrettyWriter, args: &Args )
Generates all derive flags for the type,
Returns additional imports necessary for the generated methods
ⓘ
my_type::Type : Value:
... // flags go here
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for WrappedItem<'a>
impl<'a> Send for WrappedItem<'a>
impl<'a> Sync for WrappedItem<'a>
impl<'a> Unpin for WrappedItem<'a>
impl<'a> UnwindSafe for WrappedItem<'a>
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