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: boolWhether this impl is for an unsafe trait.
generics: GenericsInformation 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_: TypeThe type that the impl block is for.
items: Vec<Id>The list of associated items contained in this impl block.
is_negative: boolWhether this is a negative impl (e.g. !Sized or !Send).
is_synthetic: boolWhether 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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more