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
sourcepub fn get_function<I>(&self, index: &I) -> TyFunctionDeclwhere
DeclEngine: DeclEngineGet<I, TyFunctionDecl>,
pub fn get_function<I>(&self, index: &I) -> TyFunctionDeclwhere DeclEngine: DeclEngineGet<I, TyFunctionDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_trait<I>(&self, index: &I) -> TyTraitDeclwhere
DeclEngine: DeclEngineGet<I, TyTraitDecl>,
pub fn get_trait<I>(&self, index: &I) -> TyTraitDeclwhere DeclEngine: DeclEngineGet<I, TyTraitDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_trait_fn<I>(&self, index: &I) -> TyTraitFnwhere
DeclEngine: DeclEngineGet<I, TyTraitFn>,
pub fn get_trait_fn<I>(&self, index: &I) -> TyTraitFnwhere DeclEngine: DeclEngineGet<I, TyTraitFn>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_impl_trait<I>(&self, index: &I) -> TyImplTraitwhere
DeclEngine: DeclEngineGet<I, TyImplTrait>,
pub fn get_impl_trait<I>(&self, index: &I) -> TyImplTraitwhere DeclEngine: DeclEngineGet<I, TyImplTrait>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_struct<I>(&self, index: &I) -> TyStructDeclwhere
DeclEngine: DeclEngineGet<I, TyStructDecl>,
pub fn get_struct<I>(&self, index: &I) -> TyStructDeclwhere DeclEngine: DeclEngineGet<I, TyStructDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_storage<I>(&self, index: &I) -> TyStorageDeclwhere
DeclEngine: DeclEngineGet<I, TyStorageDecl>,
pub fn get_storage<I>(&self, index: &I) -> TyStorageDeclwhere DeclEngine: DeclEngineGet<I, TyStorageDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine.
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_abi<I>(&self, index: &I) -> TyAbiDeclwhere
DeclEngine: DeclEngineGet<I, TyAbiDecl>,
pub fn get_abi<I>(&self, index: &I) -> TyAbiDeclwhere DeclEngine: DeclEngineGet<I, TyAbiDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_constant<I>(&self, index: &I) -> TyConstantDeclwhere
DeclEngine: DeclEngineGet<I, TyConstantDecl>,
pub fn get_constant<I>(&self, index: &I) -> TyConstantDeclwhere DeclEngine: DeclEngineGet<I, TyConstantDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_enum<I>(&self, index: &I) -> TyEnumDeclwhere
DeclEngine: DeclEngineGet<I, TyEnumDecl>,
pub fn get_enum<I>(&self, index: &I) -> TyEnumDeclwhere DeclEngine: DeclEngineGet<I, TyEnumDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
sourcepub fn get_type_alias<I>(&self, index: &I) -> TyTypeAliasDeclwhere
DeclEngine: DeclEngineGet<I, TyTypeAliasDecl>,
pub fn get_type_alias<I>(&self, index: &I) -> TyTypeAliasDeclwhere DeclEngine: DeclEngineGet<I, TyTypeAliasDecl>,
Friendly helper method for calling the get
method from the
implementation of DeclEngineGet for DeclEngine
Calling [DeclEngine][get] directly is equivalent to this method, but this method adds additional syntax that some users may find helpful.
Trait Implementations§
source§impl Debug for DeclEngine
impl Debug for DeclEngine
source§impl DeclEngineGet<DeclId<TyAbiDecl>, TyAbiDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyAbiDecl>, TyAbiDecl> for DeclEngine
source§impl DeclEngineGet<DeclId<TyConstantDecl>, TyConstantDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyConstantDecl>, TyConstantDecl> for DeclEngine
fn get(&self, index: &DeclId<TyConstantDecl>) -> TyConstantDecl
source§impl DeclEngineGet<DeclId<TyEnumDecl>, TyEnumDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyEnumDecl>, TyEnumDecl> for DeclEngine
fn get(&self, index: &DeclId<TyEnumDecl>) -> TyEnumDecl
source§impl DeclEngineGet<DeclId<TyFunctionDecl>, TyFunctionDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyFunctionDecl>, TyFunctionDecl> for DeclEngine
fn get(&self, index: &DeclId<TyFunctionDecl>) -> TyFunctionDecl
source§impl DeclEngineGet<DeclId<TyImplTrait>, TyImplTrait> for DeclEngine
impl DeclEngineGet<DeclId<TyImplTrait>, TyImplTrait> for DeclEngine
fn get(&self, index: &DeclId<TyImplTrait>) -> TyImplTrait
source§impl DeclEngineGet<DeclId<TyStorageDecl>, TyStorageDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyStorageDecl>, TyStorageDecl> for DeclEngine
fn get(&self, index: &DeclId<TyStorageDecl>) -> TyStorageDecl
source§impl DeclEngineGet<DeclId<TyStructDecl>, TyStructDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyStructDecl>, TyStructDecl> for DeclEngine
fn get(&self, index: &DeclId<TyStructDecl>) -> TyStructDecl
source§impl DeclEngineGet<DeclId<TyTraitDecl>, TyTraitDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyTraitDecl>, TyTraitDecl> for DeclEngine
fn get(&self, index: &DeclId<TyTraitDecl>) -> TyTraitDecl
source§impl DeclEngineGet<DeclId<TyTraitFn>, TyTraitFn> for DeclEngine
impl DeclEngineGet<DeclId<TyTraitFn>, TyTraitFn> for DeclEngine
source§impl DeclEngineGet<DeclId<TyTypeAliasDecl>, TyTypeAliasDecl> for DeclEngine
impl DeclEngineGet<DeclId<TyTypeAliasDecl>, TyTypeAliasDecl> for DeclEngine
fn get(&self, index: &DeclId<TyTypeAliasDecl>) -> TyTypeAliasDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyAbiDecl>>, TyAbiDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyAbiDecl>>, TyAbiDecl> for DeclEngine
source§impl DeclEngineGet<DeclRef<DeclId<TyConstantDecl>>, TyConstantDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyConstantDecl>>, TyConstantDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyConstantDecl>>) -> TyConstantDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyEnumDecl>>, TyEnumDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyEnumDecl>>, TyEnumDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyEnumDecl>>) -> TyEnumDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyFunctionDecl>>, TyFunctionDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyFunctionDecl>>, TyFunctionDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyFunctionDecl>>) -> TyFunctionDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyImplTrait>>, TyImplTrait> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyImplTrait>>, TyImplTrait> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyImplTrait>>) -> TyImplTrait
source§impl DeclEngineGet<DeclRef<DeclId<TyStorageDecl>>, TyStorageDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyStorageDecl>>, TyStorageDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyStorageDecl>>) -> TyStorageDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyStructDecl>>, TyStructDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyStructDecl>>, TyStructDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyStructDecl>>) -> TyStructDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyTraitDecl>>, TyTraitDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyTraitDecl>>, TyTraitDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyTraitDecl>>) -> TyTraitDecl
source§impl DeclEngineGet<DeclRef<DeclId<TyTraitFn>>, TyTraitFn> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyTraitFn>>, TyTraitFn> for DeclEngine
source§impl DeclEngineGet<DeclRef<DeclId<TyTypeAliasDecl>>, TyTypeAliasDecl> for DeclEngine
impl DeclEngineGet<DeclRef<DeclId<TyTypeAliasDecl>>, TyTypeAliasDecl> for DeclEngine
fn get(&self, index: &DeclRef<DeclId<TyTypeAliasDecl>>) -> TyTypeAliasDecl
source§impl DeclEngineInsert<TyAbiDecl> for DeclEngine
impl DeclEngineInsert<TyAbiDecl> for DeclEngine
source§impl DeclEngineInsert<TyConstantDecl> for DeclEngine
impl DeclEngineInsert<TyConstantDecl> for DeclEngine
fn insert(&self, decl: TyConstantDecl) -> DeclRef<DeclId<TyConstantDecl>>
source§impl DeclEngineInsert<TyEnumDecl> for DeclEngine
impl DeclEngineInsert<TyEnumDecl> for DeclEngine
fn insert(&self, decl: TyEnumDecl) -> DeclRef<DeclId<TyEnumDecl>>
source§impl DeclEngineInsert<TyFunctionDecl> for DeclEngine
impl DeclEngineInsert<TyFunctionDecl> for DeclEngine
fn insert(&self, decl: TyFunctionDecl) -> DeclRef<DeclId<TyFunctionDecl>>
source§impl DeclEngineInsert<TyImplTrait> for DeclEngine
impl DeclEngineInsert<TyImplTrait> for DeclEngine
fn insert(&self, decl: TyImplTrait) -> DeclRef<DeclId<TyImplTrait>>
source§impl DeclEngineInsert<TyStorageDecl> for DeclEngine
impl DeclEngineInsert<TyStorageDecl> for DeclEngine
fn insert(&self, decl: TyStorageDecl) -> DeclRef<DeclId<TyStorageDecl>>
source§impl DeclEngineInsert<TyStructDecl> for DeclEngine
impl DeclEngineInsert<TyStructDecl> for DeclEngine
fn insert(&self, decl: TyStructDecl) -> DeclRef<DeclId<TyStructDecl>>
source§impl DeclEngineInsert<TyTraitDecl> for DeclEngine
impl DeclEngineInsert<TyTraitDecl> for DeclEngine
fn insert(&self, decl: TyTraitDecl) -> DeclRef<DeclId<TyTraitDecl>>
source§impl DeclEngineInsert<TyTraitFn> for DeclEngine
impl DeclEngineInsert<TyTraitFn> for DeclEngine
source§impl DeclEngineInsert<TyTypeAliasDecl> for DeclEngine
impl DeclEngineInsert<TyTypeAliasDecl> for DeclEngine
fn insert(&self, decl: TyTypeAliasDecl) -> DeclRef<DeclId<TyTypeAliasDecl>>
source§impl DeclEngineReplace<TyAbiDecl> for DeclEngine
impl DeclEngineReplace<TyAbiDecl> for DeclEngine
source§impl DeclEngineReplace<TyConstantDecl> for DeclEngine
impl DeclEngineReplace<TyConstantDecl> for DeclEngine
fn replace(&self, index: DeclId<TyConstantDecl>, decl: TyConstantDecl)
source§impl DeclEngineReplace<TyEnumDecl> for DeclEngine
impl DeclEngineReplace<TyEnumDecl> for DeclEngine
fn replace(&self, index: DeclId<TyEnumDecl>, decl: TyEnumDecl)
source§impl DeclEngineReplace<TyFunctionDecl> for DeclEngine
impl DeclEngineReplace<TyFunctionDecl> for DeclEngine
fn replace(&self, index: DeclId<TyFunctionDecl>, decl: TyFunctionDecl)
source§impl DeclEngineReplace<TyImplTrait> for DeclEngine
impl DeclEngineReplace<TyImplTrait> for DeclEngine
fn replace(&self, index: DeclId<TyImplTrait>, decl: TyImplTrait)
source§impl DeclEngineReplace<TyStorageDecl> for DeclEngine
impl DeclEngineReplace<TyStorageDecl> for DeclEngine
fn replace(&self, index: DeclId<TyStorageDecl>, decl: TyStorageDecl)
source§impl DeclEngineReplace<TyStructDecl> for DeclEngine
impl DeclEngineReplace<TyStructDecl> for DeclEngine
fn replace(&self, index: DeclId<TyStructDecl>, decl: TyStructDecl)
source§impl DeclEngineReplace<TyTraitDecl> for DeclEngine
impl DeclEngineReplace<TyTraitDecl> for DeclEngine
fn replace(&self, index: DeclId<TyTraitDecl>, decl: TyTraitDecl)
source§impl DeclEngineReplace<TyTraitFn> for DeclEngine
impl DeclEngineReplace<TyTraitFn> for DeclEngine
source§impl DeclEngineReplace<TyTypeAliasDecl> for DeclEngine
impl DeclEngineReplace<TyTypeAliasDecl> for DeclEngine
fn replace(&self, index: DeclId<TyTypeAliasDecl>, decl: TyTypeAliasDecl)
source§impl Default for DeclEngine
impl Default for DeclEngine
source§fn default() -> DeclEngine
fn default() -> DeclEngine
impl DeclEngineIndex<TyAbiDecl> for DeclEngine
impl DeclEngineIndex<TyConstantDecl> for DeclEngine
impl DeclEngineIndex<TyEnumDecl> for DeclEngine
impl DeclEngineIndex<TyFunctionDecl> for DeclEngine
impl DeclEngineIndex<TyImplTrait> for DeclEngine
impl DeclEngineIndex<TyStorageDecl> for DeclEngine
impl DeclEngineIndex<TyStructDecl> for DeclEngine
impl DeclEngineIndex<TyTraitDecl> for DeclEngine
impl DeclEngineIndex<TyTraitFn> for DeclEngine
impl DeclEngineIndex<TyTypeAliasDecl> for DeclEngine
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)
Any
.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
§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>
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>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.