pub struct TraitDef {Show 16 fields
pub fqcn: Arc<str>,
pub short_name: Arc<str>,
pub is_api: bool,
pub own_methods: MemberMap<Arc<MethodDef>>,
pub own_properties: MemberMap<PropertyDef>,
pub own_constants: MemberMap<ConstantDef>,
pub template_params: Vec<TemplateParam>,
pub traits: Vec<Arc<str>>,
pub location: Option<Location>,
pub trait_use_locations: Vec<(Arc<str>, Location)>,
pub trait_use_type_args: Vec<(Arc<str>, Vec<Type>)>,
pub is_immutable: bool,
pub require_extends: Vec<Arc<str>>,
pub require_implements: Vec<Arc<str>>,
pub deprecated: Option<Arc<str>>,
pub type_aliases: FxHashMap<Arc<str>, Type>,
}Fields§
§fqcn: Arc<str>§short_name: Arc<str>§is_api: boolMarked @api / @psalm-api: used from outside the analyzed code.
own_methods: MemberMap<Arc<MethodDef>>§own_properties: MemberMap<PropertyDef>§own_constants: MemberMap<ConstantDef>§template_params: Vec<TemplateParam>§traits: Vec<Arc<str>>Traits used by this trait (use OtherTrait; inside a trait body).
location: Option<Location>§trait_use_locations: Vec<(Arc<str>, Location)>Per-use statement locations for each used trait: (fqcn, location) in
declaration order, parallel to traits. Mirrors ClassDef/EnumDef’s
field of the same name. Absent from older serialized slices; defaults
to empty.
trait_use_type_args: Vec<(Arc<str>, Vec<Type>)>Type arguments from @use OtherTrait<T1, T2> (a trait may itself
use a generic trait).
is_immutable: boolSet when the trait carries @psalm-immutable.
require_extends: Vec<Arc<str>>@psalm-require-extends / @phpstan-require-extends — FQCNs that using classes must extend.
require_implements: Vec<Arc<str>>@psalm-require-implements / @phpstan-require-implements — FQCNs that using classes must implement.
deprecated: Option<Arc<str>>@deprecated docblock annotation, if present.
type_aliases: FxHashMap<Arc<str>, Type>Type aliases declared on this trait via @psalm-type / @phpstan-type.