pub enum ItemByVal {
Type(TypeDecl),
Fun(FunDecl),
Global(GlobalDecl),
TraitDecl(TraitDecl),
TraitImpl(TraitImpl),
}Expand description
A translated item.
Variants§
Implementations§
Source§impl ItemByVal
impl ItemByVal
Sourcepub fn as_type_mut(&mut self) -> Option<&mut TypeDecl>
pub fn as_type_mut(&mut self) -> Option<&mut TypeDecl>
Optionally returns mutable references to the inner fields if this is a ItemByVal::Type, otherwise None
Sourcepub fn as_type(&self) -> Option<&TypeDecl>
pub fn as_type(&self) -> Option<&TypeDecl>
Optionally returns references to the inner fields if this is a ItemByVal::Type, otherwise None
Sourcepub fn into_type(self) -> Result<TypeDecl, Self>
pub fn into_type(self) -> Result<TypeDecl, Self>
Returns the inner fields if this is a ItemByVal::Type, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_type_unchecked(self) -> TypeDecl
pub unsafe fn into_type_unchecked(self) -> TypeDecl
Unchecked return of the inner fields of ItemByVal::Type.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_unchecked(&self) -> &TypeDecl
pub unsafe fn as_type_unchecked(&self) -> &TypeDecl
Unchecked reference of the inner fields of ItemByVal::Type.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_mut_unchecked(&mut self) -> &mut TypeDecl
pub unsafe fn as_type_mut_unchecked(&mut self) -> &mut TypeDecl
Unchecked mutable reference of the inner fields of ItemByVal::Type.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_fun_mut(&mut self) -> Option<&mut FunDecl>
pub fn as_fun_mut(&mut self) -> Option<&mut FunDecl>
Optionally returns mutable references to the inner fields if this is a ItemByVal::Fun, otherwise None
Sourcepub fn as_fun(&self) -> Option<&FunDecl>
pub fn as_fun(&self) -> Option<&FunDecl>
Optionally returns references to the inner fields if this is a ItemByVal::Fun, otherwise None
Sourcepub fn into_fun(self) -> Result<FunDecl, Self>
pub fn into_fun(self) -> Result<FunDecl, Self>
Returns the inner fields if this is a ItemByVal::Fun, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_fun_unchecked(self) -> FunDecl
pub unsafe fn into_fun_unchecked(self) -> FunDecl
Unchecked return of the inner fields of ItemByVal::Fun.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fun_unchecked(&self) -> &FunDecl
pub unsafe fn as_fun_unchecked(&self) -> &FunDecl
Unchecked reference of the inner fields of ItemByVal::Fun.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fun_mut_unchecked(&mut self) -> &mut FunDecl
pub unsafe fn as_fun_mut_unchecked(&mut self) -> &mut FunDecl
Unchecked mutable reference of the inner fields of ItemByVal::Fun.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_global_mut(&mut self) -> Option<&mut GlobalDecl>
pub fn as_global_mut(&mut self) -> Option<&mut GlobalDecl>
Optionally returns mutable references to the inner fields if this is a ItemByVal::Global, otherwise None
Sourcepub fn as_global(&self) -> Option<&GlobalDecl>
pub fn as_global(&self) -> Option<&GlobalDecl>
Optionally returns references to the inner fields if this is a ItemByVal::Global, otherwise None
Sourcepub fn into_global(self) -> Result<GlobalDecl, Self>
pub fn into_global(self) -> Result<GlobalDecl, Self>
Returns the inner fields if this is a ItemByVal::Global, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_global_unchecked(self) -> GlobalDecl
pub unsafe fn into_global_unchecked(self) -> GlobalDecl
Unchecked return of the inner fields of ItemByVal::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_global_unchecked(&self) -> &GlobalDecl
pub unsafe fn as_global_unchecked(&self) -> &GlobalDecl
Unchecked reference of the inner fields of ItemByVal::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_global_mut_unchecked(&mut self) -> &mut GlobalDecl
pub unsafe fn as_global_mut_unchecked(&mut self) -> &mut GlobalDecl
Unchecked mutable reference of the inner fields of ItemByVal::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_trait_decl(&self) -> bool
pub fn is_trait_decl(&self) -> bool
Returns true if this is a ItemByVal::TraitDecl, otherwise false
Sourcepub fn as_trait_decl_mut(&mut self) -> Option<&mut TraitDecl>
pub fn as_trait_decl_mut(&mut self) -> Option<&mut TraitDecl>
Optionally returns mutable references to the inner fields if this is a ItemByVal::TraitDecl, otherwise None
Sourcepub fn as_trait_decl(&self) -> Option<&TraitDecl>
pub fn as_trait_decl(&self) -> Option<&TraitDecl>
Optionally returns references to the inner fields if this is a ItemByVal::TraitDecl, otherwise None
Sourcepub fn into_trait_decl(self) -> Result<TraitDecl, Self>
pub fn into_trait_decl(self) -> Result<TraitDecl, Self>
Returns the inner fields if this is a ItemByVal::TraitDecl, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_trait_decl_unchecked(self) -> TraitDecl
pub unsafe fn into_trait_decl_unchecked(self) -> TraitDecl
Unchecked return of the inner fields of ItemByVal::TraitDecl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_decl_unchecked(&self) -> &TraitDecl
pub unsafe fn as_trait_decl_unchecked(&self) -> &TraitDecl
Unchecked reference of the inner fields of ItemByVal::TraitDecl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_decl_mut_unchecked(&mut self) -> &mut TraitDecl
pub unsafe fn as_trait_decl_mut_unchecked(&mut self) -> &mut TraitDecl
Unchecked mutable reference of the inner fields of ItemByVal::TraitDecl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_trait_impl(&self) -> bool
pub fn is_trait_impl(&self) -> bool
Returns true if this is a ItemByVal::TraitImpl, otherwise false
Sourcepub fn as_trait_impl_mut(&mut self) -> Option<&mut TraitImpl>
pub fn as_trait_impl_mut(&mut self) -> Option<&mut TraitImpl>
Optionally returns mutable references to the inner fields if this is a ItemByVal::TraitImpl, otherwise None
Sourcepub fn as_trait_impl(&self) -> Option<&TraitImpl>
pub fn as_trait_impl(&self) -> Option<&TraitImpl>
Optionally returns references to the inner fields if this is a ItemByVal::TraitImpl, otherwise None
Sourcepub fn into_trait_impl(self) -> Result<TraitImpl, Self>
pub fn into_trait_impl(self) -> Result<TraitImpl, Self>
Returns the inner fields if this is a ItemByVal::TraitImpl, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_trait_impl_unchecked(self) -> TraitImpl
pub unsafe fn into_trait_impl_unchecked(self) -> TraitImpl
Unchecked return of the inner fields of ItemByVal::TraitImpl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_impl_unchecked(&self) -> &TraitImpl
pub unsafe fn as_trait_impl_unchecked(&self) -> &TraitImpl
Unchecked reference of the inner fields of ItemByVal::TraitImpl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_impl_mut_unchecked(&mut self) -> &mut TraitImpl
pub unsafe fn as_trait_impl_mut_unchecked(&mut self) -> &mut TraitImpl
Unchecked mutable reference of the inner fields of ItemByVal::TraitImpl.
§Safety
Results in undefined behavior when it is the incorrect variant.
Trait Implementations§
Source§impl AstVisitable for ItemByVal
impl AstVisitable for ItemByVal
Source§fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
self, in pre-order traversal.Source§fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
self, in pre-order traversal.Source§impl<'s, V> Drive<'s, V> for ItemByVal
impl<'s, V> Drive<'s, V> for ItemByVal
Source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveMut<'s, V> for ItemByVal
impl<'s, V> DriveMut<'s, V> for ItemByVal
Source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveTwo<'s, V> for ItemByVal
impl<'s, V> DriveTwo<'s, V> for ItemByVal
Source§fn drive_two_inner(
&'s self,
other: &'s Self,
visitor: &mut V,
) -> ControlFlow<V::Break>
fn drive_two_inner( &'s self, other: &'s Self, visitor: &mut V, ) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self and other, if they correspond. If
the values don’t match up, this returns Break(Default::default()).Auto Trait Implementations§
impl Freeze for ItemByVal
impl RefUnwindSafe for ItemByVal
impl Send for ItemByVal
impl Sync for ItemByVal
impl Unpin for ItemByVal
impl UnsafeUnpin for ItemByVal
impl UnwindSafe for ItemByVal
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Mappable for T
Source§impl<T> TyVisitable for Twhere
T: AstVisitable,
impl<T> TyVisitable for Twhere
T: AstVisitable,
Source§fn type_info(&self) -> TypeInfo
fn type_info(&self) -> TypeInfo
TypeInfo.Source§fn visit_vars(&mut self, v: &mut impl VarsVisitor)
fn visit_vars(&mut self, v: &mut impl VarsVisitor)
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen De Bruijn indices
will count from the outside of self.Source§fn substitute(self, generics: &GenericArgs) -> Self
fn substitute(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
Note: if self is an item that comes from a TraitDecl, you must use
substitute_with_self or substitute_inner_binder, otherwise you’ll get panics.Source§fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
This is appropriate when substituting an inner binder.Source§fn substitute_explicits(self, generics: &GenericArgs) -> Self
fn substitute_explicits(self, generics: &GenericArgs) -> Self
Source§fn substitute_with_self(
self,
generics: &GenericArgs,
self_ref: &TraitRefKind,
) -> Self
fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self
TraitRefKind::SelfId trait ref.Source§fn substitute_with_tref(self, tref: &TraitRef) -> Self
fn substitute_with_tref(self, tref: &TraitRef) -> Self
TraitRefKind::SelfId trait ref.Source§fn try_substitute_with_tref(
self,
tref: &TraitRef,
) -> Result<Self, GenericsMismatch>
fn try_substitute_with_tref( self, tref: &TraitRef, ) -> Result<Self, GenericsMismatch>
TraitRefKind::SelfId trait ref.fn try_substitute( self, generics: &GenericArgs, ) -> Result<Self, GenericsMismatch>
fn try_substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Result<Self, GenericsMismatch>
Source§fn move_under_binder(self) -> Self
fn move_under_binder(self) -> Self
Source§fn move_under_binders(self, depth: DeBruijnId) -> Self
fn move_under_binders(self, depth: DeBruijnId) -> Self
depth binders.Source§fn move_from_under_binder(self) -> Option<Self>
fn move_from_under_binder(self) -> Option<Self>
Source§fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
depth binders. Returns None if it contains a variable bound in
one of these depth binders.Source§fn visit_db_id<B>(
&mut self,
f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>,
) -> ControlFlow<B>
fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen indices will count
from the outside of self.Source§fn has_escaping_region_var(&self) -> bool
fn has_escaping_region_var(&self) -> bool
Source§fn collect_regions(&self) -> SeqHashSet<Region>
fn collect_regions(&self) -> SeqHashSet<Region>
self.