pub struct PluginTypeInfo<'a> {
pub name: &'a str,
pub attributes: AttributeList<'a>,
pub generics: GenericParamsInfo<'a>,
pub members_info: Vec<MemberInfo<'a>>,
pub type_variant: TypeVariant,
}Expand description
Information for the type being processed by a plugin.
Fields§
§name: &'a str§attributes: AttributeList<'a>§generics: GenericParamsInfo<'a>§members_info: Vec<MemberInfo<'a>>§type_variant: TypeVariantImplementations§
Source§impl<'a> PluginTypeInfo<'a>
impl<'a> PluginTypeInfo<'a>
Sourcepub fn new(db: &'a dyn Database, item_ast: &ModuleItem<'a>) -> Option<Self>
pub fn new(db: &'a dyn Database, item_ast: &ModuleItem<'a>) -> Option<Self>
Extracts the information on the type being derived.
Sourcepub fn impl_header(
&self,
derived_trait: &str,
dependent_traits: &[&str],
) -> String
pub fn impl_header( &self, derived_trait: &str, dependent_traits: &[&str], ) -> String
Returns a full derived impl header - given derived_trait - and the dependent_traits
required for all its members.
Sourcepub fn impl_generics(
&self,
dependent_traits: &[&str],
dep_req: fn(&str, &str) -> String,
) -> Vec<String>
pub fn impl_generics( &self, dependent_traits: &[&str], dep_req: fn(&str, &str) -> String, ) -> Vec<String>
Returns the expected generics parameters for a derived impl definition.
dep_req - is the formatting of a trait and the type as a concrete trait.
Sourcepub fn full_typename(&self) -> String
pub fn full_typename(&self) -> String
Formats the full typename of the type, including generic args.
Auto Trait Implementations§
impl<'a> Freeze for PluginTypeInfo<'a>
impl<'a> RefUnwindSafe for PluginTypeInfo<'a>
impl<'a> Send for PluginTypeInfo<'a>
impl<'a> Sync for PluginTypeInfo<'a>
impl<'a> Unpin for PluginTypeInfo<'a>
impl<'a> UnwindSafe for PluginTypeInfo<'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
Source§impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more