pub struct Impl {
pub is_unsafe: bool,
pub generics: Generics,
pub provided_trait_methods: Vec<String>,
pub trait_: Option<Path>,
pub for_: Type,
pub items: Vec<Id>,
pub is_negative: bool,
pub is_synthetic: bool,
pub blanket_impl: Option<Type>,
}
Expand description
An impl
block.
Fields§
§is_unsafe: bool
Whether this impl is for an unsafe trait.
generics: Generics
Information about the impl’s type parameters and where
clauses.
provided_trait_methods: Vec<String>
The list of the names of all the trait methods that weren’t mentioned in this impl but were provided by the trait itself.
For example, for this impl of the PartialEq
trait:
struct Foo;
impl PartialEq for Foo {
fn eq(&self, other: &Self) -> bool { todo!() }
}
This field will be ["ne"]
, as it has a default implementation defined for it.
trait_: Option<Path>
The trait being implemented or None
if the impl is inherent, which means
impl Struct {}
as opposed to impl Trait for Struct {}
.
for_: Type
The type that the impl block is for.
items: Vec<Id>
The list of associated items contained in this impl block.
is_negative: bool
Whether this is a negative impl (e.g. !Sized
or !Send
).
is_synthetic: bool
Whether this is an impl that’s implied by the compiler
(for autotraits, e.g. Send
or Sync
).
blanket_impl: Option<Type>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Impl
impl<'de> Deserialize<'de> for Impl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Impl
impl StructuralPartialEq for Impl
Auto Trait Implementations§
impl Freeze for Impl
impl RefUnwindSafe for Impl
impl Send for Impl
impl Sync for Impl
impl Unpin for Impl
impl UnwindSafe for Impl
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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: 304 bytes