/// Checks that particular type `ty` implements `std::ops::FnOnce`.
///
/// This function can be used to check if a particular type is callable, since FnOnce is a
/// supertrait of Fn and FnMut, so all callable types implements at least FnOnce.
Checks that particular type `ty` implements `std::ops::FnOnce`.
This function can be used to check if a particular type is callable, since FnOnce is a
supertrait of Fn and FnMut, so all callable types implements at least FnOnce.
Checks that particular type ` ty ` implements ` std :: ops :: FnOnce ` . This function can be used to check if a particular type is callable since FnOnce is a supertrait of Fn and FnMut so all callable types implements at least FnOnce .
pub fn impls_fnonce(&self, db: &dyn HirDatabase) -> bool {
        let fnonce_trait = match FnTrait::FnOnce.get_id(db, self.krate) {
            Some(it) => it,
            None => return false,
        };
        let canonical_ty =
            Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(Interner) };
        method_resolution::implements_trait_unique(
            &canonical_ty,
            db,
            self.env.clone(),
            fnonce_trait,
        )
    }
pub fn impls_fnonce ( & self , db : & dyn HirDatabase ) -> bool { let fnonce_trait = match FnTrait :: FnOnce . get_id ( db , self . krate ) { Some ( it ) => it , None => return false , } ; let canonical_ty = Canonical { value : self . ty . clone ( ) , binders : CanonicalVarKinds :: empty ( Interner ) } ; method_resolution :: implements_trait_unique ( & canonical_ty , db , self . env . clone ( ) , fnonce_trait , ) }
Checks that particular type `ty` implements `std::ops::FnOnce`.
Checks that particular type ` ty ` implements ` std :: ops :: FnOnce ` .
&self
db
&dyn HirDatabase