#[non_exhaustive]pub struct ImplBlock {
pub id: ImplId,
pub file: RelPath,
pub line: usize,
pub span: SpanFact,
pub module: SharedStr,
pub target: TargetId,
pub test: TestRole,
pub self_type: SharedStr,
pub trait_path: Option<SharedStr>,
pub self_items: Vec<ItemId>,
pub members: Vec<ItemId>,
/* private fields */
}Expand description
An impl block of a target, inherent or of a trait, once for each module
path its file is reached under.
The struct is #[non_exhaustive]: adding a field is not a breaking change,
so a pattern names the fields it reads and ends in ...
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: ImplIdThe identity of the block.
file: RelPathThe file that holds the block.
line: usizeThe 1-based line of the impl keyword.
span: SpanFactThe whole block, from its first attribute or the impl keyword to its
closing brace.
module: SharedStrThe path of the module that holds the block, from which its self type and trait paths are read.
target: TargetIdThe target whose module tree holds the block.
test: TestRoleThe test role of the block, counting the module tree’s test flag.
self_type: SharedStrThe self type as written, without spaces.
trait_path: Option<SharedStr>The trait path as written, without spaces, for a trait impl, with the
! of a negative impl (!Sync).
self_items: Vec<ItemId>The key of the self type: the struct, enum or union of the workspace
that the self type path names from the block’s module, through any
type aliases, sorted (the cfg alternatives of one type are several
items). Empty when the self type names nothing of the workspace or is
a type the index cannot place, as a generic parameter, a reference, a
slice, a tuple or a type that a macro generates.
members: Vec<ItemId>The members of the block, in source order.
Trait Implementations§
impl Eq for ImplBlock
impl StructuralPartialEq for ImplBlock
Auto Trait Implementations§
impl Forget for ImplBlock
impl Freeze for ImplBlock
impl Move for ImplBlock
impl RefUnwindSafe for ImplBlock
impl Send for ImplBlock
impl Sync for ImplBlock
impl Unpin for ImplBlock
impl UnsafeUnpin for ImplBlock
impl UnwindSafe for ImplBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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.impl<T> EvidenceLease for T
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 more