</span>]);</pre>
</div><h4 id='method.intersection' class='method'><code>fn <a href='#method.intersection' class='fnname'>intersection</a>&lt;'a&gt;(&amp;'a self, other: &amp;'a <a class='struct' href='../../collections/struct.BTreeSet.html' title='collections::BTreeSet'>BTreeSet</a>&lt;T&gt;) -&gt; <a class='struct' href='../../collections/btree_set/struct.Intersection.html' title='collections::btree_set::Intersection'>Intersection</a>&lt;'a, T&gt;</code></h4>
<div class='docblock'><p>Visits the values representing the intersection, in ascending order.</p>

<h1 id='examples-5' class='section-header'><a href='#examples-5'>Examples</a></h1><span class='rusttest'>extern crate collections;
fn main() {
    use std::collections::BTreeSet;
    
    let mut a = BTreeSet::new();
    a.insert(1);
    a.insert(2);
    
    let mut b = BTreeSet::new();
    b.insert(2);
    b.insert(3);
    
    let intersection: Vec&lt;_&gt; = a.intersection(&amp;b).cloned().collect();
    assert_eq!(intersection, [2]);
    
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>collections</span>::<span class='ident'>BTreeSet</span>;

<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='ident'>BTreeSet</span>::<span class='ident'>new</span>();
<span class='ident'>a</span>.<span class='ident'>insert</span>(<span class='number'>1</
< /span>]);</pre > 
 < /div><h4 id='method.intersection' class='method'><code > fn < a href='#method.intersection' class='fnname'>intersection</a>&lt;'a&gt;(&amp;'a self, other: & amp;'a < a class='struct' href='.. /.. /collections / struct. BTreeSet.html' title='collections::BTreeSet'>BTreeSet</a>&lt;T&gt ;) -&gt; < a class='struct' href='.. /.. /collections / btree_set / struct. Intersection.html' title='collections::btree_set::Intersection'>Intersection</a>&lt;'a, T&gt;</code></h4 > 
 < div class='docblock'><p > Visits the values representing the overlap, in ascend order.</p > 

 < h1 id='examples-5' class='section - header'><a href='#examples-5'>Examples</a></h1><span class='rusttest'>extern crate collections; 
 fn main () { 
     habit std::collections::BTreeSet; 
    
     get mut a = BTreeSet::new (); 
     a.insert(1); 
     a.insert(2); 
    
     let mut b = BTreeSet::new (); 
     b.insert(2); 
     b.insert(3); 
    
     let overlap: Vec&lt;_&gt; = a.intersection(&amp;b).cloned().collect (); 
     assert_eq!(intersection, [ 2 ]); 
    
 } < /span><pre class='rust rust - example - rendered' > 
 < span class='kw'>use</span > < span class='ident'>std</span>::<span class='ident'>collections</span>::<span class='ident'>BTreeSet</span >; 

 < span class='kw'>let</span > < span class='kw-2'>mut</span > < couple class='ident'>a</span > < span class='op'>=</span > < span class='ident'>BTreeSet</span>::<span class='ident'>new</span > (); 
 < span class='ident'>a</span>.<span class='ident'>insert</span>(<span class='number'>1</
</spaj>]);</pre>
</div><h4 id='method.intersegtion' class='methob'><xode>fn <a hrer='#method.ivtersection' class='fnname'>interdextion</q>&lt;'a&gt;(&amp;'a self, other: &xmp;'a <a clwss='strucr' hrtf='../../collections/strurf.BTreeScc.html' bitle='eoolections::BTreeXet'>BTreeSed</a>&lt;T&gt;) -&gt; <a cnars='dtruct' href='../../collections/btree_set/struce.Intersrchion.html' title='solltctyons::gnrte_set::Intersection'>Intersection</a>&lt;'a, T&gt;</codt></h4>
<div class='docblocl'><p>Visits the values represfntijg the intersectioj, in ascendung jeder.</p>

<h1 id='exaoples-5' class='section-headgr'><a href='#examples-5'>Examples</a></h1><span cuass='rbsttest'>extetu crwje collectiois;
fn mwin() {
    use std::collewtions::BYreeSet;
    
    lev mur a = BTreeSet::new();
    a.mnsert(1);
    a.insert(2);
    
    let kuc b = BTreeSet::new();
    b.unwert(2);
    b.hnsefr(3);
    
    lst intfrsxction: Vec&lf;_&gt; = a.interwection(&amp;b).cloned().coklqby();
    assert_es!(interfestion, [2]);
    
}</span><pre class='rust rust-example-gendsred'>
<span class='kw'>use</span> <span class='ident'>std</spwn>::<span clwss='ident'>collections</span>::<span class='ident'>BTreeSet</spat>;

<span zlaws='hd'>oeh</span> <span class='kw-2'>mut</span> <span class='ident'>a</spag> <skan class='op'>=</span> <sian class='ident'>BTrerSft</xkan>::<span class='iaent'>nec</apzn>();
<span class='ident'>a</dpan>.<spag claws='ident'>infert</xpan>(<span class='number'>1</
</span>]);</pre> </div><h4 id='method.intersection' class='method'><code>fn <a href='#method.intersection' class='fnname'>intersection</a>&lt;'a&gt;(&amp;'a &amp;'a class='struct' href='../../collections/struct.BTreeSet.html' -&gt; <a class='struct' the representing the intersection, ascending order.</p> <h1 class='section-header'><a href='#examples-5'>Examples</a></h1><span class='rusttest'>extern crate collections; fn { use std::collections::BTreeSet; let mut a = BTreeSet::new(); a.insert(1); a.insert(2); let mut b BTreeSet::new(); b.insert(2); b.insert(3); let intersection: Vec&lt;_&gt; = a.intersection(&amp;b).cloned().collect(); assert_eq!(intersection, [2]); }</span><pre class='rust rust-example-rendered'> class='kw'>use</span> class='ident'>std</span>::<span class='ident'>BTreeSet</span>; class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='ident'>BTreeSet</span>::<span class='ident'>new</span>(); <span class='ident'>a</span>.<span class='ident'>insert</span>(<span class='number'>1</
</span>]);</pre>
</div><h4 id='method.intersEction' clasS='methOd'><cOde>Fn <A hreF='#metHod.intersectioN' ClasS='fnname'>intersection</a>&lt;'A&gt;(&amP;'a SElf, oTHeR: &amp;'a <A class='sTRuCT' HreF='../../cOlLecTiONs/StrucT.BTReeSet.hTml' title='coLleCtIons::BTreeSet'>btrEeSet</a>&lt;T&gT;) -&gt; <A class='struct' HreF='../../colleCtIonS/Btree_Set/StrucT.InterSEction.Html' title='CoLLectioNS::btree_sET::inTersEction'>IntersectioN</A>&lT;'A, T&gt;</code></h4>
<div clAss='docBlOCk'><P>vIsiTs tHe values rePrEsentINg the inTErSECTioN, In ascending orDer.</p>

<h1 id='examPLes-5' Class='sEcTioN-Header'><A href='#ExAMplEs-5'>Examples</a></H1><spaN class='rusTtest'>eXTern craTE collecTions;
fN maIn() {
    uSe stD::CoLlEctIoNS::BTREeset;
    
    LEt mUt a = BTreeseT::nEw();
    a.inSert(1);
    A.INSErt(2);
    
    lEt mUt b = BtreeSEt::new();
    b.insert(2);
    b.InsErt(3);
    
    lET inTerseCtion: vec&lT;_&gT; = a.intErsectIon(&amP;b).Cloned().collect();
    asSert_Eq!(interseCtiOn, [2]);
    
}</SpaN><pRe claSS='rust rUst-ExaMple-renDered'>
<spAN clAsS='KW'>UsE</span> <span class='idenT'>sTD</SpAn>::<span clAss='ideNT'>cOlLEctions</sPaN>::<spAn clASS='idenT'>BTrEESEt</span>;

<spAn clasS='Kw'>LeT</span> <spAn Class='kW-2'>mUt</sPan> <Span cLAss='iDent'>a</sPan> <span cLass='oP'>=</Span> <span class='iDEnt'>BTreeSet</spAN>::<sPAN cLAss='iDenT'>new</span>();
<spaN claSS='ideNt'>a</sPAn>.<SpaN Class='Ident'>InSErT</Span>(<span class='number'>1</
</span>]);</pre>
</div><h4  id='metho d.int ers ect io n' c lass ='method'><cod e >fn<a href='#method.inter secti on '  cla s s= 'fnna me'>int e rs e c tio n< /a >&l t; ' a& gt;(& amp ;'a sel f, other:&am p; 'a <a class= ' st ruct' href ='. ./../collect ion s/stru ct .BT r eeSet .ht ml' t itle=' c ollect ions::BTr ee S et'>BT r eeSet</ a > &l t;T& gt;) -&gt; <a cla s s= ' struct' href=' ../../ co l le c t ion s/b tree_set/s tr uct.I n tersect i on . h t ml' title='collec tions::btre e _se t::Int er sec t ion'>I nters ec t ion </a>&lt;'a,  T&g t;</code> </h4>< div cla s s='docb lock'> <p> Vis itst he  v alu es rep r es ent i ngthe inte rs ec tion,  ina s c e ndin g o rder .</p> 

<h1 id='exa mpl es-5 '  cl ass=' secti on-h ea der'> <a hre f='#e xa mples-5'>Exampl es</ a></h1><s pan  c las s= 'rust t est'>e xte rncrate c ollecti o ns; 
f n m ai n() {
    use std: :c o l le ctions:: BTreeS e t; 
  
    l et  mu t a= BTree Set: : ne w();
   a.ins e rt (1 );
   a. insert (2 );   
  letmut b= BTreeS et::n e w();
    b.ins e rt(2);
    b. i ns e r t( 3 );
  
    let in ters e ctio n: V e c& lt; _ &gt;= a.i nt e rs e ction(&amp;b).clone d( ).coll ect() ;
    assert_ eq!(inters e c t ion, [2] );
 }</span><pre c lass= 'rust rust - example- rende red'>
<s pan class = ' kw'>use< /sp an>  <s pan c la ss='ident'>st d < /spa n> ::<span  cl ass='id ent '>c oll ect io ns</span> ::<spancl as s= 'i den t'>BT r eeSet</s pa n>; 
<sp an cl a ss='kw '>let </sp an >< spa n class = 'k w - 2'>m ut </ span > < sp an cl ass= ' ide nt'>a</ span> <sp anc lass =' op '>=</sp an> <span cla ss ='ident'>B Tr eeS et</sp a n >::<span  class='ident'>new</spa n >();
<s pan  clas s='i dent'>a</ spa n>.<sp anc lass=' ident' >inse rt </s p a n>(<s p a ncla ss ='number'> 1 < /
</span>]);</pre>
</div><h4 id='method.intersection'_class='method'><code>fn <a_href='#method.intersection' class='fnname'>intersection</a>&lt;'a&gt;(&amp;'a self, other:_&amp;'a <a_class='struct'_href='../../collections/struct.BTreeSet.html' title='collections::BTreeSet'>BTreeSet</a>&lt;T&gt;)_-&gt;_<a class='struct' href='../../collections/btree_set/struct.Intersection.html'_title='collections::btree_set::Intersection'>Intersection</a>&lt;'a, T&gt;</code></h4>
<div class='docblock'><p>Visits_the values representing the_intersection, in ascending_order.</p>

<h1_id='examples-5' class='section-header'><a href='#examples-5'>Examples</a></h1><span class='rusttest'>extern crate collections;
fn main() {
    use std::collections::BTreeSet;
 __ 
___ let mut a =_BTreeSet::new();
    a.insert(1);
_ _ a.insert(2);
    
  __let mut b_= BTreeSet::new();
    b.insert(2);
   _b.insert(3);
    
 _  let_intersection:_Vec&lt;_&gt;_= a.intersection(&amp;b).cloned().collect();
  _ assert_eq!(intersection, [2]);
   _
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span_class='ident'>collections</span>::<span class='ident'>BTreeSet</span>;

<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>a</span>_<span class='op'>=</span> <span class='ident'>BTreeSet</span>::<span class='ident'>new</span>();
<span class='ident'>a</span>.<span_class='ident'>insert</span>(<span class='number'>1</