pub struct Definition {
pub visibility: Visibility,
pub ty: TypeScheme,
pub name_span: Option<Span>,
pub doc: Option<String>,
pub body: DefinitionBody,
}Fields§
§visibility: Visibility§ty: TypeScheme§name_span: Option<Span>§doc: Option<String>§body: DefinitionBodyImplementations§
Source§impl Definition
impl Definition
Sourcepub fn is_newtype(&self) -> bool
pub fn is_newtype(&self) -> bool
A newtype is a single-field, non-generic tuple struct. Relevant
because Go compiles newtypes to named scalar types, so .0 is a cast
rather than a field access, it cannot be assigned to, and taking
its address is invalid.
pub fn newtype_field(&self) -> Option<&Type>
pub fn is_pointer_backed_newtype(&self) -> bool
pub fn alias_target(&self) -> Option<&Type>
pub fn instantiate_alias_target( &self, params: &[Type], writable: bool, ) -> Option<Type>
pub fn newtype_underlying(&self, writable: bool) -> Option<Type>
Sourcepub fn constructor_type(&self) -> Option<TypeScheme>
pub fn constructor_type(&self) -> Option<TypeScheme>
Returns the callable type of a tuple struct constructor.
The constructor is derived from the struct’s resolved fields and type rather than stored separately, so it cannot become stale when either source changes.
pub fn allowed_lints(&self) -> &[String]
pub fn go_hints(&self) -> &[GoHint]
pub fn go_name(&self) -> Option<&str>
pub fn go_type_param_recipe(&self) -> Option<&[GoTypeRecipe]>
pub fn go_type_terms(&self) -> &[GoTypeTerms]
pub fn impl_receiver(&self) -> Option<&Type>
pub fn superseded_by(&self) -> Option<&str>
pub fn const_value(&self) -> Option<&ConstantValue>
pub fn is_const(&self) -> bool
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
A Go var that the bindings type wider than Go, so Go rejects writes and &.
pub fn is_variable(&self) -> bool
pub fn methods_mut(&mut self) -> Option<&mut Methods>
pub fn methods(&self) -> Option<&Methods>
pub fn fields(&self) -> Option<&[StructFieldDefinition]>
pub fn is_interface(&self) -> bool
pub fn is_ufcs_method(&self, method: &str) -> bool
pub fn is_display(&self) -> bool
pub fn is_zero_safe(&self) -> bool
pub fn is_zero_unsafe(&self) -> bool
pub fn is_closed_domain(&self) -> bool
pub fn is_serialized(&self) -> bool
pub fn is_anon_struct(&self) -> bool
pub fn is_incomparable(&self) -> bool
pub fn requires_comparable_argument(&self, position: usize) -> bool
pub fn is_constraint(&self) -> bool
pub fn is_type_definition(&self) -> bool
pub fn is_type_alias(&self) -> bool
pub fn is_value(&self, qualified_name: &str) -> bool
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§impl Debug for Definition
impl Debug for Definition
Source§impl PartialEq for Definition
impl PartialEq for Definition
impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl Forget for Definition
impl Freeze for Definitionwhere
*const u8 is !null: Freeze,
PhantomData<EcoString>: Freeze,
*const ArcInner<Box<[Type]>> is !null: Freeze,
PhantomData<ArcInner<Box<[Type]>>>: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<FunctionType> is !null: Freeze,
PhantomData<ArcInner<FunctionType>>: Freeze,
PhantomData<Type>: Freeze,
*const Type is !null: Freeze,
*const ArcInner<Spelling> is !null: Freeze,
PhantomData<ArcInner<Spelling>>: Freeze,
PhantomData<Generic>: Freeze,
PhantomData<Annotation>: Freeze,
*const Annotation is !null: Freeze,
*const ArcInner<HashMap<EcoString, Method, FxBuildHasher>> is !null: Freeze,
PhantomData<ArcInner<HashMap<EcoString, Method, FxBuildHasher>>>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<EnumVariant>: Freeze,
PhantomData<(EcoString, usize)>: Freeze,
PhantomData<StructFieldDefinition>: Freeze,
PhantomData<u64>: Freeze,
PhantomData<String>: Freeze,
PhantomData<GoHint>: Freeze,
PhantomData<GoTypeRecipe>: Freeze,
PhantomData<GoTypeTerms>: Freeze,
impl Move for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definitionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<EcoString>: UnsafeUnpin,
*const ArcInner<Box<[Type]>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Box<[Type]>>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<FunctionType> is !null: UnsafeUnpin,
PhantomData<ArcInner<FunctionType>>: UnsafeUnpin,
PhantomData<Type>: UnsafeUnpin,
*const Type is !null: UnsafeUnpin,
*const ArcInner<Spelling> is !null: UnsafeUnpin,
PhantomData<ArcInner<Spelling>>: UnsafeUnpin,
PhantomData<Generic>: UnsafeUnpin,
PhantomData<Annotation>: UnsafeUnpin,
*const Annotation is !null: UnsafeUnpin,
*const ArcInner<HashMap<EcoString, Method, FxBuildHasher>> is !null: UnsafeUnpin,
PhantomData<ArcInner<HashMap<EcoString, Method, FxBuildHasher>>>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<EnumVariant>: UnsafeUnpin,
PhantomData<(EcoString, usize)>: UnsafeUnpin,
PhantomData<StructFieldDefinition>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<GoHint>: UnsafeUnpin,
PhantomData<GoTypeRecipe>: UnsafeUnpin,
PhantomData<GoTypeTerms>: UnsafeUnpin,
impl UnwindSafe for Definitionwhere
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
Arc<Box<[Type]>>: UnwindSafe,
Arc<FunctionType>: UnwindSafe,
BoxRaw<Type>: UnwindSafe,
Arc<Spelling>: UnwindSafe,
BoxRaw<Annotation>: UnwindSafe,
Arc<HashMap<EcoString, Method, FxBuildHasher>>: UnwindSafe,
HashMap<EcoString, usize, FxBuildHasher>: UnwindSafe,
BoxRaw<GoTypeRecipe>: UnwindSafe,
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