pub struct ImplBlock {
pub trait_name: TypeName,
pub target_type: TypeName,
pub impl_name: Option<String>,
pub methods: Vec<MethodDef>,
pub associated_type_bindings: Vec<AssociatedTypeBinding>,
pub where_clause: Option<Vec<WherePredicate>>,
}Expand description
Impl block — implements a trait for a type
impl Queryable<T> for Table<T> {
method filter(predicate) { /* ... */ }
method execute() { Ok(self) }
}Under the hood, compiles identically to an extend block (UFCS desugaring) plus trait validation (all required methods present with correct arities).
Fields§
§trait_name: TypeNameThe trait being implemented (e.g., Queryable
target_type: TypeNameThe type implementing the trait (e.g., Table
impl_name: Option<String>Optional named implementation selector:
impl Display for User as JsonDisplay { ... }
methods: Vec<MethodDef>Method implementations
associated_type_bindings: Vec<AssociatedTypeBinding>Associated type bindings: type Item = number;
where_clause: Option<Vec<WherePredicate>>Where clause: where T: Display + Comparable
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImplBlock
impl<'de> Deserialize<'de> for ImplBlock
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
Auto Trait Implementations§
impl Freeze 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
Mutably borrows from an owned value. Read more