struct VisitorState {
root_use_flags: RootUseFlags,
outer_ty_kind: OuterTyKind,
}Fields§
§root_use_flags: RootUseFlagsFlags describing both the overall context in which the current Ty is, linked to how the Visitor’s original Ty was used.
outer_ty_kind: OuterTyKindFlags describing both the immediate context in which the current Ty is, linked to how it relates to its parent Ty (or lack thereof).
Implementations§
Source§impl VisitorState
impl VisitorState
Sourcefn next(&self, current_ty: Ty<'_>) -> Self
fn next(&self, current_ty: Ty<'_>) -> Self
From an existing state, compute the state of any subtype of the current type.
(General case. For the case where the current type is a function pointer, see next_in_fnptr.)
Sourcefn next_in_fnptr(&self, current_ty: Ty<'_>, fn_pos: FnPos) -> Self
fn next_in_fnptr(&self, current_ty: Ty<'_>, fn_pos: FnPos) -> Self
From an existing state, compute the state of any subtype of the current type. (Case where the current type is a function pointer, meaning we need to specify if the subtype is an argument or the return.)
Sourcefn fn_entry_point(fn_mode: CItemKind, fn_pos: FnPos) -> Self
fn fn_entry_point(fn_mode: CItemKind, fn_pos: FnPos) -> Self
Get the proper visitor state for a given function’s arguments or return type.
Sourcefn static_entry_point() -> Self
fn static_entry_point() -> Self
Get the proper visitor state for a static variable’s type
Sourcefn is_in_function(&self) -> bool
fn is_in_function(&self) -> bool
Whether the type is used in a function.
Sourcefn is_in_function_return(&self) -> bool
fn is_in_function_return(&self) -> bool
Whether the type is used (directly or not) in a function, in return position.
Sourcefn is_in_defined_function(&self) -> bool
fn is_in_defined_function(&self) -> bool
Whether the type is used (directly or not) in a defined function. In other words, whether or not we allow non-FFI-safe types behind a C pointer, to be treated as an opaque type on the other side of the FFI boundary.
Sourcefn is_in_fnptr(&self) -> bool
fn is_in_fnptr(&self) -> bool
Whether the type is used (directly or not) in a function pointer type. Here, we also allow non-FFI-safe types behind a C pointer, to be treated as an opaque type on the other side of the FFI boundary.
Sourcefn can_expect_ty_params(&self) -> bool
fn can_expect_ty_params(&self) -> bool
Whether we can expect type parameters and co in a given type.
Trait Implementations§
Source§impl Clone for VisitorState
impl Clone for VisitorState
Source§fn clone(&self) -> VisitorState
fn clone(&self) -> VisitorState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VisitorState
impl Debug for VisitorState
Source§impl PartialEq for VisitorState
impl PartialEq for VisitorState
Source§fn eq(&self, other: &VisitorState) -> bool
fn eq(&self, other: &VisitorState) -> bool
self and other values to be equal, and is used by ==.impl Copy for VisitorState
impl Eq for VisitorState
impl StructuralPartialEq for VisitorState
Auto Trait Implementations§
impl DynSend for VisitorState
impl DynSync for VisitorState
impl Freeze for VisitorState
impl RefUnwindSafe for VisitorState
impl Send for VisitorState
impl Sync for VisitorState
impl Unpin for VisitorState
impl UnsafeUnpin for VisitorState
impl UnwindSafe for VisitorState
Blanket Implementations§
Source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
Source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreSource§impl<K> IntoQueryKey<K> for K
impl<K> IntoQueryKey<K> for K
Source§fn into_query_key(self) -> K
fn into_query_key(self) -> K
Self to K.
This should always be a very cheap conversion, e.g. LocalDefId::to_def_id.Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2 bytes