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<'_>

source

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( ...
source

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(
 ...
 )
 +
 ...
source

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
 )
 +
 ...
source

pub fn write_impl_block_body(&self, writer: &mut PrettyWriter, _: &Args)

Writes the contents of the impl block for this wrapper

As:

    impl {
    ... // this!
    }
source

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§

source§

impl<'a> Debug for WrappedItem<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.