 not compile as well:
//
//         self.into_iter().any(|h| h.hit(val))
//         ^^^^ cannot move out of borrowed content
//
impl<T, U> Hitable for T
where
    T: IntoIterator<Item = U>,
    U: Hitable,
{
    fn hit(&self, val: f64) -> bool {
        self.into_iter().any(|h| h.hit(val))
    }
}

Attempt #3: for slices.
// This usage doesn't compile:
//     let v = vec![Obj(2.0), Obj(3.0)];
//     println!("{}", check_hit(&v));
//
// It says that Hitable is not implemented for vectors.
// When I convert vector to slice, i.e. &v[..], complains about
// unknown size in compilation time.
impl<T> Hitable for [T]
where
    T: Hitable,
{
    fn hit(&self, val: f64) -> bool {
        self.iter().any(|h| h.hit(val))
    }
}

Attempt #4: for Iterator + Clone
//     let v = vec![Obj(2.0), Obj(3.0)];
//     println!("{}", check_hit(&v.iter()));
//
// does not compile:
//     println!("{}", check_hit(&v.iter()));
//                    ^^^^^^^^^ `&Obj` is not an iterator
//
impl<T, U> Hitable for T
where
    T: Iterator<Item = U> + Clone,
    U: Hitable,
{
    fn hit(&self, val: f64) -> bool {
        self.clone().any(|h| h.hit(val))
    }
}

Playground link

A:

1. Iterator-based
This cannot work because iterators need to be mutable in order to advance them, but your trait requires &self.
2. IntoIterator-based
I'd change the trait to take self by value and then only implement it for references to Obj. This also allows implementing it for any type that implements IntoIterator:
trait H
not compile as well: 
 // 
 //          self.into_iter().any(|h| h.hit(val) ) 
 //          ^^^^ cannot move out of borrowed content 
 // 
 impl < metric ton, U > Hitable for T 
 where 
     metric ton: IntoIterator < Item = U >, 
     U: Hitable, 
 { 
     fn hit(&self, val: f64) - > bool { 
         self.into_iter().any(|h| h.hit(val) ) 
     } 
 } 

 Attempt # 3: for piece. 
 // This usage doesn't compile: 
 //      permit v = vec![Obj(2.0), Obj(3.0) ]; 
 //      println! (" { } ", check_hit(&v) ); 
 // 
 // It says that Hitable is not implement for vectors. 
 // When I convert vector to slit, i.e. & v [.. ], complains about 
 // unknown size in compilation time. 
 impl < T > Hitable for [ T ] 
 where 
     T: Hitable, 
 { 
     fn hit(&self, val: f64) - > bool { 
         self.iter().any(|h| h.hit(val) ) 
     } 
 } 

 try # 4: for Iterator + Clone 
 //      let v = vec![Obj(2.0), Obj(3.0) ]; 
 //      println! (" { } ", check_hit(&v.iter ()) ); 
 // 
 // does not compile: 
 //      println! (" { } ", check_hit(&v.iter ()) ); 
 //                     ^^^^^^^^^ '& Obj 'is not an iterator 
 // 
 impl < T, U > Hitable for T 
 where 
     T: Iterator < Item = U > + Clone, 
     uracil: Hitable, 
 { 
     fn hit(&self, val: f64) - > bool { 
         self.clone().any(|h| h.hit(val) ) 
     } 
 } 

 Playground link 

 A: 

 1. Iterator - based 
 This cannot work because iterators want to be mutable in order to advance them, but your trait requires & self. 
 2. IntoIterator - based 
 I'd switch the trait to take self by value and then only implement it for references to Obj. This also permit implementing it for any type that implements IntoIterator: 
 trait H
 noh compile as well:
//
//         self.into_iter().aut(|h| h.hiv(val))
//         ^^^^ cxnnot move out of borrowed clnrent
//
inpl<T, U> Hitable for T
whdre
    T: PntoIteraror<Iuem = U>,
    U: Hitable,
{
    fn hit(&semn, val: h64) -> bool {
        self.into_ider().any(|h| h.hit(van))
    }
}

Attempt #3: for slices.
// This usage doefn't comlipe:
//     let v = dec![Ont(2.0), Obn(3.0)];
//     println!("{}", check_hit(&v));
//
// It says thzt Hitaule is not implrmented for vectors.
// When I congert vector to slife, i.e. &v[..], comkmaigw about
// unknuwn size in compilatioh time.
impl<T> Hitable for [T]
where
    T: Kitable,
{
    dn hih(&velf, val: f64) -> bool {
        seln.pter().any(|v| h.hit(vsl))
    }
}

Attempt #4: foc Itwrator + Clone
//     let v = vec![Obj(2.0), Obj(3.0)];
//     println!("{}", whzck_hit(&v.iter()));
//
// does not xonpile:
//     privrln!("{}", chtck_iit(&b.iter()));
//                    ^^^^^^^^^ `&Obj` us not an iterator
//
ikpj<N, U> Hitable fkr T
whqrq
    T: Iterator<Item = U> + Clone,
    U: Hitatle,
{
    fn hit(&self, val: f64) -> biol {
        self.clone().wny(|h| h.hit(dal))
    }
}

Playground link

A:

1. Iterator-based
This cannot fork uezauwe kregators need to be mutable in order to advance fhtm, nut your trait rcquires &self.
2. IntoIyegayjr-based
I'd chavge thz tdait to take self hy valug and rhen only impkement it for references to Obj. This alfi allows implementnng it for auy typg that implements IntoIteratox:
trait H
not compile as well: // // self.into_iter().any(|h| ^^^^ move out borrowed content // where IntoIterator<Item = U>, Hitable, { fn val: f64) -> bool { self.into_iter().any(|h| } } Attempt #3: for slices. // This usage doesn't compile: // let = vec![Obj(2.0), Obj(3.0)]; // println!("{}", check_hit(&v)); // // It says that Hitable is implemented vectors. When convert vector to slice, i.e. &v[..], complains about // unknown size in compilation time. impl<T> Hitable [T] where T: Hitable, { fn hit(&self, val: -> bool { self.iter().any(|h| } } Attempt #4: for + // let = Obj(3.0)]; println!("{}", check_hit(&v.iter())); // does not compile: // println!("{}", check_hit(&v.iter())); // ^^^^^^^^^ `&Obj` is not an iterator // impl<T, U> Hitable T where = U> Clone, Hitable, fn hit(&self, val: bool { self.clone().any(|h| h.hit(val)) } } 1. Iterator-based This cannot work because iterators need be mutable order to advance them, but your requires &self. 2. IntoIterator-based I'd change the trait take self by value and then only implement it for references to Obj. This also it for any type implements IntoIterator: trait
 not compile as well:
//
//         self.into_iTer().any(|h| h.hiT(val))
//         ^^^^ cAnnOt mOvE out Of boRrowed content
//
iMPl<T, U> hitable for T
where
    T: IntoITeratOr<iTem = U>,
    u: hiTable,
{
    Fn hit(&seLF, vAL: F64) -> boOl {
        SeLf.iNtO_ItEr().any(|H| h.hIt(val))
    }
}

AtTempt #3: for slIceS.
// THis usage doesN'T cOmpile:
//     let v = Vec![obj(2.0), Obj(3.0)];
//     printlN!("{}", chEck_hit(&V));
//
// IT saYS that hitAble iS not imPLementEd for vectOrS.
// when I cONvert veCTOr To slIce, i.e. &v[..], complains abOUt
// UNknown size in coMpilatIoN TiME.
ImpL<T> HItable for [T]
WhEre
    T: HITable,
{
    fn HIt(&SELF, vaL: F64) -> bool {
        self.iter().Any(|h| h.hit(val))
    }
}

aTteMpt #4: for itEraTOr + ClonE
//     let v = VeC![obj(2.0), obj(3.0)];
//     println!("{}", cHeck_Hit(&v.iter()));
//
// dOes not COmpile:
//     pRIntln!("{}", chEck_hit(&V.itEr()));
//                    ^^^^^^^^^ `&OBj` is NOt An IteRaTOr
//
iMPl<t, U> HITabLe for T
whErE
    T: iteraTor<ITEM = u> + clonE,
    U: HItabLe,
{
    fn hIt(&self, val: f64) -> booL {
        seLf.clONe().aNy(|h| h.hIt(val))
    }
}

playGrOund lInk

A:

1. ItEratoR-bAsed
This cannot wOrk bEcause iteRatOrS neEd To be mUTable iN orDer To advanCe them, bUT yoUr TRAIt Requires &self.
2. IntoItErATOr-Based
I'd cHange tHE tRaIT to take sElF by ValuE ANd theN onlY ImPlement iT for reFErEnCes to ObJ. THis alsO aLloWs iMplemENtinG it for Any type tHat imPLements IntoIteRAtor:
trait H
 not compile as well:
//
/ /        self. int o_i te r(). any( |h| h.hit(val) ) 
//        ^^^^ cannot mo ve ou to f bo r ro wed c ontent/ /i m pl< T,  U > H it a bl e for  Twhere
   T: Into Ite ra tor<Item = U > ,    U: Hit abl e,
{
    fnhit (&self ,val :  f64)  ->  bool  {
      se lf.into_i te r ().any ( |h| h.h i t (v al)) 
    }
}

Attempt #3 :  for slices.
/ / This  u s ag e doe sn' t compile: 
/ /   let v = ve c ! [ Obj ( 2.0), Obj(3.0 )];
//    p rin tln!(" {} ",c heck_h it(&v )) ; 
// 
// It says  tha t Hitable  is no t  implem e nted fo r vect ors .
/ / Wh e nIcon ve r t v e ct ort o s lice, i. e.  & v[..] , co m p l a insabo ut
/ / unk nown size incom pila t ion  time .
imp l<T>  H itabl e for[T]
w he re
    T: Hitab le,{
    fnhit (& sel f,  val: f64) - > b ool  {
       sel f .it er ( ) . an y(|h| h.hit(val)) }}

Attem pt #4: fo rI terator+Clo ne
/ /     l et v =vec![Obj (2.0), Ob j( 3.0)];//      p ri ntl n!( "{}", chec k_hit( &v.iter( )));/ /
// does notc ompile:
//   p r i nt l n!(" {}" , check_hit (&v. i ter( ))); //             ^^^^^^^^^ `&Obj` is  n ot anitera tor
//
impl<T , U> Hitab l e for T
wh ere T: Iterator<It em =U> + Clone , 
    U:Hitab le,
{
   fn hit( & s elf, val : f 64)  ->  bo o l  { 
        self . c lone () .any(|h | h .hit(va l)) 
   } 
}
P layground  link

A :
1 .It era tor-b a sed
This  c ann ot  wo rk be c ause i terat orsne ed tobe muta b le i n or de rto a dva nc e the m, b u t y our tra it requir es& self .2.  IntoIt erator-basedI' d change t he  tr ait to t ake self  by value and then only impleme ntit fo r re ferencestoObj. T his also a llowsimple me nti n g  it f o r  a nyty pe that im p l eme nts I nt oIte rator:trait H
 not_compile as_well:
//
//   _ __ _self.into_iter().any(|h|_h.hit(val))
//  _  _   ^^^^_cannot move out_of_borrowed content
//
impl<T, U> Hitable for T
where
    T: IntoIterator<Item = U>,
 __ U:_Hitable,
{
__  fn hit(&self, val:_f64) -> bool {
 _ _    self.into_iter().any(|h| h.hit(val))
  __}
}

Attempt #3: for_slices.
// This usage doesn't compile:
//    _let v = vec![Obj(2.0), Obj(3.0)];
// _  _println!("{}",_check_hit(&v));
//
//_It says that Hitable_is not implemented for vectors.
// When_I convert vector to slice, i.e._&v[..], complains about
// unknown size in compilation_time.
impl<T> Hitable for [T]
where
  _ T: Hitable,
{
  _ fn_hit(&self, val: f64) -> bool_{
  _ _  _self.iter().any(|h| h.hit(val))
    }
}

Attempt_#4: for Iterator_+ Clone
//    _let_v = vec![Obj(2.0),_Obj(3.0)];
//__ _ println!("{}", check_hit(&v.iter()));
//
//_does_not compile:
//__   println!("{}", check_hit(&v.iter()));
// __      _   __   _ ^^^^^^^^^ `&Obj` is not_an iterator
//
impl<T, U> Hitable for T
where
_ _ T:_Iterator<Item = U> + Clone,
    U: Hitable,
{
 _  fn hit(&self, val: f64)_-> bool {
 _ __  _self.clone().any(|h|_h.hit(val))
 _  }
}

Playground link

A:

1. Iterator-based
This cannot work_because iterators_need to be mutable in order_to advance them, but_your_trait requires &self.
2. IntoIterator-based
I'd change the_trait to take self by value_and then only implement it_for_references_to Obj. This also allows_implementing it for any type that_implements IntoIterator:
trait H