1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769
// // DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/xpccomponents.idl // /// `interface nsIXPCComponents_InterfacesByID : nsISupports` /// /// ```text /// /** /// * interface of Components.interfacesByID /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_InterfacesByID { vtable: *const nsIXPCComponents_InterfacesByIDVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_InterfacesByID. unsafe impl XpCom for nsIXPCComponents_InterfacesByID { const IID: nsIID = nsID(0xf235ef76, 0x9919, 0x478b, [0xaa, 0x0f, 0x28, 0x2d, 0x99, 0x4d, 0xdf, 0x76]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_InterfacesByID { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_InterfacesByID. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_InterfacesByIDCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_InterfacesByID`. fn coerce_from(v: &nsIXPCComponents_InterfacesByID) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_InterfacesByIDCoerce for nsIXPCComponents_InterfacesByID { #[inline] fn coerce_from(v: &nsIXPCComponents_InterfacesByID) -> &Self { v } } impl nsIXPCComponents_InterfacesByID { /// Cast this `nsIXPCComponents_InterfacesByID` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_InterfacesByIDCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_InterfacesByID { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_InterfacesByIDCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_InterfacesByID) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_InterfacesByID // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_InterfacesByIDVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_InterfacesByID { } /// `interface nsIXPCComponents_Interfaces : nsISupports` /// /// ```text /// /** /// * interface of Components.interfaces /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Interfaces { vtable: *const nsIXPCComponents_InterfacesVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Interfaces. unsafe impl XpCom for nsIXPCComponents_Interfaces { const IID: nsIID = nsID(0xb8c31bba, 0x79db, 0x4a1d, [0x93, 0x0d, 0x4c, 0xdd, 0x68, 0x71, 0x3f, 0x9e]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Interfaces { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Interfaces. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_InterfacesCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Interfaces`. fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_InterfacesCoerce for nsIXPCComponents_Interfaces { #[inline] fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self { v } } impl nsIXPCComponents_Interfaces { /// Cast this `nsIXPCComponents_Interfaces` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_InterfacesCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Interfaces { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_InterfacesCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Interfaces // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_InterfacesVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Interfaces { } /// `interface nsIXPCComponents_Classes : nsISupports` /// /// ```text /// /** /// * interface of Components.classes /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Classes { vtable: *const nsIXPCComponents_ClassesVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Classes. unsafe impl XpCom for nsIXPCComponents_Classes { const IID: nsIID = nsID(0x978ff520, 0xd26c, 0x11d2, [0x98, 0x42, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Classes { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Classes. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_ClassesCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Classes`. fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_ClassesCoerce for nsIXPCComponents_Classes { #[inline] fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self { v } } impl nsIXPCComponents_Classes { /// Cast this `nsIXPCComponents_Classes` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_ClassesCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Classes { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_ClassesCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Classes // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_ClassesVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* void initialize (in nsIJSCID cid, in string idString); */ pub Initialize: unsafe extern "system" fn (this: *const nsIXPCComponents_Classes, cid: *const nsIJSCID, idString: *const libc::c_char) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Classes { /// `void initialize (in nsIJSCID cid, in string idString);` #[inline] pub unsafe fn Initialize(&self, cid: *const nsIJSCID, idString: *const libc::c_char) -> nsresult { ((*self.vtable).Initialize)(self, cid, idString) } } /// `interface nsIXPCComponents_ClassesByID : nsISupports` /// /// ```text /// /** /// * interface of Components.classesByID /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_ClassesByID { vtable: *const nsIXPCComponents_ClassesByIDVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_ClassesByID. unsafe impl XpCom for nsIXPCComponents_ClassesByID { const IID: nsIID = nsID(0x336a9590, 0x4d19, 0x11d3, [0x98, 0x93, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_ClassesByID { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_ClassesByID. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_ClassesByIDCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_ClassesByID`. fn coerce_from(v: &nsIXPCComponents_ClassesByID) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_ClassesByIDCoerce for nsIXPCComponents_ClassesByID { #[inline] fn coerce_from(v: &nsIXPCComponents_ClassesByID) -> &Self { v } } impl nsIXPCComponents_ClassesByID { /// Cast this `nsIXPCComponents_ClassesByID` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_ClassesByIDCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_ClassesByID { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_ClassesByIDCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_ClassesByID) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_ClassesByID // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_ClassesByIDVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_ClassesByID { } /// `interface nsIXPCComponents_Results : nsISupports` /// /// ```text /// /** /// * interface of Components.results /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Results { vtable: *const nsIXPCComponents_ResultsVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Results. unsafe impl XpCom for nsIXPCComponents_Results { const IID: nsIID = nsID(0x2fc229a0, 0x5860, 0x11d3, [0x98, 0x99, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Results { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Results. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_ResultsCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Results`. fn coerce_from(v: &nsIXPCComponents_Results) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_ResultsCoerce for nsIXPCComponents_Results { #[inline] fn coerce_from(v: &nsIXPCComponents_Results) -> &Self { v } } impl nsIXPCComponents_Results { /// Cast this `nsIXPCComponents_Results` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_ResultsCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Results { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_ResultsCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Results) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Results // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_ResultsVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Results { } /// `interface nsIXPCComponents_ID : nsISupports` /// /// ```text /// /** /// * interface of Components.ID /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_ID { vtable: *const nsIXPCComponents_IDVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_ID. unsafe impl XpCom for nsIXPCComponents_ID { const IID: nsIID = nsID(0x7994a6e0, 0xe028, 0x11d3, [0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_ID { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_ID. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_IDCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_ID`. fn coerce_from(v: &nsIXPCComponents_ID) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_IDCoerce for nsIXPCComponents_ID { #[inline] fn coerce_from(v: &nsIXPCComponents_ID) -> &Self { v } } impl nsIXPCComponents_ID { /// Cast this `nsIXPCComponents_ID` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_IDCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_ID { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_IDCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_ID) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_ID // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_IDVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_ID { } /// `interface nsIXPCComponents_Exception : nsISupports` /// /// ```text /// /** /// * interface of Components.Exception /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Exception { vtable: *const nsIXPCComponents_ExceptionVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Exception. unsafe impl XpCom for nsIXPCComponents_Exception { const IID: nsIID = nsID(0x5bf039c0, 0xe028, 0x11d3, [0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Exception { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Exception. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_ExceptionCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Exception`. fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_ExceptionCoerce for nsIXPCComponents_Exception { #[inline] fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self { v } } impl nsIXPCComponents_Exception { /// Cast this `nsIXPCComponents_Exception` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_ExceptionCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Exception { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_ExceptionCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Exception // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_ExceptionVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Exception { } /// `interface nsIXPCComponents_Constructor : nsISupports` /// /// ```text /// /** /// * interface of Components.Constructor /// * (interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Constructor { vtable: *const nsIXPCComponents_ConstructorVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Constructor. unsafe impl XpCom for nsIXPCComponents_Constructor { const IID: nsIID = nsID(0x88655640, 0xe028, 0x11d3, [0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Constructor { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Constructor. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_ConstructorCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Constructor`. fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_ConstructorCoerce for nsIXPCComponents_Constructor { #[inline] fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self { v } } impl nsIXPCComponents_Constructor { /// Cast this `nsIXPCComponents_Constructor` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_ConstructorCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Constructor { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_ConstructorCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Constructor // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_ConstructorVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Constructor { } /// `interface nsIXPCConstructor : nsISupports` /// /// ```text /// /** /// * interface of object returned by Components.Constructor /// * (additional interesting stuff only reflected into JavaScript) /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCConstructor { vtable: *const nsIXPCConstructorVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCConstructor. unsafe impl XpCom for nsIXPCConstructor { const IID: nsIID = nsID(0xc814ca20, 0xe0dc, 0x11d3, [0x8f, 0x5f, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCConstructor { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCConstructor. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCConstructorCoerce { /// Cheaply cast a value of this type from a `nsIXPCConstructor`. fn coerce_from(v: &nsIXPCConstructor) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCConstructorCoerce for nsIXPCConstructor { #[inline] fn coerce_from(v: &nsIXPCConstructor) -> &Self { v } } impl nsIXPCConstructor { /// Cast this `nsIXPCConstructor` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCConstructorCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCConstructor { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCConstructorCoerce for T { #[inline] fn coerce_from(v: &nsIXPCConstructor) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCConstructor // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCConstructorVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* readonly attribute nsIJSCID classID; */ pub GetClassID: unsafe extern "system" fn (this: *const nsIXPCConstructor, aClassID: *mut *const nsIJSCID) -> nsresult, /* readonly attribute nsIJSIID interfaceID; */ pub GetInterfaceID: unsafe extern "system" fn (this: *const nsIXPCConstructor, aInterfaceID: *mut *const nsIJSIID) -> nsresult, /* readonly attribute string initializer; */ pub GetInitializer: unsafe extern "system" fn (this: *const nsIXPCConstructor, aInitializer: *mut *const libc::c_char) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCConstructor { /// `readonly attribute nsIJSCID classID;` #[inline] pub unsafe fn GetClassID(&self, aClassID: *mut *const nsIJSCID) -> nsresult { ((*self.vtable).GetClassID)(self, aClassID) } /// `readonly attribute nsIJSIID interfaceID;` #[inline] pub unsafe fn GetInterfaceID(&self, aInterfaceID: *mut *const nsIJSIID) -> nsresult { ((*self.vtable).GetInterfaceID)(self, aInterfaceID) } /// `readonly attribute string initializer;` #[inline] pub unsafe fn GetInitializer(&self, aInitializer: *mut *const libc::c_char) -> nsresult { ((*self.vtable).GetInitializer)(self, aInitializer) } } /// `interface nsIXPCComponents_utils_Sandbox : nsISupports` /// /// ```text /// /** /// * interface of object returned by Components.utils.Sandbox. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_utils_Sandbox { vtable: *const nsIXPCComponents_utils_SandboxVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_utils_Sandbox. unsafe impl XpCom for nsIXPCComponents_utils_Sandbox { const IID: nsIID = nsID(0x4f8ae0dc, 0xd266, 0x4a32, [0x87, 0x5b, 0x6a, 0x9d, 0xe7, 0x1a, 0x8c, 0xe9]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_utils_Sandbox { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_utils_Sandbox. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_utils_SandboxCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_utils_Sandbox`. fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_utils_SandboxCoerce for nsIXPCComponents_utils_Sandbox { #[inline] fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self { v } } impl nsIXPCComponents_utils_Sandbox { /// Cast this `nsIXPCComponents_utils_Sandbox` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_utils_SandboxCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_utils_Sandbox { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_utils_SandboxCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_utils_Sandbox // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_utils_SandboxVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_utils_Sandbox { } /// `interface ScheduledGCCallback : nsISupports` /// /// ```text /// /** /// * interface for callback to be passed to Cu.schedulePreciseGC /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct ScheduledGCCallback { vtable: *const ScheduledGCCallbackVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for ScheduledGCCallback. unsafe impl XpCom for ScheduledGCCallback { const IID: nsIID = nsID(0x71000535, 0xb0fd, 0x44d1, [0x8c, 0xe0, 0x90, 0x97, 0x60, 0xe3, 0x95, 0x3c]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for ScheduledGCCallback { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from ScheduledGCCallback. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait ScheduledGCCallbackCoerce { /// Cheaply cast a value of this type from a `ScheduledGCCallback`. fn coerce_from(v: &ScheduledGCCallback) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl ScheduledGCCallbackCoerce for ScheduledGCCallback { #[inline] fn coerce_from(v: &ScheduledGCCallback) -> &Self { v } } impl ScheduledGCCallback { /// Cast this `ScheduledGCCallback` to one of its base interfaces. #[inline] pub fn coerce<T: ScheduledGCCallbackCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for ScheduledGCCallback { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> ScheduledGCCallbackCoerce for T { #[inline] fn coerce_from(v: &ScheduledGCCallback) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every ScheduledGCCallback // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct ScheduledGCCallbackVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* void callback (); */ pub Callback: unsafe extern "system" fn (this: *const ScheduledGCCallback) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl ScheduledGCCallback { /// `void callback ();` #[inline] pub unsafe fn Callback(&self, ) -> nsresult { ((*self.vtable).Callback)(self, ) } } /// `interface nsIBlockThreadedExecutionCallback : nsISupports` /// /// ```text /// /** /// * Interface for callback to be passed to Cu.blockThreadedExecution. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIBlockThreadedExecutionCallback { vtable: *const nsIBlockThreadedExecutionCallbackVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIBlockThreadedExecutionCallback. unsafe impl XpCom for nsIBlockThreadedExecutionCallback { const IID: nsIID = nsID(0xc3b85a5c, 0xc328, 0x47d4, [0xaa, 0xaf, 0x38, 0x4c, 0x4f, 0xf9, 0xd7, 0x7d]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIBlockThreadedExecutionCallback { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIBlockThreadedExecutionCallback. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIBlockThreadedExecutionCallbackCoerce { /// Cheaply cast a value of this type from a `nsIBlockThreadedExecutionCallback`. fn coerce_from(v: &nsIBlockThreadedExecutionCallback) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIBlockThreadedExecutionCallbackCoerce for nsIBlockThreadedExecutionCallback { #[inline] fn coerce_from(v: &nsIBlockThreadedExecutionCallback) -> &Self { v } } impl nsIBlockThreadedExecutionCallback { /// Cast this `nsIBlockThreadedExecutionCallback` to one of its base interfaces. #[inline] pub fn coerce<T: nsIBlockThreadedExecutionCallbackCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIBlockThreadedExecutionCallback { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIBlockThreadedExecutionCallbackCoerce for T { #[inline] fn coerce_from(v: &nsIBlockThreadedExecutionCallback) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIBlockThreadedExecutionCallback // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIBlockThreadedExecutionCallbackVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* void callback (); */ pub Callback: unsafe extern "system" fn (this: *const nsIBlockThreadedExecutionCallback) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIBlockThreadedExecutionCallback { /// `void callback ();` #[inline] pub unsafe fn Callback(&self, ) -> nsresult { ((*self.vtable).Callback)(self, ) } } /// `interface nsIXPCComponents_Utils : nsISupports` /// /// ```text /// /** /// * interface of Components.utils /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents_Utils { vtable: *const nsIXPCComponents_UtilsVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents_Utils. unsafe impl XpCom for nsIXPCComponents_Utils { const IID: nsIID = nsID(0x86003fe3, 0xee9a, 0x4620, [0x91, 0xdc, 0xee, 0xf8, 0xb1, 0xe5, 0x88, 0x15]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents_Utils { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents_Utils. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponents_UtilsCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents_Utils`. fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponents_UtilsCoerce for nsIXPCComponents_Utils { #[inline] fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self { v } } impl nsIXPCComponents_Utils { /// Cast this `nsIXPCComponents_Utils` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponents_UtilsCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents_Utils { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponents_UtilsCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents_Utils // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponents_UtilsVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* [implicit_jscontext] void reportError (in jsval error); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub ReportError: *const ::libc::c_void, /* readonly attribute nsIXPCComponents_utils_Sandbox Sandbox; */ pub GetSandbox: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aSandbox: *mut *const nsIXPCComponents_utils_Sandbox) -> nsresult, /* [implicit_jscontext,optional_argc] jsval evalInSandbox (in AString source, in jsval sandbox, [optional] in jsval version, [optional] in AUTF8String filename, [optional] in long lineNo); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub EvalInSandbox: *const ::libc::c_void, /* [implicit_jscontext] jsval getSandboxAddonId (in jsval sandbox); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetSandboxAddonId: *const ::libc::c_void, /* [implicit_jscontext] jsval getSandboxMetadata (in jsval sandbox); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetSandboxMetadata: *const ::libc::c_void, /* [implicit_jscontext] void setSandboxMetadata (in jsval sandbox, in jsval metadata); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub SetSandboxMetadata: *const ::libc::c_void, /* [implicit_jscontext,optional_argc] jsval import (in AUTF8String aResourceURI, [optional] in jsval targetObj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub Import: *const ::libc::c_void, /* boolean isModuleLoaded (in AUTF8String aResourceURI); */ pub IsModuleLoaded: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aResourceURI: &::nsstring::nsACString, _retval: *mut bool) -> nsresult, /* void unload (in AUTF8String registryLocation); */ pub Unload: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, registryLocation: &::nsstring::nsACString) -> nsresult, /* [implicit_jscontext] void importGlobalProperties (in jsval aPropertyList); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub ImportGlobalProperties: *const ::libc::c_void, /* [implicit_jscontext] xpcIJSWeakReference getWeakReference (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetWeakReference: *const ::libc::c_void, /* void forceGC (); */ pub ForceGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* void forceCC ([optional] in nsICycleCollectorListener aListener); */ pub ForceCC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aListener: *const nsICycleCollectorListener) -> nsresult, /* void finishCC (); */ pub FinishCC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* void ccSlice (in long long budget); */ pub CcSlice: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, budget: libc::int64_t) -> nsresult, /* long getMaxCCSliceTimeSinceClear (); */ pub GetMaxCCSliceTimeSinceClear: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut libc::int32_t) -> nsresult, /* void clearMaxCCTime (); */ pub ClearMaxCCTime: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* void forceShrinkingGC (); */ pub ForceShrinkingGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* void schedulePreciseGC (in ScheduledGCCallback callback); */ pub SchedulePreciseGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, callback: *const ScheduledGCCallback) -> nsresult, /* void schedulePreciseShrinkingGC (in ScheduledGCCallback callback); */ pub SchedulePreciseShrinkingGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, callback: *const ScheduledGCCallback) -> nsresult, /* void unlinkGhostWindows (); */ pub UnlinkGhostWindows: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* [implicit_jscontext] jsval getJSTestingFunctions (); */ /// Unable to generate binding because `jscontext is unsupported` pub GetJSTestingFunctions: *const ::libc::c_void, /* [implicit_jscontext] jsval callFunctionWithAsyncStack (in jsval function, in nsIStackFrame stack, in AString asyncCause); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub CallFunctionWithAsyncStack: *const ::libc::c_void, /* [implicit_jscontext] jsval getGlobalForObject (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetGlobalForObject: *const ::libc::c_void, /* [implicit_jscontext] boolean isProxy (in jsval vobject); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub IsProxy: *const ::libc::c_void, /* [implicit_jscontext] jsval exportFunction (in jsval vfunction, in jsval vscope, [optional] in jsval voptions); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub ExportFunction: *const ::libc::c_void, /* [implicit_jscontext] jsval createObjectIn (in jsval vobj, [optional] in jsval voptions); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub CreateObjectIn: *const ::libc::c_void, /* [implicit_jscontext] void makeObjectPropsNormal (in jsval vobj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub MakeObjectPropsNormal: *const ::libc::c_void, /* bool isDeadWrapper (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub IsDeadWrapper: *const ::libc::c_void, /* bool isCrossProcessWrapper (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub IsCrossProcessWrapper: *const ::libc::c_void, /* ACString getCrossProcessWrapperTag (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetCrossProcessWrapperTag: *const ::libc::c_void, /* void permitCPOWsInScope (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub PermitCPOWsInScope: *const ::libc::c_void, /* [implicit_jscontext] void recomputeWrappers ([optional] in jsval vobj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub RecomputeWrappers: *const ::libc::c_void, /* [implicit_jscontext] void setWantXrays (in jsval vscope); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub SetWantXrays: *const ::libc::c_void, /* [implicit_jscontext] void forcePermissiveCOWs (); */ /// Unable to generate binding because `jscontext is unsupported` pub ForcePermissiveCOWs: *const ::libc::c_void, /* [implicit_jscontext] void forcePrivilegedComponentsForScope (in jsval vscope); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub ForcePrivilegedComponentsForScope: *const ::libc::c_void, /* [implicit_jscontext] jsval getComponentsForScope (in jsval vscope); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetComponentsForScope: *const ::libc::c_void, /* [implicit_jscontext] void dispatch (in jsval runnable, [optional] in jsval scope); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub Dispatch: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean strict; */ /// Unable to generate binding because `jscontext is unsupported` pub GetStrict: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean strict; */ /// Unable to generate binding because `jscontext is unsupported` pub SetStrict: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean werror; */ /// Unable to generate binding because `jscontext is unsupported` pub GetWerror: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean werror; */ /// Unable to generate binding because `jscontext is unsupported` pub SetWerror: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean strict_mode; */ /// Unable to generate binding because `jscontext is unsupported` pub GetStrict_mode: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean strict_mode; */ /// Unable to generate binding because `jscontext is unsupported` pub SetStrict_mode: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean ion; */ /// Unable to generate binding because `jscontext is unsupported` pub GetIon: *const ::libc::c_void, /* [implicit_jscontext] attribute boolean ion; */ /// Unable to generate binding because `jscontext is unsupported` pub SetIon: *const ::libc::c_void, /* readonly attribute boolean isInAutomation; */ pub GetIsInAutomation: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aIsInAutomation: *mut bool) -> nsresult, /* void crashIfNotInAutomation (); */ pub CrashIfNotInAutomation: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, /* [implicit_jscontext] void setGCZeal (in long zeal); */ /// Unable to generate binding because `jscontext is unsupported` pub SetGCZeal: *const ::libc::c_void, /* [implicit_jscontext] void nukeSandbox (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub NukeSandbox: *const ::libc::c_void, /* [implicit_jscontext] void blockScriptForGlobal (in jsval global); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub BlockScriptForGlobal: *const ::libc::c_void, /* [implicit_jscontext] void unblockScriptForGlobal (in jsval global); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub UnblockScriptForGlobal: *const ::libc::c_void, /* bool isXrayWrapper (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub IsXrayWrapper: *const ::libc::c_void, /* [implicit_jscontext] jsval waiveXrays (in jsval aVal); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub WaiveXrays: *const ::libc::c_void, /* [implicit_jscontext] jsval unwaiveXrays (in jsval aVal); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub UnwaiveXrays: *const ::libc::c_void, /* [implicit_jscontext] string getClassName (in jsval aObj, in bool aUnwrap); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetClassName: *const ::libc::c_void, /* nsIClassInfo getDOMClassInfo (in AString aClassName); */ pub GetDOMClassInfo: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aClassName: &::nsstring::nsAString, _retval: *mut *const nsIClassInfo) -> nsresult, /* [implicit_jscontext] jsval getIncumbentGlobal ([optional] in jsval callback); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetIncumbentGlobal: *const ::libc::c_void, /* [implicit_jscontext] nsISupports generateXPCWrappedJS (in jsval obj, [optional] in jsval scope); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GenerateXPCWrappedJS: *const ::libc::c_void, /* PRTime getWatchdogTimestamp (in AString aCategory); */ pub GetWatchdogTimestamp: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aCategory: &::nsstring::nsAString, _retval: *mut PRTime) -> nsresult, /* [implicit_jscontext] jsval getJSEngineTelemetryValue (); */ /// Unable to generate binding because `jscontext is unsupported` pub GetJSEngineTelemetryValue: *const ::libc::c_void, /* [implicit_jscontext] jsval cloneInto (in jsval value, in jsval scope, [optional] in jsval options); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub CloneInto: *const ::libc::c_void, /* nsIPrincipal getWebIDLCallerPrincipal (); */ pub GetWebIDLCallerPrincipal: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut *const nsIPrincipal) -> nsresult, /* [implicit_jscontext] nsIPrincipal getObjectPrincipal (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetObjectPrincipal: *const ::libc::c_void, /* [implicit_jscontext] ACString getCompartmentLocation (in jsval obj); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetCompartmentLocation: *const ::libc::c_void, /* [implicit_jscontext] void setAddonInterposition (in ACString addonId, in nsIAddonInterposition interposition); */ /// Unable to generate binding because `jscontext is unsupported` pub SetAddonInterposition: *const ::libc::c_void, /* [implicit_jscontext] void setAddonCallInterposition (in jsval target); */ /// Unable to generate binding because `native type JS::Value is unsupported` pub SetAddonCallInterposition: *const ::libc::c_void, /* [implicit_jscontext] void allowCPOWsInAddon (in ACString addonId, in bool allow); */ /// Unable to generate binding because `jscontext is unsupported` pub AllowCPOWsInAddon: *const ::libc::c_void, /* double now (); */ pub Now: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut libc::c_double) -> nsresult, /* AUTF8String readUTF8File (in nsIFile file); */ pub ReadUTF8File: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, file: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult, /* AUTF8String readUTF8URI (in nsIURI url); */ pub ReadUTF8URI: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, url: *const nsIURI, _retval: &mut ::nsstring::nsACString) -> nsresult, /* void blockThreadedExecution (in nsIBlockThreadedExecutionCallback aBlockedCallback); */ pub BlockThreadedExecution: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aBlockedCallback: *const nsIBlockThreadedExecutionCallback) -> nsresult, /* void unblockThreadedExecution (); */ pub UnblockThreadedExecution: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents_Utils { /// `[implicit_jscontext] void reportError (in jsval error);` const _ReportError: () = (); /// `readonly attribute nsIXPCComponents_utils_Sandbox Sandbox;` #[inline] pub unsafe fn GetSandbox(&self, aSandbox: *mut *const nsIXPCComponents_utils_Sandbox) -> nsresult { ((*self.vtable).GetSandbox)(self, aSandbox) } /// `[implicit_jscontext,optional_argc] jsval evalInSandbox (in AString source, in jsval sandbox, [optional] in jsval version, [optional] in AUTF8String filename, [optional] in long lineNo);` const _EvalInSandbox: () = (); /// `[implicit_jscontext] jsval getSandboxAddonId (in jsval sandbox);` const _GetSandboxAddonId: () = (); /// `[implicit_jscontext] jsval getSandboxMetadata (in jsval sandbox);` const _GetSandboxMetadata: () = (); /// `[implicit_jscontext] void setSandboxMetadata (in jsval sandbox, in jsval metadata);` const _SetSandboxMetadata: () = (); /// `[implicit_jscontext,optional_argc] jsval import (in AUTF8String aResourceURI, [optional] in jsval targetObj);` const _Import: () = (); /// ```text /// /** /// * Returns true if the js file located at 'registryLocation' location has /// * been loaded previously via the import method above. Returns false /// * otherwise. /// * /// * @param resourceURI A resource:// URI string representing the location of /// * the js file to be checked if it is already loaded or not. /// * @returns boolean, true if the js file has been loaded via import. false /// * otherwise /// */ /// ``` /// /// `boolean isModuleLoaded (in AUTF8String aResourceURI);` #[inline] pub unsafe fn IsModuleLoaded(&self, aResourceURI: &::nsstring::nsACString, _retval: *mut bool) -> nsresult { ((*self.vtable).IsModuleLoaded)(self, aResourceURI, _retval) } /// `void unload (in AUTF8String registryLocation);` #[inline] pub unsafe fn Unload(&self, registryLocation: &::nsstring::nsACString) -> nsresult { ((*self.vtable).Unload)(self, registryLocation) } /// `[implicit_jscontext] void importGlobalProperties (in jsval aPropertyList);` const _ImportGlobalProperties: () = (); /// `[implicit_jscontext] xpcIJSWeakReference getWeakReference (in jsval obj);` const _GetWeakReference: () = (); /// `void forceGC ();` #[inline] pub unsafe fn ForceGC(&self, ) -> nsresult { ((*self.vtable).ForceGC)(self, ) } /// `void forceCC ([optional] in nsICycleCollectorListener aListener);` #[inline] pub unsafe fn ForceCC(&self, aListener: *const nsICycleCollectorListener) -> nsresult { ((*self.vtable).ForceCC)(self, aListener) } /// `void finishCC ();` #[inline] pub unsafe fn FinishCC(&self, ) -> nsresult { ((*self.vtable).FinishCC)(self, ) } /// `void ccSlice (in long long budget);` #[inline] pub unsafe fn CcSlice(&self, budget: libc::int64_t) -> nsresult { ((*self.vtable).CcSlice)(self, budget) } /// `long getMaxCCSliceTimeSinceClear ();` #[inline] pub unsafe fn GetMaxCCSliceTimeSinceClear(&self, _retval: *mut libc::int32_t) -> nsresult { ((*self.vtable).GetMaxCCSliceTimeSinceClear)(self, _retval) } /// `void clearMaxCCTime ();` #[inline] pub unsafe fn ClearMaxCCTime(&self, ) -> nsresult { ((*self.vtable).ClearMaxCCTime)(self, ) } /// `void forceShrinkingGC ();` #[inline] pub unsafe fn ForceShrinkingGC(&self, ) -> nsresult { ((*self.vtable).ForceShrinkingGC)(self, ) } /// `void schedulePreciseGC (in ScheduledGCCallback callback);` #[inline] pub unsafe fn SchedulePreciseGC(&self, callback: *const ScheduledGCCallback) -> nsresult { ((*self.vtable).SchedulePreciseGC)(self, callback) } /// `void schedulePreciseShrinkingGC (in ScheduledGCCallback callback);` #[inline] pub unsafe fn SchedulePreciseShrinkingGC(&self, callback: *const ScheduledGCCallback) -> nsresult { ((*self.vtable).SchedulePreciseShrinkingGC)(self, callback) } /// `void unlinkGhostWindows ();` #[inline] pub unsafe fn UnlinkGhostWindows(&self, ) -> nsresult { ((*self.vtable).UnlinkGhostWindows)(self, ) } /// `[implicit_jscontext] jsval getJSTestingFunctions ();` const _GetJSTestingFunctions: () = (); /// `[implicit_jscontext] jsval callFunctionWithAsyncStack (in jsval function, in nsIStackFrame stack, in AString asyncCause);` const _CallFunctionWithAsyncStack: () = (); /// `[implicit_jscontext] jsval getGlobalForObject (in jsval obj);` const _GetGlobalForObject: () = (); /// `[implicit_jscontext] boolean isProxy (in jsval vobject);` const _IsProxy: () = (); /// `[implicit_jscontext] jsval exportFunction (in jsval vfunction, in jsval vscope, [optional] in jsval voptions);` const _ExportFunction: () = (); /// `[implicit_jscontext] jsval createObjectIn (in jsval vobj, [optional] in jsval voptions);` const _CreateObjectIn: () = (); /// `[implicit_jscontext] void makeObjectPropsNormal (in jsval vobj);` const _MakeObjectPropsNormal: () = (); /// ```text /// /** /// * Determines whether this object is backed by a DeadObjectProxy. /// * /// * Dead-wrapper objects hold no other objects alive (they have no outgoing /// * reference edges) and will throw if you touch them (e.g. by /// * reading/writing a property). /// */ /// ``` /// /// `bool isDeadWrapper (in jsval obj);` const _IsDeadWrapper: () = (); /// ```text /// /** /// * Determines whether this object is a cross-process wrapper. /// */ /// ``` /// /// `bool isCrossProcessWrapper (in jsval obj);` const _IsCrossProcessWrapper: () = (); /// ```text /// /** /// * CPOWs can have user data attached to them. This data originates /// * in the local process via the /// * nsIRemoteTagService.getRemoteObjectTag method. It's sent along /// * with the CPOW to the remote process, where it can be fetched /// * with this function, getCrossProcessWrapperTag. /// */ /// ``` /// /// `ACString getCrossProcessWrapperTag (in jsval obj);` const _GetCrossProcessWrapperTag: () = (); /// ```text /// /** /// * If CPOWs are disabled for browser code via the /// * dom.ipc.cpows.forbid-unsafe-from-browser preferences, then only /// * add-ons can use CPOWs. This function allows a non-addon scope /// * to opt into CPOWs. It's necessary for the implementation of /// * RemoteAddonsParent.jsm. /// */ /// ``` /// /// `void permitCPOWsInScope (in jsval obj);` const _PermitCPOWsInScope: () = (); /// `[implicit_jscontext] void recomputeWrappers ([optional] in jsval vobj);` const _RecomputeWrappers: () = (); /// `[implicit_jscontext] void setWantXrays (in jsval vscope);` const _SetWantXrays: () = (); /// `[implicit_jscontext] void forcePermissiveCOWs ();` const _ForcePermissiveCOWs: () = (); /// `[implicit_jscontext] void forcePrivilegedComponentsForScope (in jsval vscope);` const _ForcePrivilegedComponentsForScope: () = (); /// `[implicit_jscontext] jsval getComponentsForScope (in jsval vscope);` const _GetComponentsForScope: () = (); /// `[implicit_jscontext] void dispatch (in jsval runnable, [optional] in jsval scope);` const _Dispatch: () = (); /// `[implicit_jscontext] attribute boolean strict;` const _GetStrict: () = (); /// `[implicit_jscontext] attribute boolean strict;` const _SetStrict: () = (); /// `[implicit_jscontext] attribute boolean werror;` const _GetWerror: () = (); /// `[implicit_jscontext] attribute boolean werror;` const _SetWerror: () = (); /// `[implicit_jscontext] attribute boolean strict_mode;` const _GetStrict_mode: () = (); /// `[implicit_jscontext] attribute boolean strict_mode;` const _SetStrict_mode: () = (); /// `[implicit_jscontext] attribute boolean ion;` const _GetIon: () = (); /// `[implicit_jscontext] attribute boolean ion;` const _SetIon: () = (); /// `readonly attribute boolean isInAutomation;` #[inline] pub unsafe fn GetIsInAutomation(&self, aIsInAutomation: *mut bool) -> nsresult { ((*self.vtable).GetIsInAutomation)(self, aIsInAutomation) } /// `void crashIfNotInAutomation ();` #[inline] pub unsafe fn CrashIfNotInAutomation(&self, ) -> nsresult { ((*self.vtable).CrashIfNotInAutomation)(self, ) } /// `[implicit_jscontext] void setGCZeal (in long zeal);` const _SetGCZeal: () = (); /// `[implicit_jscontext] void nukeSandbox (in jsval obj);` const _NukeSandbox: () = (); /// `[implicit_jscontext] void blockScriptForGlobal (in jsval global);` const _BlockScriptForGlobal: () = (); /// `[implicit_jscontext] void unblockScriptForGlobal (in jsval global);` const _UnblockScriptForGlobal: () = (); /// ```text /// /** /// * Check whether the given object is an XrayWrapper. /// */ /// ``` /// /// `bool isXrayWrapper (in jsval obj);` const _IsXrayWrapper: () = (); /// ```text /// /** /// * Waive Xray on a given value. Identity op for primitives. /// */ /// ``` /// /// `[implicit_jscontext] jsval waiveXrays (in jsval aVal);` const _WaiveXrays: () = (); /// ```text /// /** /// * Strip off Xray waivers on a given value. Identity op for primitives. /// */ /// ``` /// /// `[implicit_jscontext] jsval unwaiveXrays (in jsval aVal);` const _UnwaiveXrays: () = (); /// ```text /// /** /// * Gets the name of the JSClass of the object. /// * /// * if |aUnwrap| is true, all wrappers are unwrapped first. Unless you're /// * specifically trying to detect whether the object is a proxy, this is /// * probably what you want. /// */ /// ``` /// /// `[implicit_jscontext] string getClassName (in jsval aObj, in bool aUnwrap);` const _GetClassName: () = (); /// ```text /// /** /// * Get a DOM classinfo for the given classname. Only some class /// * names are supported. /// */ /// ``` /// /// `nsIClassInfo getDOMClassInfo (in AString aClassName);` #[inline] pub unsafe fn GetDOMClassInfo(&self, aClassName: &::nsstring::nsAString, _retval: *mut *const nsIClassInfo) -> nsresult { ((*self.vtable).GetDOMClassInfo)(self, aClassName, _retval) } /// ```text /// /** /// * Gets the incument global for the execution of this function. For internal /// * and testing use only. /// * /// * If |callback| is passed, it is invoked with the incumbent global as its /// * sole argument. This allows the incumbent global to be measured in callback /// * environments with no scripted frames on the stack. /// */ /// ``` /// /// `[implicit_jscontext] jsval getIncumbentGlobal ([optional] in jsval callback);` const _GetIncumbentGlobal: () = (); /// ```text /// /** /// * Forces the generation of an XPCWrappedJS for a given object. For internal /// * and testing use only. This is only useful to set up wrapper map conditions /// * for a testcase. The return value is not an XPCWrappedJS itself, but an /// * opaque nsISupports holder that keeps the underlying XPCWrappedJS alive. /// * /// * if |scope| is passed, the XPCWrappedJS is generated in the scope of that object. /// */ /// ``` /// /// `[implicit_jscontext] nsISupports generateXPCWrappedJS (in jsval obj, [optional] in jsval scope);` const _GenerateXPCWrappedJS: () = (); /// ```text /// /** /// * Retrieve the last time, in microseconds since epoch, that a given /// * watchdog-related event occured. /// * /// * Valid categories: /// * "ContextStateChange" - Context switching between active and inactive states /// * "WatchdogWakeup" - Watchdog waking up from sleeping /// * "WatchdogHibernateStart" - Watchdog begins hibernating /// * "WatchdogHibernateStop" - Watchdog stops hibernating /// */ /// ``` /// /// `PRTime getWatchdogTimestamp (in AString aCategory);` #[inline] pub unsafe fn GetWatchdogTimestamp(&self, aCategory: &::nsstring::nsAString, _retval: *mut PRTime) -> nsresult { ((*self.vtable).GetWatchdogTimestamp)(self, aCategory, _retval) } /// `[implicit_jscontext] jsval getJSEngineTelemetryValue ();` const _GetJSEngineTelemetryValue: () = (); /// `[implicit_jscontext] jsval cloneInto (in jsval value, in jsval scope, [optional] in jsval options);` const _CloneInto: () = (); /// `nsIPrincipal getWebIDLCallerPrincipal ();` #[inline] pub unsafe fn GetWebIDLCallerPrincipal(&self, _retval: *mut *const nsIPrincipal) -> nsresult { ((*self.vtable).GetWebIDLCallerPrincipal)(self, _retval) } /// `[implicit_jscontext] nsIPrincipal getObjectPrincipal (in jsval obj);` const _GetObjectPrincipal: () = (); /// `[implicit_jscontext] ACString getCompartmentLocation (in jsval obj);` const _GetCompartmentLocation: () = (); /// `[implicit_jscontext] void setAddonInterposition (in ACString addonId, in nsIAddonInterposition interposition);` const _SetAddonInterposition: () = (); /// `[implicit_jscontext] void setAddonCallInterposition (in jsval target);` const _SetAddonCallInterposition: () = (); /// `[implicit_jscontext] void allowCPOWsInAddon (in ACString addonId, in bool allow);` const _AllowCPOWsInAddon: () = (); /// `double now ();` #[inline] pub unsafe fn Now(&self, _retval: *mut libc::c_double) -> nsresult { ((*self.vtable).Now)(self, _retval) } /// `AUTF8String readUTF8File (in nsIFile file);` #[inline] pub unsafe fn ReadUTF8File(&self, file: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).ReadUTF8File)(self, file, _retval) } /// `AUTF8String readUTF8URI (in nsIURI url);` #[inline] pub unsafe fn ReadUTF8URI(&self, url: *const nsIURI, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).ReadUTF8URI)(self, url, _retval) } /// ```text /// /** /// * If the main thread is using any kind of fancy cooperative /// * scheduling (e.g., Quantum DOM scheduling), /// * blockThreadedExecution disables it temporarily. The /// * aBlockedCallback is called when it has been completely disabled /// * and events are back to running sequentially on a single main /// * thread. Calling unblockThreadedExecution will re-enable thread /// * scheduling of the main thread. Multiple calls to /// * blockThreadedExecution will require the same number of calls to /// * unblockThreadedExecution in order to resume cooperative /// * scheduling. /// */ /// ``` /// /// `void blockThreadedExecution (in nsIBlockThreadedExecutionCallback aBlockedCallback);` #[inline] pub unsafe fn BlockThreadedExecution(&self, aBlockedCallback: *const nsIBlockThreadedExecutionCallback) -> nsresult { ((*self.vtable).BlockThreadedExecution)(self, aBlockedCallback) } /// `void unblockThreadedExecution ();` #[inline] pub unsafe fn UnblockThreadedExecution(&self, ) -> nsresult { ((*self.vtable).UnblockThreadedExecution)(self, ) } } /// `interface nsIXPCComponentsBase : nsISupports` /// /// ```text /// /** /// * Interface for the 'Components' object. /// * /// * The first interface contains things that are available to non-chrome XBL code /// * that runs in a scope with an ExpandedPrincipal. The second interface /// * includes members that are only exposed to chrome. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponentsBase { vtable: *const nsIXPCComponentsBaseVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponentsBase. unsafe impl XpCom for nsIXPCComponentsBase { const IID: nsIID = nsID(0xeeeada2f, 0x86c0, 0x4609, [0xb2, 0xbf, 0x4b, 0xf2, 0x35, 0x1b, 0x1c, 0xe6]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponentsBase { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponentsBase. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponentsBaseCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponentsBase`. fn coerce_from(v: &nsIXPCComponentsBase) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponentsBaseCoerce for nsIXPCComponentsBase { #[inline] fn coerce_from(v: &nsIXPCComponentsBase) -> &Self { v } } impl nsIXPCComponentsBase { /// Cast this `nsIXPCComponentsBase` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponentsBaseCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponentsBase { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIXPCComponentsBaseCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponentsBase) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponentsBase // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponentsBaseVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* readonly attribute nsIXPCComponents_Interfaces interfaces; */ pub GetInterfaces: unsafe extern "system" fn (this: *const nsIXPCComponentsBase, aInterfaces: *mut *const nsIXPCComponents_Interfaces) -> nsresult, /* readonly attribute nsIXPCComponents_InterfacesByID interfacesByID; */ pub GetInterfacesByID: unsafe extern "system" fn (this: *const nsIXPCComponentsBase, aInterfacesByID: *mut *const nsIXPCComponents_InterfacesByID) -> nsresult, /* readonly attribute nsIXPCComponents_Results results; */ pub GetResults: unsafe extern "system" fn (this: *const nsIXPCComponentsBase, aResults: *mut *const nsIXPCComponents_Results) -> nsresult, /* boolean isSuccessCode (in nsresult result); */ pub IsSuccessCode: unsafe extern "system" fn (this: *const nsIXPCComponentsBase, result: nsresult, _retval: *mut bool) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponentsBase { /// `readonly attribute nsIXPCComponents_Interfaces interfaces;` #[inline] pub unsafe fn GetInterfaces(&self, aInterfaces: *mut *const nsIXPCComponents_Interfaces) -> nsresult { ((*self.vtable).GetInterfaces)(self, aInterfaces) } /// `readonly attribute nsIXPCComponents_InterfacesByID interfacesByID;` #[inline] pub unsafe fn GetInterfacesByID(&self, aInterfacesByID: *mut *const nsIXPCComponents_InterfacesByID) -> nsresult { ((*self.vtable).GetInterfacesByID)(self, aInterfacesByID) } /// `readonly attribute nsIXPCComponents_Results results;` #[inline] pub unsafe fn GetResults(&self, aResults: *mut *const nsIXPCComponents_Results) -> nsresult { ((*self.vtable).GetResults)(self, aResults) } /// `boolean isSuccessCode (in nsresult result);` #[inline] pub unsafe fn IsSuccessCode(&self, result: nsresult, _retval: *mut bool) -> nsresult { ((*self.vtable).IsSuccessCode)(self, result, _retval) } } /// `interface nsIXPCComponents : nsIXPCComponentsBase` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIXPCComponents { vtable: *const nsIXPCComponentsVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIXPCComponents. unsafe impl XpCom for nsIXPCComponents { const IID: nsIID = nsID(0xaa28aaf6, 0x70ce, 0x4b03, [0x95, 0x14, 0xaf, 0xe4, 0x3c, 0x7d, 0xfd, 0xa8]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIXPCComponents { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIXPCComponents. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIXPCComponentsCoerce { /// Cheaply cast a value of this type from a `nsIXPCComponents`. fn coerce_from(v: &nsIXPCComponents) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIXPCComponentsCoerce for nsIXPCComponents { #[inline] fn coerce_from(v: &nsIXPCComponents) -> &Self { v } } impl nsIXPCComponents { /// Cast this `nsIXPCComponents` to one of its base interfaces. #[inline] pub fn coerce<T: nsIXPCComponentsCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIXPCComponents { type Target = nsIXPCComponentsBase; #[inline] fn deref(&self) -> &nsIXPCComponentsBase { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsIXPCComponentsBaseCoerce> nsIXPCComponentsCoerce for T { #[inline] fn coerce_from(v: &nsIXPCComponents) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIXPCComponents // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIXPCComponentsVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsIXPCComponentsBaseVTable, /* readonly attribute nsIXPCComponents_Classes classes; */ pub GetClasses: unsafe extern "system" fn (this: *const nsIXPCComponents, aClasses: *mut *const nsIXPCComponents_Classes) -> nsresult, /* readonly attribute nsIXPCComponents_ClassesByID classesByID; */ pub GetClassesByID: unsafe extern "system" fn (this: *const nsIXPCComponents, aClassesByID: *mut *const nsIXPCComponents_ClassesByID) -> nsresult, /* readonly attribute nsIStackFrame stack; */ pub GetStack: unsafe extern "system" fn (this: *const nsIXPCComponents, aStack: *mut *const nsIStackFrame) -> nsresult, /* readonly attribute nsIComponentManager manager; */ pub GetManager: unsafe extern "system" fn (this: *const nsIXPCComponents, aManager: *mut *const nsIComponentManager) -> nsresult, /* readonly attribute nsIXPCComponents_Utils utils; */ pub GetUtils: unsafe extern "system" fn (this: *const nsIXPCComponents, aUtils: *mut *const nsIXPCComponents_Utils) -> nsresult, /* readonly attribute nsIXPCComponents_ID ID; */ pub GetID: unsafe extern "system" fn (this: *const nsIXPCComponents, aID: *mut *const nsIXPCComponents_ID) -> nsresult, /* readonly attribute nsIXPCComponents_Exception Exception; */ pub GetException: unsafe extern "system" fn (this: *const nsIXPCComponents, aException: *mut *const nsIXPCComponents_Exception) -> nsresult, /* readonly attribute nsIXPCComponents_Constructor Constructor; */ pub GetConstructor: unsafe extern "system" fn (this: *const nsIXPCComponents, aConstructor: *mut *const nsIXPCComponents_Constructor) -> nsresult, /* [implicit_jscontext] attribute jsval returnCode; */ /// Unable to generate binding because `native type JS::Value is unsupported` pub GetReturnCode: *const ::libc::c_void, /* [implicit_jscontext] attribute jsval returnCode; */ /// Unable to generate binding because `native type JS::Value is unsupported` pub SetReturnCode: *const ::libc::c_void, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIXPCComponents { /// `readonly attribute nsIXPCComponents_Classes classes;` #[inline] pub unsafe fn GetClasses(&self, aClasses: *mut *const nsIXPCComponents_Classes) -> nsresult { ((*self.vtable).GetClasses)(self, aClasses) } /// `readonly attribute nsIXPCComponents_ClassesByID classesByID;` #[inline] pub unsafe fn GetClassesByID(&self, aClassesByID: *mut *const nsIXPCComponents_ClassesByID) -> nsresult { ((*self.vtable).GetClassesByID)(self, aClassesByID) } /// `readonly attribute nsIStackFrame stack;` #[inline] pub unsafe fn GetStack(&self, aStack: *mut *const nsIStackFrame) -> nsresult { ((*self.vtable).GetStack)(self, aStack) } /// `readonly attribute nsIComponentManager manager;` #[inline] pub unsafe fn GetManager(&self, aManager: *mut *const nsIComponentManager) -> nsresult { ((*self.vtable).GetManager)(self, aManager) } /// `readonly attribute nsIXPCComponents_Utils utils;` #[inline] pub unsafe fn GetUtils(&self, aUtils: *mut *const nsIXPCComponents_Utils) -> nsresult { ((*self.vtable).GetUtils)(self, aUtils) } /// `readonly attribute nsIXPCComponents_ID ID;` #[inline] pub unsafe fn GetID(&self, aID: *mut *const nsIXPCComponents_ID) -> nsresult { ((*self.vtable).GetID)(self, aID) } /// `readonly attribute nsIXPCComponents_Exception Exception;` #[inline] pub unsafe fn GetException(&self, aException: *mut *const nsIXPCComponents_Exception) -> nsresult { ((*self.vtable).GetException)(self, aException) } /// `readonly attribute nsIXPCComponents_Constructor Constructor;` #[inline] pub unsafe fn GetConstructor(&self, aConstructor: *mut *const nsIXPCComponents_Constructor) -> nsresult { ((*self.vtable).GetConstructor)(self, aConstructor) } /// `[implicit_jscontext] attribute jsval returnCode;` const _GetReturnCode: () = (); /// `[implicit_jscontext] attribute jsval returnCode;` const _SetReturnCode: () = (); }