@@ -714,7 +714,9 @@ fn render_impls(
714
714
None ,
715
715
false ,
716
716
true ,
717
+ true ,
717
718
& [ ] ,
719
+ true ,
718
720
) ;
719
721
buffer. into_inner ( )
720
722
} )
@@ -1053,7 +1055,9 @@ fn render_assoc_items(
1053
1055
None ,
1054
1056
false ,
1055
1057
true ,
1058
+ true ,
1056
1059
& [ ] ,
1060
+ true ,
1057
1061
) ;
1058
1062
}
1059
1063
}
@@ -1254,9 +1258,12 @@ fn render_impl(
1254
1258
use_absolute : Option < bool > ,
1255
1259
is_on_foreign_type : bool ,
1256
1260
show_default_items : bool ,
1261
+ // It'll exclude methods.
1262
+ show_non_assoc_items : bool ,
1257
1263
// This argument is used to reference same type with different paths to avoid duplication
1258
1264
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
1259
1265
aliases : & [ String ] ,
1266
+ toggle_open_by_default : bool ,
1260
1267
) {
1261
1268
let cache = cx. cache ( ) ;
1262
1269
let traits = & cache. traits ;
@@ -1280,16 +1287,18 @@ fn render_impl(
1280
1287
is_default_item : bool ,
1281
1288
trait_ : Option < & clean:: Trait > ,
1282
1289
show_def_docs : bool ,
1290
+ show_non_assoc_items : bool ,
1283
1291
) {
1284
1292
let item_type = item. type_ ( ) ;
1285
1293
let name = item. name . as_ref ( ) . unwrap ( ) ;
1286
1294
1287
- let render_method_item = match render_mode {
1288
- RenderMode :: Normal => true ,
1289
- RenderMode :: ForDeref { mut_ : deref_mut_ } => {
1290
- should_render_item ( & item, deref_mut_, cx. cache ( ) )
1291
- }
1292
- } ;
1295
+ let render_method_item = show_non_assoc_items
1296
+ && match render_mode {
1297
+ RenderMode :: Normal => true ,
1298
+ RenderMode :: ForDeref { mut_ : deref_mut_ } => {
1299
+ should_render_item ( & item, deref_mut_, cx. cache ( ) )
1300
+ }
1301
+ } ;
1293
1302
1294
1303
let in_trait_class = if trait_. is_some ( ) { " trait-impl" } else { "" } ;
1295
1304
@@ -1456,6 +1465,7 @@ fn render_impl(
1456
1465
false ,
1457
1466
trait_. map ( |t| & t. trait_ ) ,
1458
1467
show_def_docs,
1468
+ show_non_assoc_items,
1459
1469
) ;
1460
1470
}
1461
1471
@@ -1469,6 +1479,7 @@ fn render_impl(
1469
1479
containing_item : & clean:: Item ,
1470
1480
render_mode : RenderMode ,
1471
1481
show_def_docs : bool ,
1482
+ show_non_assoc_items : bool ,
1472
1483
) {
1473
1484
for trait_item in & t. items {
1474
1485
let n = trait_item. name ;
@@ -1491,6 +1502,7 @@ fn render_impl(
1491
1502
true ,
1492
1503
Some ( t) ,
1493
1504
show_def_docs,
1505
+ show_non_assoc_items,
1494
1506
) ;
1495
1507
}
1496
1508
}
@@ -1511,14 +1523,19 @@ fn render_impl(
1511
1523
parent,
1512
1524
render_mode,
1513
1525
show_def_docs,
1526
+ show_non_assoc_items,
1514
1527
) ;
1515
1528
}
1516
1529
}
1517
1530
if render_mode == RenderMode :: Normal {
1518
1531
let toggled = !( impl_items. is_empty ( ) && default_impl_items. is_empty ( ) ) ;
1519
1532
if toggled {
1520
1533
close_tags. insert_str ( 0 , "</details>" ) ;
1521
- write ! ( w, "<details class=\" rustdoc-toggle implementors-toggle\" open>" ) ;
1534
+ write ! (
1535
+ w,
1536
+ "<details class=\" rustdoc-toggle implementors-toggle\" {}>" ,
1537
+ if toggle_open_by_default { " open" } else { "" }
1538
+ ) ;
1522
1539
write ! ( w, "<summary>" )
1523
1540
}
1524
1541
render_impl_summary (
0 commit comments