pub struct PluginTypeInfo {
pub name: SmolStr,
pub attributes: AttributeList,
pub generics: GenericParamsInfo,
pub members_info: Vec<MemberInfo>,
pub type_variant: TypeVariant,
}
Expand description
Information for the type being processed by a plugin.
Fields§
§name: SmolStr
§attributes: AttributeList
§generics: GenericParamsInfo
§members_info: Vec<MemberInfo>
§type_variant: TypeVariant
Implementations§
Source§impl PluginTypeInfo
impl PluginTypeInfo
Sourcepub fn new(db: &dyn SyntaxGroup, item_ast: &ModuleItem) -> Option<Self>
pub fn new(db: &dyn SyntaxGroup, item_ast: &ModuleItem) -> 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 its 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 Freeze for PluginTypeInfo
impl RefUnwindSafe for PluginTypeInfo
impl Send for PluginTypeInfo
impl Sync for PluginTypeInfo
impl Unpin for PluginTypeInfo
impl UnwindSafe for PluginTypeInfo
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<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