Enum sway_core::language::ty::TyDeclaration
source · pub enum TyDeclaration {
VariableDeclaration(Box<TyVariableDeclaration>),
ConstantDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
FunctionDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
TraitDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
StructDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
EnumDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
ImplTrait {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
AbiDeclaration {
name: Ident,
decl_id: DeclId,
decl_span: Span,
},
GenericTypeForFunctionScope {
name: Ident,
type_id: TypeId,
},
ErrorRecovery(Span),
StorageDeclaration {
decl_id: DeclId,
decl_span: Span,
},
}
Variants§
VariableDeclaration(Box<TyVariableDeclaration>)
ConstantDeclaration
FunctionDeclaration
TraitDeclaration
StructDeclaration
EnumDeclaration
ImplTrait
AbiDeclaration
GenericTypeForFunctionScope
ErrorRecovery(Span)
StorageDeclaration
Implementations§
source§impl TyDeclaration
impl TyDeclaration
sourcepub fn friendly_name(&self, engines: &Engines<'_>) -> String
pub fn friendly_name(&self, engines: &Engines<'_>) -> String
friendly name string used for error reporting, which consists of the the identifier for the declaration.
sourcepub fn friendly_type_name(&self) -> &'static str
pub fn friendly_type_name(&self) -> &'static str
friendly type name string used for error reporting, which consists of the type name of the declaration AST node.
Trait Implementations§
source§impl Clone for TyDeclaration
impl Clone for TyDeclaration
source§fn clone(&self) -> TyDeclaration
fn clone(&self) -> TyDeclaration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TyDeclaration
impl Debug for TyDeclaration
source§impl GetDeclIdent for TyDeclaration
impl GetDeclIdent for TyDeclaration
fn get_decl_ident(&self) -> Option<Ident>
source§impl GetDeclRef for TyDeclaration
impl GetDeclRef for TyDeclaration
fn get_decl_ref(&self) -> Option<DeclRef>
Auto Trait Implementations§
impl RefUnwindSafe for TyDeclaration
impl Send for TyDeclaration
impl Sync for TyDeclaration
impl Unpin for TyDeclaration
impl UnwindSafe for TyDeclaration
Blanket Implementations§
source§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying type as
Any
.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.