Struct sway_core::decl_engine::DeclEngine
source · pub struct DeclEngine { /* private fields */ }
Expand description
Used inside of type inference to store declarations.
Implementations§
source§impl DeclEngine
impl DeclEngine
pub fn get_function<'a, T, I>(&self, index: &'a T) -> TyFunctionDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_trait<'a, T, I>(&self, index: &'a T) -> TyTraitDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_trait_fn<'a, T, I>(&self, index: &'a T) -> TyTraitFnwhere DeclId<I>: From<&'a T>,
pub fn get_impl_trait<'a, T, I>(&self, index: &'a T) -> TyImplTraitwhere DeclId<I>: From<&'a T>,
pub fn get_struct<'a, T, I>(&self, index: &'a T) -> TyStructDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_storage<'a, T, I>(&self, index: &'a T) -> TyStorageDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_abi<'a, T, I>(&self, index: &'a T) -> TyAbiDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_constant<'a, T, I>(&self, index: &'a T) -> TyConstantDeclarationwhere DeclId<I>: From<&'a T>,
pub fn get_enum<'a, T, I>(&self, index: &'a T) -> TyEnumDeclarationwhere DeclId<I>: From<&'a T>,
Trait Implementations§
source§impl Debug for DeclEngine
impl Debug for DeclEngine
source§impl DeclEngineIndex<TyAbiDeclaration> for DeclEngine
impl DeclEngineIndex<TyAbiDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyAbiDeclaration>) -> TyAbiDeclaration
fn replace(&self, index: DeclId<TyAbiDeclaration>, decl: TyAbiDeclaration)
fn insert(&self, decl: TyAbiDeclaration) -> DeclRef<DeclId<TyAbiDeclaration>>
source§impl DeclEngineIndex<TyConstantDeclaration> for DeclEngine
impl DeclEngineIndex<TyConstantDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyConstantDeclaration>) -> TyConstantDeclaration
fn replace( &self, index: DeclId<TyConstantDeclaration>, decl: TyConstantDeclaration )
fn insert( &self, decl: TyConstantDeclaration ) -> DeclRef<DeclId<TyConstantDeclaration>>
source§impl DeclEngineIndex<TyEnumDeclaration> for DeclEngine
impl DeclEngineIndex<TyEnumDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyEnumDeclaration>) -> TyEnumDeclaration
fn replace(&self, index: DeclId<TyEnumDeclaration>, decl: TyEnumDeclaration)
fn insert(&self, decl: TyEnumDeclaration) -> DeclRef<DeclId<TyEnumDeclaration>>
source§impl DeclEngineIndex<TyFunctionDeclaration> for DeclEngine
impl DeclEngineIndex<TyFunctionDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyFunctionDeclaration>) -> TyFunctionDeclaration
fn replace( &self, index: DeclId<TyFunctionDeclaration>, decl: TyFunctionDeclaration )
fn insert( &self, decl: TyFunctionDeclaration ) -> DeclRef<DeclId<TyFunctionDeclaration>>
source§impl DeclEngineIndex<TyImplTrait> for DeclEngine
impl DeclEngineIndex<TyImplTrait> for DeclEngine
fn get(&self, index: DeclId<TyImplTrait>) -> TyImplTrait
fn replace(&self, index: DeclId<TyImplTrait>, decl: TyImplTrait)
fn insert(&self, decl: TyImplTrait) -> DeclRef<DeclId<TyImplTrait>>
source§impl DeclEngineIndex<TyStorageDeclaration> for DeclEngine
impl DeclEngineIndex<TyStorageDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyStorageDeclaration>) -> TyStorageDeclaration
fn replace(&self, index: DeclId<TyStorageDeclaration>, decl: TyStorageDeclaration)
fn insert( &self, decl: TyStorageDeclaration ) -> DeclRef<DeclId<TyStorageDeclaration>>
source§impl DeclEngineIndex<TyStructDeclaration> for DeclEngine
impl DeclEngineIndex<TyStructDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyStructDeclaration>) -> TyStructDeclaration
fn replace(&self, index: DeclId<TyStructDeclaration>, decl: TyStructDeclaration)
fn insert( &self, decl: TyStructDeclaration ) -> DeclRef<DeclId<TyStructDeclaration>>
source§impl DeclEngineIndex<TyTraitDeclaration> for DeclEngine
impl DeclEngineIndex<TyTraitDeclaration> for DeclEngine
fn get(&self, index: DeclId<TyTraitDeclaration>) -> TyTraitDeclaration
fn replace(&self, index: DeclId<TyTraitDeclaration>, decl: TyTraitDeclaration)
fn insert(&self, decl: TyTraitDeclaration) -> DeclRef<DeclId<TyTraitDeclaration>>
source§impl DeclEngineIndex<TyTraitFn> for DeclEngine
impl DeclEngineIndex<TyTraitFn> for DeclEngine
source§impl Default for DeclEngine
impl Default for DeclEngine
source§fn default() -> DeclEngine
fn default() -> DeclEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for DeclEngine
impl Send for DeclEngine
impl Sync for DeclEngine
impl Unpin for DeclEngine
impl UnwindSafe for DeclEngine
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.