{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'PDF TO Markdown' && linkText !== 'PDF TO Markdown' ) { link.textContent = 'PDF TO Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== 'Voice Cloning' ) { link.textContent = 'Voice Cloning'; link.href = 'https://vibevoice.info/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'PDF TO Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); ` znajduje się cała zawartość strony. Zatem w arkuszu stylów wystarczy umieścić następujący kod: > body { background-color: black; color: white; }\n Zwróć uwagę, że deklaracja stylów, którą ujmuje się w nawiasy klamrowe, składa się tutaj z dwóch linijek. Każda z nich rozpoczyna się od podania tzw. cechy (inaczej własności), po której następuje wartość. Cecha określa, co chcemy zmienić w wyglądzie wybranego elementu, natomiast wartość - w jaki sposób ma się to zmienić. Zatem gdyby przetłumaczyć powyższą regułę stylów na bardziej zrozumiały język, brzmiałaby ona mniej więcej tak: dla całej zawartości znacznika `body` (selektor) zmień kolor tła (cecha `background-color` ) na czarny (wartość `black` ) i kolor tekstu (cecha `color` ) na biały (wartość `white` ). Pamiętaj, aby po wpisaniu cechy (własności) zawsze postawić znak dwukropka, a po każdej wartości - średnik. Zwróć również uwagę, że jeśli cecha (bądź wartość) zawiera znak myślnika (np. `background-color` ), to przed nim ani po nim nie może znajdować się spacja. \nAby ustalić inny kolor tła albo tekstu, wystarczy że w miejsce wartości wstawisz wybraną definicję koloru - zobacz: Wykaz kolorów.\n\nPoza zwykłym tekstem na stronę możesz wprowadzić znaczniki (tzw. tagi). Znacznik jest to specjalny tekst umieszczony w nawiasach ostrych - np.: `` . Jest on częścią składni języka HTML i pozwala sterować wyglądem strony. Dzięki niemu możesz np. ustalić kolor tła, rodzaj formatowania tekstu, wstawić obrazek czy tabelę itd. Znacznik nie jest widoczny na ekranie. Widoczne są tylko efekty jego działania (np. wstawienie obrazka). Ja sam aby umieszczony powyżej znacznik `` był widoczny, musiałem się posłużyć pewną \"sztuczką\" (jeśli nie możesz wytrzymać i już teraz chcesz wiedzieć jaką, zajrzyj na stronę: Znaki specjalne). \nPonieważ znaki: \"<\" (znak mniejszości) oraz \">\" (znak większości) są zarezerwowane dla znaczników, nie powinny się one pojawić w normalnej treści strony. Jeżeli musimy ich użyć, należy wpisywać zamiast nich odpowiednio: &lt; oraz &gt;. Ponadto znak \"&\" (ampersand - angielskie \"and\" - Shift+7) należy zastępować przez: &amp;\n Istnieją znaczniki otwierające (np.: `` ) oraz zamykające (np.: `` ). Zauważ, że znacznik zamykający rozpoczyna się ukośnikiem (czyli znakiem: \"/\") i ma taką samą nazwę jak otwierający. Pomiędzy znacznikami otwierającym i zamykającym może znaleźć się jakiś tekst, który chcemy np. poddać formatowaniu (w tym przypadku będzie to wytłuszczenie tekstu), np.: > Ten tekst zostanie wytłuszczony.albo\n > Ten tekst zostanie wytłuszczony. (oba powyższe sposoby są równoważne).\n\n>
\n Powyższy znacznik ( `
` ) stosuje się gdy chcemy natychmiastowo zakończyć linię. Zapytasz zapewne: Po co go stosować, nie można po prostu nacisnąć Enter i przenieść kursor tekstowy do następnej linii? Otóż nie można. Przeglądarka internetowa ignoruje wszelkie znaki przejścia do następnej linii za pomocą klawisza Enter (ignoruje również postawienie obok siebie więcej niż jednej spacji - zobacz: Znaki specjalne). Na przykład jeśli wpiszesz w edytorze taki tekst: > To jest pierwsza linia... a to jest druga linia.\n\n* ACRONYM - dla oznaczania wszystkich skrótów powinien być używany znacznik ABBR\n * APPLET - w zamian należy używać znacznika OBJECT\n * ISINDEX - może zostać zastąpiony przez kontrolki formularzy\n * DIR - w zamian należy używać znacznika UL\n\n* NOSCRIPT - nie może być używany w języku XHTML5 w przypadku serwowania dokumentu z typem MIME \"application/xhtml+xml\"; element został wycofany w składni XML, ponieważ parser HTML odczytuje go jako czysty tekst (inaczej do dokumentu załadowałyby się np. objęte nim arkusze CSS, nawet jeżeli przeglądarka obsługuje skrypty), co nie jest możliwe w języku XML\n\nCzy tworzenie stron internetowych naprawdę jest tak trudne, jak mówią?\n * Edytory HTML\n\nKtóry edytor HTML wybrać: Pajączek, CoreEditor, Bluefish, Brackets, PSPad, gedit, Kate, Quanta Plus, SCREEM, Smultron?\n * Ramy dokumentu\n\nJak wygląda typowy dokument HTML? Co to są podstrony?\n * Wpisywanie tekstu\n\nW jaki sposób wpisuje się tekst na stronach WWW? Jakie są zasady poprawnego wpisywania znaków interpunkcyjnych w tekście komputerowym?\n * Znaczniki\n\nCo to są znaczniki HTML?\n * Koniec linii\n\nW jaki sposób pogrubić (wytłuścić) tekst na stronie WWW?\n * Tekst pochylony\n\nW jaki sposób pochylić tekst na stronie WWW (kursywa)?\n * Tekst podkreślony\n\nW jaki sposób podkreślić tekst na stronie WWW?\n * Wielkość czcionki\n\nW jaki sposób zmienić rozmiar czcionki na stronie WWW?\n * Kolor czcionki\n\nW jaki sposób zmienić kolor czcionki na stronie WWW?\n * Rodzaj czcionki\n\nW jaki sposób zmienić rodzaj czcionki na stronie WWW?\n * Łączenie parametrów\n\nW jaki sposób zmienić wygląd tekstu na stronie WWW?\n * Kolor tła oraz tekstu\n\nW jaki sposób zmienić kolor tła oraz kolor tekstu na stronie WWW?\n * Wstawienie obrazka\n\nDo czego służą odsyłacze (hiperłącza, linki, odnośniki hipertekstowe)?\n * Odsyłacz do adresu internetowego\n\nJak wstawić link (odsyłacz, hiperłącze, odnośnik hipertekstowy) na stronie WWW?\n * Odsyłacz pocztowy\n\nJak wstawić adres e-mail na stronie WWW?\n * Odsyłacz obrazkowy\n\nW jaki sposób wstawić na stronie WWW odnośnik (link, hiperłącze, odsyłacz hipertekstowy) obrazkowy (graficzny), czyli klikalny przycisk?\n * Jak zrobić dobrą stronę\n\nCzego unikać, aby Twoja strona WWW nie odstraszała internautów?\n * Gotowiec HTML\n\nPotrzebujesz na jutro gotowej, profesjonalnie wyglądającej strony HTML (gotowiec) i to zupełnie za darmo?\n * Podsumowanie\n\nHTML\n * Powtórka\n\nHTML\n Widzę, że jesteś \"zielony/zielona\"... ale nic się nie martw. Jeśli koniecznie chcesz \"zmienić kolor\", przeczytaj umieszczony poniżej tekst. Pozwoli Ci on, stworzyć Twoją pierwszą stronę internetową, nawet w ciągu jednego dnia. Jeśli uważasz, że pisanie stron w języku HTML jest dla Ciebie \"czarną magią\", a sama strona jest jakimś tajemniczym i bardzo skomplikowanym dokumentem, to się mylisz. Napisanie krótkiej strony internetowej jest prostsze niż Ci się wydaje. Zatem nie trać już czasu na wymówki typu:> Ja się niczego nie nauczę!\ni tym podobne, bo to nieprawda. Zacznij już lepiej czytać. \nMam tylko jedną prośbę: postaraj się przeczytać w miarę uważnie i po kolei całą treść na tej stronie. Jeśli pominiesz jakiś punkt lub przeczytasz go zbyt pobieżnie, może to spowodować, że nie zrozumiesz następnych.\n\n* HTML 4.01 Specification\n * XHTML 1.0 The Extensible HyperText Markup Language\n * XHTML 1.1 - Module-based XHTML\n * HTML5 - A vocabulary and associated APIs for HTML and XHTML\n * Differences from HTML4\n * Unicode Character Database\n\n Aby dodać zwykły tekst do istniejącej strony internetowej, wystarczy otworzyć wybrany plik *.html w edytorze HTML. Następnie trzeba wyszukać miejsce w dokumencie, gdzie ma zostać dodany nowy tekst - powinno to być gdzieś wewnątrz sekcji `...` . Tekst można w tym miejscu po prostu wpisać z klawiatury albo wkleić ze schowka systemowego np. przy pomocy kombinacji klawiszy Ctrl+V (pod systemem Windows). Na koniec można zapisać zmieniony plik *.html przy pomocy skrótu klawiaturowego: Ctrl+S. Poza zwykłym tekstem na stronę możesz wprowadzić znaczniki (tzw. tagi). Znacznik jest to specjalny tekst umieszczony w nawiasach ostrych - np.: `` . Jest on częścią składni języka HTML i pozwala sterować wyglądem strony. Dzięki niemu możesz np. ustalić kolor tła, rodzaj formatowania tekstu, wstawić obrazek czy tabelę itd. Znacznik nie jest widoczny na ekranie. Widoczne są tylko efekty jego działania (np. wstawienie obrazka). Ja sam aby umieszczony powyżej znacznik `` był widoczny, musiałem się posłużyć pewną \"sztuczką\" (jeśli nie możesz wytrzymać i już teraz chcesz wiedzieć jaką, zajrzyj na stronę: Znaki specjalne). \nPonieważ znaki: \"<\" (znak mniejszości) oraz \">\" (znak większości) są zarezerwowane dla znaczników, nie powinny się one pojawić w normalnej treści strony. Jeżeli musimy ich użyć, należy wpisywać zamiast nich odpowiednio: &lt; oraz &gt;. Ponadto znak \"&\" (ampersand - angielskie \"and\" - Shift+7) należy zastępować przez: &amp;\n Istnieją znaczniki otwierające (np.: `` ) oraz zamykające (np.: `` ). Zauważ, że znacznik zamykający rozpoczyna się ukośnikiem (czyli znakiem: \"/\") i ma taką samą nazwę jak otwierający. Pomiędzy znacznikami otwierającym i zamykającym może znaleźć się jakiś tekst, który chcemy np. poddać formatowaniu (w tym przypadku będzie to wytłuszczenie tekstu), np.: > Ten tekst zostanie wytłuszczony.albo\n > Ten tekst zostanie wytłuszczony. (oba powyższe sposoby są równoważne).\n\nPonieważ znaki: \"<\" (znak mniejszości) oraz \">\" (znak większości) są zarezerwowane dla znaczników, nie powinny się one pojawić w normalnej treści strony. Jeżeli musimy ich użyć, należy wpisywać zamiast nich odpowiednio: &lt; oraz &gt;.\n >
\n Powyższy znacznik ( `
` ) stosuje się gdy chcemy natychmiastowo zakończyć linię. Zapytasz zapewne: Po co go stosować, nie można po prostu nacisnąć Enter i przenieść kursor tekstowy do następnej linii? Otóż nie można. Przeglądarka internetowa ignoruje wszelkie znaki przejścia do następnej linii za pomocą klawisza Enter (ignoruje również postawienie obok siebie więcej niż jednej spacji - zobacz: Znaki specjalne). Na przykład jeśli wpiszesz w edytorze taki tekst: > To jest pierwsza linia... a to jest druga linia.\n\n Aby ustawić dwie linijki tekstu jedna pod drugą, umieść pomiędzy nimi znacznik `
` . >

Tu wpisz treść akapitu

\n Akapit (w pewnych warunkach nazywany paragrafem) to pewien ustęp w tekście. Następujące po sobie akapity, są rozdzielone linijką przerwy. Treść akapitu należy wpisać pomiędzy znacznikami `

` oraz `

` . Przyjęło się, że praktycznie każdy zwykły tekst na stronie WWW umieszcza się w akapitach. Pojedynczy akapit przedstawia ustęp w tekście, który nieco różni się tematycznie od poprzedniego. Zamiast stosować dwa znaczniki końca linii: `

` , można po prostu objąć wybrany fragment tekstu paragrafem. Efekt będzie identyczny, a dodatkowo przeglądarka lepiej wyświetli taki tekst. Dzięki temu strona będzie wyglądała estetyczniej i łatwiej będzie można odszukać na niej interesujące informacje. \nAkapit (paragraf) jest bardzo ważny w składni HTML, ponieważ pozwala w określony sposób sformatować tekst na ekranie (ułożyć go w podany sposób). Robi się to podając atrybuty znacznika. Atrybut wpisuje się zawsze wewnątrz znacznika otwierającego - bezpośrednio po jego nazwie (oddzielony od niej spacją), a przed znakiem zamknięcia nawiasu ostrego, czyli przed \">\". Każdy znacznik ma ściśle określone atrybuty, które obsługuje. W przypadku akapitu można zastosować m.in. następujące:\n\n* Wyrównanie tekstu do lewej strony (domyślnie)\n>

Treść akapitu

\nlub po prostu >

Treść akapitu

\n * Wyrównanie tekstu do prawej\n>

Treść akapitu

\n * Wyśrodkowanie tekstu\n>

Treść akapitu

\n * Justowanie tekstu (wyrównanie do obu marginesów jednocześnie)\n>

Treść akapitu

\n We wszystkich przypadkach wyróżnione zostały właśnie atrybuty znacznika wraz z ich wartościami (wartość atrybutu podaje się w cudzysłowie po znaku równości).W miejsce tekstu: Treść akapitu, należy wpisać tekst, który ma zostać sformatowany w sposób określony przez parametr. \n\n### Przykład

Tu wpisz tekst...` . W ten sposób często oznacza się nieartykułowany tekst albo błąd ortograficzny. > Tu wpisz tekst Tu wpisz tekst Ten tekst został napisany czcionką koloru czerwonego Tu wpisz tekstlub\n > Tu wpisz tekst

To jest jakiś tekst ` ), a na końcu zamykamy ten znacznik, który otworzyliśmy jako pierwszy (czyli `

` ). Dodatkowo wartości atrybutu `style=\"...\"` odnoszące się do tego samego znacznika (w naszym przypadku jest to znacznik `` ), można połączyć wypisując je po kolei rozdzielone od siebie znakami średnika (w naszym przypadku są to wartości: \n\n```\n\"font-size: large; color: red\"\n```\n\n). Kolejność wpisywania zarówno wartości atrybutu jak i znaczników (otwierających) jest dowolna. \n\nNatomiast jako: \"ustawienie\" należy wpisać:\n\n* left\n * Obrazek będzie ustawiony po lewej stronie względem otaczającego go tekstu\n * right\n * Obrazek po prawej stronie względem tekstu\n Dla zainteresowanychJeśli chcesz dowiedzieć się więcej na temat dodatkowych możliwości przy wstawianiu obrazków na stronach internetowych, zobacz rozdział: Multimedia / Obrazek. \n\n### Przykład opis odsyłacza \"Tu).\n\nJak widać odsyłacza obrazkowego możemy użyć w połączeniu z dowolnym typem odnośników (do podstrony, do adresu internetowego lub pocztowy). Jednak najczęściej w ten sposób tworzy się menu nawigacyjne serwisu (odsyłacze do podstron).\n\nObrazki przycisków najlepiej zapisywać w formacie GIF. Jeśli nie masz zacięcia artystycznego, nie musisz samodzielnie rysować wszystkich grafik. W Internecie na pewno znajdziesz wiele stron, gdzie możesz darmowo pobrać gotowe przyciski.\n Dla zainteresowanychJeśli chcesz dowiedzieć się więcej na temat dodatkowych możliwości przy wstawianiu odsyłaczy obrazkowych na stronach internetowych, zobacz rozdział: Odsyłacze / Odsyłacz obrazkowy. \n\n### Przykład

Tu wpisz treść akapitu

\n >

Treść akapitu

\n >

Treść akapitu

\n >

Treść akapitu

\n >

Treść akapitu

\n >

Treść akapitu

Tu wpisz tekst Tu wpisz tekst Tu wpisz tekst Tu wpisz tekst Tu wpisz tekst Tu jest właściwa treść strony \"Tu
opis odsyłacza opis odsyłacza opis odsyłacza \"Tu alternatywa\n * Pasek postępu:\n> alternatywa alternatywa alternatywa\n * Minimum i maksimum:\n> alternatywa\n * Przedziały wartości:\n> alternatywa alternatywa\n * Wartość optymalna:\n> alternatywa alternatywa
nagłówek ...
\n * Panel domyślnie otwarty:\n>
nagłówek ... \n * Podstawowy odtwarzacz audio (niezalecane!):\n> \n * Odtwarzacz wielu formatów wideo:\n> \n * Odtwarzacz wielu formatów audio:\n>
tytuł

podtytuł

...
\n Niestety atrybut `accept-charset=\"...\"` nie jest cudownym sposobem na zachowanie prawidłowych polskich znaków diakrytycznych w prostych formularzach pocztowych 🙁 Nie wiadomo z jakiego systemu operacyjnego ani z jakiego programu pocztowego korzysta użytkownik, który będzie wypełniał formularz, a więc nie można jednoznacznie ustalić docelowej strony kodowej wysyłanych danych. \n\nDzięki temu dokument HTML zostanie wyświetlony w taki sposób, aby nie wymagał od użytkownika dalszego powiększania. W przeciwnym razie przeglądarka mobilna starałaby się wyświetlić stronę w rozdzielczości typowej dla przeglądarek używanych na standardowych komputerach, co zwykle oznaczałoby zdecydowanie zbyt mały rozmiar tekstu, aby nadawał się do wygodnego czytania.\n\n(interpretuje: Internet Explorer, Firefox, Opera 7, Chrome)\n > Tekst pogrubionyalbo też:\n > Tekst pogrubiony\n przy czym znacznik `` jest otwierający, natomiast `` - zamykający. \n\n### Wykaz atrybutów zdeprecjonowanych #\n\nWskazuje formę skróconą.\n\nWskazuje akronim - wyraz powstały z pierwszych liter innych wyrazów.\nAtrybuty: \n\nUmieszczanie informacji kontaktowych z autorem.\n\n* _blank - załadowanie do nowego okna\n * _parent - do ramki nadrzędnej\n * _self - do tej samej, w której znajduje się element\n * _top - do pełnego, oryginalnego okna\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nUstala atrybuty czcionki bazowej (zdeprecjonowane).\nAtrybuty: \n\nWłącza algorytm dwukierunkowego tekstu.\nAtrybuty: \n\nWyświetla tekst dużą czcionką.\nAtrybuty: \n\nCytat (wyświetlany w bloku).\n\nOdwołanie do innego źródła.\n\nFragment kodu komputerowego.\n\nPozwala zgrupować atrybuty dla kilku kolumn tabeli (TABLE). W odróżnieniu od COLGROUP nie grupuje kolumn strukturalnie.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nPozwala zgrupować strukturalnie kilka kolumn tabeli (TABLE). Może zawierać znaczniki COL.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nOpis terminu (DT) w liście definicyjnej (DL).\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nUżywane do zaznaczenia sekcji dokumentu, które zostały usunięte w stosunku do innej wersji dokumentu.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: wymagany \nDefinicja załączonego terminu.\n\nWielokolumnowy spis zawartości katalogu (LI) (zdeprecjonowane).\nAtrybuty: \n\nBlok.\n\nLista definicyjna terminów (DT) i opisów (DD).\n\nTermin listy definicyjnej (DL).\n\nPozwala autorowi pogrupować tematycznie kontrolki i etykiety formularza (FORM). Zawiera zwykle legendę (LEGEND).\n\nZmienia atrubuty czcionki dla tekstu, który zawiera (zdeprecjonowane).\nAtrybuty: \n\n* auto - ramka będzie przewijana, kiedy to będzie konieczne (domyślnie)\n * no - ramka nie będzie przewijana\n * yes - ramka będzie przewijana zawsze\n * SRC=\"adres\"\n * Podaje lokację inicjalizującego dokumentu ramki\n * STYLE=\"styl\"\n * Informacje stylów (CSS)\n * TITLE=\"tekst\"\n * Tekst pomocniczy\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nOkreśla ustawienie ramek (FRAME). Zwykle zawiera również znacznik NOFRAMES (dla przeglądarek, które nie obsługują ramek).\nAtrybuty: \n\nonload, onunload\n Znacznik otwierający: wymaganyZnacznik zamykający: wymagany \nNagłówek (tytuł rozdziału) poziomu od 1 do 6.\n\n* ltr - od lewej do prawej\n * rtl - od prawej do lewej\n * ID=\"nazwa\"\n * Przypisuje nazwę elementowi (identyfikator), która nie może się powtarzać w całym dokumencie\n * LANG=\"język\"\n * Informacja o języku bazowym (np.: LANG=\"en\" oznacza angielski, LANG=\"pl\" - polski itd.)\n * NOSHADE\n * Jednolity kolor (bez cienia) (zdeprecjonowane)\n * SIZE=\"piksele\"\n * Wysokość w pikselach (zdeprecjonowane)\n * STYLE=\"styl\"\n * Informacje stylów (CSS)\n * TITLE=\"tekst\"\n * Tekst pomocniczy\n * WIDTH=\"długość\"\n * Szerokość w pikselach lub w procentach (domyślnie 100%) (zdeprecjonowane)\n\n) Znacznik otwierający: opcjonalnyZnacznik zamykający: opcjonalny \nWyświetla tekst pochylony.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nTworzy kontrolki w formularzu (FORM).\n\nUżywane do zaznaczenia sekcji dokumentu, które zostały wstawione w stosunku do innej wersji dokumentu.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: wymagany \nJednoliniowe pole tekstowe (zdeprecjonowane - należy używać INPUT).\nAtrybuty: \n\nTekst do wprowadzenia przez użytkownika.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nOdnośnik, określa powiązania dokumentu. Występuje tylko w sekcji HEAD.\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nDefiniuje mapę odnośników klienta, wewnątrz której znajdują się obszary AREA. Aby dany element mógł się odwołać do takiej mapy, musi mieć atrybut USEMAP, o wartości zgodnej z atrybutem NAME mapy.\n\nJednokolumnowy spis menu (LI) (zdeprecjonowane).\nAtrybuty: \n\n* ltr - od lewej do prawej\n * rtl - od prawej do lewej\n * HTTP-EQUIV=\"nazwa\"\n * Informacja nagłówkowa (może być używana w zamian NAME)\n * LANG=\"język\"\n * Informacja o języku bazowym (np.: LANG=\"en\" oznacza angielski, LANG=\"pl\" - polski itd.)\n * NAME=\"nazwa\"\n * Identyfikuje nazwę własności\n * SCHEME=\"schemat\"\n * Schemat interpretacji własności\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nOkreśla zawartość, która powinna być wyświetlona tylko wtedy, gdy przeglądarka nie obsługuje ramek (FRAMESET).\nAtrybuty: \n\nPozwala zdefiniować treść alternatywną na wypadek, gdy skrypt umieszczony na stronie (SCRIPT) nie może zostać uruchomiony.\nAtrybuty: \n\nLista uporządkowana punktów (LI).\n\n* ltr - od lewej do prawej\n * rtl - od prawej do lewej\n * ID=\"nazwa\"\n * Przypisuje nazwę elementowi (identyfikator), która nie może się powtarzać w całym dokumencie\n * LANG=\"język\"\n * Informacja o języku bazowym (np.: LANG=\"en\" oznacza angielski, LANG=\"pl\" - polski itd.)\n * START=\"liczba\"\n * Początkowa liczba dla pierszego punktu (domyślnie \"1\", co odpowiada: \"1\", \"A\", \"a\", \"I\" lub \"i\" - w zależności od typu) (zdeprecjonowane)\n * STYLE=\"styl\"\n * Informacje stylów (CSS)\n * TITLE=\"tekst\"\n * Tekst pomocniczy\n * TYPE=\"typ\"\n * Typ listy (zdeprecjonowane):\n\n* 1 - liczby arabskie (1, 2, 3,...)\n * A - wielkie litery (A, B, C,...)\n * a - małe litery (a, b, c,...)\n * I - wielkie liczby rzymskie (I, II, III,...)\n * i - małe liczby rzymskie (i, ii, iii,...)\n\nGrupuje opcje (OPTION) w liście wyboru (SELECT).\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: wymagany \nTworzy opcję w liście wyboru (SELECT). Opcje mogą być zgrupowane (OPTGROUP).\n\n* ltr - od lewej do prawej\n * rtl - od prawej do lewej\n * DISABLED\n * Blokada kontrolki\n * ID=\"nazwa\"\n * Przypisuje nazwę elementowi (identyfikator), która nie może się powtarzać w całym dokumencie\n * LABEL=\"etykieta\"\n * Etykieta dla grupy opcji\n * LANG=\"język\"\n * Informacja o języku bazowym (np.: LANG=\"en\" oznacza angielski, LANG=\"pl\" - polski itd.)\n * SELECTED\n * Opcja jest zaznaczona\n * STYLE=\"styl\"\n * Informacje stylów (CSS)\n * TITLE=\"tekst\"\n * Tekst pomocniczy\n * VALUE=\"wartość\"\n * Wartość inicjalizująca kontrolki (jeśli nie jest podana, przyjmuje zawartość elementu)\n\n* data - wartość atrybutu VALUE zostanie przekazana do obiektu jako łańcuch znakowy (domyślnie)\n * object - VALUE jest identyfikatorem (ID) innego obiektu (OBJECT) w tym samym dokumencie\n * ref - VALUE wyznacza adres zasobu, gdzie są przechowywane wartości\n Znacznik otwierający: wymaganyZnacznik zamykający: zabroniony \nTekst preformatowany (interpretuje tabulację, dodatkowe spacje i znak końca linii).\n\nCytat (wyświetlany w linii).\n\nWyświetla tekst przekreślony (to samo co STRIKE) (zdeprecjonowane).\n\nPrzykład.\n\nWyświetla tekst małą czcionką.\n\nRozciąganie stylu.\n\nWyświetla tekst przekreślony (to samo co S) (zdeprecjonowane).\nAtrybuty: \n\nMocne wyróżnienie tekstu.\n\nIndeks górny.\n\nCiało (włściwa treść) tabeli (TABLE). Zawiera wiersze (TR).\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nWieloliniowe pole tekstowe, używane najczęściej w formularzach (FORM).\n\nStopka tabeli (TABLE). Zawiera wiersze (TR).\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nObszar nagłówkowy tabeli (TABLE). Zawiera wiersze (TR).\n\n* ltr - od lewej do prawej\n * rtl - od prawej do lewej\n * LANG=\"język\"\n * Informacja o języku bazowym (np.: LANG=\"en\" oznacza angielski, LANG=\"pl\" - polski itd.)\n Znacznik otwierający: wymaganyZnacznik zamykający: wymagany \nWiersz w tabeli (TABLE). Zawiera komórki danych (TD) i komórki nagłówkowe (TH).\n\nonclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup\n Znacznik otwierający: wymaganyZnacznik zamykający: opcjonalny \nWyświetla tekst w trybie dalekopisu lub o stałych odstępach pomiędzy znakami.\nAtrybuty: \n\nWyświetla tekst podkreślony (zdeprecjonowane).\n\nLista nieuporządkowana punktów (LI).\n\n* circle - kształt okręgu\n * disc - kształt koła\n * square - kształt kwadratu\n\nPrzykład zmiennej lub argumentu programu.\n\nW zasadzie aby rozpocząć przygodę z językiem CSS, wystarczy wstawić w nagłówku strony - tzn. w dowolnym miejscu pomiędzy znacznikami `` oraz `` - jedną dodatkową linijkę: > Tu wpisz tytuł strony Tu wpisuje się treść strony \n Dzięki znacznikowi `` do dokumentu zostanie automatycznie dołączony arkusz stylów. W nim właśnie wpisuje się wszystkie polecenia zmieniające wygląd strony. Ważne jest tylko, aby ten plik posiadał rozszerzenie *.css. W powyższym przykładzie jest to plik pod nazwą \"style.css\", który znajduje się w tym samym katalogu co dokument *.html. Można go oczywiście zapisać w innej lokalizacji - wtedy zamiast \"style.css\" trzeba podać pełną ścieżkę dostępu (tworzy się ją w analogiczny sposób, jak przy wstawianiu obrazka). \nWarto podkreślić, że jeśli Twoja strona WWW składa się z wielu podstron, na każdej z nich możesz dołączyć ten sam plik arkusza stylów. Dzięki temu zmiany wykonane tylko w jednym miejscu - czyli w pliku arkusza stylów - wpłyną na wygląd od razu wszystkich podstron Twojego serwisu. Czyż to nie jest piękne? Już nigdy więcej nie będzie Cię czekać żmudne przerabianie każdej podstrony tylko po to, aby zmienić na niej np. kolor albo rozmiar tekstu 🙂\n Dla zainteresowanychJeśli chcesz dowiedzieć się więcej na temat dodatkowych możliwości wstawiania stylów CSS na stronach internetowych, zobacz rozdział: Wstawianie stylów. \n\nPrzeglądarki zwykle ustalają pewną szerokość marginesów strony. Nie zawsze jednak domyślne ustawienia będą dobrze współgrać np. z określonym przez nas rozmiarem czcionki. Na szczęście bardzo łatwo można to zmienić:\n > body { margin: szerokość; }\n\nTapety graficzne umieszczone w tle są chętnie używanym elementem w każdym systemie operacyjnym. Podobne rozwiązanie można zastosować również na stronie internetowej.\n\nTekst na stronie internetowej najlepiej jest wpisywać w akapitach. Dzięki temu będzie on bardziej czytelny dla użytkownika. W pojedynczym dokumencie HTML może się znajdować wiele oddzielnych akapitów. Co zrobić, aby tekst w każdym z nich był ułożony tak samo? Dzięki możliwościom jakie dają style CSS, nie musimy tego robić dla każdego akapitu osobno. Wystarczy że w arkuszu CSS wpiszemy następującą regułę stylów:\n > p { text-align: wyrównanie; }\n\nPraktycznym zastosowaniem klas selektorów mogą być np. ramki wizualnie wyróżniające tekst, który się w nich znajduje. Wystarczy, że raz zdefiniujemy ich wygląd w arkuszu stylów:\n > .nazwa-klasy { deklaracje stylów }\n\nTo by było na tyle. Poznane tu polecenia powinny pozwolić Ci nie tylko na napisanie prostej strony WWW, ale zarazem określenie jej wyglądu w profesjonalny sposób. W dalszych rozdziałach Kursu CSS poznasz m.in. bardziej zaawansowane techniki tworzenia selektorów oraz rozbudowaną listę własności, dzięki którym zyskasz jeszcze większe możliwości stylizacji elementów Twojego serwisu.Zapraszam... \nTo by było na tyle. Poznane tu polecenia powinny pozwolić Ci nie tylko na napisanie prostej strony WWW, ale zarazem określenie jej wyglądu w profesjonalny sposób. W dalszych rozdziałach Kursu CSS poznasz m.in. bardziej zaawansowane techniki tworzenia selektorów oraz rozbudowaną listę własności, dzięki którym zyskasz jeszcze większe możliwości stylizacji elementów Twojego serwisu.\n\n> selektor { list-style-type: typ }\n Selektorem mogą być znaczniki dotyczące wykazów: ul - wypunktowanie, ol - wykaz numerowany oraz li - pojedynczy punkt wykazu [zobacz: Wstawianie stylów].Natomiast \"typ\" odpowiada za wygląd wyróżnika wykazu (markera) i należy zamiast niego wpisać: \nNatomiast \"typ\" odpowiada za wygląd wyróżnika wykazu (markera) i należy zamiast niego wpisać:\n\nn | wzór | wynik |\n | --- | --- | --- |\n0 | | 1 |\n1 | | 3 |\n2 | | 5 |\nitd. |\n\nW przypadku sąsiadowania ze sobą lub zagnieżdżania wewnątrz siebie elementów posiadających marginesy, może zajść proces załamywania marginesów zewnętrznych (ang. collapsing margins), polegający na połączeniu kilku sąsiadujących odstępów w jeden o rozmiarze pojedynczego marginesu, a nie sumy składowych. Według CSS 2.1 załamywane mogą być tylko marginesy pionowe w następujących przypadkach:\n\nCzy projektowanie wyglądu stron internetowych naprawdę jest tak trudne, jak mówią?\n * Edytory CSS\n\nKtóry edytor CSS wybrać: TopStyle Lite, Balthisar Cascade, Cascade DTP?\n * Wstawienie arkusza stylów\n\nJak wygląda typowy sposób dołączania arkusza CSS?\n * Arkusz stylów\n\nJak wygląda typowy arkusz CSS?\n * Kolor tła oraz tekstu\n\nW jaki sposób zmienić kolor tła oraz kolor tekstu na stronie WWW?\n * Czcionka\n\nW jaki sposób zmienić wielkość i rodzaj czcionki na stronie WWW?\n * Marginesy strony\n\nJak ustawić marginesy strony WWW? Czy da się określić marginesy niesymetryczne?\n * Tapeta\n\nJak ustawić tapetę graficzną w tle strony internetowej? W jaki sposób stworzyć tło w postaci zeszytu w kratkę, w linie albo ukośnej siatki?\n * Wyrównanie tekstu\n\nW jaki sposób układać tekst na ekranie? Jak wyśrodkować lub wyjustować tekst?\n * Kolor odsyłaczy\n\nJak zmienić kolor odsyłaczy (odnośników hipertekstowych, hiperłączy, linków)? Jak zrobić podświetlany link (odsyłacz, odnośnik hipertekstowy, hiperłacze)?\n * Klasy selektorów\n\nW jaki sposób przypisać do dowolnego elementu zbiór reguł formatujących, znajdujących się w jednym miejscu, oszczędzając sobie tym samym pisania?\n * Ramki z tekstem\n\nJak ująć tekst w ramkę w postaci obramowania z zaokrąglonymi narożnikami i tłem?\n * Podsumowanie\n\nCSS\n * Powtórka\n\nIstnieją specjalne edytory przeznaczone tylko do języka CSS. Nie są one jednak zbyt popularne i przez to często dawno przestały być już rozwijane. Najlepszym rozwiązaniem jest użycie edytora HTML, który ma wbudowaną obsługę również języka CSS. Na przykład Brackets to jeden z lepszych edytorów HTML i CSS. Posiada szereg wbudowanych funkcji przydatnych przy tworzeniu stron internetowych. Obsługuje instalowanie darmowych rozszerzeń, które mogą dodatkowo zwiększyć jego możliwości. Jest przy tym całkowicie darmowy i dostępny w wersjach dla każdego systemu operacyjnego.\n W zasadzie aby rozpocząć przygodę z językiem CSS, wystarczy wstawić w nagłówku strony - tzn. w dowolnym miejscu pomiędzy znacznikami `` oraz `` - jedną dodatkową linijkę: > Tu wpisz tytuł strony Tu wpisuje się treść strony \n Dzięki znacznikowi `` do dokumentu zostanie automatycznie dołączony arkusz stylów. W nim właśnie wpisuje się wszystkie polecenia zmieniające wygląd strony. Ważne jest tylko, aby ten plik posiadał rozszerzenie *.css. W powyższym przykładzie jest to plik pod nazwą \"style.css\", który znajduje się w tym samym katalogu co dokument *.html. Można go oczywiście zapisać w innej lokalizacji - wtedy zamiast \"style.css\" trzeba podać pełną ścieżkę dostępu (tworzy się ją w analogiczny sposób, jak przy wstawianiu obrazka). \nWarto podkreślić, że jeśli Twoja strona WWW składa się z wielu podstron, na każdej z nich możesz dołączyć ten sam plik arkusza stylów. Dzięki temu zmiany wykonane tylko w jednym miejscu - czyli w pliku arkusza stylów - wpłyną na wygląd od razu wszystkich podstron Twojego serwisu. Czyż to nie jest piękne? Już nigdy więcej nie będzie Cię czekać żmudne przerabianie każdej podstrony tylko po to, aby zmienić na niej np. kolor albo rozmiar tekstu :-)\n Dla zainteresowanychJeśli chcesz dowiedzieć się więcej na temat dodatkowych możliwości wstawiania stylów CSS na stronach internetowych, zobacz rozdział: Wstawianie stylów. \n\nArkusz stylów CSS jest plikiem tekstowym służącym do ustalania wyglądu strony internetowej. Zawiera on tzw. reguły stylów. Z kolei każda z nich składa się z selektora i deklaracji stylów. Poszczególne deklaracje obejmują listę poleceń, które określają, w jaki sposób chcemy zmienić wygląd elementu na stronie wskazanego przez selektor.\n Aby zmienić wygląd jakiegoś elementu na stronie, trzeba go najpierw wskazać. W języku CSS robi się to za pomocą tzw. selektora. W najprostszym przypadku jest to nazwa wybranego znacznika, który wcześniej wstawiliśmy do naszego dokumentu HTML. Wszystko co znajduje się wewnątrz tak wskazanego znacznika - czyli zarówno tekst, jak i inne znaczniki - otrzyma style podane w deklaracji. Przykładowo, aby zmienić kolor tła oraz teksu na całej stronie, możemy się posłużyć selektorem `body` , ponieważ właśnie wewnątrz znacznika `...` znajduje się cała zawartość strony. Zatem w arkuszu stylów wystarczy umieścić następujący kod: > body { background-color: black; color: white; }\n Zwróć uwagę, że deklaracja stylów, którą ujmuje się w nawiasy klamrowe, składa się tutaj z dwóch linijek. Każda z nich rozpoczyna się od podania tzw. cechy (inaczej własności), po której następuje wartość. Cecha określa, co chcemy zmienić w wyglądzie wybranego elementu, natomiast wartość - w jaki sposób ma się to zmienić. Zatem gdyby przetłumaczyć powyższą regułę stylów na bardziej zrozumiały język, brzmiałaby ona mniej więcej tak: dla całej zawartości znacznika `body` (selektor) zmień kolor tła (cecha `background-color` ) na czarny (wartość `black` ) i kolor tekstu (cecha `color` ) na biały (wartość `white` ). Pamiętaj, aby po wpisaniu cechy (własności) zawsze postawić znak dwukropka, a po każdej wartości - średnik. Zwróć również uwagę, że jeśli cecha (bądź wartość) zawiera znak myślnika (np. `background-color` ), to przed nim ani po nim nie może znajdować się spacja. \nAby ustalić inny kolor tła albo tekstu, wystarczy że w miejsce wartości wstawisz wybraną definicję koloru - zobacz: Wykaz kolorów.\n\nustawi czcionkę Arial dla tekstu na całej stronie. Stanie się to jednak tylko wtedy, gdy użytkownik odwiedzający stronę będzie miał zainstalowaną taką czcionkę w swoim systemie operacyjnym. W przeciwnym razie automatycznie zostanie użyta czcionka Helvetica, a jeśli i to nie będzie możliwe, tekst zostanie wyświetlony przy pomocy czcionki najbardziej zbliżonej wyglądem. \nPrzeglądarki zwykle ustalają pewną szerokość marginesów strony. Nie zawsze jednak domyślne ustawienia będą dobrze współgrać np. z określonym przez nas rozmiarem czcionki. Na szczęście bardzo łatwo można to zmienić:\n > body { margin: szerokość; }\n\nustawi wszystkie marginesy strony o szerokości i wysokości 2,5 centymetra. Należy jednak pamiętać, aby w razie potrzeby w wartościach liczbowych nie używać przecinka tylko kropki dziesiętnej. Ponadto przed nazwą jednostki nie może być spacji. W przeciwnym razie polecenie może nie zadziałać albo jego efekty będą inne niż oczekiwane! \nTapety graficzne umieszczone w tle są chętnie używanym elementem w każdym systemie operacyjnym. Podobne rozwiązanie można zastosować również na stronie internetowej.\n\n. Tak wstawiona tapeta pozostanie nieruchoma przy przewijaniu strony, a przy tym wypełni całą powierzchnię strony z zachowaniem oryginalnych proporcji zdjęcia. Może być jednak przycięta po bokach albo na górze i na dole, jeśli nie będzie pasować do aktualnych proporcji wymiarów okna przeglądarki. \nTekst na stronie internetowej najlepiej jest wpisywać w akapitach. Dzięki temu będzie on bardziej czytelny dla użytkownika. W pojedynczym dokumencie HTML może się znajdować wiele oddzielnych akapitów. Co zrobić, aby tekst w każdym z nich był ułożony tak samo? Dzięki możliwościom jakie dają style CSS, nie musimy tego robić dla każdego akapitu osobno. Wystarczy że w arkuszu CSS wpiszemy następującą regułę stylów:\n > p { text-align: wyrównanie; }\n\n. > a { color: kolor; } a:hover { color: podświetlenie; }\n\n. Przypisuje on do znacznika bloku podaną klasę CSS. Dzięki temu element ten wraz z całą jego zawartością przyjmie wygląd, który został określony w arkuszu stylów dla wskazanej klasy CSS. \nPraktycznym zastosowaniem klas selektorów mogą być np. ramki wizualnie wyróżniające tekst, który się w nich znajduje. Wystarczy, że raz zdefiniujemy ich wygląd w arkuszu stylów:\n > .nazwa-klasy { deklaracje stylów }\n\n. Jeśli na stronie chcemy wstawić więcej takich samych ramek, należy powielić tylko drugie polecenie. To by było na tyle. Poznane tu polecenia powinny pozwolić Ci nie tylko na napisanie prostej strony WWW, ale zarazem określenie jej wyglądu w profesjonalny sposób. W dalszych rozdziałach Kursu CSS poznasz m.in. bardziej zaawansowane techniki tworzenia selektorów oraz rozbudowaną listę własności, dzięki którym zyskasz jeszcze większe możliwości stylizacji elementów Twojego serwisu.Zapraszam... \nPoniżej znajdziesz wykaz najczęściej zadawanych pytań z tego rozdziału wraz ze zwięzłymi odpowiedziami i gotowymi do użycia przykładami kodu CSS. Aby sprawdzić bardziej szczegółowy opis, kliknij odnośnik \"Zobacz więcej...\" pod wybraną odpowiedzią.\n\n. Jeśli na stronie chcemy wstawić więcej takich samych ramek, należy powielić tylko drugie polecenie. \nSprawdź, czy pamiętasz, za co odpowiadają poniższe fragmenty kodu źródłowego CSS. W razie wątpliwości kliknij odnośnik \"Zobacz więcej...\" pod wybraną grupą przykładów.\n\n> Array.prototype.unshift()\nArray.prototype.unshift(item1) Array.prototype.unshift(item1, item2...) \n\n(child) Dany element jest nazywany dzieckiem innego elementu, jeżeli ten drugi element jest jego rodzicem.\n\nIdentyfikator to wartość atrybutu\n `id=\"...\"` nadanego selektorowi z poziomu języka HTML. \nNatomiast wyrazy \"cecha\" oraz \"wartość\" określają atrybuty elementu nadane poprzez style i zostaną opisane w dalszych rozdziałach.\n Jako identyfikator należy podać dowolny pojedynczy wyraz, który nie może zawierać znaków: spacji, kropki, przecinka, dwukropka, pytajnika, nawiasów, znaku równości, plusa itp. Może natomiast zawierać litery (A-Z, a-z), cyfry (0-9), myślniki (\"-\") i podkreślniki (\"_\"). Lepiej nie używać polskich liter. Nie może się on również rozpoczynać cyfrą ani myślnikiem. Jeśli koniecznie chcemy użyć \"zakazanych\" znaków, należy w deklaracji poprzedzić je odwróconym ukośnikiem \"\\\", np. deklaracja:\n\n```\nselektor#B\\&W\\? { cecha: wartość }\n```\n\nodpowiada identyfikatorowi: `id=\"B&W?\"` . Identyfikator może wystąpić tylko raz w hierarchii drzewa dokumentu, czyli w pojedynczym dokumencie nie mogą się znaleźć dwa elementy z takimi samymi identyfikatorami! \nPolecenie to pozwala, na nadanie określonych atrybutów formatowania dla elementu, który ma jednoznaczny identyfikator (ID), czyli występuje tylko raz w drzewie dokumentu (w odróżnieniu od klasy).\n\nJeżeli w arkuszu stylów strony została umieszczona następująca reguła: > p#przyklad_identyfikator { color: red }to akapit o podanym identyfikatorze ID:\n >

To jest akapit.

zostanie wyświetlony w kolorze czerwonym:\n\nDla porównania, to też jest akapit, ale bez podania identyfikatora i dlatego nie jest czerwony.\n\nUżycie selektora uniwersalnego pozwala przypisać styl do dowolnego znacznika z określonym identyfikatorem:\n > *#przyklad_uniwersalny { color: red }\n\nTo jest pogrubienie, któremu został nadany identyfikator id=\"przyklad_uniwersalny\".\n\nW tym przypadku gwiazdkę (*) w regule stylu można pominąć:\n > #przyklad_uniwersalny { color: red }\n\n(document tree) Drzewo elementów umieszczonych w dokumencie źródłowym. Każdy element w takim drzewie ma dokładnie jednego rodzica, oprócz elementu podstawowego, czyli korzenia drzewa (root).\n\n* Termin 1\n * Definicja 1\n Zwróć uwagę, że tylko termin drugiej z list jest podkreślony, ponieważ pierwsza lista posiada więcej niż jeden element `
...
` . Jednocześnie, ponieważ jedyny termin drugiej listy jest zarazem ostatnim takim elementem, przyjmie również określony wcześniej dodatkowy sposób formatowania - kursywę. Natomiast jedyna definicja drugiej listy jest zarazem na niej pierwsza, więc będzie pogrubiona. \n\nJeżeli wciśniesz i przytrzymasz przycisk myszki nad tym odsyłaczem, to do chwili zwolnienia przycisku, będzie on pogrubiony.\n\n(CSS 3 - interpretuje Internet Explorer 9, Firefox, Opera, Chrome)\n > selektor:target { cecha: wartość }\n `id=\"...\"` albo ewentualnie może to być element A posiadający atrybut `name=\"...\"` [zobacz: Odsyłacz do etykiety i Wstawianie stylów]. \nNatomiast wyrazy \"cecha\" oraz \"wartość\" określają atrybuty elementu nadane poprzez style i zostaną opisane w dalszych rozdziałach.\n Czasami podział serwisu na podstrony jest niewystarczający. Zdarza się, że jeden artykuł jest podzielony dodatkowo na niewielkie sekcje - zbyt małe, aby tworzyć z każdej z nich osobną podstronę. Chcielibyśmy jednak mieć możliwość odesłania czytelnika bezpośrednio do podanej sekcji, żeby nie musiał jej szukać \"ręcznie\". W takiej sytuacji stosuje się etykiety (np.:\n\nWARTOŚĆscroll | fixed | inheritOPISZaczepienie tłaINICJALIZACJAscrollZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | transparent | inheritOPISKolor tłaINICJALIZACJAtransparentZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | none | inheritOPISTło obrazkoweINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆrepeat | repeat-x | repeat-y | no-repeat | inheritOPISPowtarzanie tłaINICJALIZACJArepeatZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | inheritOPISAtrybuty mieszane stylu górnego/prawego/dolnego/lewego obramowaniaINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | inheritOPISAtrybuty mieszane szerokości górnego/prawego/dolnego/lewego obramowaniaINICJALIZACJAmediumZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆcollapse | separate | inheritOPISModel obramowania tabeliINICJALIZACJAcollapseZASTOSOWANIEtabeleDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆ ? | inheritOPISOdstęp między komórkami tabeliINICJALIZACJA0ZASTOSOWANIEtabeleDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆtop | bottom | left | right | inheritOPISPozycja podpisu tabeliINICJALIZACJAtopZASTOSOWANIEpodpis tabeliDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆnone | left | right | both | inheritOPISPrzyleganie do elementu pływającegoINICJALIZACJAnoneZASTOSOWANIEelementy blokoweDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | auto | inheritOPISObcinanieINICJALIZACJAautoZASTOSOWANIEelementy blokowe i zastępowaneDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | inheritOPISKolorINICJALIZACJAzależy od przeglądarkiZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆltr | rtl | inheritOPISKierunek tekstuINICJALIZACJAltrZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆ | below | level | above | higher | lower | inheritOPISPodniesienie dźwięku przestrzennegoINICJALIZACJAlevelZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆshow | hide | inheritOPISObramowanie pustych komórek tabeliINICJALIZACJAshowZASTOSOWANIEkomórki tabeliDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆleft | right | none | inheritOPISUstawienieINICJALIZACJAnoneZASTOSOWANIEwszystkie elementy oprócz pozycjonowanychDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | none | inheritOPISDopasowanie rozmiaru czcionkiINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆ | none | inheritOPISWyróżnik obrazkowy wykazuINICJALIZACJAnoneZASTOSOWANIEelementy wykazuDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆinside | outside | inheritOPISPozycja wyróżnika wykazuINICJALIZACJAoutsideZASTOSOWANIEelementy wykazuDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆ | inheritOPISSzerokość górnego/prawego/dolnego/lewego marginesuINICJALIZACJA0ZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYodnosi się do szerokości bloku obejmującegoMEDIAvisual\n\nWARTOŚĆ | auto | inheritOPISOdstęp wyróżnika wykazuINICJALIZACJAautoZASTOSOWANIEwyróżniki wykazuDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ[ crop || cross ] | none | inheritOPISZnaczniki strony (po wydrukowaniu)INICJALIZACJAnoneZASTOSOWANIEkontekst stronyDZIEDZICZENIEniePROCENTYnieMEDIAvisual, paged\n\nWARTOŚĆ | invert | inheritOPISKolor obrysuINICJALIZACJAinveritZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual, interactive\n\nWARTOŚĆ | inheritOPISStyl obrysuINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual, interactive\n\nWARTOŚĆ | inheritOPISSzerokość obrysuINICJALIZACJAmediumZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual, interactive\n\nWARTOŚĆ | autoOPISNazwa stronyINICJALIZACJAautoZASTOSOWANIEelementy blokoweDZIEDZICZENIEtakPROCENTYnieMEDIAvisual, paged\n\nWARTOŚĆavoid | auto | inheritOPISPrzełamanie strony wewnątrz blokuINICJALIZACJAautoZASTOSOWANIEelementy blokoweDZIEDZICZENIEtakPROCENTYnieMEDIAvisual, paged\n\nWARTOŚĆ | inheritOPISOdchylenie częstotliwości od średniejINICJALIZACJA50ZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆ mix? repeat? | auto | none | inheritOPISTło dźwiękowe podczas wymowyINICJALIZACJAautoZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAaural\n\nWARTOŚĆstatic | relative | absolute | fixed | inheritOPISPozycja elementuINICJALIZACJAstaticZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | inheritOPISBogactwo głosuINICJALIZACJA50ZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆnormal | none | spell-out | inheritOPISParametry mowyINICJALIZACJAnormalZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆonce | always | inheritOPISCzytanie na głos nagłówków tabeliINICJALIZACJAonceZASTOSOWANIEelementy z informacją nagłówkowąDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆdigits | continuous | inheritOPISWymowa liczebnikówINICJALIZACJAcontinuousZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆcode | none | inheritOPISWymowa interpunkcjiINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆ | x-slow | slow | medium | fast | x-fast | faster | slower | inheritOPISPrędkość wymowyINICJALIZACJAmediumZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆ | inheritOPISAkcentINICJALIZACJA50ZASTOSOWANIEwszystkie elementyDZIEDZICZENIEtakPROCENTYnieMEDIAaural\n\nWARTOŚĆauto | fixed | inheritOPISRozplanowanie tabeliINICJALIZACJAautoZASTOSOWANIEtabeleDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆ | | inheritOPISWcięcie tekstuINICJALIZACJA0ZASTOSOWANIEelementy blokoweDZIEDZICZENIEtakPROCENTYodnosi się do szerokości bloku obejmującegoMEDIAvisual\n\nWARTOŚĆnone | [ || ? ,]* [ || ?] | inheritOPISCień tekstuINICJALIZACJAnoneZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆnormal | embed | bidi-override | inheritOPISAlgorytm dwukierunkowego tekstuINICJALIZACJAnormalZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆvisible | hidden | collapse | inheritOPISWidzialnośćINICJALIZACJAinheritZASTOSOWANIEwszystkie elementyDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\nWARTOŚĆnormal | pre | nowrap | inheritOPISKontrola białych znakówINICJALIZACJAnormalZASTOSOWANIEelementy blokoweDZIEDZICZENIEtakPROCENTYnieMEDIAvisual\n\nWARTOŚĆauto | | inheritOPISPozycja w stosie nakładających się elementówINICJALIZACJAautoZASTOSOWANIEelementy pozycjonowaneDZIEDZICZENIEniePROCENTYnieMEDIAvisual\n\n To jest akapit koloru zielonego, wewnątrz którego znajduje się: pochylenie oraz podkreślenie, którym nie zostały nadane żadne style, a więc dziedziczą je po przodku, czyli po akapicie (są również zielone).A to jest pogrubienie, które znajduje się także wewnątrz tego samego akapitu, ale został mu nadany atrybut koloru czcionki (biały) oraz koloru tła (niebieski) i dlatego nie odziedziczył stylu po przodku.\n\nŁańcuchy znakowe (tzw. strings) mogą być pisane w podwójnym cudzysłowie ( `\"...\"` ) lub w pojedynczym ( `'...'` ). Łańcuchy ograniczone podwójnym cudzysłowem nie mogą już zawierać wewnątrz takiego znaku - wtedy należy użyć znaku odwróconego ukośnika (backslash) przed cudzysłowem wewnątrz. Tzn. aby wpisać następujący string: `\"123\"123\"` (niepoprawnie!), należy podać: `\"123\\\"123\"` (poprawnie). To samo dotyczy pojedynczego cudzysłowu (zamiast `'123'123'` należy wpisać `'123\\'123'` ). Natomiast dozwolony jest zapis: `\"123'123\"` lub `'123\"123'` . \nNiedozwolone jest bezpośrednie użycie znaku nowej linii (przez przełamanie linii klawiszem Enter). Należy zamiast tego użyć znaku \\A.\n\nPoniżej znajdziesz wykaz wszystkich cech (własności) oraz ich wartości według oryginalnej specyfikacji CSS2, opracowanej przez organizację W3C.\n\nWyjaśnienie znaczenia poszczególnych elementów opisu:\n\n* WARTOŚĆ\n * Wartości które może przyjąć cecha. Przyjęto tutaj następujące oznaczenia:\n\n* Słowa kluczowe zostały wpisane bez żadnych dodatkowych znaków (np. center, left-side). Wyraz inherit oznacza, że element przyjmuje wartość cechy, taką samą jak jego rodzic (zasada dziedziczenia).\n * Typy podstawowe zostały ujęte w znaki < oraz >. Są to:\n\n* \n `` - pojedyncza liczba * \n `` - wartość długości * \n `` - wartość procentowa * \n `` - kąt * \n `` - czas * \n `` - częstotliwość * \n `<łańcuch znakowy>` - łańcuch znakowy (string) * \n `` - definicja koloru * \n `` - adres (ścieżka dostępu) w postaci: `url(adres)` * \n `` - identyfikator elementu w postaci: `#nazwa` * Typy które przyjmują takie same wartości jak inne cechy, zostały ujęte w znaki <' oraz '> (np. <'background-color'>). Ich wartości należy szukać pod podaną nazwą.\n * Typy ujęte w znaki < oraz >, które nie zostały wymienione powyżej (np.: ), stanowią specjalne wartości, określone tylko dla danej cechy. Należy ich szukać w opisie danej cechy (po kliknięciu jej nazwy).\n * Znak \"|\" oddzielający dwie lub więcej wartości oznacza, że dokładnie jedna z nich musi się pojawić w deklaracji stylu, np. dla zestawienia:\n> scroll | fixed | inherit\nmożna podać: > fixed\n * Znak \"||\" oddzielający dwie lub więcej wartości oznacza, że jedna lub więcej z nich musi się pojawić w deklaracji stylu w dowolnym porządku, np. dla zestawienia:\n> <'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'>\nmożna podać: > <'background-repeat'> <'background-image'>\n * Nawiasy kwadratowe \"[\" oraz \"]\" służą do grupowania, np. wyrażenie:\n> a b | c || d e\njest równoważne: > [ a b ] | [ c || [ d e ]]\n * Gwiazdka \"*\" wskazuje, że poprzedzający typ, wyraz lub grupa może się pojawić zero lub więcej razy.\n * Plus \"+\" oznacza, że poprzedzający typ, wyraz lub grupa może się pojawić raz lub więcej.\n * Pytajnik \"?\" wskazuje, że poprzedzający typ, wyraz lub grupa jest opcjonalna.\n * Para liczb w nawiasach klamrowych {A,B} oznacza, że poprzedzający typ, wyraz lub grupa musi się pojawić przynajmniej A razy, natomiast maksymalnie B razy.\n * OPIS\n * Tutaj znajdziesz krótki opis znaczenia cechy. Jeżeli szczegółowy opis jest dostępny, można się do niego przenieść klikając odnośnik.\n * INICJALIZACJA\n * Wartość domyślna cechy.\n * ZASTOSOWANIE\n * Elementy których dotyczy cecha.\n * DZIEDZICZENIE\n * Wskazuje, czy wartość jest dziedziczona od przodka.\n * PROCENTY\n * Określa czy dana cecha akceptuje wartości procentowe, a jeśli tak, to w jaki sposób są interpretowane.\n * MEDIA\n * Grupa mediów, do których cecha się stosuje.\n\n```\nscroll | fixed | inherit\n```\n\n```\n | transparent | inherit\n```\n\n```\nrepeat | repeat-x | repeat-y | no-repeat | inherit\n```\n\n * OPIS\n * Powtarzanie tła\n * INICJALIZACJA\n * repeat\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n* WARTOŚĆ\n * \n ` | inherit` * OPIS\n * Atrybuty mieszane koloru górnego/prawego/dolnego/lewego obramowania\n * INICJALIZACJA\n * wartość cechy\n `'color'` * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\ncollapse | separate | inherit\n```\n\n * OPIS\n * Model obramowania tabeli\n * INICJALIZACJA\n * collapse\n * ZASTOSOWANIE\n * tabele\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n{1,4} | transparent | inherit\n```\n\n```\n ? | inherit\n```\n\n * OPIS\n * Odstęp między komórkami tabeli\n * INICJALIZACJA\n * 0\n * ZASTOSOWANIE\n * tabele\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n{1,4} | inherit\n```\n\n```\n{1,4} | inherit\n```\n\n```\ntop | bottom | left | right | inherit\n```\n\n * OPIS\n * Pozycja podpisu tabeli\n * INICJALIZACJA\n * top\n * ZASTOSOWANIE\n * podpis tabeli\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n * OPIS\n * Przyleganie do elementu pływającego\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n* WARTOŚĆ\n * \n ` | inherit` * OPIS\n * Kolor\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n[ <'cue-before'> || <'cue-after'> ] | inherit\n```\n\n * OPIS\n * Sygnał wywoławczy przed i po...\n * INICJALIZACJA\n * zobacz cechy indywidualne\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * aural\n\n* WARTOŚĆ\n * \n `ltr | rtl | inherit` * OPIS\n * Kierunek tekstu\n * INICJALIZACJA\n * ltr\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n | below | level | above | higher | lower | inherit\n```\n\n```\nshow | hide | inherit\n```\n\n * OPIS\n * Obramowanie pustych komórek tabeli\n * INICJALIZACJA\n * show\n * ZASTOSOWANIE\n * komórki tabeli\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n * OPIS\n * Ustawienie\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * wszystkie elementy oprócz pozycjonowanych\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n[[ | ],]* [ | ] | inherit\n```\n\n * OPIS\n * Rodzina czcionek\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n | | | | inherit\n```\n\n * OPIS\n * Rozmiar czcionki\n * INICJALIZACJA\n * medium\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * odnosi się do rozmiaru czcionki rodzica\n * MEDIA\n * visual\n\n```\n | none | inherit\n```\n\n * OPIS\n * Dopasowanie rozmiaru czcionki\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\nnormal | small-caps | inherit\n```\n\n * OPIS\n * Wysokość linii\n * INICJALIZACJA\n * normal\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * odnosi się do rozmiaru czcionki elementu\n * MEDIA\n * visual\n\n * OPIS\n * Wyróżnik obrazkowy wykazu\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * elementy wykazu\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\ninside | outside | inherit\n```\n\n * OPIS\n * Pozycja wyróżnika wykazu\n * INICJALIZACJA\n * outside\n * ZASTOSOWANIE\n * elementy wykazu\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n{1,4} | inherit\n```\n\n```\n | inherit\n```\n\n * OPIS\n * Szerokość górnego/prawego/dolnego/lewego marginesu\n * INICJALIZACJA\n * 0\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * odnosi się do szerokości bloku obejmującego\n * MEDIA\n * visual\n\n```\n[ crop || cross ] | none | inherit\n```\n\n * OPIS\n * Znaczniki strony (po wydrukowaniu)\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * kontekst strony\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual, paged\n\n * OPIS\n * Minimalna szerokość\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * wszystkie elementy oprócz niezastępowanych elementów inline i tabel\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * odnosi się do bloku obejmującego\n * MEDIA\n * visual\n\n```\n[ <'outline-color'> || <'outline-style'> || <'outline-width'> ] | inherit\n```\n\n```\n | invert | inherit\n```\n\n * OPIS\n * Styl obrysu\n * INICJALIZACJA\n * none\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual, interactive\n\n * OPIS\n * Szerokość obrysu\n * INICJALIZACJA\n * medium\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual, interactive\n\n```\nvisible | hidden | scroll | auto | inherit\n```\n\n * OPIS\n * Kontroluje przepełnienie elementu\n * INICJALIZACJA\n * visible\n * ZASTOSOWANIE\n * elementy blokowe i zastępowane\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n{1,4} | inherit\n```\n\n```\n | inherit\n```\n\n```\n | auto\n```\n\n * OPIS\n * Nazwa strony\n * INICJALIZACJA\n * auto\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual, paged\n\n * OPIS\n * Przełamanie strony przed blokiem\n * INICJALIZACJA\n * auto\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual, paged\n\n * OPIS\n * Przerwa przed wymawianym tekstem\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * odnosi się do odwrotności wartości 'speech-rate'\n * MEDIA\n * aural\n\n* WARTOŚĆ\n * \n ` | inherit` * OPIS\n * Odchylenie częstotliwości od średniej\n * INICJALIZACJA\n * 50\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * aural\n\n```\n mix? repeat? | auto | none | inherit\n```\n\n * OPIS\n * Tło dźwiękowe podczas wymowy\n * INICJALIZACJA\n * auto\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * aural\n\n```\nstatic | relative | absolute | fixed | inherit\n```\n\n * OPIS\n * Pozycja elementu\n * INICJALIZACJA\n * static\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\n[<łańcuch znakowy> <łańcuch znakowy>]+ | none | inherit\n```\n\n * OPIS\n * Określa znaki cudzysłowu\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\nnormal | none | spell-out | inherit\n```\n\n```\nonce | always | inherit\n```\n\n * OPIS\n * Czytanie na głos nagłówków tabeli\n * INICJALIZACJA\n * once\n * ZASTOSOWANIE\n * elementy z informacją nagłówkową\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * aural\n\n```\ndigits | continuous | inherit\n```\n\n```\ncode | none | inherit\n```\n\n```\n | x-slow | slow | medium | fast | x-fast | faster | slower | inherit\n```\n\n * OPIS\n * Prędkość wymowy\n * INICJALIZACJA\n * medium\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * aural\n\n```\nauto | fixed | inherit\n```\n\n * OPIS\n * Rozplanowanie tabeli\n * INICJALIZACJA\n * auto\n * ZASTOSOWANIE\n * tabele\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\nleft | right | center | justify | <łańcuch znakowy> | inherit\n```\n\n * OPIS\n * Wyrównanie tekstu\n * INICJALIZACJA\n * zależy od przeglądarki\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n * OPIS\n * Wcięcie tekstu\n * INICJALIZACJA\n * 0\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * odnosi się do szerokości bloku obejmującego\n * MEDIA\n * visual\n\n```\nnone | [ || ? ,]* [ || ?] | inherit\n```\n\n```\nnormal | embed | bidi-override | inherit\n```\n\n * OPIS\n * Algorytm dwukierunkowego tekstu\n * INICJALIZACJA\n * normal\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n * OPIS\n * Widzialność\n * INICJALIZACJA\n * inherit\n * ZASTOSOWANIE\n * wszystkie elementy\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\nnormal | pre | nowrap | inherit\n```\n\n * OPIS\n * Kontrola białych znaków\n * INICJALIZACJA\n * normal\n * ZASTOSOWANIE\n * elementy blokowe\n * DZIEDZICZENIE\n * tak\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n```\nauto | | inherit\n```\n\n * OPIS\n * Pozycja w stosie nakładających się elementów\n * INICJALIZACJA\n * auto\n * ZASTOSOWANIE\n * elementy pozycjonowane\n * DZIEDZICZENIE\n * nie\n * PROCENTY\n * nie\n * MEDIA\n * visual\n\n...i gotowe. Prawda że szybko poszło? 😉\n\nJeżeli nie odpowiada nam podstawowy wygląd menu, można go zmienić wykorzystując polecenia CSS. W tym celu w pliku menu.css należy wkleić np.:\n > #menu0 { width: 200px; margin: 10px; padding: 0; } #menu0 dt { background-color: #888; color: #fff; font-weight: bold; text-align: center; cursor: pointer; margin: 10px 0 0 0; padding: 2px; } #menu0 dd { background-color: #eee; color: #000; border-width: 0 1px 1px 1px; border-style: solid; border-color: #888; margin: 0; padding: 1px 5px; } #menu0 dd.active { font-weight: bold; }\n\n* Wstaw w nagłówku pliku jeden raz kod:\n> \n * W wybranych miejscach strony osadź bloki menu używając znaczników listy definicyjnej
...
, przy czym każdemu kolejnemu menu nadaj inny identyfikator\n `id=\"...\"` - np. `id=\"menu0\"` , `id=\"menu1\"` , `id=\"menu2\"` itd. * Pod każdym blokiem menu wstaw wywołanie skryptu (ostatni zaprezentowany wcześniej fragment kodu), pamiętając, aby w każdym z nich podać odpowiedni identyfikator (menu0, menu1, menu2 itd.).\n Warto nadmienić, że w przypadku kiedy elementy menu zawierają odsyłacze, gałąź menu, w której znajduje się odnośnik do aktualnie wczytanej strony, zostanie na starcie automatycznie rozwinięta. Dzięki temu użytkownik łatwiej odnajdzie punkt w nawigacji, w którym teraz się znajduje. Dodatkowo w takiej sytuacji elementowi `
...
` , w którym znajduje się bieżący odsyłacz, zostanie przypisana klasa CSS pod nazwą active, dzięki której można dodatkowo wyróżnić aktualną pozycję menu, dodając odpowiednie deklaracje CSS w arkuszu stylów, np.: > #menu0 dd.active { font-weight: bold; }\n\noddzielone średnikami (\";\"). \n\n* Ochrona adresu e-mail\n * Zabezpieczenie naszego adresu e-mail przed robotami sieciowymi, czyli specjalnymi programami, które automatycznie gromadzą adresy pocztowe umieszczone na stronach WWW, a później używają ich do rozsyłania spamu.\n * Wczytanie stron do dwóch ramek\n * Załadowanie dwóch (lub więcej) ramek jednocześnie, po kliknięciu pojedynczego odsyłacza.\n * Ostrzeżenie przed ramką\n * Ostrzeżenie, że dana strona wchodzi w skład struktury ramek i aby zobaczyć pełny kontekst (spis treści), użytkownik powinien udać się na stronę główną. W innym wariancie skrypt automatycznie wczytuje stronę główną i ustawia podstronę, spod której wchodził użytkownik.\n * Sprawdzenie pól formularza\n * Sprawdzenie przed wysłaniem formularza pocztowego, czy wszystkie pola zostały wypełnione przez użytkownika.\n * Strona na hasło\n * Jeżeli nie chcesz, aby wszystkie informacje na Twojej stronie były publicznie dostępne, możesz zabezpieczyć wybrane podstrony hasłem. Prezentowany skrypt jest niezwykle prosty do wprowadzenia, ale jednocześnie bardzo skuteczny.\n * Dynamiczne blokowanie pól formularza\n * Blokowanie/odblokowywanie albo ukrywanie/wyświetlanie jednego lub kilku pól formularza dopiero po wcześniejszym wybraniu przez użytkownika określonej opcji. Funkcja niezwykle przydatna przy bardziej skomplikowanych formularzach.\n * Potwierdzenie wyczyszczenia formularza\n * Wyeliminowanie możliwości pomyłkowego naciśnięcia przycisku \"reset\" w formularzu (czyszczącego wszystkie dane), dzięki potwierdzeniu zamiaru użytkownika.\n * Usunięcie polskich znaków z formularza\n * Usunięcie polskich znaków z formularza pocztowego, a przez to uniknięcie błędnego ich zakodowania.\n * Alternatywny sposób wysłania formularza\n * Sposób na ominięcie błędu pojawiającego w niektórych wersjach systemu operacyjnego, powodującego, że zamiast wysłania formularza, otwiera się program pocztowy z pustą wiadomością.\n\n# Generator stron WWW\n\nIstrukcja obsługi\n\nKlikając przyciski z menu wprowadzamy do wpisywanego teksu znaczniki HTML czyli specjalne polecenia w nawiasach ostrych, które pozwalają zmieniać wygląd tekstu na ekranie, np.:\n\n```\nTen tekst zostanie pogrubiony, to jest zwykły tekst...\n```\n\nZnaczniki HTML będą niewidoczne później na stronie, natomiast widoczny będzie tekst, który wpiszemy wewnątrz lub poza nimi (tekst wewnątrz dodatkowo zmieni wygląd).\n\nPo kliknięciu dowolnego przycisku (Czcionka, Hiperłącze lub Wyrównanie) w oknie edycji wpisujemy tekst, którego wygląd chcemy zmienić. Jednocześnie można zauważyć, że na przycisku który wybraliśmy, pojawił się symbol gwiazdki - przypomina nam on, że po wpisaniu całego tekstu, który ma być np. pogrubiony czy pochylony, musimy ponownie kliknąć ten sam przycisk, aby podawany dalej tekst miał już normalny wygląd (wtedy symbol gwiazdki zniknie z przycisku).\n\n# Generator szablonów WWW\n\nTytuł:\n\n Opis:\n\n Lewa kolumna:\n\n Obramowanie zawartości z góry:\n px # \n\n Obramowanie zawartości z prawej:\n px # \n\n Obramowanie zawartości z dołu:\n px # \n\n Prawa kolumna:\n\n 1Strona\n\n Tak\n Znak wodny\n\n 2Ramka\n\n 3Wnętrze\n\n 4Logo\n\n 5Linki\n\n 6Nagłówek menu\n\n 7Zawartość menu\n\n Link podstawowy:\n # PodkreśleniePogrubieniePochylenie\n\n Link odwiedzony:\n # PodkreśleniePogrubieniePochylenie\n\n Podświetlenie:\n # PodkreśleniePogrubieniePochylenie\n\n 8Treść\n\n 9Stopka\n\n Obramowanie z lewej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTytuł:\nTytuł:\n Opis:\nOpis:\n Lewa kolumna:\nLewa kolumna:\n Szerokość:\n px\nSzerokość:\n px\npx\npx Margines nagłówka:\n\n pxpx pxpx\nMargines nagłówka:\n pxpx pxpx\npxpx px\npx px px\npx Obramowanie nagłówka z góry:\n px #\nObramowanie nagłówka z góry:\n px #\n Obramowanie nagłówka z prawej:\n px #\nObramowanie nagłówka z prawej:\n px #\n Obramowanie nagłówka z dołu:\n px #\nObramowanie nagłówka z dołu:\n px #\n Obramowanie nagłówka z lewej:\n px #\nObramowanie nagłówka z lewej:\n px #\n Margines zawartości:\n\n pxpx pxpx\nMargines zawartości:\n pxpx pxpx\npxpx px\npx px px\npx Obramowanie zawartości z góry:\n px #\nObramowanie zawartości z góry:\n px #\n Obramowanie zawartości z prawej:\n px #\nObramowanie zawartości z prawej:\n px #\n Obramowanie zawartości z dołu:\n px #\nObramowanie zawartości z dołu:\n px #\n Obramowanie zawartości z lewej:\n px #\nObramowanie zawartości z lewej:\n px #\n Prawa kolumna:\nPrawa kolumna:\n Szerokość:\n px\nSzerokość:\n px\npx\npx Margines nagłówka:\n\n pxpx pxpx\nMargines nagłówka:\n pxpx pxpx\npx\npx px\npx px\npx px\npx Obramowanie nagłówka z góry:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \nObramowanie nagłówka z góry:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie nagłówka z prawej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0123\nObramowanie nagłówka z prawej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0123456789ABCDEF\npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie nagłówka z dołu:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0\nObramowanie nagłówka z dołu:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0123456789ABCDEF0123456789ABCDEF\npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie nagłówka z lewej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0\nObramowanie nagłówka z lewej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # 0\npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Margines zawartości:\n\n pxpx pxpx\nMargines zawartości:\n pxpx pxpx\npx\npx px\npx px\npx px\npx Obramowanie zawartości z góry:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \nObramowanie zawartości z góry:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie zawartości z prawej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \nObramowanie zawartości z prawej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# \n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie zawartości z dołu:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \nObramowanie zawartości z dołu:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# 0123\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Obramowanie zawartości z lewej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \nObramowanie zawartości z lewej:\n px nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset # \npx\npx nonehiddendasheddottedsoliddoublegrooveridgeinsetoutset\nnone\n hidden\n dashed\n dotted\n solid\n double\n groove\n ridge\n inset\n outset\n #\n# \n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 1Strona\n1Strona\n1Strona\nStrona Czcionka:\n px serifsans-serifmonospacecursivefantasy\nCzcionka:\n px serifsans-serifmonospacecursivefantasy\npx\npx serifsans-serifmonospacecursivefantasy\nserif\n sans-serif\n monospace\n cursive\n fantasy\n Tło:\n # \nTło:\n # \n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło graficzne:\n\n Tak\n Znak wodny\nTło graficzne:\n Tak\n Znak wodny\nTak\n Znak wodny\n 2Ramka\n2Ramka\n2Ramka\nRamka Tło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło graficzne:\n\n Tak\nTło graficzne:\n Tak\nTak\n 3Wnętrze\n3Wnętrze\n3Wnętrze\nWnętrze Tło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło graficzne:\n\n Tak\nTło graficzne:\n Tak\nTak\n 4Logo\n4Logo\n4Logo\nLogo Czcionka:\n px serifsans-serifmonospacecursivefantasy\nCzcionka:\n px serifsans-serifmonospacecursivefantasy\npx\npx serifsans-serifmonospacecursivefantasy\nserif\n sans-serif\n monospace\n cursive\n fantasy\n Tekst:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTekst:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło graficzne:\n\n pxpx pxpx\nMargines wewnątrz:\n pxpx pxpx\npxpx px\npx px px\npx 7Zawartość menu\n7Zawartość menu\n7Zawartość menu\nZawartość menu Czcionka:\n px\nCzcionka:\n px\n Tekst:\n #\nTekst:\n #\n Tło:\n #\nTło:\n #\n Tło graficzne:\n\n pxpx pxpx\nMargines wewnątrz:\n pxpx pxpx\npxpx px\npx px px\npx Link podstawowy:\n # PodkreśleniePogrubieniePochylenie\nLink podstawowy:\n # PodkreśleniePogrubieniePochylenie\nPodkreślenie\n Pogrubienie\n Pochylenie\n Link odwiedzony:\n # PodkreśleniePogrubieniePochylenie\nLink odwiedzony:\n # PodkreśleniePogrubieniePochylenie\nPodkreślenie\n Pogrubienie\n Pochylenie\n Podświetlenie:\n # PodkreśleniePogrubieniePochylenie\nPodświetlenie:\n # PodkreśleniePogrubieniePochylenie\nPodkreślenie\n Pogrubienie\n Pochylenie\n 8Treść\n8Treść\n8Treść\nTreść Czcionka:\n px serifsans-serifmonospacecursivefantasy\nCzcionka:\n px serifsans-serifmonospacecursivefantasy\npx\npx serifsans-serifmonospacecursivefantasy\nserif\n sans-serif\n monospace\n cursive\n fantasy\n Tekst:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTekst:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\nTło:\n # 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n#\n# 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n 0123456789ABCDEF\n0\n 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n A\n B\n C\n D\n E\n F\n Tło graficzne:\n\n# Generator META i BODY\n\nGenerator META i BODY MetBod Nagłówek: Typ dokumentu: HTML XHTML Opis zawartości: Wyrazy kluczowe: Język: pl (polski) af (afrykanerski) sq (albański) en (angielski) en-au (angielski - Australia) en-bz (angielski - Belize) en-ie (angielski - Irlandia) en-jm (angielski - Jamajka) en-ca (angielski - Kanada) en-nz (angielski - Nowa Zelandia) en-za (angielski - Rep. Płd. Afryki) en-us (angielski - Stany Zjednoczone) en-tt (angielski - Trynidad) en-gb (angielski - Wielka Brytania) ar (arabski) ar-dz (arabski - Algieria) ar-sa (arabski - Arabia Saudyjska) ar-bh (arabski - Bahrajn) ar-eg (arabski - Egipt) ar-iq (arabski - Irak) ar-ye (arabski - Jemen) ar-jo (arabski - Jordan) ar-qa (arabski - Katar) ar-kw (arabski - Kuwejt) ar-lb (arabski - Liban) ar-ly (arabski - Libia) ar-ma (arabski - Maroko) ar-om (arabski - Oman) ar-sy (arabski - Syria) ar-tn (arabski - Tunezja) ar-ae (arabski - Zjed. Emiraty Arabskie) eu (baskijski) be (białoruski) bg (bułgarski) zh (chiński) zh-cn (chiński - Chiny) zk-hk (chiński - Hong Kong) zh-sg (chiński - Singapur) zh-tw (chiński - Tajwan) hr (chorwacki) cs (czeski) da (duński) et (estoński) fo (farerski) fi (fiński) fr (francuski) fr-be (francuski - Belgia) fr-ca (francuski - Kanada) fr-lu (francuski - Luksemburg) fr-ch (francuski - Szwajcaria) gd (gaelicki) el (grecki) he (hebrajski) hi (hindi) es (hiszpański) es-ar (hiszpański - Argentyna) es-bo (hiszpański - Boliwia) es-cl (hiszpański - Chile) es-do (hiszpański - Dominikana) es-ec (hiszpański - Ekwador) es-gt (hiszpański - Gwatemala) es-hn (hiszpański - Honduras) es-co (hiszpański - Kolumbia) es-cr (hiszpański - Kostaryka) es-mx (hiszpański - Meksyk) es-ni (hiszpański - Nikaragua) es-py (hiszpański - Panama) es-pe (hiszpański - Peru) es-pr (hiszpański - Puerto Rico) es-sv (hiszpański - Salwador) es-uy (hiszpański - Urugwaj) in (indonezyjski) is (islandzki) ja (japoński) ji (jidysz) ca (kataloński) ko (koreański) lt (litewski) lv (łotewski) mk (macedoński) ms (malezyjski) mt (maltański) nl (niderlandzki) nl-be (niderlandzki - Belgia) de (niemiecki) de-at (niemiecki - Austria) de-li (niemiecki - Liechtenstein) de-lu (niemiecki - Luksemburg) de-ch (niemiecki - Szwajcaria) no (norweski) fa (perski - Farsi) pt (portugalski) pt-br (portugalski - Brazylia) rm (retoromański) ru (rosyjski) ru-mo (rosyjski - Mołdawia) ro (rumuński) ro-mo (rumuński - Mołdawia) sr (serbski) sx (sutu) sv (szwedzki) sv-fi (szwedzki - Finlandia) sk (słowacki) sl (słoweński) th (tajlandzki) ts (tsonga) tn (tswana) tr (turecki) uk (ukraiński) ur (urdu) vi (wietnamski) it (włoski) it-ch (włoski - Szwajcaria) hu (węgierski) xh (xhosa) zu (zuluski) Autor: Twórca: Wydawca: Odświeżanie strony co: sek. Przejdź do strony: Użyty edytor: Roboty sieciowe: all - indeksuj wszystko none - nie indeksuj niczego index - indeksuj stronę noindex - nie indeksuj strony follow - indeksuj odsyłacze nofollow - nie indeksuj odsyłaczy noarchive - nie zapisuj w archiwum nosnippet - nie wyświetlaj opisu notranslate - nie proponuje tłumaczenia strony na inny język noimageindex - nie indeksuj obrazków nositelinkssearchbox - nie wyświetlaj pola wyszukiwania z linkami do podstron indexifembedded - indeksuj strony w ramkach Skalowanie: Szerokość: device-width (szerokość obszaru wyświetlania) inna (podaj wartość) Wysokość: device-height (wysokość obszaru wyświetlania) inna (podaj wartość) Skala początkowa: Skala minimalna: Skala maksymalna: Blokada skalowania Tytuł strony: Zewnętrzny arkusz stylów CSS: Plik: Media: all (wszystkie) screen (monitor kolorowy) print (drukarka) aural (syntezator mowy) braille (czytanie braillem) embossed (drukarka brailla) handheld (urządzenie ręczne) projection (projektor) tty (monotypiczne - dalekopis) tv (telewizor) Ikona strony: Ciało: Kolor tekstu : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Kolor tła : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Tło obrazkowe: Plik: Nieruchome Powtarzanie: repeat-x (w poziomie) repeat-y (w pionie) no-repeat (nie powtarzaj) Pozycja: center top right top right right bottom bottom left bottom left left top inna (podaj 1 lub 2 wartości) Od lewej: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Od góry: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Odnośniki: Podstawowy : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Odwiedzony : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Aktywny : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Wszystkie: Krój: Rodzina ogólna: serif (szeryfowa) sans-serif (bezszeryfowa) monospace (monotypiczna) cursive (pochyła) fantasy (fantazyjna) Pogrubienie Kursywa Dekoracja: none (brak) underline (podkreślenie) overline (nadkreślenie) line-through (przekreślenie) blink (migotanie) Podświetlenie: Kolor : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Tło : # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Dekoracja: none (brak) underline (podkreślenie) overline (nadkreślenie) line-through (przekreślenie) blink (migotanie) Marginesy: Symetryczne : Poziomy: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Pionowy: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Niesymetryczne : Lewy: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Prawy: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Górny: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Dolny: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Czcionka: Krój: Wyrównanie: left (do lewej) right (do prawej) center (wyśrodkowanie) justify (justowanie) Rozmiar: px (piksele) pt (punkty) in (cale) cm (centymetry) mm (milimetry) pc (pika) Rodzina ogólna: serif (szeryfowa) sans-serif (bezszeryfowa) monospace (monotypiczna) cursive (pochyła) fantasy (fantazyjna) Pogrubienie Kursywa Dekoracja: none (brak) underline (podkreślenie) overline (nadkreślenie) line-through (przekreślenie) Transformacja: uppercase (wielkie litery) lowercase (małe litery) capitalize (kapitalizacja) Wysokość linii: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Rozciągnięcie wyrazów: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Rozciągnięcie liter: px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) ch (szerokość cyfry zero) rem (wysokość czcionki korzenia) vw (% szerokość obszaru wyświetlania) vh (% wysokość obszaru wyświetlania) vmin (mniejsza z wartości: vw lub vh) vmax (większa z wartości: vw lub vh) in (cale) cm (centymetry) mm (milimetry) pt (punkty) pc (pika) Blokada (JavaScript): Menu kontekstowe (prawy klawisz) Zaznaczanie Przeciąganie Wygenerowana treść: Zobacz także Jak wyznaczyć kąt, utworzony między dodatnią poziomą półosią układu współrzędnych a prostą przechodzącą przez środek układu współrzędnych i zadany punkt? W jaki sposób objąć stylem kilka elementów tekstowych? W jaki sposób za pomocą CSS odnieść się do korzenia drzewa dokumentu? Jak wypełnić tło płynnym przejściem kilku kolorów w postaci gradientu? Jak ustawić szerokość (grubość) obramowania dla wszystkich krawędzi jednocześnie? © www.kurshtml.edu.pl\n\n# Konwerter HTML/Tekst\n\nKonwerter HTML/Tekst Kod źródłowy: Inteligentny tryb preformatowany Zamień sąsiadujące spacje i tabulacje na niełamliwe Zamień niełamliwe spacje na zwykłe Dodaj przełamania linii Usuń przełamania linii Zobacz także Jak przekształcić dowolną wartość na obiekt liczbowy? Co to jest obrys i czym się różni od obramowania? Jak przekształcić dowolną wartość na obiekt tekstowy? Jak zabezpieczyć się przed nieestetycznym przyleganiem dwóch elementów oblewanych tekstem (np. obrazki)? W jaki sposób nie dopuścić, aby obok tekstu znajdował się obrazek ani inny element? Ile wynosi logarytm naturalny z liczby 2? © www.kurshtml.edu.pl\n\n# Tester kolorów\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras scelerisque. Nulla facilisi. In interdum urna vitae nisl. Vestibulum at ipsum. Quisque consequat tortor vel urna aliquam accumsan. Etiam nulla lectus, consectetuer eu, hendrerit nec, ultrices eget, nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas facilisis ipsum quis enim. Pellentesque lectus enim, eleifend eu, facilisis ac, scelerisque et, sapien. Phasellus interdum. Nullam semper lectus nec odio. Ut placerat. Morbi nec turpis. In volutpat. Nulla venenatis nibh in augue. Cras id quam. Donec nonummy nonummy odio.\n Fusce in arcu ultricies tortor volutpat tristique. Curabitur condimentum odio id orci. Donec fringilla metus et enim. Nam feugiat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus ut libero non purus mattis adipiscing. Aliquam tortor lectus, vestibulum ac, porttitor at, adipiscing porta, leo. Mauris a metus. Nam venenatis pede at lorem. Morbi at neque. Proin consequat magna vitae est. In suscipit. Etiam tortor ante, blandit eu, gravida in, rhoncus ac, lectus. Proin posuere. Proin dignissim nisi vitae magna. Etiam ac lectus. Nunc placerat laoreet erat. Praesent lectus elit, nonummy in, egestas ut, tempus ac, quam.\n\nMożliwe jest określenie wyglądu nowego okna (rozmiarów, położenia, pokazanie/ukrycie pasków menu, narzędzi, statusu itp.), poprzez podanie w poleceniu dodatkowych parametrów. Zamiast opisu zamieszam poniżej generator. Otrzymany w nim kod, należy wpisać w miejsce wyróżnionego tekstu, np. jako wartość atrybutu `onload=\"...\"` (pierwszy sposób). \nUWAGA! Jeśli chcesz otworzyć zwykłe okno po kliknięciu odsyłacza (trzeci wariant), czyli bez określania parametrów wyglądu, lepiej to zrobić w następujący sposób:\n >
opis (przycisk rozbudowany) Kolor tekstu: # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Kolor tła: # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Rozmiar czcionki: pt (punkty) px (piksele) % (procent) em (wysokość czcionki) ex (wysokość małej litery) in (cale) cm (centymetry) mm (milimetry) pc (pika) Rodzaj(e) czcionki: Dekoracja: Pogrubienie Pochylenie Podkreślenie Przekreślenie Nadkreślenie Szerokość: px (piksele) pt (punkty) % (procent) em (wysokość czcionki) ex (wysokość małej litery) in (cale) cm (centymetry) mm (milimetry) pc (pika) Wysokość: px (piksele) pt (punkty) % (procent) em (wysokość czcionki) ex (wysokość małej litery) in (cale) cm (centymetry) mm (milimetry) pc (pika) Obramowanie: Styl: NONE (brak) SOLID (ciągłe) DASHED (kreskowe) DOTTED (kropkowe) DOUBLE (podwójne) GROOVE (rowek) RIDGE (grzbiet) INSET OUTSET Kolor: # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Szerokość: px (piksele) pt (punkty) % (procent) em (wysokość czcionki) ex (wysokość małej litery) in (cale) cm (centymetry) mm (milimetry) pc (pika) Podgląd: Brak obsługi ramek lokalnych! Wygenerowany kod: Zobacz także Jak obliczyć arcus tangens? W jaki sposób przekształcić tekst na liczbę? Jak połączyć kilka selektorów atrybutów w jednej regule stylów CSS? Co zrobić, aby liczby w kolumnach tabeli z danymi były ułożone równo pod sobą? W jaki sposób wyświetlić licznik i mianownik rozdzielone kreską ułamkową? Jak pobrać milisekundę z podanej daty? © www.kurshtml.edu.pl\n\n# Tester pliku robots.txt\n\nTester pliku robots.txt robots.txt Adresy URL: User-Agent: Opcje: Pomiń dyrektywę: Allow Pomiń wzorzec dopasowania: * Pomiń wzorzec dopasowania: $ Allow: Disallow: Zobacz także Co zrobić, aby wokół pustych komórek tabeli wyświetlało się obramowanie? W jaki sposób poprawnie oznaczać datę i czas w dokumentach HTML5? W jaki sposób rozciągnąć lub ścieśnić czcionkę? Jak rozpocząć nową stronę papieru w określonym miejscu na wydruku? Jak zmienić wygląd odsyłaczy (odnośników hipertekstowych, hiperłączy, linków)? © www.kurshtml.edu.pl\n\nGenerator gradientów CSS Typ liniowy promienisty Powtarzany Kierunek w górę w prawy-górny róg w prawo w prawy-dolny róg w dół w lewy-dolny róg w lewo w lewy-górny róg Kąt... Kąt stopnie gradusy radiany obroty Kształt elipsa okrąg Rozmiar bliższa krawędź dalsza krawędź bliższy narożnik dalszy narożnik Inny rozmiar... Inny rozmiar Poziom procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Pion procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Pozycja centrum na górze w prawym-górnym rógu po prawej w prawym-dolnym rogu na dole w lewym-dolnym rogu po lewej w lewym-górnym rogu Inna pozycja... Inna pozycja Od lewej procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Od góry procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Kolor czarny biały srebrny szary kasztanowy czerwony purpurowy fuksja zielony limonowy oliwkowy żółty granatowy niebieski zielonomodry akwamaryna pomarańczowy Inny kolor... Inny kolor # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Odległość procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Kolor czarny biały srebrny szary kasztanowy czerwony purpurowy fuksja zielony limonowy oliwkowy żółty granatowy niebieski zielonomodry akwamaryna pomarańczowy Inny kolor... Inny kolor # 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F Odległość procenty cale centymetry milimetry punkty pika piksele wysokość czcionki wysokość małej litery szerokość cyfry \"0\" wysokość czcionki korzenia szer. obszaru wyświetlania wys. obszaru wyświetlania min szer/wys obszaru wyśw. max szer/wys obszaru wyśw. Dodaj kolor Wybierz Zobacz także Jak utworzyć nową instancję tablicy, która może przechowywać listę elementów? Co zrobić, aby wysokość i pionowe marginesy dopasowywały się do sąsiednich elementów, tak aby wyświetlanie zawsze było poprawne? Definicje CSS: dokument źródłowy (source document) Jak pobrać wszystkie dopasowania wzorca (wyrażenia regularnego) do podanego tekstu? Jak określić specjalny wygląd strony w wersji do wydruku czy na urządzenia przenośne? © www.kurshtml.edu.pl\n\n# Kalkulator (przelicznik) jednostek CSS\n\nKalkulator (przelicznik) jednostek CSS Wartość * Jednostka in (cal) cm (centymetr) mm (milimetr) Q (ćwierćmilimetr) pt (punkt) pc (pika) px (piksel) deg (stopień) grad (gradus) rad (radian) turn (obrót) ms (milisekunda) s (sekunda) Hz (herc) kHz (kiloherc) dpi (plamki na cal) dpcm (plamki na centymetr) dppx (plamki na piksel) = * Wszystkie wyniki są zaokrąglane do trzeciego miejsca po przecinku. Zobacz także Jak przekształcić rzucony wyjątek na tekst, który można wyświetlić użytkownikowi? Jak pobrać dzień miesiąca z podanej daty w strefie czasowej południka zerowego (UTC)? Podstawowe definicje (terminy) dotyczące stylów CSS Jak zmienić miesiąc w podanej dacie? Jak przekształcić tekst w formacie JSON na obiekty i wartości JavaScript? © www.kurshtml.edu.pl\n\n# Znaki Unicode (utf-8)\n\nZnaki Unicode (utf-8) Wpisz znak Unicode: 0 [Łaciński podstawowy = 0] 100 [Łaciński-1 = 127] 200 [Łaciński rozszerzony-A = 256] 300 [Łaciński rozszerzony-B = 399] 400 500 600 700 [Litery modyfikujące odstępy = 710; Łączące znaki diakrytyczne = 768] 800 [Grecki podstawowy = 894] 900 1000 [Cyrylica = 1025] 1100 1200 1300 1400 [Hebrajski rozszerzony = 1456; Hebrajski podstawowy = 1488] 1500 [Arabski podstawowy = 1548] 1600 [Arabski rozszerzony = 1632] 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 [Łaciński rozszerzony dodatkowy = 7808] 7900 8000 8100 8200 [Standardowe znaki przestankowe = 8204] 8300 [Indeksy górne i dolne = 8319; Symbole waluty = 8355] 8400 [Symbole literopodobne = 8453] 8500 [Formy liczb = 8531; Strzałki = 8592] 8600 8700 [Operatory matematyczne = 8706] 8800 8900 [Różne techniczne = 8962] 9000 9100 9200 9300 9400 [Elementy ramek = 9472] 9500 9600 [Elementy blokowe = 9600; Kształty geometryczne = 9632] 9700 [Dingbats (różne) = 9786] 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13700 13800 13900 14000 14100 14200 14300 14400 14500 14600 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15800 15900 16000 16100 16200 16300 16400 16500 16600 16700 16800 16900 17000 17100 17200 17300 17400 17500 17600 17700 17800 17900 18000 18100 18200 18300 18400 18500 18600 18700 18800 18900 19000 19100 19200 19300 19400 19500 19600 19700 19800 19900 20000 20100 20200 20300 20400 20500 20600 20700 20800 20900 21000 21100 21200 21300 21400 21500 21600 21700 21800 21900 22000 22100 22200 22300 22400 22500 22600 22700 22800 22900 23000 23100 23200 23300 23400 23500 23600 23700 23800 23900 24000 24100 24200 24300 24400 24500 24600 24700 24800 24900 25000 25100 25200 25300 25400 25500 25600 25700 25800 25900 26000 26100 26200 26300 26400 26500 26600 26700 26800 26900 27000 27100 27200 27300 27400 27500 27600 27700 27800 27900 28000 28100 28200 28300 28400 28500 28600 28700 28800 28900 29000 29100 29200 29300 29400 29500 29600 29700 29800 29900 30000 30100 30200 30300 30400 30500 30600 30700 30800 30900 31000 31100 31200 31300 31400 31500 31600 31700 31800 31900 32000 32100 32200 32300 32400 32500 32600 32700 32800 32900 33000 33100 33200 33300 33400 33500 33600 33700 33800 33900 34000 34100 34200 34300 34400 34500 34600 34700 34800 34900 35000 35100 35200 35300 35400 35500 35600 35700 35800 35900 36000 36100 36200 36300 36400 36500 36600 36700 36800 36900 37000 37100 37200 37300 37400 37500 37600 37700 37800 37900 38000 38100 38200 38300 38400 38500 38600 38700 38800 38900 39000 39100 39200 39300 39400 39500 39600 39700 39800 39900 40000 40100 40200 40300 40400 40500 40600 40700 40800 40900 41000 41100 41200 41300 41400 41500 41600 41700 41800 41900 42000 42100 42200 42300 42400 42500 42600 42700 42800 42900 43000 43100 43200 43300 43400 43500 43600 43700 43800 43900 44000 44100 44200 44300 44400 44500 44600 44700 44800 44900 45000 45100 45200 45300 45400 45500 45600 45700 45800 45900 46000 46100 46200 46300 46400 46500 46600 46700 46800 46900 47000 47100 47200 47300 47400 47500 47600 47700 47800 47900 48000 48100 48200 48300 48400 48500 48600 48700 48800 48900 49000 49100 49200 49300 49400 49500 49600 49700 49800 49900 50000 50100 50200 50300 50400 50500 50600 50700 50800 50900 51000 51100 51200 51300 51400 51500 51600 51700 51800 51900 52000 52100 52200 52300 52400 52500 52600 52700 52800 52900 53000 53100 53200 53300 53400 53500 53600 53700 53800 53900 54000 54100 54200 54300 54400 54500 54600 54700 54800 54900 55000 55100 55200 55300 55400 55500 55600 55700 55800 55900 56000 56100 56200 56300 56400 56500 56600 56700 56800 56900 57000 57100 57200 57300 57400 57500 57600 57700 57800 57900 58000 58100 58200 58300 58400 58500 58600 58700 58800 58900 59000 59100 59200 59300 [Obszar do użytku własnego = 59393] 59400 59500 59600 59700 59800 59900 60000 60100 60200 60300 60400 60500 60600 60700 60800 60900 61000 61100 61200 61300 61400 61500 61600 61700 61800 61900 62000 62100 62200 62300 62400 62500 62600 62700 62800 62900 63000 63100 63200 63300 63400 63500 63600 63700 63800 63900 64000 64100 64200 [Formularze prezentacji alfabetycznej = 64257] 64300 [Formularze prezentacji arabskiej-A = 64342] 64400 64500 64600 64700 64800 64900 65000 65100 [Formularze prezentacji arabskiej-B = 65152] 65200 65300 65400 65500 [Specjalne = 65532] Brak obsługi skryptów! Brak obsługi pływających ramek! Zobacz także Jak ustawić bloki w wierszach na dole, na górze albo równomiernie na całej dostępnej wysokości? Co zrobić, aby Twoja strona była odnajdywana w wyszukiwarkach? Co zrobić, aby punkt wykazu (wyróżnik, marker) znajdował się wewnątrz tekstu? Jak zbudować bardziej profesjonalny serwis? Jak wprowadzić dłuższy cytat? © www.kurshtml.edu.pl\n\n# Test przeglądarki\n\nDate: 2001-01-31\nCategories: \nTags: \n\nWłasność | Opis | Twoja przeglądarka |\n | --- | --- | --- |\nwidth | szerokość | 800 |\nheight | wysokość | 600 |\nleft | lewa krawędź | brak danych |\ntop | górna krawędź | brak danych |\navailWidth | dostępna szerokość | 800 |\navailHeight | dostępna wysokość | 600 |\navailLeft | dostępna pozycja od lewej | 0 |\navailTop | dostępna pozycja od góry | 0 |\ncolorDepth | głębia kolorów | 24 |\npixelDepth | głębia pikseli | 24 |\nbufferDepth | głębokość buffora | brak danych |\ndeviceXDPI | rozdzielczość DPI w poziomie | brak danych |\ndeviceYDPI | rozdzielczość DPI w pionie | brak danych |\nlogicalXDPI | logiczna rozdzielczość DPI w poziomie | brak danych |\nlogicalYDPI | logiczna rozdzielczość DPI w pionie | brak danych |\nupdateInterval | czas odświeżania w milisekundach | brak danych |\nfontSmoothingEnabled | wygładzanie czcionek | brak danych |\n\nWłasność | Opis | Twoja przeglądarka | MSIE 6 | MSIE 5 | Mozilla 1 | Firefox 0.9 | Netscape 6 | Opera 7 | Opera 6 |\n | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\nappName | nazwa | Netscape | Microsoft Internet Explorer | Microsoft Internet Explorer | Netscape | Netscape | Netscape | Microsoft Internet Explorer | Microsoft Internet Explorer |\nappVersion | wersja | 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/119.0.6045.105 Safari/537.36 | 4.0 (compatible; MSIE 6.0; Windows NT 5.1) | 4.0 (compatible; MSIE 5.01; Windows NT 5.0) | 5.0 (Windows; PL) | 5.0 (Windows; pl-PL) | 5.0 (Windows; en-US) | 4.0 (compatible; MSIE 6.0; Windows NT 5.1) | 4.0 (compatible; MSIE 5.0; Windows XP) |\nappMinorVersion | zainstalowane aktualizacje | brak danych | ;SP1;Q837009;Q832894;Q831167; | ;SP1;Q837009;Q832894;Q831167; | brak danych | brak danych | brak danych |\nappCodeName | nazwa kodu | Mozilla | Mozilla | Mozilla | Mozilla | Mozilla | Mozilla | Mozilla | Mozilla |\nuserAgent | przegladarka | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/119.0.6045.105 Safari/537.36 | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) | Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) | Mozilla/5.0 (Windows; U; Windows NT 5.1; PL; rv:1.5) Gecko/20030925 | Mozilla/5.0 (Windows; U; Windows NT 5.1; pl-PL; rv:1.7) Gecko/20040707 Firefox/0.9.2 | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18) Gecko/20010131 Netscape6/6.01 | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.23 [pl] | Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.05 [pl] |\nplatform | system operacyjny | Linux x86_64 | Win32 | Win32 | Win32 | Win32 | Win32 | Win32 | Win32 |\ncookieEnabled | obsługa cookie | tak | tak | tak | tak | tak | tak | tak | tak |\njavaEnabled() | obsługa Javy | nie | tak | tak | tak | tak | tak | tak | tak |\ntaintEnabled() | oznaczenie danych jako niebezpieczne | brak danych | nie | nie | nie | nie | nie | nie | nie |\nlanguage | język | en-US | brak danych | brak danych | PL | pl-PL | en-US | pl | pl |\nbrowserLanguage | język przeglądarki | brak danych | pl | pl | brak danych | brak danych | brak danych | pl | pl |\nsystemLanguage | domyślny język systemu operacyjnego | brak danych | pl | pl | brak danych | brak danych | brak danych | brak danych | brak danych |\nuserLanguage | ustawiony język systemu operacyjnego | brak danych | pl | pl | brak danych | brak danych | brak danych | pl | brak danych |\noscpu | system operacyjny | brak danych | brak danych | brak danych | Windows NT 5.1 | Windows NT 5.1 | Windows NT 5.0 | brak danych | brak danych |\nvendor | producent | Google Inc. | brak danych | brak danych | Firefox | Netscape6 | brak danych | brak danych |\nvendorSub | numer wersji producenta | brak danych | brak danych | 0.9.2 | 6.01 | brak danych | brak danych |\nproduct | produkt | Gecko | brak danych | brak danych | Gecko | Gecko | Gecko | brak danych | brak danych |\nproductSub | numer wersji produktu | 20030107 | brak danych | brak danych | 20030925 | 20040707 | 20010131 | brak danych | brak danych |\nsecurityPolicy | polityka bezpieczeństwa | brak danych | brak danych | brak danych | brak danych | brak danych |\ncpuClass | klasa procesora | brak danych | x86 | x86 | brak danych | brak danych | brak danych | brak danych | brak danych |\nonLine | tryb online | tak | tak | tak | brak danych | brak danych | brak danych | brak danych | brak danych |\nuserProfile | profil użytkownika | brak danych | obiekt dostępny | obiekt dostępny | brak danych | brak danych | brak danych | brak danych | brak danych |\nopsProfile | informacje o użytkowniku | brak danych | wskaźnik dostępny | wskaźnik dostępny | brak danych | brak danych | brak danych | brak danych | brak danych |\n\nJęzyk | Twoja przeglądarka | MSIE 6 | MSIE 5 | Mozilla 1 | Firefox 0.9 | Netscape 6 | Opera 7 | Opera 6 |\n | --- | --- | --- | --- | --- | --- | --- | --- | --- |\nJavascript: | tak | tak | tak | tak | tak | tak | tak | tak |\nJavaScript1.1: | tak | tak | tak | tak | tak | tak | tak | tak |\nJavaScript1.2: | tak | tak | tak | tak | tak | tak | tak | tak |\nJavaScript1.3: | tak | tak | tak | tak | tak | tak | tak | tak |\nJavaScript1.4: | tak | nie | nie | tak | tak | tak | tak | tak |\nJavaScript1.5: | tak | nie | nie | tak | tak | tak | tak (7.5) | nie |\nJScript: | tak | tak | tak | nie | nie | nie | tak | tak |\nLiveScript: | tak | tak | tak | tak | tak | tak | tak | tak |\nVBScript: | nie | tak | nie | nie | nie | nie | nie | nie |\n\nTwoja przeglądarka | MSIE 6 | MSIE 5 | Mozilla 1 | Firefox 0.9 | Netscape 6 | Opera 7 | Opera 6 |\n | --- | --- | --- | --- | --- | --- | --- | --- |\nDOM Level 1 | DOM Level 1 | DOM Level 1 | DOM Level 1 | DOM Level 1 | DOM Level 1 | DOM Level 1 | DOM Level 1 |\n\nnavigator: | appCodeName, appName, appVersion, clearAppBadge, clipboard, connection, cookieEnabled, credentials, deviceMemory, doNotTrack, geolocation, getBattery, getGamepads, getInstalledRelatedApps, getUserMedia, gpu, hardwareConcurrency, hid, ink, javaEnabled, keyboard, language, languages, locks, managed, maxTouchPoints, mediaCapabilities, mediaDevices, mediaSession, mimeTypes, onLine, pdfViewerEnabled, permissions, platform, plugins, presentation, product, productSub, registerProtocolHandler, requestMIDIAccess, requestMediaKeySystemAccess, scheduling, sendBeacon, serial, serviceWorker, setAppBadge, storage, unregisterProtocolHandler, usb, userActivation, userAgent, userAgentData, vendor, vendorSub, vibrate, virtualKeyboard, wakeLock, webdriver, webkitGetUserMedia, webkitPersistentStorage, webkitTemporaryStorage, windowControlsOverlay, xr |\n | --- | --- |\nwindow: | PERSISTENT, TEMPORARY, addEventListener, alert, atob, blur, btoa, caches, cancelAnimationFrame, cancelIdleCallback, captureEvents, cdc_adoQpoasnfa76pfcZLmcfl_Array, cdc_adoQpoasnfa76pfcZLmcfl_JSON, cdc_adoQpoasnfa76pfcZLmcfl_Object, cdc_adoQpoasnfa76pfcZLmcfl_Promise, cdc_adoQpoasnfa76pfcZLmcfl_Proxy, cdc_adoQpoasnfa76pfcZLmcfl_Symbol, clearInterval, clearTimeout, clientInformation, close, closed, confirm, cookieStore, createImageBitmap, credentialless, crossOriginIsolated, crypto, customElements, devicePixelRatio, dhtml_level, dispatchEvent, document, documentPictureInPicture, external, fetch, find, focus, frameElement, frames, getComputedStyle, getScreenDetails, getSelection, history, indexedDB, innerHeight, innerWidth, isSecureContext, javascript13, javascript14, javascript15, launchQueue, length, localStorage, location, locationbar, matchMedia, menubar, moveBy, moveTo, name, navigation, navigator, onabort, onafterprint, onanimationend, onanimationiteration, onanimationstart, onappinstalled, onauxclick, onbeforeinput, onbeforeinstallprompt, onbeforematch, onbeforeprint, onbeforetoggle, onbeforeunload, onbeforexrselect, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontentvisibilityautostatechange, oncontextlost, oncontextmenu, oncontextrestored, oncuechange, ondblclick, ondevicemotion, ondeviceorientation, ondeviceorientationabsolute, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformdata, ongotpointercapture, onhashchange, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onlanguagechange, onload, onloadeddata, onloadedmetadata, onloadstart, onlostpointercapture, onmessage, onmessageerror, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onoffline, ononline, onpagehide, onpageshow, onpause, onplay, onplaying, onpointercancel, onpointerdown, onpointerenter, onpointerleave, onpointermove, onpointerout, onpointerover, onpointerrawupdate, onpointerup, onpopstate, onprogress, onratechange, onrejectionhandled, onreset, onresize, onscroll, onscrollend, onsearch, onsecuritypolicyviolation, onseeked, onseeking, onselect, onselectionchange, onselectstart, onslotchange, onstalled, onstorage, onsubmit, onsuspend, ontimeupdate, ontoggle, ontransitioncancel, ontransitionend, ontransitionrun, ontransitionstart, onunhandledrejection, onunload, onvolumechange, onwaiting, onwebkitanimationend, onwebkitanimationiteration, onwebkitanimationstart, onwebkittransitionend, onwheel, open, openDatabase, opener, origin, originAgentCluster, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, performance, personalbar, postMessage, print, prompt, queryLocalFonts, queueMicrotask, releaseEvents, removeEventListener, reportError, requestAnimationFrame, requestIdleCallback, resizeBy, resizeTo, ret_nodes, scheduler, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollBy, scrollTo, scrollX, scrollY, scrollbars, self, sessionStorage, setInterval, setTimeout, showDirectoryPicker, showOpenFilePicker, showSaveFilePicker, speechSynthesis, status, statusbar, stop, structuredClone, styleMedia, toolbar, top, trustedTypes, visualViewport, webkitCancelAnimationFrame, webkitRequestAnimationFrame, webkitRequestFileSystem, webkitResolveLocalFileSystemURL, window |\ndocument: | ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, URL, activeElement, addEventListener, adoptNode, adoptedStyleSheets, alinkColor, all, anchors, append, appendChild, applets, baseURI, bgColor, body, captureEvents, caretRangeFromPoint, characterSet, charset, childElementCount, childNodes, children, clear, cloneNode, close, compareDocumentPosition, compatMode, contains, contentType, cookie, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEvent, createExpression, createNSResolver, createNodeIterator, createProcessingInstruction, createRange, createTextNode, createTreeWalker, currentScript, defaultView, designMode, dir, dispatchEvent, doctype, documentElement, documentURI, domain, elementFromPoint, elementsFromPoint, embeds, evaluate, execCommand, exitFullscreen, exitPictureInPicture, exitPointerLock, featurePolicy, fgColor, firstChild, firstElementChild, fonts, forms, fragmentDirective, fullscreen, fullscreenElement, fullscreenEnabled, getAnimations, getElementById, getElementsByClassName, getElementsByName, getElementsByTagName, getElementsByTagNameNS, getRootNode, getSelection, hasChildNodes, hasFocus, hasPrivateToken, hasRedemptionRecord, hasStorageAccess, head, hidden, images, implementation, importNode, inputEncoding, insertBefore, isConnected, isDefaultNamespace, isEqualNode, isSameNode, lastChild, lastElementChild, lastModified, linkColor, links, location, lookupNamespaceURI, lookupPrefix, nextSibling, nodeName, nodeType, nodeValue, normalize, onabort, onanimationend, onanimationiteration, onanimationstart, onauxclick, onbeforecopy, onbeforecut, onbeforeinput, onbeforematch, onbeforepaste, onbeforetoggle, onbeforexrselect, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontentvisibilityautostatechange, oncontextlost, oncontextmenu, oncontextrestored, oncopy, oncuechange, oncut, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformdata, onfreeze, onfullscreenchange, onfullscreenerror, ongotpointercapture, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onlostpointercapture, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpaste, onpause, onplay, onplaying, onpointercancel, onpointerdown, onpointerenter, onpointerleave, onpointerlockchange, onpointerlockerror, onpointermove, onpointerout, onpointerover, onpointerrawupdate, onpointerup, onprerenderingchange, onprogress, onratechange, onreadystatechange, onreset, onresize, onresume, onscroll, onscrollend, onsearch, onsecuritypolicyviolation, onseeked, onseeking, onselect, onselectionchange, onselectstart, onslotchange, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, ontransitioncancel, ontransitionend, ontransitionrun, ontransitionstart, onvisibilitychange, onvolumechange, onwaiting, onwebkitanimationend, onwebkitanimationiteration, onwebkitanimationstart, onwebkitfullscreenchange, onwebkitfullscreenerror, onwebkittransitionend, onwheel, open, ownerDocument, parentElement, parentNode, pictureInPictureElement, pictureInPictureEnabled, plugins, pointerLockElement, prepend, prerendering, previousSibling, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue, querySelector, querySelectorAll, readyState, referrer, releaseEvents, removeChild, removeEventListener, replaceChild, replaceChildren, requestStorageAccess, requestStorageAccessFor, rootElement, scripts, scrollingElement, startViewTransition, styleSheets, textContent, timeline, title, visibilityState, vlinkColor, wasDiscarded, webkitCancelFullScreen, webkitCurrentFullScreenElement, webkitExitFullscreen, webkitFullscreenElement, webkitFullscreenEnabled, webkitHidden, webkitIsFullScreen, webkitVisibilityState, write, writeln, xmlEncoding, xmlStandalone, xmlVersion |\ndocument.body: | ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, aLink, accessKey, addEventListener, after, animate, append, appendChild, ariaAtomic, ariaAutoComplete, ariaBrailleLabel, ariaBrailleRoleDescription, ariaBusy, ariaChecked, ariaColCount, ariaColIndex, ariaColSpan, ariaCurrent, ariaDescription, ariaDisabled, ariaExpanded, ariaHasPopup, ariaHidden, ariaInvalid, ariaKeyShortcuts, ariaLabel, ariaLevel, ariaLive, ariaModal, ariaMultiLine, ariaMultiSelectable, ariaOrientation, ariaPlaceholder, ariaPosInSet, ariaPressed, ariaReadOnly, ariaRelevant, ariaRequired, ariaRoleDescription, ariaRowCount, ariaRowIndex, ariaRowSpan, ariaSelected, ariaSetSize, ariaSort, ariaValueMax, ariaValueMin, ariaValueNow, ariaValueText, assignedSlot, attachInternals, attachShadow, attributeStyleMap, attributes, autocapitalize, autofocus, background, baseURI, before, bgColor, blur, checkVisibility, childElementCount, childNodes, children, classList, className, click, clientHeight, clientLeft, clientTop, clientWidth, cloneNode, closest, compareDocumentPosition, computedStyleMap, contains, contentEditable, dataset, dir, dispatchEvent, draggable, elementTiming, enterKeyHint, firstChild, firstElementChild, focus, getAnimations, getAttribute, getAttributeNS, getAttributeNames, getAttributeNode, getAttributeNodeNS, getBoundingClientRect, getClientRects, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getInnerHTML, getRootNode, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, hasPointerCapture, hidden, hidePopover, id, inert, innerHTML, innerText, inputMode, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, insertBefore, isConnected, isContentEditable, isDefaultNamespace, isEqualNode, isSameNode, lang, lastChild, lastElementChild, link, localName, lookupNamespaceURI, lookupPrefix, matches, namespaceURI, nextElementSibling, nextSibling, nodeName, nodeType, nodeValue, nonce, normalize, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, onabort, onafterprint, onanimationend, onanimationiteration, onanimationstart, onauxclick, onbeforecopy, onbeforecut, onbeforeinput, onbeforematch, onbeforepaste, onbeforeprint, onbeforetoggle, onbeforeunload, onbeforexrselect, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontentvisibilityautostatechange, oncontextlost, oncontextmenu, oncontextrestored, oncopy, oncuechange, oncut, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformdata, onfullscreenchange, onfullscreenerror, ongotpointercapture, onhashchange, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onlanguagechange, onload, onloadeddata, onloadedmetadata, onloadstart, onlostpointercapture, onmessage, onmessageerror, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onoffline, ononline, onpagehide, onpageshow, onpaste, onpause, onplay, onplaying, onpointercancel, onpointerdown, onpointerenter, onpointerleave, onpointermove, onpointerout, onpointerover, onpointerrawupdate, onpointerup, onpopstate, onprogress, onratechange, onrejectionhandled, onreset, onresize, onscroll, onscrollend, onsearch, onsecuritypolicyviolation, onseeked, onseeking, onselect, onselectionchange, onselectstart, onslotchange, onstalled, onstorage, onsubmit, onsuspend, ontimeupdate, ontoggle, ontransitioncancel, ontransitionend, ontransitionrun, ontransitionstart, onunhandledrejection, onunload, onvolumechange, onwaiting, onwebkitanimationend, onwebkitanimationiteration, onwebkitanimationstart, onwebkitfullscreenchange, onwebkitfullscreenerror, onwebkittransitionend, onwheel, outerHTML, outerText, ownerDocument, parentElement, parentNode, part, popover, prefix, prepend, previousElementSibling, previousSibling, querySelector, querySelectorAll, releasePointerCapture, remove, removeAttribute, removeAttributeNS, removeAttributeNode, removeChild, removeEventListener, replaceChild, replaceChildren, replaceWith, requestFullscreen, requestPointerLock, role, scroll, scrollBy, scrollHeight, scrollIntoView, scrollIntoViewIfNeeded, scrollLeft, scrollTo, scrollTop, scrollWidth, setAttribute, setAttributeNS, setAttributeNode, setAttributeNodeNS, setPointerCapture, shadowRoot, showPopover, slot, spellcheck, style, tabIndex, tagName, text, textContent, title, toggleAttribute, togglePopover, translate, vLink, virtualKeyboardPolicy, webkitMatchesSelector, webkitRequestFullScreen, webkitRequestFullscreen |\nscreen: | addEventListener, availHeight, availLeft, availTop, availWidth, colorDepth, dispatchEvent, height, isExtended, onchange, orientation, pixelDepth, removeEventListener, width |\n\nDate: 2014-01-01\nCategories: \nTags: \n\n> \n Polecenie to należy wstawić między znacznikami: `` oraz `` . Pozwala ono opisać co znajduje się na Twojej stronie. Z informacji tej korzystają wyszukiwarki sieciowe, dlatego staraj się tutaj wpisać tekst, który jak najlepiej opisze zawartość strony i zachęci do jej odwiedzenia. Ciekawy, ale niezbyt długi, opis może zachęcić internautów do obejrzenia Twojej strony. Znacznik\n\n> \n Polecenie to należy wstawić między znacznikami: `` oraz `` . Pozwala Ci ono podać wyrazy kluczowe, z których korzystają wyszukiwarki sieciowe. Dlatego staraj się tutaj wpisać wyrazy, które jak najlepiej opiszą zawartość Twojej strony. Dobrze dobrane wyrazy kluczowe, pomogą wyszukiwarkom odnaleźć Twoją stronę. Znacznik\n\n* RSS\n> \n * Atom\n> \n `title=\"...\"` ), ponieważ inaczej użytkownik nie będzie mógł rozróżnić, co chciałby subskrybować. \n\nvar data = new Date(); document.write(data); \n\nprof. WWW\n\nUmieszczanie na swojej stronie nieoznaczonych płatnych linków reklamowych jest niezgodne z wytycznymi Google. Karą za takie postępowanie może być ręczne obniżenie pozycji strony w wynikach wyszukiwania albo nawet usunięcie z nich całego serwisu.\n Dlatego jeśli chcemy umieścić na własnej stronie płatne odnośniki sponsorowane, koniecznie należy je oznaczyć atrybutem `rel=\"sponsored\"` . \n\n W tym celu wewnątrz znacznika wybranej komórki `...` tabeli nadrzędnej wstawiamy znacznik tabeli podrzędnej `...
` wraz z całą jego zawartością - tzn. wewnętrznymi wierszami `...` i zawartymi w nich komórkami wewnętrznymi. \n\nKażdy dokument podstrony musi posiadać odpowiadający sobie plik z różniącym się kodem nagłówkowym. Plik ten musi znajdować się w tym samym katalogu co podstrona i nazywać się identycznie, tylko do nazwy trzeba na końcu dodać przyrostek .html. Przykładowo: dokument podstrona.shtml musi posiadać w tym samym katalogu plik podstrona.shtml.html, którego zawartość może być następująca:\n > Tytuł strony\n UWAGA!Jeżeli zapomnisz utworzyć takiego pliku albo pomylisz jego nazwę, w szablonie strony wyświetlą się błędy, a nawet w ogóle może się on nie wyświetlić. \n\nWybierz obrazek w formacie JPG, muzykę w dowolnym formacie albo plik w formacie GIF:\n\n To wbrew pozorom nie wszystkie miejsca, gdzie można umieścić ważne słowa kluczowe. Oczywiście niezwykle duże znaczenie mają słowa umieszczone bezpośrednio w treści strony (szczególnie głównej). Problem w tym, że nie możemy ich tam wpisywać tyle, ile byśmy chcieli, bo strona stanie się po prostu nieczytelna dla człowieka. Niektóre wyszukiwarki traktują jednak \"mocniej\" wyrażenia umieszczone w takich miejscach jak: tytuły (szczególnie pierwszego rzędu), treść alternatywna obrazków (atrybut `alt=\"...\"` ), dymki narzędziowe odsyłaczy (atrybut `title=\"...\"` ) albo tekst (opis) samych odsyłaczy. Dodatkowe punkty można również dostać, jeśli ważne słowo kluczowe znajduje się bezpośrednio w adresie strony. Lepiej jest także jeśli sam adres jest krótszy. \n\nW większości przedstawionych wcześniej metod możliwe jest pewne oszukiwanie wyszukiwarek, ponieważ to autor strony wpisuje słowa kluczowe, które przecież mogą nie mieć nic wspólnego z treścią. Można swobodnie wpisać wyrażenia, które są najczęściej wyszukiwane i tym sposobem próbować zwiększyć oglądalność strony. Na dłuższą metę nie jest to jednak dobre rozwiązanie, ponieważ jeśli czytelnik nie znajdzie na naszej stronie spodziewanych informacji, to prawdopodobnie więcej już na nią nie powróci. Poza tym jeśli wyszukiwarki zorientują się, że chcemy je oszukać, mogą na zawsze usunąć stronę z wszelkich wyników wyszukiwania!\n\nSposoby wstawiania stylów do gotowych dokumentów są różne. Nie znaczy to, że jedne są lepsze od drugich. Każdy sposób jest przydatny w innych sytuacjach. Większość witryn stosuje jednocześnie wszystkie z przedstawionych metod osadzania CSS - w zależności od konkretnej potrzeby.\n\nTo jest jakiś tekst\n\n Ten akapit ma zresetowane wszystkie style do wartości domyślnych, ponieważ została mu przypisana deklaracja \"all: initial\".A to jest pogrubienie, które znajduje się wewnątrz tego akapitu. Odziedziczyło ono zresetowany rodzaj czcionki. Ale jej waga nie została zmieniona - tekst nadal jest wizualnie wytłuszczony - ponieważ zostało to oddzielne przypisane do tego elementu.\n\nAtrybuty formatowania w języku CSS definiuje się za pomocą tzw. reguł stylów. Każda reguła odnosi się do konkretnego elementu (znacznika) i składa się z dwóch części: selektora i deklaracji. Selektor określa do jakich elementów ma zostać przypisane formatowanie, a deklaracja podaje to formatowanie i jest umieszczona w nawiasie klamrowym `{...}` . Każda deklaracja składa się przynajmniej z jednego zespołu cecha lub inaczej własność albo właściwość (ang. property) - wartość (ang. value), przy czym można podać dowolną liczbę, rozdzielając kolejne znakiem średnika (;). Średnik na końcu deklaracji nie jest konieczny. Każda grupa elementów (znaczników) ma określony zespół cech CSS, które można jej przypisać, a każda cecha ma ściśle wyszczególnioną listę wartości, które może przyjąć. Na przykład: cecha `text-align` (wyrównanie tekstu) może być przypisana tylko i wyłącznie do elementów blokowych, ponieważ podanie jej dla elementów wyświetlanych w linii nie miałoby sensu. Z drugiej strony cecha ta może przyjmować tylko wartości takie jak: `left` , `right` , `center` , `justify` . Przypisanie do niej np. wartości koloru nie miałoby sensu. \nW MSIE 8.0 i starszych jeden plik arkusza CSS może zawierać tylko 4095 selektorów, przy czym w listach każdy selektor liczy się osobno - następne deklaracje zostaną pominięte! W przypadku przekroczenia tej granicy, jedynym rozwiązaniem jest podział arkusza CSS na kilka osobnych plików, ale nie więcej niż 31.\n\n* Pseudoklasy dynamiczne\n * Pseudoklasa etykiety: :target\n * Pseudoklasa języka: :lang()\n * Pseudoklasy interfejsu użytkownika:\n * Pseudoklasy strukturalne:\n * Pseudoklasa negacji: :not()\n\n(CSS 3 - interpretuje Firefox 34)\n > selektor { font-variant-position: wariant }\n\n(interpretuje: Internet Explorer 10.0, Firefox 3.5, Opera 9.5, Chrome, Konqueror)\n > selektor { text-shadow: poziom pion rozmycie kolor,... }\n\ntext-shadow: 3px 3px red, yellow -3px 3px 2px, 3px -3px\n\nA to jest zwykły akapit z tłem, bez określenia jakichkolwiek marginesów. Dlatego jego szerokość wynosi tyle co zwykłego tekstu, a także wewnątrz elementu (prostokąta) nie ma żadnego odstępu.\n\n(CSS 3 - interpretuje Firefox 32, Opera 12-)\n > selektor { box-decoration-break: dekoracja }\n\n(CSS 3 - interpretuje Firefox 33, Opera 77, Chrome 91)\n\n> selektor { list-style-position: pozycja }\n Selektorem mogą być znaczniki dotyczące wykazów: ul - wypunktowanie, ol - wykaz numerowany oraz li - pojedynczy punkt wykazu [zobacz: Wstawianie stylów].Natomiast \"pozycja\" określa, jak będą zawijane wiersze wykazu, które nie zmieszczą się w jednej linii. Możliwe są tutaj dwa przypadki: \nNatomiast \"pozycja\" określa, jak będą zawijane wiersze wykazu, które nie zmieszczą się w jednej linii. Możliwe są tutaj dwa przypadki:\n\n* Punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy... punkt pierwszy.\n * Punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi... punkt drugi.\n * Punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci... punkt trzeci.\n\n> selektor { list-style-image: url(ścieżka dostępu) }\n Selektorem mogą być znaczniki dotyczące wykazów: ul - wypunktowanie, ol - wykaz numerowany oraz li - pojedynczy punkt wykazu [zobacz: Wstawianie stylów].Natomiast jako \"ścieżka dostępu\" należy wpisać względną ścieżkę do obrazka, który ma się pojawić jako wyróżnik wykazu (marker). Wpisanie none usunie obrazek. \nNatomiast jako \"ścieżka dostępu\" należy wpisać względną ścieżkę do obrazka, który ma się pojawić jako wyróżnik wykazu (marker). Wpisanie none usunie obrazek.\n\nSytuacja jest podobna jak w poprzednim punkcie za wyjątkiem tego, że element posiada wewnętrzną wysokość (zobacz punkt 8 podrozdziału: Szerokość i marginesy automatyczne).\n\n> selektor { max-height: wartość }\n Selektorem może być dowolny znacznik wyświetlany w bloku lub element zastępowany [zobacz: Wstawianie stylów].Natomiast jako \"wartość\" należy podać wartość maksymalnej dozwolonej wysokości, jaką może mieć element. \nNatomiast jako \"wartość\" należy podać wartość maksymalnej dozwolonej wysokości, jaką może mieć element.\n Polecenie nie odnosi się do elementów inline!UWAGA! Polecenie nie interpretuje MSIE 6, a MSIE 7.0 obsługuje, ale nie w trybie Quirks. \n\nTen obrazek powinien mieć wysokość minimalną 150px (min-height: 150px):\n\n(CSS 3 - interpretuje Internet Explorer * , Firefox, Opera, Chrome)\n > selektor { text-overflow: sposób }\n\n> selektor { caption-side: ustawienie }\n Selektorem może być element CAPTION [zobacz: Wstawianie stylów].Natomiast jako \"ustawienie\" należy podać: \nNatomiast jako \"ustawienie\" należy podać:\n\n> selektor { border-spacing: odstęp }\n Selektorem może być element TABLE [zobacz: Wstawianie stylów].Natomiast jako \"odstęp\" należy podać wartość, korzystając z jednostek długości. Przy czy możliwe jest podanie: \nNatomiast jako \"odstęp\" należy podać wartość, korzystając z jednostek długości. Przy czy możliwe jest podanie:\n\n> selektor { empty-cells: sposób }\n Selektorem może być element TABLE, TD lub TH [zobacz: Wstawianie stylów].Natomiast jako \"sposób\" należy podać: \nNatomiast jako \"sposób\" należy podać:\n\nDo tabel (...
), ich komórek (...), wierszy (...) oraz kolumn (...) można stosować parametry dotyczące szerokości i wysokości. Odnośnie komórek oraz całej tabeli można ustawić zarówno ich szerokość jak i wysokość. Natomiast dla wiersza możliwe jest określenie tylko wysokości, ponieważ szerokość jest jednocześnie szerokością tabeli. Podobnie dla kolumny można ustalić jedynie jej szerokość, bo wysokość jest wysokością tabeli.\n Przykład {width, height}\n komórka1komórka2komórka3komórka4\n\n komórka1\n komórka2\n komórka3\n\n komórka4\n komórka5\n komórka6\n\n komórka7\n komórka8\n komórka1komórka2komórka3komórka4komórka5komórka6\n Pytania i odpowiedzi\n Jak ustawić szerokość tabeli?\n\n Aby uzyskać efekt autodopasowania rozmiaru tabeli do okna, który jest znany z programu Microsoft Word, można ustawić szerokość tabeli na 100% za pomocą właściwości width, co spowoduje, że tabela zajmie całą dostępna przestrzeń w poziomie, a kolumny dopasują się proporcjonalnie do zawartości. Przykład:
\n Nie można ustawić wysokości kolumny...
...
.\nDo tabel (...
), ich komórek ( `...` ), wierszy ( `...` ) oraz kolumn (...) można stosować parametry dotyczące szerokości i wysokości. Odnośnie komórek oraz całej tabeli można ustawić zarówno ich szerokość jak i wysokość. Natomiast dla wiersza możliwe jest określenie tylko wysokości, ponieważ szerokość jest jednocześnie szerokością tabeli. Podobnie dla kolumny można ustalić jedynie jej szerokość, bo wysokość jest wysokością tabeli. \n\nGdyby w arkuszu stylów tej strony [zobacz: Wstawianie stylów], została umieszczona taka linijka: > h1 { position: relative; left: 50% }to teraz wszystkie tytuły\n `h1` byłyby pozycjonowane względnie. Ale jeśli chcielibyśmy zrezygnować z pozycjonowania dla kilku wybranych elementów, wystarczyłoby wpisać `position: static` w definicji inline. \n\n(CSS 3 - interpretuje Internet Explorer 9, Firefox 2, Opera, Chrome)\n > selektor { opacity: nieprzezroczystość }\n\n(interpretuje MSIE 6; Firefox, Opera 15 i Chrome tylko pliki *.cur - również w systemie Linux)\n\n(CSS 3 - interpretuje Firefox 53, Opera 44, Chrome 57)\n > selektor { caret-color: kolor }\n\nJako \"wartości atrybutów\" można podać samą wartość szerokości kolumny, tylko liczbę kolumn lub obie wartości rozdzielone spacją. Ustalenie wartości auto usuwa kolumny.\n Polecenie jest przydatne, jeżeli chcemy skrócić zapis. Możemy też dzięki niemu szybko usunąć podział na kolumny, poprzez wpisanie \" `columns: auto` \". \n\ncolumn-span: all; To jest element rozciągający się ponad wszystkimi kolumnami tekstu.\nTo jest przykładowa treść, ułożona w wielu sąsiadujących kolumnach. Tekst jest automatycznie przenoszony z końca jednej kolumny na początek sąsiedniej, leżącej po jej prawej stronie... To jest przykładowa treść, ułożona w wielu sąsiadujących kolumnach. Tekst jest automatycznie przenoszony z końca jednej kolumny na początek sąsiedniej, leżącej po jej prawej stronie... To jest przykładowa treść, ułożona w wielu sąsiadujących kolumnach. Tekst jest automatycznie przenoszony z końca jednej kolumny na początek sąsiedniej, leżącej po jej prawej stronie... \n\n(CSS 3 - interpretuje Internet Explorer 10, Firefox, Opera 12, Chrome)\n > selektor { margin-top: auto } selektor { margin-right: auto } selektor { margin-bottom: auto } selektor { margin-left: auto } selektor { margin: auto }\n\n# Przykład @media\n\nPrzypominam, że naszym celem będzie stworzenie estetycznego i funkcjonalnego menu nawigacyjnego na bazie kodu HTML przedstawionego na wstępie w formie listy nieuporządkowanej - tylko poprzez dołączenie deklaracji CSS. Tym razem, na przekór domyślnej prezentacji pozycji listy, ułożymy odnośniki nawigacyjne poziomo - w formie zakładek. Takie ustawienie możemy uzyskać na dwa sposoby:\n\nPrawy margines pozycji listy ustala odstępy pomiędzy sąsiednimi zakładkami.\n\n* Kolumna menu nawigacyjnego powinna się znaleźć po prawej stronie, a w kodzie źródłowym znajduje się na początku, zatem zostaje jej przypisana własność\n `float: right` . * Kolumna dodatkowych informacji może pozostać w kolejności wynikającej z ułożenia w kodzie źródłowym, a zatem przypisujemy\n `float: left` . * Kolejność bloku treści strony, wynikająca z naturalnego ułożenia, również jest odpowiednia (powinien się wyświetlić po kolumnie dodatkowych informacji, która w kodzie źródłowym poprzedza blok treści), a zatem -\n `float: left` . \nMożliwe są również inne konfiguracje - np. czasami spotykane ułożenie obu wąskich kolumn po lewej, a treści po prawej stronie:\n > html, body { background-color: #fff; color: #000; margin: 0; padding: 0; text-align: center; } #top { width: 780px; margin-left: auto; margin-right: auto; text-align: left; } #NAGLOWEK { background-color: #888; } #MENU { width: 150px; float: left; overflow: hidden; background-color: #ccc; } #INFORMACJE { width: 150px; float: left; overflow: hidden; background-color: #ccc; } #TRESC { width: 480px; float: left; overflow: hidden; background-color: #fff; } #STOPKA { clear: both; width: 100%; background-color: #888; }\n W tym przypadku naturalna kolejność wyświetlania bloków, wynikająca z ułożenia elementów w kodzie źródłowym strony, jest odpowiednia. Przypisanie własności `float: left` , miało jedynie na celu ustawienie kolumn obok siebie, a nie pod sobą. Natomiast nie wpływa to na ich kolejność. \n\nPłynny szablon (ang. liquid layout) charakteryzuje się zmianą swoich poziomych proporcji przy zmianie rozmiaru okna przeglądarki lub rozdzielczości ekranu. Najczęściej w każdych warunkach zajmuje on całą dostępną szerokość w oknie. Jest on raczej rzadziej stosowany, ze względu na niemożliwe do przewidzenia ułożenie elementów treści. Poza tym tekst w zbyt długich linijkach zwykle gorzej się czyta, ponieważ trudniej przenieść wzrok z końca wiersza na początek następnego. Czasami jednak może być wygodny, np. kiedy zawiera jakieś szerokie elementy, które mogą nie zmieścić się w ustalonej szerokości dla stałego szablonu (czyli zwykle 780px minus szerokość kolumny menu i ewentualnie dodatkowych informacji).\n\nDate: 2014-10-07\nCategories: \nTags: \n\nKażdy programista wie, jaki przełom w rozwoju informatyki przyniosła koncepcja Programowania Zorientowanego Obiektowo (ang. Object Oriented Programming). Dlaczego by nie przenieść tego na grunt CSS? Może zabrzmi to zaskakująco, ale CSS już teraz daje taką możliwość. Nie są wymagane do tego żadne dodatkowe rozszerzenia w przeglądarkach, a jedynie zmiana sposobu myślenia webmasterów podczas projektowania arkuszy stylów. Paradoksalnie osobom, które nigdy nie programowały w językach proceduralnych, prawdopodobnie łatwiej przyjdzie zrozumienie założeń CSS Zorientowanych Obiektowo (ang. Object Oriented CSS), gdyż są one bardzo intuicyjne.\n\n### Obiekty #\n\nPopatrz przez chwilę na dowolną stronę WWW (tak, możesz spojrzeć również na stronę, którą właśnie czytasz 🙂). Zwykle zawiera ona m.in.:\n\n* nagłówek\n * menu\n * artykuł\n * stopkę\n\nKażdy z tych elementów z naszego punktu widzenia jest właśnie obiektem. Obiekt CSS to wizualnie samodzielny element strony. Artykuł potrafi wyświetlić się poprawnie bez nagłówka ani stopki serwisu. Taki sposób przedstawiania elementów strony jest dla człowieka bardziej intuicyjny niż pojmowanie jej jako zbiór wielu DIV-ów, SPAN-ów i innych znaczników. Obiektowość CSS sprowadza się do nadawania formatowania w kontekście takich obiektów, a nie poszczególnych znaczników występujących w kodzie źródłowym dokumentu. Pojedynczemu obiektowi zwykle odpowiada klasa CSS albo selektor identyfikatora:\n > #Header { /* nagłówek */ } .Menu { /* menu */ } .Article { /* artykuł */ } #Footer { /* stopka */ }\n\nWarto zwrócić uwagę, że w przypadku stosowania systemów parsowania szablonów na serwerze (np. w języku PHP), każdy obiekt jest kandydatem na zapisanie jego znaczników w osobnym pliku szablonu.\n\n### Atrybuty #\n\nCzęsto obiekty nie są na tyle proste, aby można było określić ich wygląd przy pomocy pojedynczej reguły stylów (jednego selektora). Menu nawigacyjne będzie zawierać elementy podrzędne - listę odnośników - którym również musimy przypisać określony styl. Atrybuty stanowią zbiór wszystkich elementów (znaczników) potomnych obiektu, którym jest przypisany styl.\n >
.Menu { background-color: white; } .Menu ul, .Menu li { display: block; list-style: none; margin: 0; padding: 0; } .Menu li { float: left; margin-right: 1em; } .Menu a { color: blue; text-decoration: none; }\n\n### Kompozycja #\n\nZwróćmy uwagę, że typowy artykuł może zawierać informacje o:\n\n* autorze - np. z jego imieniem, nazwiskiem i zdjęciem\n * źródle - nazwa, logo i odnośnik\n\nKażdy z tych elementów można traktować jako osobny obiekt (zmiana wyglądu informacji o autorze nie powinna wpływać na wygląd samej treści artykułu), z których składa się (ang. composition) główny obiekt artykułu. Myślenie o skomplikowanym obiekcie jako o złożeniu kilku mniejszych, samodzielnych obiektów, ułatwia nam pojmowanie otaczającej nas rzeczywistości. Patrząc na typowy komputer widzimy, że składa się on m.in. z ekranu, klawiatury, urządzenia wskazującego (np. myszki), a nie z masy połączonych ze sobą tranzystorów i innych elementów elektronicznych. Przeciętny człowiek nie byłby w stanie przyswoić tak wielkiej złożoności w postaci pojedynczego modelu. Z punktu widzenia kompozycji w obiektowości CSS chodzi o to, aby rozbijać w myślach skomplikowane obiekty na mniejsze i stylizować je oddzielnie. Korzyścią takiego podejścia będzie możliwość osadzenia np. informacji o autorze na osobnej stronie albo na liście wszystkich autorów piszących w serwisie.\n\nObiekty składowe są szczególnym przypadkiem złożonych atrybutów.\n\n >
...
...
...
...
...
... .Article { color: black; background-color: white; /* ... */ } .Review { color: green; font-size: 12px; /* ... */ }\n Pamiętaj jednak, że kolejność wymieniania nazw klas w atrybucie `class=\"...\"` z punktu widzenia kaskadowości stylów nie ma znaczenia, dlatego należy zadbać, aby w arkuszu stylów definicja klasy Review znajdowała się później niż Article. \nTen prosty zabieg pozwoli nam uzyskać recenzję z zielonym tekstem, przy zachowaniu białego tła oraz ewentualnych wielu innych deklaracji, zdefiniowanych w klasie bazowej. W ten sposób, nawet przy istnieniu drobnych różnic wyglądu, nadal możemy korzystać z techniki rozszerzania cech obiektów, oszczędzając sobie sporo niepotrzebnego pisania. Gdyby jednak oba rodzaje artykułu wyglądały zupełnie inaczej, nie postępuj w ten sposób, gdyż tylko utrudni Ci to pracę.\n\n### Klasa abstrakcyjna #\n\nKlasa abstrakcyjna (ang. abstract class) jest przeznaczona wyłącznie do rozszerzania przez klasy pochodne, a nie do samodzielnego użycia w dokumencie. Jeśli w serwisie mamy więcej rodzajów publikacji, zapewne chcielibyśmy, aby każda z nich wyglądała podobnie. Takie wspólne deklaracje stylów możemy zdefiniować w klasie abstrakcyjnej Publication, a potem używać następująco:\n >
...
...
... ... .Information { background-color: white; } div.Warning { color: red; } span.Warning { font-weight: bold; }\n\n07.10.2014 16:12\n bardzo swietny poradnik Zobacz więcej * kurshtml\n\n17.12.2012 13:02\n W tradycyjnych językach programowania wygląda to tak samo. Jeżeli dwie klasy bazowe mają zaimplementowaną metodę o takiej samej sygnaturze, klasa pochodna w wyniku tego nie odziedziczy przecież obu tych metod, bo to jest niemożliwe. W takim przypadku konieczne jest rozstrzygnięcie... Zobacz więcej * Tom\n\n17.12.2012 11:43\n Witam Mam wrażenie, że w rozdziale \"Wielokrotne rozszerzanie\" jest pewien błąd logiczny. Kilka niezależnych klas bazowych sugeruje równoległe/niezależne ładowanie stylów kilku klas, podczas gdy w CSS kolejność jest zawsze ustalona. Jakimś wyjątkiem jest sytuacja, gdy stylizacja w... Zobacz więcej * kurshtml\n\n04.11.2011 17:31\n Wreszcie udało mi się zebrać i spisać ogólne wytyczne, którymi powinien kierować się każdy webmaster w swojej codziennej pracy zawodowej: Przykazania webmastera. Jeżeli komuś przyjdzie jeszcze coś na myśl, poza tematami tam poruszanymi, będę wdzięczny za dopisanie tego tutaj. Oczywiście zdaję... Zobacz więcej * jsmp\n\n28.04.2009 17:13\n dobry jest też tekst z wikipedi English o Progressive: http://en.wikipedia.org/wiki/Progressive_enhancement Jak widzę przy nim, polską wersję to jest taka uboga :| Zobacz więcej * kurshtml\n\n28.04.2009 14:24\n Graceful Degradation & Progressive Enhancement Zobacz więcej * Roberto\n\n12.04.2009 22:01\n ad 1 - dodatkowym plusem jest to, że nie musisz dodawać dodatkowej klasy dla inputów-przycisków (jasne - można użyć trochę bardziej 'skomplikowanych'[?] selektorów css, ale wtedy IE6 polegnie, a tego nie chcemy przecież). ad 2 - na pewno warto na to zwrócić uwagę. to już w sumie zostało... Zobacz więcej * kurshtml\n\n12.04.2009 13:25\n stray: \"menu rozwijane byloby warto dodac, skoro juz o technikach w CSS\". Nie jestem pewny, czy założony zakres tematyki to obejmuje. Może kiedyś pomyślę o szerszym rozdziale na temat technik CSS. \"Image Replacement\" wydaje mi się dobrą praktyką, a nie tylko techniką, o tyle, że można... Zobacz więcej * Roberto\n\n11.04.2009 23:09\n o, przypomniała mi się jeszcze jedna przydatna sprawa, a nawet dwie na tyle oczywiste (tak samo jak dropdown wspomniany już przez stray - coś takiego musi się w takim dziale znaleźć bo to podstawy są ;]), że o nich zapomniałem ;) tylko nie wiem czy to nie podchodzi już pod techniki czyli dawanie... Zobacz więcej * jsmp\n\n11.04.2009 22:58\n Ja myśle, że dobrze by było w jednym artykule zebrać \"Dobre praktyki\", czyli np. te markery ktore opisałem w moim tutorialu czy pare innych rzeczy które można wykorzystać w pisanym kodzie CSS. A jako osobny podrozdział już takie tricki czy kurshtml: \"osobny rozdział o technikach CSS\"... Zobacz więcej\n\n(element) Podstawowa konstrukcja składniowa dokumentu. Większość reguł stylów używa nazw tych elementów (takich jak P, TABLE, OL dla HTML), żeby określić ich wygląd.\n\n(replaced element) Element dla którego formater stylów zna tylko wymiar wewnętrzny. W języku HTML są to: IMG, INPUT, TEXTAREA, SELECT, OBJECT. Na przykład zawartość elementu IMG jest zastępowana przez obrazek, wyznaczony atrybutem src.\n\n(intrinsic dimensions) Szerokość i wysokość które zostały zdefiniowane przez sam element, nie narzucone przez otoczenie. W CSS2 jest założone, że tylko elementy zastępowane przychodzą z wewnętrznym rozmiarem.\n\n(attribute) Wartość powiązana z elementem, składająca się z nazwy i związanej wartości (tekstowej). W języku HTML może to być np. href elementu A, określający lokalizację zasobu sieciowego albo src elementu IMG, wskazujący lokalizację pliku obrazka.\n\n(content) Zawartość (treść) związana z elementem w dokumencie źródłowym. Nie wszystkie elementy mają zawartość - w takim wypadku są nazywane pustymi (empty). Zawartością elementu może być tekst jak również pewna liczba podelementów, wtedy element nazywany jest rodzicem (parent) tych podelementów.\n\n(rendered content) Zawartość elementu po zinterpretowaniu zgodnie z powiązanym arkuszem stylów. Zawartość zinterpretowana elementów zastępowanych przychodzi z zewnątrz dokumentu źródłowego. Zawartością taką może być także alternatywny tekst dla elementu (wartość atrybutu `alt` w składni HTML) czy pozycja wstawiona (domyślnie lub poprzez ścisłe określenie) przez arkusz stylów (np. numerowanie). \n(rendered content) Zawartość elementu po zinterpretowaniu zgodnie z powiązanym arkuszem stylów. Zawartość zinterpretowana elementów zastępowanych przychodzi z zewnątrz dokumentu źródłowego. Zawartością taką może być także alternatywny tekst dla elementu (wartość atrybutu\n\n> NaN\n\n> Infinity\n\n> undefined\n\n> eval(x)\n\n> parseInt(string) parseInt(string, radix)\n\n> parseFloat(string)\n\n> encodeURI(uri)\n\n > encodeURI(\"http://example.com/{test}\"); // \"http://example.com/%7Btest%7D\" encodeURI(\"\\uDC00\"); // URIError\n\n> encodeURIComponent(uriComponent)\n\n> Object() Object(value)\n\n> new Object() new Object(value)\n\n> Object.prototype.toString()\n\n> Object.prototype.toLocaleString()\n\n> Object.prototype.valueOf()\n\n> Object.prototype.hasOwnProperty(V)\n\n> Object.prototype.isPrototypeOf(V)\n\n> Object.prototype.propertyIsEnumerable(V)\n\nFunction() Function(body) Function(p1, p2... pn, body)Działa identycznie jak konstrukcja new Function(...). Komentarze # Zobacz więcej komentarzy\n\n> Function.length\n\n* Wartość:\n * \n `Number` - liczba 1 Ta wartość zawsze wynosi 1. Nie można jej zmienić. Jest niedostępna w pętli `for-in` . \n\n### Przykład Function.length\n\n > Function.length; // 1 Function.length = 2; Function.length; // 1 Object.keys(Function); // []\n\nPrzejdź do treści\n > Function.length\n `Number` - liczba 1 Ta wartość zawsze wynosi 1. Nie można jej zmienić. Jest niedostępna w pętli `for-in` . > Function.length; // 1 Function.length = 2; Function.length; // 1 Object.keys(Function); // []\n\n> Function.prototype.constructor\n\n> Function.prototype.toString()\n\n> Function.prototype.apply(thisArg) Function.prototype.apply(thisArg, argArray)\n\n> Function.prototype.call(thisArg) Function.prototype.call(thisArg, arg1, arg2... argn)\n\n> Array() Array(len) Array(item0) Array(item0, item1...)\n\nDziała identycznie jak konstrukcja new Array(...).\n\n(interpretuje: Internet Explorer 9, Firefox 4, Opera 10.50, Chrome)\n > Array.isArray(arg)\n\n* Parametry\n * arg - sprawdzany obiekt\n * Wartość:\n * \n `Boolean` - czy obiekt jest tablicą \nPozwala sprawdzić, czy podany obiekt jest tablicą.\n\n### Przykład Array.isArray\n\n > Array.isArray([]); // true Array.isArray(new Array()); // true Array.isArray(Array()); // true Array.isArray(Array); // false Array.isArray({}); // false Array.isArray(new Object()); // false Array.isArray(true); // false Array.isArray(1); // false Array.isArray(\"test\"); // false Array.isArray(null); // false Array.isArray(undefined); // false Array.isArray(NaN); // false Array.isArray(Infinity); // false\n\n> Array.prototype.toString()\n\n> Array.prototype.toLocaleString()\n\n> Array.prototype.concat() Array.prototype.concat(item1) Array.prototype.concat(item1, item2...)\n\n> Array.prototype.join() Array.prototype.join(separator)\n\n> Array.prototype.push()\nArray.prototype.push(item1) Array.prototype.push(item1, item2...) \n\n> Array.prototype.reverse()\n\n> Array.prototype.slice() Array.prototype.slice(start) Array.prototype.slice(start, end)\n\n> Array.prototype.sort() Array.prototype.sort(comparefn)\n\n> Array.prototype.splice() Array.prototype.splice(start, deleteCount) Array.prototype.splice(start, deleteCount, item1) Array.prototype.splice(start, deleteCount, item1, item2...)\n\n> String() String(value)\n\n> String.fromCharCode() String.fromCharCode(char0) String.fromCharCode(char0, char1...)\n\n> String.prototype.charCodeAt() String.prototype.charCodeAt(pos)\n\n> String.prototype.localeCompare(that)\n\n> String.prototype.replace(searchValue, replaceValue)\n\n> String.prototype.search(regexp)\n\n> String.prototype.slice() String.prototype.slice(start) String.prototype.slice(start, end)\n\n> String.prototype.split() String.prototype.split(separator) String.prototype.split(separator, limit)\n\n> String.prototype.substring() String.prototype.substring(start) String.prototype.substring(start, end)\n\n> new Boolean() new Boolean(value)\n\n* Parametry:\n * value - wartość na podstawie której zostanie utworzony obiekt\n * Wartość:\n * \n `Boolean` - nowa instancja obiektu logicznego \nInaczej niż funkcja Boolean, zawsze tworzy nową instancję obiektu logicznego, a nie tylko prostą wartość logiczną.\n\n### Przykład new Boolean\n\n > // new Boolean(true): new Boolean(true); new Boolean(1); new Boolean(-1.2); new Boolean(Infinity); new Boolean(-Infinity); new Boolean(\"test\"); new Boolean(\" \"); new Boolean(\"null\"); new Boolean(\"false\"); new Boolean(\"0\"); new Boolean(\"undefined\"); new Boolean(\"NaN\"); new Boolean([]); new Boolean([false]); new Boolean({}); // new Boolean(false): new Boolean(); new Boolean(undefined); new Boolean(null); new Boolean(false); new Boolean(0); new Boolean(NaN); new Boolean(\"\");\n\n> Boolean.prototype.constructor\n\n> Boolean.prototype.toString()\n\n> Boolean.prototype.valueOf()\n\n> Number() Number(value)\n\n> new Number() new Number(value)\n\n> Number.MAX_VALUE\n\n> Number.MIN_VALUE\n\n> Number.NaN\n\n> Number.prototype.toString() Number.prototype.toString(radix)\n\n> Number.prototype.toLocaleString()\n\n> Number.prototype.valueOf()\n\n> Number.prototype.toFixed() Number.prototype.toFixed(fractionDigits)\n\n> Number.prototype.toExponential() Number.prototype.toExponential(fractionDigits)\n\n> Number.prototype.toPrecision() Number.prototype.toPrecision(precision)\n\n> Math.LN10\n\n> Math.LOG2E\n\n> Math.PI\n\n> Math.abs(x)\n\n> Math.acos(x)\n\n> Math.asin(x)\n\n> Math.atan(x)\n\n> Math.atan2(y, x)\n\n> Math.ceil(x)\n\n> Math.cos(x)\n\n> Math.exp(x)\n\n> Math.floor(x)\n\n> Math.log(x)\n\n > Math.log(-Infinity); // NaN Math.log(-0.01); // NaN Math.log(0); // -Infinity Math.log(0.5); // -0.6931471805599453 Math.log(1); // 0 Math.log(Math.E); // 1 Math.log(Infinity); // Infinity Math.log(NaN); // NaN\n\n> Math.pow(x, y)\n\n> Math.sin(x)\n\n> Math.sqrt(x)\n\n> Math.tan(x)\n\n> Date()\n\n > Date(); // np.: \"Sat Jan 04 2014 17:38:21 GMT+0100\"\n\nPrzejdź do treści\n > Date()\n `String` - aktualna data i czas Działa identycznie jak konstrukcja:\n\n, tzn. zwraca aktualną datę i czas w postaci tekstowej. > Date(); // np.: \"Sat Jan 04 2014 17:38:21 GMT+0100\"\n\n> new Date() new Date(value) new Date(year, month) new Date(year, month, date) new Date(year, month, date, hours) new Date(year, month, date, hours, minutes) new Date(year, month, date, hours, minutes, seconds) new Date(year, month, date, hours, minutes, seconds, ms)\n\n> Date.parse(string)\n\n> Date.now()\n\n> Date.prototype.toLocaleString()\n\n> Date.prototype.toLocaleDateString()\n\n> Date.prototype.toLocaleTimeString()\n\n> Date.prototype.getFullYear()\n\n> Date.prototype.getUTCFullYear()\n\n> Date.prototype.getMonth()\n\n> Date.prototype.getUTCMonth()\n\n> Date.prototype.getHours()\n\n> Date.prototype.getTimezoneOffset()\n\n> Date.prototype.setMinutes(min) Date.prototype.setMinutes(min, sec) Date.prototype.setMinutes(min, sec, ms)\n\n> Date.prototype.setUTCMinutes(min) Date.prototype.setUTCMinutes(min, sec) Date.prototype.setUTCMinutes(min, sec, ms)\n\n > var x = new Date(\"1410-07-15T13:30:59.000+02:00\"); x.setUTCMinutes(15, 0, 500); // -17655021899500 x; // new Date(\"1410-07-15T13:15:00.500+02:00\") x.setUTCMinutes(90); // -17655017399500 x; // new Date(\"1410-07-15T14:30:00.500+02:00\") x.setUTCMinutes(-30); // -17655020999500 x; // new Date(\"1410-07-15T13:30:00.500+02:00\") Date.prototype.setUTCMinutes.call(null, 0); // TypeError Date.prototype.setUTCMinutes.call(undefined, 0); // TypeError Date.prototype.setUTCMinutes.call(0, 0); // TypeError Date.prototype.setUTCMinutes.call(\"\", 0); // TypeError Date.prototype.setUTCMinutes.call(\"2000\", 0); // TypeError Date.prototype.setUTCMinutes.call({}, 0); // TypeError\n\n> Date.prototype.setDate(date)\n\n> Date.prototype.setUTCDate(date)\n\n > var x = new Date(\"1410-07-15T00:00:00.000+02:00\"); x.setUTCDate(16); // -17654896800000 x; // new Date(\"1410-07-17T00:00:00.000+02:00\") x.setUTCDate(32); // -17653600800000 x; // new Date(\"1410-08-02T00:00:00.000+02:00\") x.setUTCDate(-2); // -17653773600000 x; // new Date(\"1410-07-30T00:00:00.000+02:00\") Date.prototype.setUTCDate.call(null, 0); // TypeError Date.prototype.setUTCDate.call(undefined, 0); // TypeError Date.prototype.setUTCDate.call(0, 0); // TypeError Date.prototype.setUTCDate.call(\"\", 0); // TypeError Date.prototype.setUTCDate.call(\"2000\", 0); // TypeError Date.prototype.setUTCDate.call({}, 0); // TypeError\n\n> Date.prototype.setFullYear(year) Date.prototype.setFullYear(year, month) Date.prototype.setFullYear(year, month, date)\n\n> Date.prototype.setUTCFullYear(year) Date.prototype.setUTCFullYear(year, month) Date.prototype.setUTCFullYear(year, month, date)\n\n> Date.prototype.toJSON() Date.prototype.toJSON(key)\n\n> RegExp() RegExp(pattern) RegExp(pattern, flags)\n\n* Parametry:\n * \n `String|RegExp` pattern - wzorzec (domyślnie: \"(?:)\") * \n `String` flags - flagi: \n\n* g - dopasowanie globalne\n * i - ignorowanie wielkości liter\n * m - dopasowanie wielu linii\n * Wartość:\n * \n `RegExp` - instancja obiektu wyrażenia regularnego * Wyjątki:\n * \n `TypeError` - pattern jest typu `RegExp` i argument flags został zdefiniowany * \n `SyntaxError` - nieprawidłowy wzorzec lub flagi Jeżeli pattern jest instancją obiektu `RegExp` , a argument flags nie został podany (albo wynosi undefined), funkcja zwraca obiekt przekazany jako pattern. W przeciwnym razie następuje wywołanie: new RegExp(...). \n\n### Przykład RegExp\n\n > var x = /abc/; RegExp(x) === x; // true RegExp(\"abc\", \"i\"); // /abc/i RegExp(x, \"i\"); // TypeError RegExp(\"(\"); // SyntaxError RegExp(\"abc\", \"x\"); // SyntaxError RegExp(\"abc\", \"gg\"); // SyntaxError\n\n> RegExp.prototype.exec(string)\n\n> RegExp.prototype.test(string)\n\n> RegExp.prototype.toString()\n\n> Error() Error(message)\n\nPrzejdź do treści\n > Error() Error(message)\n `String` message - komunikat błędu (domyślnie: \"\") `Error` - nowa instancja obiektu błędu \nDziała identycznie jak konstrukcja new Error(...).\n\n> Error.prototype.constructor\n\n> Error.prototype.name\n\nPrzejdź do treści\n > Error.prototype.name\n `String` - nazwa błędu (domyślnie: \"Error\") \nNazwa obiektu błędu, która zostanie użyta przez metodę toString.\n > Error.prototype.name; // \"Error\" new Error().name; // \"Error\"\n\n> Error.prototype.message\n\n> Error.prototype.toString()\n\n(interpretuje: Internet Explorer 8, Firefox 3.5, Opera 10.50, Chrome)\n > JSON.parse(text) JSON.parse(text, reviver)\n\n* Parametry:\n * \n `String` text - tekst w formacie JSON * \n `Function` reviver - funkcja przekształcająca wartości, przyjmująca argumenty: \n\n* \n `String` key - klucz danych albo pusty tekst * \n\n```\nObject|Array|String|Boolean|Number|Null\n```\n\nvalue - wartość danych * Wartość:\n * \n `Object` - obiekt * \n `Array` - tablica * \n `String` - tekst * \n `Boolean` - wartość logiczna * \n `Number` - liczba * \n `Null` - nic * Wyjątki:\n * \n `SyntaxError` - text zawiera błąd składni formatu JSON Przekształca tekst w formacie JSON (ang. JavaScript Object Notation) na wartości proste i obiekty obsługiwane przez JavaScript. JSON jest specjalnym formatem zapisu różnych danych o typach występujących w języku JavaScript, ale z dodatkowymi ograniczeniami. Polegają one m.in. na tym, że wszystkie wartości tekstowe - w tym klucze obiektów - muszą być ujęte w znaki cudzysłowu, a nie apostrofy. Dane muszą być zapisane wprost przy pomocy literałów, a nie z użyciem operatora `new` oraz tworzone w całości za jednym razem bez używania zmiennych pomocniczych. Ponadto w formacie JSON można zapisać tylko następujące typy danych: `Object` , `Array` , `String` , `Boolean` , `Number` , `Null` . \nTaki format zapisu danych stał się niezwykle przydatny w sytuacji, kiedy zachodzi potrzeba wymiany danych pomiędzy zdalnymi systemami, zaimplementowanymi w różnych językach. Ponieważ sposób zapisu JSON został określony standardem, w wielu językach programowania są dostępne gotowe biblioteki do jego obsługi. Dzięki temu możemy np. w skrypcie JavaScript odwołać się do aplikacji napisanej w PHP, która działa na serwerze, a następnie odczytać dane, które zostaną zwrócone z powrotem do naszego skryptu. Dzięki swojej prostocie, większej odporności na błędy oraz względnie niewielkim narzucie wydajnościowym i objętościowym, JSON w wielu miejscach wypiera XML jako uniweralny standard wymiany danych w heterogenicznym środowisku rozproszonym.\n Funkcja reviver pozwala dodatkowo przekształcić dane wejściowe. Jest ona wywoływana po kolei dla wartości każdej właściwości danych wejściowych. Wartość `this` w tej funkcji będzie stanowił obiekt, w którym jest zapisany podany klucz. Wartość zwrócona przez funkcję jest następnie umieszczana w danych wyjściowych. \nW przypadku właściwości obiektów, gdy funkcja zwrotna reviver zwróci wartość undefined albo nie zwróci nic jawnie, podany klucz zostanie usunięty z danych wyjściowych. Nie dotyczy to elementów tablic.\n\n### Przykład JSON.parse\n\n > JSON.parse('{\"a\": 1}'); // {a: 1} var x = '{\"a\": 1, \"b\": 2, \"c\": 3}'; var f = function (key, value) { if (key == \"\") { return value; } if (value < 3) { return value * 2; } }; JSON.parse(x, f); // {a: 2, b: 4} JSON.parse(\"{\"); // SyntaxError JSON.parse(\"{a: 1}\"); // SyntaxError JSON.parse(\"{'a': 1}\"); // SyntaxError\n\nDate: 2015-03-12\nCategories: \nTags: \n\nPrzykład\n[Nowość] [To jest odsyłacz do strony z nowością] \n\nMożliwe jest otwarcie jednocześnie kilku nowych okien. Należy wtedy oddzielić średnikami (\";\") kolejne polecenia\n\nDlatego dobrze się zastanów, czy otwieranie nowych okien na pewno jest Ci absolutnie niezbędne i czy nie przyniesie czasem więcej strat niż korzyści. Zresztą przez nadużywanie podobnych skryptów, przeglądarki zaczęły na stałe blokować otwieranie \"wyskakujących okienek\", które zwykle były używane w celach reklamowych.\n\n# Co to są klasy w CSS?\n\n Klasy w CSS to nazwy, które w postaci atrybutu `class=\"...\"` przypisuje się elementom HTML w celu zastosowania do nich określonych stylów. Klasy pozwalają na definiowanie zbioru elementów, które mają być stylizowane w ten sam sposób. Przykład: \n\n# Jak wywołać klasę w CSS?\n\n Aby wywołać klasę w CSS, używa się kropki przed nazwą klasy. Następnie, w elemencie HTML, który ma zostać stylizowany, dodaje się atrybut `class=\"...\"` z nazwą klasy. Przykład: \n\ni \n\n```\n
Treść
\n```\n\n# Jak nazywać klasy w CSS?\n\n Klasy w CSS mogą być nazwane dowolnie, ale dobrze jest stosować opisowe i zrozumiałe nazwy, które odzwierciedlają funkcję lub rolę elementów. Na przykład, zamiast `.a` lepiej użyć `.naglowek` , co ułatwia zrozumienie kodu i stylów. \n\n# Czym się różni CLASS od ID?\n\n Różnica między CLASS a ID polega na tym, że atrybut `class=\"...\"` może być używany wielokrotnie na stronie dla wielu elementów, podczas gdy `id=\"...\"` powinno być unikalne i używane tylko raz dla danego elementu w tym samym pliku HTML. Klasy pozwalają na grupowanie elementów o podobnych właściwościach i stosowanie do nich tych samych stylów, natomiast ID identyfikuje unikalny element na stronie. \n\n > selektor.klasa { cecha: wartość }\n > ...\n > selektor.klasa1.klasa3 { cecha: wartość }\n\nŹródło: CSS Cascading and Inheritance Level 4\n all #\n Resetowanie wszystkich cech\n\n Wartość\n\nResetowanie wszystkich cech\n\nAby zastosować taki skrypt, należy na stronie głównej do znacznika `` dodać atrybut `id=\"autoiframe\"` , np.: > \n UWAGA!Pamiętaj, aby podać taką wysokość ramki ( `height=\"...\"` ), która będzie wygodna w przypadku, gdyby skrypt nie zadziałał! \nTeraz na wszystkie podstrony, które będą wczytywane do ramki lokalnej, należy wstawić następujący kod (trzeba to zrobić koniecznie w nagłówku dokumentu, czyli w ramach ...):\n > \n Następnie na samym końcu podstrony (tuż przed znacznikiem zamykającym `` ) należy wkleić kod: > \n W wyróżnionym miejscu (w nawiasie) można podać wartość dodatkowego wstępnego \"marginesu\" pionowego na końcu podstrony. Jest on szczególnie przydatny, jeśli na stronie znajdują się zdjęcia o niezdefiniowanych wymiarach za pomocą atrybutów `width=\"...\"` oraz `height=\"...\"` znacznika . W takim przypadku margines ten należy dobrać na tyle duży, aby podczas doczytywania obrazów - a tym samym stopniowej zmiany wysokości treści - nie pojawił się pionowy suwak do przewijania ramki. Jest to tylko wartość wstępna (tymczasowa), ponieważ po wczytaniu wszystkiego, wysokość i tak się automatycznie dopasuje w drugim kroku. Jeśli chcemy zrezygnować z podawania marginesu, należy po prostu zupełnie pominąć wstawianie tej części kodu na podstronach. \nOstatnim krokiem będzie stworzenie nowego pliku autoiframe.js (w tym samym katalogu co podstrony) i zapisanie w nim:\n > /** * @author {@link https://www.kurshtml.edu.pl} * @copyright NIE usuwaj tego komentarza! (Do NOT remove this comment!) */ // Domyślny identyfikator IFRAME: var autoiframe_id = 'autoiframe'; // Domyślny dolny margines: var autoiframe_margin = 50; var autoiframe_timer = null; function autoiframe(id, margin) { if (parent != self && document.body && document.body.offsetHeight && document.body.scrollHeight) { clearTimeout(autoiframe_timer) if (typeof id != 'undefined' && id) autoiframe_id = id; parent.document.getElementById(autoiframe_id).height = 1; autoiframe_timer = setTimeout(\"parent.document.getElementById(autoiframe_id).height = Math.max(document.body.offsetHeight, document.body.scrollHeight) + \" + (typeof margin == 'undefined' || isNaN(parseInt(margin)) ? autoiframe_margin : parseInt(margin)), 1); } } if (window.addEventListener) window.addEventListener('load', function() { autoiframe(); }, false); else if (window.attachEvent) window.attachEvent('onload', function() { autoiframe(); });\n\n* autoiframe\n * Domyślna wartość atrybutu\n `id=\"...\"` ramki `` na stronie nadrzędnej, której wysokością chcemy sterować. * 50\n * Dodatkowy ostateczny \"margines\" pionowy na końcu podstrony, na wypadek gdyby dobrana automatycznie wysokość była jednak trochę za mała, co skutkowałoby wyświetleniem paska przewijania ramki lokalnej. Został on dobrany tak, aby nie był zbyt niski w większości przeglądarkach, jednak jeśli zajdzie potrzeba, można go oczywiście zwiększyć. Należy zauważyć, że zwykle będzie on miał wartość mniejszą niż analogiczny parametr wstępny wpisywany we wcześniejszym bloku kodu na końcu każdej z podstron, ponieważ określa margines już po wczytaniu wszystkich obrazów i innych elementów strony. Jest to wartość ostateczna tego parametru i nie będzie ona już dalej zmieniana.\n\nCzasami zachodzi potrzeba umieszczenia na jednej stronie kilku ramek `` , których wysokość powinna się automatycznie dopasowywać do zawartości. Oczywiście dla każdej takiej ramki proces dostosowywania wysokości musi zachodzić niezależnie. Aby to zrobić, należy dla każdej takiej ramki należy ustawić odrębny identyfikator `id=\"...\"` . Na przykład tak mógłby wyglądać fragment strony głównej serwisu: > \n Nic nie stoi na przeszkodzie, aby wstawić więcej niż dwie ramki `` - każda kolejna z innym identyfikatorem `id=\"...\"` . Następnie na końcu wszystkich podstron wczytywanych do ramki `id=\"autoiframe\"` - nazwijmy ją ramką główną - umieszczamy taki kod jak poprzednio, tzn.: > lub\n > \n Natomiast na podstronach, które będą wczytywane do ramki `id=\"autoiframe2\"` , umieszczamy, również na końcu, nieco zmienioną formę kodu, podając w nim wartość identyfikatora tej właśnie ramki (wstawioną w apostrofach): > \n Sposób wyświetlania daty można zmienić, podając w wyróżnionym miejscu inny szablon formatujący datę. Pojedyncze litery w tym tekście odpowiadają specjalnym kodom formatującym. Przykładowo: litera `d` zostanie zastąpiona dniem miesiąca, `m` - numerem miesiąca, natomiast `Y` - rokiem. W związku z tym wpisanie `d.m.Y` może poskutkować następującym wynikiem na ekranie: \nLista wszystkich możliwych do użycia kodów w szablonie formatującym datę jest następująca:\n\n* \n `a` - \"przed południem\" lub \"po południu\" * \n `d` - dzień miesiąca, 2 cyfry z zerem na początku; tzn. od \"01\" do \"31\" * \n `D` - dzień tygodnia, tekst, 3 litery; np. \"Pią\" * \n `E` - miesiąc, tekst, pełna nazwa w dopełniaczu; np. \"stycznia\" * \n `F` - miesiąc, tekst, pełna nazwa; np. \"Styczeń\" * \n `g` - godzina, format 12-godzinny bez zera na początku; tzn. od \"1\" do \"12\" * \n `G` - godzina, format 24-godzinny bez zera na początku; tzn. od \"0\" do \"23\" * \n `h` - godzina, format 12-godzinny z zerem na początku; tzn. od \"01\" do \"12\" * \n `H` - godzina, format 24-godzinny z zerem na początku; tzn. od \"00\" do \"23\" * \n `i` - minuty; tzn. od \"00\" do \"59\" * \n `j` - dzień miesiąca bez zera na początku; tzn. od \"1\" do \"31\" * \n `l` - (mała litera 'L') dzień tygodnia, tekst, pełna nazwa; np. \"Piątek\" * \n `L` - \"1\" jeśli rok przestępny, \"0\" w przeciwnym razie * \n `m` - miesiąc; tzn. \"01\" to \"12\" * \n `M` - miesiąc, tekst, 3 litery; np. \"Sty\" * \n `n` - miesiąc bez zera na początku; tzn. \"1\" to \"12\" * \n `O` - różnica w stosunku do czasu Greenwich; np. \"+0200\" * \n `r` - data sformatowana; np. \"Czw, 21 Gru 2000 16:01:07 +0200\" * \n `s` - sekundy; np. \"00\" to \"59\" * \n `S` - standardowy sufiks liczebnika porządkowego, tzn. \"-wszy\", \"-gi\", \"-ci\" , \"-ty\" lub \"my\" * \n `t` - liczba dni w danym miesiącu; tzn. od \"28\" do \"31\" * \n `U` - liczba sekund od uniksowej Epoki (1 stycznia 1970 00:00:00 GMT) * \n `w` - dzień tygodnia, liczbowy, tzn. od \"0\" (Niedziela) do \"6\" (Sobota) * \n `W` - numer tygodnia w roku według ISO-8601, przedział od 1 do 53, gdzie tydzień 1 jest pierwszym tygodniem, który ma co najmniej 4 dni w aktualnym roku, przy czym pierwszym dniem tygodnia jest poniedziałek * \n `Y` - rok, 4 cyfry; np. \"1999\" * \n `y` - rok, 2 cyfry; np. \"99\" * \n `z` - dzień roku; tzn. od \"1\" do \"365\" (\"366\") * \n `Z` - ofset strefy czasowej w sekundach (tzn. pomiędzy \"-43200\" a \"43200\"). Ofset dla stref czasowych na zachód od UTC (południka zero) jest zawsze ujemny a dla tych na wschód od UTC jest zawsze dodatni. \nAby normalnie wyświetlić na ekranie literę będącą kodem formatującym, należy ją poprzedzić podwójnym znakiem \\\\. Na przykład po wpisaniu: \"\\\\d\" zostanie wyświetlona po prostu litera \"d\", a nie dzień miesiąca. Ponadto jeśli w szablonie formatującym datę ma się wyświetlić znak \\ trzeba go zamienić na cztery takie znaki: \"\\\\\\\\\".\n\n > 2023-11-16 04:15:42\n > Czwartek, 16 listopada 2023, 4:15\n > 16-ty listopada 2023 r., godz. 4:15 przed południem (dzień roku: 320, tydzień roku: 46)\n\n### Aktualna data #\n\n Po niewielkiej modyfikacji można wyświetlić na ekranie bieżącą datę, a nie czas aktualizacji strony. Aby to zrobić wystarczy w drugiej części skryptu usunąć wyrażenie:\n\n```\ndocument.lastModified\n```\n\n > Dzisiaj jest: Dzisiaj jest:Czwartek, 16 listopada 2023\n\n### Jedno okno #\n\n* Po załadowaniu strony:\n> ...\n * Przed załadowaniem strony:\n> \n * Po kliknięciu odsyłacza:\n> opis...!\n UWAGA!Pierwsze dwa warianty są obecnie blokowane przez prawie wszystkie przeglądarki, z uwagi na dużą uciążliwość dla internautów. Oznacza to, że mogą w ogóle nie zadziałać, chyba że użytkownik wyrazi na to zgodę! \n\n### Pop-under #\n\nPolecenie to pozwala automatycznie otworzyć nowe okno i określić jego wygląd (patrz dalej). W pierwszym wariancie okno zostanie otwarte dopiero po wczytaniu i wyświetleniu całej strony, w drugim - jeszcze zanim zostanie załadowana treść dokumentu, a w trzecim - po kliknięciu odpowiedniego odsyłacza, czyli specjalnie wyróżnionego tekstu.\n\nWszystkie powyższe warianty otwierają okna typu pop-up tzn., że pokazują się one na wierzchu, zasłaniając sobą stronę główną. Jest to bardzo uciążliwe, ponieważ zmusza użytkownika do natychmiastowego zamknięcia lub zminimalizowania takiego okna, jeśli chce zobaczyć właściwą stronę. Jest jednak inny, mniej uciążliwy typ okien nazywany pop-under. Różni się on jedynie tym, że otwiera się pod spodem i nie drażni tak internautów. Użytkownik i tak zobaczy treść pop-undera, kiedy będzie wychodził z naszej strony, zamykając główne okno przeglądarki. Skuteczność tej metody może być równie wysoka, ponieważ po dłuższym czasie spędzonym na stronie, internauta może już nie pamiętać, czy okno ukryte pod spodem otworzył wcześniej on sam czy raczej otworzyło się samo.\n Aby otworzyć okno pop-under, wystarczy dla wszystkich powyższych wariantów (choć trzeci raczej mija się z celem) nieznacznie zmodyfikować wyróżniony fragment kodu: na końcu zamiast `focus()` wpisujemy `blur()` > window.open('adres', 'nazwa').blur()\n\nW niektórych systemach operacyjnych i przy pewnych ustawieniach w niektórych przeglądarkach, okna pop-under mogą działać identycznie jak pop-up.\n\nKliknij tutaj, aby przejść na stronę, na której nastąpi automatyczne otwarcie nowego okna typu pop-up.\n\nKliknij tutaj, aby przejść na stronę, na której nastąpi automatyczne otwarcie nowego okna typu pop-under.\n\nKliknij tutaj, aby otworzyć nowe okno przy użyciu odsyłacza.\n Możliwe jest otwarcie jednocześnie kilku nowych okien. Należy wtedy oddzielić średnikami (\";\") kolejne polecenia\n\nDlatego dobrze się zastanów, czy otwieranie nowych okien na pewno jest Ci absolutnie niezbędne i czy nie przyniesie czasem więcej strat niż korzyści. Zresztą przez nadużywanie podobnych skryptów, przeglądarki zaczęły na stałe blokować otwieranie \"wyskakujących okienek\", które zwykle były używane w celach reklamowych.\n Możliwe jest określenie wyglądu nowego okna (rozmiarów, położenia, pokazanie/ukrycie pasków menu, narzędzi, statusu itp.), poprzez podanie w poleceniu dodatkowych parametrów. Zamiast opisu zamieszam poniżej generator. Otrzymany w nim kod, należy wpisać w miejsce wyróżnionego tekstu, np. jako wartość atrybutu `onload=\"...\"` (pierwszy sposób). \nUWAGA! Jeśli chcesz otworzyć zwykłe okno po kliknięciu odsyłacza (trzeci wariant), czyli bez określania parametrów wyglądu, lepiej to zrobić w następujący sposób:\n > opis \"Tekst i dopiero taki dokument podaje się w linku:\n > \"Tekst...
` ) i ramki (przykład takiego właśnie szablonu znajdziesz w rozdziale Struktura tabeli). Jest to wygodne o tyle, że pozwala szybko zbudować stronę elastyczną w aktualizacji, bez wykorzystania języków skryptowych po stronie serwera (np. PHP). Niestety takie rozwiązanie ma przynajmniej jedną poważną wadę: trudno jest dopasować wysokość ramki IFRAME tak, aby była odpowiednia dla każdej rozdzielczości ekranu. Jeśli ustalimy za duży rozmiar, użytkownicy w niskiej rozdzielczości będą mieli problem z przewijaniem zawartości ramki. Natomiast jeśli ustalimy za mały, w wyższej rozdzielczości pojawi się niewielkie \"okienko\", w którym trudno nawigować. Pewnym rozwiązanie mogłoby być określenie na tyle dużej wysokości, aby treść ramki zawsze się w niej w całości mieściła bez konieczności pokazywania suwaków do przewijania - wtedy będzie tylko jeden suwak pionowy do przewijania całej strony głównej. Niestety takie rozwiązanie nie zawsze jest możliwe, bo na początku nie wiemy jak długie będą nasze podstrony. Poza tym jeśli ustalimy zbyt dużą wysokość, cała strona główna bardzo się rozciągnie, a po wczytaniu do ramki lokalnej krótkiej treści, na jej końcu pozostanie bardzo dużo wolnego miejsca, co będzie wyglądało dosyć dziwnie i na pewno nie będzie wygodne dla użytkownika. \nCzy można sobie zatem jakoś poradzić? Oczywiście! Skrypt przedstawiony na tej stronie potrafi całkowicie automatycznie dopasować wysokość ramki IFRAME do długości aktualnie wyświetlanej w niej treści podstrony. Robi to tak, aby nigdy nie pojawił się pionowy suwak do przewijania ramki lokalnej. Wysokość nie będzie ani za duża ani za mała, ale zawsze po prostu idealnie dopasowana.\n Aby zastosować taki skrypt, należy na stronie głównej do znacznika `` dodać atrybut `id=\"autoiframe\"` , np.: > \n UWAGA!Pamiętaj, aby podać taką wysokość ramki ( `height=\"...\"` ), która będzie wygodna w przypadku, gdyby skrypt nie zadziałał! \nTeraz na wszystkie podstrony, które będą wczytywane do ramki lokalnej, należy wstawić następujący kod (trzeba to zrobić koniecznie w nagłówku dokumentu, czyli w ramach ...):\n > \n Następnie na samym końcu podstrony (tuż przed znacznikiem zamykającym `` ) należy wkleić kod: > \n W wyróżnionym miejscu (w nawiasie) można podać wartość dodatkowego wstępnego \"marginesu\" pionowego na końcu podstrony. Jest on szczególnie przydatny, jeśli na stronie znajdują się zdjęcia o niezdefiniowanych wymiarach za pomocą atrybutów `width=\"...\"` oraz `height=\"...\"` znacznika . W takim przypadku margines ten należy dobrać na tyle duży, aby podczas doczytywania obrazów - a tym samym stopniowej zmiany wysokości treści - nie pojawił się pionowy suwak do przewijania ramki. Jest to tylko wartość wstępna (tymczasowa), ponieważ po wczytaniu wszystkiego, wysokość i tak się automatycznie dopasuje w drugim kroku. Jeśli chcemy zrezygnować z podawania marginesu, należy po prostu zupełnie pominąć wstawianie tej części kodu na podstronach. \nOstatnim krokiem będzie stworzenie nowego pliku autoiframe.js (w tym samym katalogu co podstrony) i zapisanie w nim:\n > /** * @author {@link https://www.kurshtml.edu.pl} * @copyright NIE usuwaj tego komentarza! (Do NOT remove this comment!) */ // Domyślny identyfikator IFRAME: var autoiframe_id = 'autoiframe'; // Domyślny dolny margines: var autoiframe_margin = 50; var autoiframe_timer = null; function autoiframe(id, margin) { if (parent != self && document.body && document.body.offsetHeight && document.body.scrollHeight) { clearTimeout(autoiframe_timer) if (typeof id != 'undefined' && id) autoiframe_id = id; parent.document.getElementById(autoiframe_id).height = 1; autoiframe_timer = setTimeout(\"parent.document.getElementById(autoiframe_id).height = Math.max(document.body.offsetHeight, document.body.scrollHeight) + \" + (typeof margin == 'undefined' || isNaN(parseInt(margin)) ? autoiframe_margin : parseInt(margin)), 1); } } if (window.addEventListener) window.addEventListener('load', function() { autoiframe(); }, false); else if (window.attachEvent) window.attachEvent('onload', function() { autoiframe(); });\n\n* autoiframe\n * Domyślna wartość atrybutu\n `id=\"...\"` ramki `` na stronie nadrzędnej, której wysokością chcemy sterować. * 50\n * Dodatkowy ostateczny \"margines\" pionowy na końcu podstrony, na wypadek gdyby dobrana automatycznie wysokość była jednak trochę za mała, co skutkowałoby wyświetleniem paska przewijania ramki lokalnej. Został on dobrany tak, aby nie był zbyt niski w większości przeglądarkach, jednak jeśli zajdzie potrzeba, można go oczywiście zwiększyć. Należy zauważyć, że zwykle będzie on miał wartość mniejszą niż analogiczny parametr wstępny wpisywany we wcześniejszym bloku kodu na końcu każdej z podstron, ponieważ określa margines już po wczytaniu wszystkich obrazów i innych elementów strony. Jest to wartość ostateczna tego parametru i nie będzie ona już dalej zmieniana.\n Czasami zachodzi potrzeba umieszczenia na jednej stronie kilku ramek `` , których wysokość powinna się automatycznie dopasowywać do zawartości. Oczywiście dla każdej takiej ramki proces dostosowywania wysokości musi zachodzić niezależnie. Aby to zrobić, należy dla każdej takiej ramki należy ustawić odrębny identyfikator `id=\"...\"` . Na przykład tak mógłby wyglądać fragment strony głównej serwisu: > \n Nic nie stoi na przeszkodzie, aby wstawić więcej niż dwie ramki `` - każda kolejna z innym identyfikatorem `id=\"...\"` . Następnie na końcu wszystkich podstron wczytywanych do ramki `id=\"autoiframe\"` - nazwijmy ją ramką główną - umieszczamy taki kod jak poprzednio, tzn.: > lub\n > \n Natomiast na podstronach, które będą wczytywane do ramki `id=\"autoiframe2\"` , umieszczamy, również na końcu, nieco zmienioną formę kodu, podając w nim wartość identyfikatora tej właśnie ramki (wstawioną w apostrofach): > lub\n > \n * W wybranych miejscach strony osadź bloki menu używając znaczników listy definicyjnej
...
, przy czym każdemu kolejnemu menu nadaj inny identyfikator\n `id=\"...\"` - np. `id=\"menu0\"` , `id=\"menu1\"` , `id=\"menu2\"` itd. * Pod każdym blokiem menu wstaw wywołanie skryptu (ostatni zaprezentowany wcześniej fragment kodu), pamiętając, aby w każdym z nich podać odpowiedni identyfikator (menu0, menu1, menu2 itd.).\n Warto nadmienić, że w przypadku kiedy elementy menu zawierają odsyłacze, gałąź menu, w której znajduje się odnośnik do aktualnie wczytanej strony, zostanie na starcie automatycznie rozwinięta. Dzięki temu użytkownik łatwiej odnajdzie punkt w nawigacji, w którym teraz się znajduje. Dodatkowo w takiej sytuacji elementowi `
...
` , w którym znajduje się bieżący odsyłacz, zostanie przypisana klasa CSS pod nazwą active, dzięki której można dodatkowo wyróżnić aktualną pozycję menu, dodając odpowiednie deklaracje CSS w arkuszu stylów, np.: > #menu0 dd.active { font-weight: bold; }\n Prezentowany skrypt obsługuje również wielopoziomowe struktury menu. Zasada zagnieżdżania polega na zbudowaniu najpierw pierwszego, płaskiego poziomu, a następnie wybraniu określonego elementu `
...
` i umieszczeniu w nim podrzędnej listy `
...
` , ze swoimi nagłówkami `
...
` i elementami `
...
` . Oczywiście ilość poziomów zagnieżdżenia nie jest niczym ograniczona. \nW celu osadzenia wielopoziomowego menu, należy powtórzyć wszystkie przedstawione wcześniej kroki. Zmianie ulegnie tylko kod HTML tworzący sam blok menu:\n >
Nagłówek 1
Nagłówek 1.1
Nagłówek 1.1.1
Element 1.1.1.1
Element 1.1.1.2
Element 1.1.1.3
Nagłówek 1.1.2
Element 1.1.2.1
Element 1.1.2.2
Element 1.1.2.3
Nagłówek 1.2
Element 1.2.1
Element 1.2.2
Element 1.2.3
Nagłówek 2
Nagłówek 2.1
Element 2.1.1
Element 2.1.2
Element 2.1.3
Nagłówek 2.2
Element 2.2.1
Element 2.2.2
Element 2.2.3
\n```\n### [Options](#options)\n\nOptions can be passed when instantiating `uid`:\n```\nconst options = { ... };\n\nconst uid = new ShortUniqueId(options);\n```\nFor more information take a look at the [docs](https://shortunique.id/interfaces/shortuniqueidoptions.html).\n\n[Available for](#available-for)\n---\n\n* [Node.js (npm)](https://www.npmjs.com/package/short-unique-id)\n* [Deno](https://esm.sh/short-unique-id)\n* [Browsers](https://www.jsdelivr.com/package/npm/short-unique-id?path=dist)\n\n[Documentation with Online Short UUID Generator](#documentation-with-online-short-uuid-generator)\n---\n\nYou can find the docs and online generator at:\n\n](https://github.com/serendipious/).\n\nSince this package is now reporting 200k+ npm weekly downloads and 16M+ weekly cdn hits,\nwe've gone ahead and re-written the whole of it in TypeScript and made sure to package dist modules compatible with Deno, Node.js and all major Browsers.\n\n[Sponsors](#sponsors)\n---\n\n* [Clever Synapse](https://cleversynapse.com)\n\n[Development](#development)\n---\n\nClone this repo:\n```\n# SSH git clone git@github.com:jeanlescure/short-unique-id.git\n\n# HTTPS git clone https://github.com/jeanlescure/short-unique-id.git\n```\nTests run using:\n```\npnpm test\n```\n[Build](#build)\n---\n\nIn order to publish the latest changes you must build the distribution files:\n```\npnpm build\n```\nThen commit all changes and run the release script:\n```\npnpm release\n```\n[Contributing](#contributing)\n---\n\nYes, thank you! This plugin is community-driven, most of its features are from different authors.\nPlease update the docs and tests and add your name to the `package.json` file.\n\n[Contributors ✨](#contributors-)\n---\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n| | | | | | | | |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short-unique-id/commits?author=serendipious \"Code\") |\n\n | \n\n| |\n| --- |\n| [🚧](#maintenance-jeanlescure \"Maintenance\") [💻](https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure \"Code\") [📖](https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure \"Documentation\") [⚠️](https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure \"Tests\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short_uuid/commits?author=DiLescure \"Code\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short_uuid/commits?author=EmerLM \"Code\") |\n\n |\n| \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short_uuid/commits?author=angelnath26 \"Code\") [👀](https://github.com/jeanlescure/short_uuid/pulls?q=is%3Apr+reviewed-by%3Aangelnath26 \"Reviewed Pull Requests\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short-unique-id/commits?author=jeffturcotte \"Code\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short-unique-id/commits?author=neversun \"Code\") |\n\n | \n\n| |\n| --- |\n| [🤔](https://github.com/jeanlescure/short-unique-id/issues/19 \"Ideas, Planning, & Feedback\") |\n\n |\n| \n\n| |\n| --- |\n| [🛡️](https://github.com/jeanlescure/short-unique-id/issues/35 \"Security\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short-unique-id/pull/46 \"Code\") |\n\n | \n\n| |\n| --- |\n| [💻](https://github.com/jeanlescure/short-unique-id/pull/48 \"Code\") |\n\n | \n\n| |\n| --- |\n| [📖](https://github.com/jeanlescure/short-unique-id/issues/47 \"Documentation\") |\n\n |\n\n[License](#license)\n---\n\nCopyright (c) 2018-2023 [Short Unique ID Contributors](https://github.com/jeanlescure/short-unique-id/#contributors-). \n\nLicensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).\nReadme\n---\n\n### Keywords\n\n* short\n* random\n* uid\n* uuid\n* guid\n* node\n* unique id\n* generator\n* tiny"}}},{"rowIdx":445,"cells":{"project":{"kind":"string","value":"geostat-framework"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"Unknown"},"content":{"kind":"string","value":"GeoStat Framework\n Release 1.0\n Jul 04, 2021\nContents 1.1 GSTool... 3 1.2 PyKrig... 3 1.3 ogs5p... 4 1.4 WellTestP... 4 1.5 AnaFlo... 5 1.6 pentap... 5\n i\nii\nGeoStat Framework, Release 1.0\n Create your geo-statistical model with Python!\nGeoStat Framework, Release 1.0 2 Contents\nCHAPTER 1\n Included Packages The following Python-Packages are part of the GeoStat Framework.\n1.1 GSTools GeoStatTools is a library providing geostatistical tools like kriging, random field generation, variogram estimation,\ncovariance models and much more.\n Version\n Installation pip install gstools or conda install gstools\n Source https://github.com/GeoStat-Framework/GSTools\n Documentation https://gstools.readthedocs.io 1.2 PyKrige PyKrige provides 2D and 3D ordinary and universal kriging.\nGeoStat Framework, Release 1.0\n Version\n Installation pip install PyKrige or conda install pykrige\n Source https://github.com/GeoStat-Framework/PyKrige\n Documentation https://pykrige.readthedocs.io 1.3 ogs5py ogs5py is a Python-API for the OpenGeoSys 5 scientific modeling package.\n Version\n Installation pip install ogs5py or conda install ogs5py\n Source https://github.com/GeoStat-Framework/ogs5py\n Documentation https://ogs5py.readthedocs.io 1.4 WellTestPy WellTestPy is a python-package for handling well based field campaigns.\nGeoStat Framework, Release 1.0\n Version\n Installation pip install welltestpy\n Source https://github.com/GeoStat-Framework/welltestpy\n Documentation https://welltestpy.readthedocs.io 1.5 AnaFlow Anaflow provides several analytical and semi-analytical solutions for the groundwater-flow-equation.\n Version\n Installation pip install anaflow\n Source https://github.com/GeoStat-Framework/AnaFlow\n Documentation https://anaflow.readthedocs.io 1.6 pentapy pentapy is a toolbox to deal with pentadiagonal matrices in Python.\nGeoStat Framework, Release 1.0\n Version\n Installation pip install pentapy\n Source https://github.com/GeoStat-Framework/pentapy\n Documentation https://pentapy.readthedocs.io"}}},{"rowIdx":446,"cells":{"project":{"kind":"string","value":"git-object"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate git_object\n===\n\nThis crate provides types for read-only git objects backed by bytes provided in git’s serialization format as well as mutable versions of these. Both types of objects can be encoded.\n\n### Feature Flags\n\n* **`serde1`** — Data structures implement `serde::Serialize` and `serde::Deserialize`.\n* **`verbose-object-parsing-errors`** — When parsing objects by default errors will only be available on the granularity of success or failure, and with the above flag enabled details information about the error location will be collected.\nUse it in applications which expect broken or invalid objects or for debugging purposes. Incorrectly formatted objects aren’t at all common otherwise.\n\nRe-exports\n---\n\n`pub use bstr;`Modules\n---\n\ncommitdataContains a borrowed Object bound to a buffer holding its decompressed data.decodeencodeEncoding utilitieskindtagtreeStructs\n---\n\nBlobA mutable chunk of any `data`.BlobRefA chunk of any `data`.CommitA mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.CommitRefA git commit parsed using `from_bytes()`.CommitRefIterLike `CommitRef`, but as `Iterator` to support (up to) entirely allocation free parsing.\nIt’s particularly useful to traverse the commit graph without ever allocating arrays for parents.DataA borrowed object using a slice as backing buffer, or in other words a bytes buffer that knows the kind of object it represents.TagA mutable git tag.TagRefRepresents a git tag, commonly indicating a software release.TagRefIterLike `TagRef`, but as `Iterator` to support entirely allocation free parsing.\nIt’s particularly useful to dereference only the target chain.TreeA mutable Tree, containing other trees, blobs or commits.TreeRefA directory snapshot containing files (blobs), directories (trees) and submodules (commits).TreeRefIterA directory snapshot containing files (blobs), directories (trees) and submodules (commits), lazily evaluated.Enums\n---\n\nKindThe four types of objects that git differentiates. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]ObjectMutable objects with each field being separately allocated and changeable.ObjectRefImmutable objects are read-only structures referencing most data from a byte slice.Traits\n---\n\nWriteToWriting of objects to a `Write` implementation\n\nCrate git_object\n===\n\nThis crate provides types for read-only git objects backed by bytes provided in git’s serialization format as well as mutable versions of these. Both types of objects can be encoded.\n\n### Feature Flags\n\n* **`serde1`** — Data structures implement `serde::Serialize` and `serde::Deserialize`.\n* **`verbose-object-parsing-errors`** — When parsing objects by default errors will only be available on the granularity of success or failure, and with the above flag enabled details information about the error location will be collected.\nUse it in applications which expect broken or invalid objects or for debugging purposes. Incorrectly formatted objects aren’t at all common otherwise.\n\nRe-exports\n---\n\n`pub use bstr;`Modules\n---\n\ncommitdataContains a borrowed Object bound to a buffer holding its decompressed data.decodeencodeEncoding utilitieskindtagtreeStructs\n---\n\nBlobA mutable chunk of any `data`.BlobRefA chunk of any `data`.CommitA mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.CommitRefA git commit parsed using `from_bytes()`.CommitRefIterLike `CommitRef`, but as `Iterator` to support (up to) entirely allocation free parsing.\nIt’s particularly useful to traverse the commit graph without ever allocating arrays for parents.DataA borrowed object using a slice as backing buffer, or in other words a bytes buffer that knows the kind of object it represents.TagA mutable git tag.TagRefRepresents a git tag, commonly indicating a software release.TagRefIterLike `TagRef`, but as `Iterator` to support entirely allocation free parsing.\nIt’s particularly useful to dereference only the target chain.TreeA mutable Tree, containing other trees, blobs or commits.TreeRefA directory snapshot containing files (blobs), directories (trees) and submodules (commits).TreeRefIterA directory snapshot containing files (blobs), directories (trees) and submodules (commits), lazily evaluated.Enums\n---\n\nKindThe four types of objects that git differentiates. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]ObjectMutable objects with each field being separately allocated and changeable.ObjectRefImmutable objects are read-only structures referencing most data from a byte slice.Traits\n---\n\nWriteToWriting of objects to a `Write` implementation\n\nEnum git_object::ObjectRef\n===\n\n\n```\npub enum ObjectRef<'a> {\n Tree(TreeRef<'a>),\n Blob(BlobRef<'a>),\n Commit(CommitRef<'a>),\n Tag(TagRef<'a>),\n}\n```\nImmutable objects are read-only structures referencing most data from a byte slice.\n\nImmutable objects are expected to be deserialized from bytes that acts as backing store, and they cannot be mutated or serialized. Instead, one will convert them into their `mutable` counterparts which support mutation and serialization.\n\nAn `ObjectRef` is representing `Trees`, `Blobs`, `Commits`, or `Tags`.\n\nVariants\n---\n\n### Tree(TreeRef<'a>)\n\n### Blob(BlobRef<'a>)\n\n### Commit(CommitRef<'a>)\n\n### Tag(TagRef<'a>)\n\nImplementations\n---\n\n### impl<'a> ObjectRef<'a#### pub fn from_loose(data: &'a [u8]) -> Result, LooseDecodeErrorDeserialize an object from a loose serialisation\n\n#### pub fn from_bytes(kind: Kind, data: &'a [u8]) -> Result, ErrorDeserialize an object of `kind` from the given `data`.\n\n#### pub fn into_owned(self) -> Object\n\nConvert the immutable object into a mutable version, consuming the source in the process.\n\nNote that this is an expensive operation.\n\n#### pub fn to_owned(&self) -> Object\n\nConvert this immutable object into its mutable counterpart.\n\nNote that this is an expensive operation.\n\n### impl<'a> ObjectRef<'aConvenient access to contained objects.\n\n#### pub fn as_blob(&self) -> Option<&BlobRef<'a>Interpret this object as blob.\n\n#### pub fn into_blob(self) -> OptionInterpret this object as blob, chainable.\n\n#### pub fn as_commit(&self) -> Option<&CommitRef<'a>Interpret this object as commit.\n\n#### pub fn into_commit(self) -> OptionInterpret this object as commit, chainable.\n\n#### pub fn as_tree(&self) -> Option<&TreeRef<'a>Interpret this object as tree.\n\n#### pub fn into_tree(self) -> OptionInterpret this object as tree, chainable\n\n#### pub fn as_tag(&self) -> Option<&TagRef<'a>Interpret this object as tag.\n\n#### pub fn into_tag(self) -> OptionInterpret this object as tag, chainable.\n\n#### pub fn kind(&self) -> Kind\n\nReturn the kind of object.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for ObjectRef<'a#### fn clone(&self) -> ObjectRef<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: CommitRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for Object\n\n#### fn from(v: ObjectRef<'_>) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: TagRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: TreeRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> Hash for ObjectRef<'a#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for ObjectRef<'a#### fn partial_cmp(&self, other: &ObjectRef<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### fn write_to(&self, out: impl Write) -> Result<()Write the contained object to `out` in the git serialization format.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl<'a> Eq for ObjectRef<'a### impl<'a> StructuralEq for ObjectRef<'a### impl<'a> StructuralPartialEq for ObjectRef<'aAuto Trait Implementations\n---\n\n### impl<'a> RefUnwindSafe for ObjectRef<'a### impl<'a> Send for ObjectRef<'a### impl<'a> Sync for ObjectRef<'a### impl<'a> Unpin for ObjectRef<'a### impl<'a> UnwindSafe for ObjectRef<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nEnum git_object::Object\n===\n\n\n```\npub enum Object {\n Tree(Tree),\n Blob(Blob),\n Commit(Commit),\n Tag(Tag),\n}\n```\nMutable objects with each field being separately allocated and changeable.\n\nMutable objects are Commits, Trees, Blobs and Tags that can be changed and serialized.\n\nThey either created using object construction or by deserializing existing objects and converting these into mutable copies for adjustments.\n\nAn `Object` is representing `Trees`, `Blobs`, `Commits` or `Tags`.\n\nVariants\n---\n\n### Tree(Tree)\n\n### Blob(Blob)\n\n### Commit(Commit)\n\n### Tag(Tag)\n\nImplementations\n---\n\n### impl Object\n\nConvenient extraction of typed object.\n\n#### pub fn into_blob(self) -> Blob\n\nTurns this instance into a `Blob`, panic otherwise.\n\n#### pub fn into_commit(self) -> Commit\n\nTurns this instance into a `Commit` panic otherwise.\n\n#### pub fn into_tree(self) -> Tree\n\nTurns this instance into a `Tree` panic otherwise.\n\n#### pub fn into_tag(self) -> Tag\n\nTurns this instance into a `Tag` panic otherwise.\n\n#### pub fn try_into_blob(self) -> Result OptionTurns this instance into a `BlobRef` if it is a blob.\n\n#### pub fn try_into_commit(self) -> Result Result Result Option<&BlobReturns a `Blob` if it is one.\n\n#### pub fn as_commit(&self) -> Option<&CommitReturns a `Commit` if it is one.\n\n#### pub fn as_tree(&self) -> Option<&TreeReturns a `Tree` if it is one.\n\n#### pub fn as_tag(&self) -> Option<&TagReturns a `Tag` if it is one.\n\n#### pub fn kind(&self) -> Kind\n\nReturns the kind of object stored in this instance.\n\nTrait Implementations\n---\n\n### impl Clone for Object\n\n#### fn clone(&self) -> Object\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: Blob) -> Self\n\nConverts to this type from the input type.### impl From for Object\n\n#### fn from(v: Commit) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for Object\n\n#### fn from(v: ObjectRef<'_>) -> Self\n\nConverts to this type from the input type.### impl From for Object\n\n#### fn from(v: Tag) -> Self\n\nConverts to this type from the input type.### impl From for Object\n\n#### fn from(v: Tree) -> Self\n\nConverts to this type from the input type.### impl Hash for Object\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Object) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Object) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Object\n\n#### fn partial_cmp(&self, other: &Object) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result for Commit\n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result for Tag\n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result for Tree\n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result Result<()Write the contained object to `out` in the git serialization format.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl Eq for Object\n\n### impl StructuralEq for Object\n\n### impl StructuralPartialEq for Object\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Object\n\n### impl Send for Object\n\n### impl Sync for Object\n\n### impl Unpin for Object\n\n### impl UnwindSafe for Object\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nModule git_object::commit\n===\n\nModules\n---\n\nmessageref_iterStructs\n---\n\nExtraHeadersAn iterator over extra headers in owned and borrowed commits.MessageRefA parsed commit message that assumes a title separated from the body by two consecutive newlines.\n\nModule git_object::data\n===\n\nContains a borrowed Object bound to a buffer holding its decompressed data.\n\nModules\n---\n\nverifyTypes supporting object hash verification\n\nModule git_object::decode\n===\n\nStructs\n---\n\nError`verbose-object-parsing-errors`A type to indicate errors during parsing and to abstract away details related to `nom`.Enums\n---\n\nLooseHeaderDecodeErrorReturned by `loose_header()`Functions\n---\n\nloose_headerDecode a loose object header, being ` \\0`, returns\n(`kind`, `size`, `consumed bytes`).Type Definitions\n---\n\nParseError`verbose-object-parsing-errors`The type to be used for parse errors.ParseErrorOwned`verbose-object-parsing-errors`The owned type to be used for parse errors.\n\nModule git_object::encode\n===\n\nEncoding utilities\n\nEnums\n---\n\nErrorAn error returned when object encoding fails.Functions\n---\n\nloose_headerGenerates a loose header buffer\n\nModule git_object::kind\n===\n\nEnums\n---\n\nErrorThe Error used in `Kind::from_bytes()`.\n\nModule git_object::tag\n===\n\nModules\n---\n\nref_iterwrite\n\nModule git_object::tree\n===\n\nModules\n---\n\nwriteStructs\n---\n\nEntryAn entry in a `Tree`, similar to an entry in a directory.EntryRefAn element of a `TreeRef`.Enums\n---\n\nEntryModeThe mode of items storable in a tree, similar to the file mode on a unix file system.\n\nStruct git_object::Blob\n===\n\n\n```\npub struct Blob {\n pub data: Vec,\n}\n```\nA mutable chunk of any `data`.\n\nFields\n---\n\n`data: Vec`The data itself.\n\nImplementations\n---\n\n### impl Blob\n\n#### pub fn to_ref(&self) -> BlobRef<'_Provide a `BlobRef` to this owned blob\n\nTrait Implementations\n---\n\n### impl Clone for Blob\n\n#### fn clone(&self) -> Blob\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: Blob) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for Blob\n\n#### fn from(v: BlobRef<'a>) -> Self\n\nConverts to this type from the input type.### impl Hash for Blob\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Blob) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Blob) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Blob\n\n#### fn partial_cmp(&self, other: &Blob) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result Result<()Write the blobs data to `out` verbatim.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl Eq for Blob\n\n### impl StructuralEq for Blob\n\n### impl StructuralPartialEq for Blob\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Blob\n\n### impl Send for Blob\n\n### impl Sync for Blob\n\n### impl Unpin for Blob\n\n### impl UnwindSafe for Blob\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::BlobRef\n===\n\n\n```\npub struct BlobRef<'a> {\n pub data: &'a [u8],\n}\n```\nA chunk of any `data`.\n\nFields\n---\n\n`data: &'a [u8]`The bytes themselves.\n\nImplementations\n---\n\n### impl<'a> BlobRef<'a#### pub fn from_bytes(data: &[u8]) -> Result, InfallibleInstantiate a `Blob` from the given `data`, which is used as-is.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for BlobRef<'a#### fn clone(&self) -> BlobRef<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: BlobRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: BlobRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> Hash for BlobRef<'a#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for BlobRef<'a#### fn partial_cmp(&self, other: &BlobRef<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl<'a> Eq for BlobRef<'a### impl<'a> StructuralEq for BlobRef<'a### impl<'a> StructuralPartialEq for BlobRef<'aAuto Trait Implementations\n---\n\n### impl<'a> RefUnwindSafe for BlobRef<'a### impl<'a> Send for BlobRef<'a### impl<'a> Sync for BlobRef<'a### impl<'a> Unpin for BlobRef<'a### impl<'a> UnwindSafe for BlobRef<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::Commit\n===\n\n\n```\npub struct Commit {\n pub tree: ObjectId,\n pub parents: SmallVec<[ObjectId; 1]>,\n pub author: Signature,\n pub committer: Signature,\n pub encoding: Option,\n pub message: BString,\n pub extra_headers: Vec<(BString, BString)>,\n}\n```\nA mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.\n\nFields\n---\n\n`tree: ObjectId`The hash of recorded working tree state.\n\n`parents: SmallVec<[ObjectId; 1]>`Hash of each parent commit. Empty for the first commit in repository.\n\n`author: Signature`Who wrote this commit.\n\n`committer: Signature`Who committed this commit.\n\nThis may be different from the `author` in case the author couldn’t write to the repository themselves and is commonly encountered with contributed commits.\n\n`encoding: Option`The name of the message encoding, otherwise UTF-8 should be assumed.\n\n`message: BString`The commit message documenting the change.\n\n`extra_headers: Vec<(BString, BString)>`Extra header fields, in order of them being encountered, made accessible with the iterator returned by `extra_headers()`.\n\nImplementations\n---\n\n### impl Commit\n\n#### pub fn extra_headers(\n &self\n) -> ExtraHeadersReturns a convenient iterator over all extra headers.\n\nTrait Implementations\n---\n\n### impl Clone for Commit\n\n#### fn clone(&self) -> Commit\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: Commit) -> Self\n\nConverts to this type from the input type.### impl From> for Commit\n\n#### fn from(other: CommitRef<'_>) -> Commit\n\nConverts to this type from the input type.### impl Hash for Commit\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Commit) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Commit) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Commit\n\n#### fn partial_cmp(&self, other: &Commit) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result Result<()Serializes this instance to `out` in the git serialization format.\n\n#### fn kind(&self) -> Kind\n\nReturns the type of this object.#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\n### impl StructuralEq for Commit\n\n### impl StructuralPartialEq for Commit\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Commit\n\n### impl Send for Commit\n\n### impl Sync for Commit\n\n### impl Unpin for Commit\n\n### impl UnwindSafe for Commit\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::CommitRef\n===\n\n\n```\npub struct CommitRef<'a> {\n pub tree: &'a BStr,\n pub parents: SmallVec<[&'a BStr; 1]>,\n pub author: SignatureRef<'a>,\n pub committer: SignatureRef<'a>,\n pub encoding: Option<&'a BStr>,\n pub message: &'a BStr,\n pub extra_headers: Vec<(&'a BStr, Cow<'a, BStr>)>,\n}\n```\nA git commit parsed using `from_bytes()`.\n\nA commit encapsulates information about a point in time at which the state of the repository is recorded, usually after a change which is documented in the commit `message`.\n\nFields\n---\n\n`tree: &'a BStr`HEX hash of tree object we point to. Usually 40 bytes long.\n\nUse `tree()` to obtain a decoded version of it.\n\n`parents: SmallVec<[&'a BStr; 1]>`HEX hash of each parent commit. Empty for first commit in repository.\n\n`author: SignatureRef<'a>`Who wrote this commit. Name and email might contain whitespace and are not trimmed to ensure round-tripping.\n\nUse the `author()` method to received a trimmed version of it.\n\n`committer: SignatureRef<'a>`Who committed this commit. Name and email might contain whitespace and are not trimmed to ensure round-tripping.\n\nUse the `committer()` method to received a trimmed version of it.\n\nThis may be different from the `author` in case the author couldn’t write to the repository themselves and is commonly encountered with contributed commits.\n\n`encoding: Option<&'a BStr>`The name of the message encoding, otherwise UTF-8 should be assumed.\n\n`message: &'a BStr`The commit message documenting the change.\n\n`extra_headers: Vec<(&'a BStr, Cow<'a, BStr>)>`Extra header fields, in order of them being encountered, made accessible with the iterator returned by `extra_headers()`.\n\nImplementations\n---\n\n### impl<'a> CommitRef<'a#### pub fn message_summary(&self) -> Cow<'a, BStrReturn exactly the same message as `MessageRef::summary()`.\n\n#### pub fn message_trailers(&self) -> Trailers<'aReturn an iterator over message trailers as obtained from the last paragraph of the commit message.\nMay be empty.\n\n### impl<'a> CommitRef<'a#### pub fn from_bytes(data: &'a [u8]) -> Result, ErrorDeserialize a commit from the given `data` bytes while avoiding most allocations.\n\n#### pub fn tree(&self) -> ObjectId\n\nReturn the `tree` fields hash digest.\n\n#### pub fn parents(&self) -> impl Iterator + '_\n\nReturns an iterator of parent object ids\n\n#### pub fn extra_headers(\n &self\n) -> ExtraHeadersReturns a convenient iterator over all extra headers.\n\n#### pub fn author(&self) -> SignatureRef<'aReturn the author, with whitespace trimmed.\n\nThis is different from the `author` field which may contain whitespace.\n\n#### pub fn committer(&self) -> SignatureRef<'aReturn the committer, with whitespace trimmed.\n\nThis is different from the `committer` field which may contain whitespace.\n\n#### pub fn message(&self) -> MessageRef<'aReturns a partially parsed message from which more information can be derived.\n\n#### pub fn time(&self) -> Time\n\nReturns the time at which this commit was created.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for CommitRef<'a#### fn clone(&self) -> CommitRef<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(other: CommitRef<'_>) -> Commit\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: CommitRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> Hash for CommitRef<'a#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for CommitRef<'a#### fn partial_cmp(&self, other: &CommitRef<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### fn kind(&self) -> Kind\n\nReturns the type of this object.#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n---\n\n### impl<'a> RefUnwindSafe for CommitRef<'a### impl<'a> Send for CommitRef<'a### impl<'a> Sync for CommitRef<'a### impl<'a> Unpin for CommitRef<'a### impl<'a> UnwindSafe for CommitRef<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\n{\"Trailers<'a>\":\"

Notable traits for Trailers&lt;'a&gt;

impl&lt;'a&gt; Iterator for Trailers&lt;'a&gt; type Item = TrailerRef&lt;'a&gt;;\"}\n\nStruct git_object::CommitRefIter\n===\n\n\n```\npub struct CommitRefIter<'a> { /* private fields */ }\n```\nLike `CommitRef`, but as `Iterator` to support (up to) entirely allocation free parsing.\nIt’s particularly useful to traverse the commit graph without ever allocating arrays for parents.\n\nImplementations\n---\n\n### impl<'a> CommitRefIter<'a#### pub fn from_bytes(data: &'a [u8]) -> CommitRefIter<'aCreate a commit iterator from data.\n\n#### pub fn tree_id(&mut self) -> Result impl Iterator + 'a\n\nReturn all parent_ids as iterator.\n\nParsing errors are ignored quietly.\n\n#### pub fn signatures(self) -> impl Iterator> + 'a\n\nReturns all signatures, first the author, then the committer, if there is no decoding error.\n\nErrors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not if not exactly two signatures were iterable.\nErrors are not the common case - if an error needs to be detectable, use this instance as iterator.\n\n#### pub fn committer(self) -> Result, ErrorReturns the committer signature if there is no decoding error.\n\n#### pub fn author(self) -> Result, ErrorReturns the author signature if there is no decoding error.\n\nIt may contain white space surrounding it, and is exactly as parsed.\n\n#### pub fn message(self) -> Result<&'a BStr, ErrorReturns the message if there is no decoding error.\n\nIt may contain white space surrounding it, and is exactly as\n\nTrait Implementations\n---\n\n### impl<'a> Clone for CommitRefIter<'a#### fn clone(&self) -> CommitRefIter<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n &mut self\n) -> Result<[Self::Item; N], IntoIter>where\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_next_chunk`)Advances the iterator and returns an array containing the next `N` values. Read more1.0.0 · source#### fn size_hint(&self) -> (usize, Option)\n\nReturns the bounds on the remaining length of the iterator. Read more1.0.0 · source#### fn count(self) -> usizewhere\n Self: Sized,\n\nConsumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · source#### fn last(self) -> Optionwhere\n Self: Sized,\n\nConsumes the iterator, returning the last element. \n Self: Sized,\n\nCreates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more1.0.0 · source#### fn chain(self, other: U) -> Chain::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\nTakes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · source#### fn zip(self, other: U) -> Zip::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\n‘Zips up’ two iterators into a single iterator of pairs. \n Self: Sized,\n G: FnMut() -> Self::Item,\n\n🔬This is a nightly-only experimental API. (`iter_intersperse`)Creates a new iterator which places an item generated by `separator`\nbetween adjacent items of the original iterator. Read more1.0.0 · source#### fn map(self, f: F) -> Mapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> B,\n\nTakes a closure and creates an iterator which calls that closure on each element. Read more1.21.0 · source#### fn for_each(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),\n\nCalls a closure on each element of an iterator. Read more1.0.0 · source#### fn filter

(self, predicate: P) -> Filterwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator which uses a closure to determine if an element should be yielded. Read more1.0.0 · source#### fn filter_map(self, f: F) -> FilterMapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both filters and maps. Read more1.0.0 · source#### fn enumerate(self) -> Enumeratewhere\n Self: Sized,\n\nCreates an iterator which gives the current iteration count as well as the next value. Read more1.0.0 · source#### fn peekable(self) -> Peekablewhere\n Self: Sized,\n\nCreates an iterator which can use the `peek` and `peek_mut` methods to look at the next element of the iterator without consuming it. See their documentation for more information. Read more1.0.0 · source#### fn skip_while

(self, predicate: P) -> SkipWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that `skip`s elements based on a predicate. Read more1.0.0 · source#### fn take_while

(self, predicate: P) -> TakeWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that yields elements based on a predicate. Read more1.57.0 · source#### fn map_while(self, predicate: P) -> MapWhilewhere\n Self: Sized,\n P: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · source#### fn skip(self, n: usize) -> Skipwhere\n Self: Sized,\n\nCreates an iterator that skips the first `n` elements. Read more1.0.0 · source#### fn take(self, n: usize) -> Takewhere\n Self: Sized,\n\nCreates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. Read more1.0.0 · source#### fn scan(self, initial_state: St, f: F) -> Scanwhere\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option,\n\nAn iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. Read more1.0.0 · source#### fn flat_map(self, f: F) -> FlatMapwhere\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,\n\nCreates an iterator that works like map, but flattens nested structure. Read more1.0.0 · source#### fn fuse(self) -> Fusewhere\n Self: Sized,\n\nCreates an iterator which ends after the first `None`. Read more1.0.0 · source#### fn inspect(self, f: F) -> Inspectwhere\n Self: Sized,\n F: FnMut(&Self::Item),\n\nDoes something with each element of an iterator, passing the value on. Read more1.0.0 · source#### fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,\n\nBorrows an iterator, rather than consuming it. Read more1.0.0 · source#### fn collect(self) -> Bwhere\n B: FromIterator,\n Self: Sized,\n\nTransforms an iterator into a collection. \n E: Extend,\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_collect_into`)Collects all the items from an iterator into a collection. Read more1.0.0 · source#### fn partition(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend,\n F: FnMut(&Self::Item) -> bool,\n\nConsumes an iterator, creating two collections from it. \n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_is_partitioned`)Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return `true` precede all those that return `false`. Read more1.27.0 · source#### fn try_fold(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more1.27.0 · source#### fn try_for_each(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more1.0.0 · source#### fn fold(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,\n\nFolds every element into an accumulator by applying an operation,\nreturning the final result. Read more1.51.0 · source#### fn reduce(self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,\n\nReduces the elements to a single one, by repeatedly applying a reducing operation. \n &mut self,\n f: F\n) -> <::Residual as Residual::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`iterator_try_reduce`)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · source#### fn all(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if every element of the iterator matches a predicate. Read more1.0.0 · source#### fn any(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if any element of the iterator matches a predicate. Read more1.0.0 · source#### fn find

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nSearches for an element of an iterator that satisfies a predicate. Read more1.30.0 · source#### fn find_map(&mut self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nApplies function to the elements of iterator and returns the first non-none result. \n &mut self,\n f: F\n) -> <::Residual as Residual>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`try_find`)Applies function to the elements of iterator and returns the first true result or the first error. Read more1.0.0 · source#### fn position

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\nSearches for an element in an iterator, returning its index. Read more1.6.0 · source#### fn max_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the maximum value from the specified function. Read more1.15.0 · source#### fn max_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the maximum value with respect to the specified comparison function. Read more1.6.0 · source#### fn min_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the minimum value from the specified function. Read more1.15.0 · source#### fn min_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the minimum value with respect to the specified comparison function. Read more1.0.0 · source#### fn unzip(self) -> (FromA, FromB)where\n FromA: Default + Extend,\n FromB: Default + Extend,\n Self: Sized + Iterator,\n\nConverts an iterator of pairs into a pair of containers. Read more1.36.0 · source#### fn copied<'a, T>(self) -> Copiedwhere\n T: 'a + Copy,\n Self: Sized + Iterator,\n\nCreates an iterator which copies all of its elements. Read more1.0.0 · source#### fn cloned<'a, T>(self) -> Clonedwhere\n T: 'a + Clone,\n Self: Sized + Iterator,\n\nCreates an iterator which `clone`s all of its elements. Read more1.0.0 · source#### fn cycle(self) -> Cyclewhere\n Self: Sized + Clone,\n\nRepeats an iterator endlessly. \n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_array_chunks`)Returns an iterator over `N` elements of the iterator at a time. Read more1.11.0 · source#### fn sum(self) -> Swhere\n Self: Sized,\n S: Sum,\n\nSums the elements of an iterator. Read more1.11.0 · source#### fn product

(self) -> Pwhere\n Self: Sized,\n P: Product,\n\nIterates over the entire iterator, multiplying all the elements \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Ordering,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn partial_cmp(self, other: I) -> Optionwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nLexicographically compares the elements of this `Iterator` with those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn eq(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are equal to those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Determines if the elements of this `Iterator` are equal to those of another with respect to the specified equality function. Read more1.5.0 · source#### fn ne(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are unequal to those of another. Read more1.5.0 · source#### fn lt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less than those of another. Read more1.5.0 · source#### fn le(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less or equal to those of another. Read more1.5.0 · source#### fn gt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than those of another. Read more1.5.0 · source#### fn ge(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than or equal to those of another. \n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given comparator function. \n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given key extraction function. \n---\n\n### impl<'a> RefUnwindSafe for CommitRefIter<'a### impl<'a> Send for CommitRefIter<'a### impl<'a> Sync for CommitRefIter<'a### impl<'a> Unpin for CommitRefIter<'a### impl<'a> UnwindSafe for CommitRefIter<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl IntoIterator for Iwhere\n I: Iterator,\n\n#### type Item = ::Item\n\nThe type of the elements being iterated over.#### type IntoIter = I\n\nWhich kind of iterator are we turning this into?const: unstable · source#### fn into_iter(self) -> I\n\nCreates an iterator from a value. \n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"CommitRefIter<'a>\":\"

Notable traits for CommitRefIter&lt;'a&gt;

impl&lt;'a&gt; Iterator for CommitRefIter&lt;'a&gt; type Item = Result&lt;Token&lt;'a&gt;, Error&gt;;\"}\n\nStruct git_object::Data\n===\n\n\n```\npub struct Data<'a> {\n    pub kind: Kind,\n    pub data: &'a [u8],\n}\n```\nA borrowed object using a slice as backing buffer, or in other words a bytes buffer that knows the kind of object it represents.\n\nFields\n---\n\n`kind: Kind`kind of object\n\n`data: &'a [u8]`decoded, decompressed data, owned by a backing store.\n\nImplementations\n---\n\n### impl Data<'_#### pub fn verify_checksum(&self, desired: impl AsRef) -> Result<(), ErrorCompute the checksum of `self` and compare it with the `desired` hash.\nIf the hashes do not match, an `Error` is returned, containing the actual hash of `self`.\n\n### impl<'a> Data<'a#### pub fn new(kind: Kind, data: &'a [u8]) -> Data<'aConstructs a new data object from `kind` and `data`.\n\n#### pub fn decode(&self) -> Result, ErrorDecodes the data in the backing slice into a `ObjectRef`, allowing to access all of its data conveniently. The cost of parsing an object is negligible.\n\n**Note** that mutable, decoded objects can be created from `Data`\nusing `crate::ObjectRef::into_owned()`.\n\n#### pub fn try_into_tree_iter(self) -> OptionReturns this object as tree iterator to parse entries one at a time to avoid allocations, or\n`None` if this is not a tree object.\n\n#### pub fn try_into_commit_iter(self) -> OptionReturns this object as commit iterator to parse tokens one at a time to avoid allocations, or\n`None` if this is not a commit object.\n\n#### pub fn try_into_tag_iter(self) -> OptionReturns this object as tag iterator to parse tokens one at a time to avoid allocations, or\n`None` if this is not a tag object.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for Data<'a#### fn clone(&self) -> Data<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for Data<'a#### fn partial_cmp(&self, other: &Data<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n---\n\n### impl<'a> RefUnwindSafe for Data<'a### impl<'a> Send for Data<'a### impl<'a> Sync for Data<'a### impl<'a> Unpin for Data<'a### impl<'a> UnwindSafe for Data<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct git_object::Tag\n===\n\n\n```\npub struct Tag {\n    pub target: ObjectId,\n    pub target_kind: Kind,\n    pub name: BString,\n    pub tagger: Option,\n    pub message: BString,\n    pub pgp_signature: Option,\n}\n```\nA mutable git tag.\n\nFields\n---\n\n`target: ObjectId`The hash this tag is pointing to.\n\n`target_kind: Kind`The kind of object this tag is pointing to.\n\n`name: BString`The name of the tag, e.g. “v1.0”.\n\n`tagger: Option`The tags author.\n\n`message: BString`The message describing the tag.\n\n`pgp_signature: Option`A pgp signature over all bytes of the encoded tag, excluding the pgp signature itself.\n\nTrait Implementations\n---\n\n### impl Clone for Tag\n\n#### fn clone(&self) -> Tag\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: Tag) -> Self\n\nConverts to this type from the input type.### impl From> for Tag\n\n#### fn from(other: TagRef<'_>) -> Tag\n\nConverts to this type from the input type.### impl Hash for Tag\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Tag) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Tag) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Tag\n\n#### fn partial_cmp(&self, other: &Tag) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result Result<()Write a representation of this instance to `out`.#### fn kind(&self) -> Kind\n\nReturns the type of this object.#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\n### impl StructuralEq for Tag\n\n### impl StructuralPartialEq for Tag\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Tag\n\n### impl Send for Tag\n\n### impl Sync for Tag\n\n### impl Unpin for Tag\n\n### impl UnwindSafe for Tag\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::TagRef\n===\n\n\n```\npub struct TagRef<'a> {\n    pub target: &'a BStr,\n    pub target_kind: Kind,\n    pub name: &'a BStr,\n    pub tagger: Option>,\n    pub message: &'a BStr,\n    pub pgp_signature: Option<&'a BStr>,\n}\n```\nRepresents a git tag, commonly indicating a software release.\n\nFields\n---\n\n`target: &'a BStr`The hash in hexadecimal being the object this tag points to. Use `target()` to obtain a byte representation.\n\n`target_kind: Kind`The kind of object that `target` points to.\n\n`name: &'a BStr`The name of the tag, e.g. “v1.0”.\n\n`tagger: Option>`The author of the tag.\n\n`message: &'a BStr`The message describing this release.\n\n`pgp_signature: Option<&'a BStr>`A cryptographic signature over the entire content of the serialized tag object thus far.\n\nImplementations\n---\n\n### impl<'a> TagRef<'a#### pub fn from_bytes(data: &'a [u8]) -> Result, ErrorDeserialize a tag from `data`.\n\n#### pub fn target(&self) -> ObjectId\n\nThe object this tag points to as `Id`.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for TagRef<'a#### fn clone(&self) -> TagRef<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(other: TagRef<'_>) -> Tag\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: TagRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> Hash for TagRef<'a#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for TagRef<'a#### fn partial_cmp(&self, other: &TagRef<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\nReturns the type of this object.#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n---\n\n### impl<'a> RefUnwindSafe for TagRef<'a### impl<'a> Send for TagRef<'a### impl<'a> Sync for TagRef<'a### impl<'a> Unpin for TagRef<'a### impl<'a> UnwindSafe for TagRef<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::TagRefIter\n===\n\n\n```\npub struct TagRefIter<'a> { /* private fields */ }\n```\nLike `TagRef`, but as `Iterator` to support entirely allocation free parsing.\nIt’s particularly useful to dereference only the target chain.\n\nImplementations\n---\n\n### impl<'a> TagRefIter<'a#### pub fn from_bytes(data: &'a [u8]) -> TagRefIter<'aCreate a tag iterator from data.\n\n#### pub fn target_id(self) -> Result Result>, ErrorReturns the taggers signature if there is no decoding error, and if this field exists.\nErrors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for TagRefIter<'a#### fn clone(&self) -> TagRefIter<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n &mut self\n) -> Result<[Self::Item; N], IntoIter>where\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_next_chunk`)Advances the iterator and returns an array containing the next `N` values. Read more1.0.0 · source#### fn size_hint(&self) -> (usize, Option)\n\nReturns the bounds on the remaining length of the iterator. Read more1.0.0 · source#### fn count(self) -> usizewhere\n Self: Sized,\n\nConsumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · source#### fn last(self) -> Optionwhere\n Self: Sized,\n\nConsumes the iterator, returning the last element. \n Self: Sized,\n\nCreates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more1.0.0 · source#### fn chain(self, other: U) -> Chain::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\nTakes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · source#### fn zip(self, other: U) -> Zip::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\n‘Zips up’ two iterators into a single iterator of pairs. \n Self: Sized,\n G: FnMut() -> Self::Item,\n\n🔬This is a nightly-only experimental API. (`iter_intersperse`)Creates a new iterator which places an item generated by `separator`\nbetween adjacent items of the original iterator. Read more1.0.0 · source#### fn map(self, f: F) -> Mapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> B,\n\nTakes a closure and creates an iterator which calls that closure on each element. Read more1.21.0 · source#### fn for_each(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),\n\nCalls a closure on each element of an iterator. Read more1.0.0 · source#### fn filter

(self, predicate: P) -> Filterwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator which uses a closure to determine if an element should be yielded. Read more1.0.0 · source#### fn filter_map(self, f: F) -> FilterMapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both filters and maps. Read more1.0.0 · source#### fn enumerate(self) -> Enumeratewhere\n Self: Sized,\n\nCreates an iterator which gives the current iteration count as well as the next value. Read more1.0.0 · source#### fn peekable(self) -> Peekablewhere\n Self: Sized,\n\nCreates an iterator which can use the `peek` and `peek_mut` methods to look at the next element of the iterator without consuming it. See their documentation for more information. Read more1.0.0 · source#### fn skip_while

(self, predicate: P) -> SkipWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that `skip`s elements based on a predicate. Read more1.0.0 · source#### fn take_while

(self, predicate: P) -> TakeWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that yields elements based on a predicate. Read more1.57.0 · source#### fn map_while(self, predicate: P) -> MapWhilewhere\n Self: Sized,\n P: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · source#### fn skip(self, n: usize) -> Skipwhere\n Self: Sized,\n\nCreates an iterator that skips the first `n` elements. Read more1.0.0 · source#### fn take(self, n: usize) -> Takewhere\n Self: Sized,\n\nCreates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. Read more1.0.0 · source#### fn scan(self, initial_state: St, f: F) -> Scanwhere\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option,\n\nAn iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. Read more1.0.0 · source#### fn flat_map(self, f: F) -> FlatMapwhere\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,\n\nCreates an iterator that works like map, but flattens nested structure. Read more1.0.0 · source#### fn fuse(self) -> Fusewhere\n Self: Sized,\n\nCreates an iterator which ends after the first `None`. Read more1.0.0 · source#### fn inspect(self, f: F) -> Inspectwhere\n Self: Sized,\n F: FnMut(&Self::Item),\n\nDoes something with each element of an iterator, passing the value on. Read more1.0.0 · source#### fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,\n\nBorrows an iterator, rather than consuming it. Read more1.0.0 · source#### fn collect(self) -> Bwhere\n B: FromIterator,\n Self: Sized,\n\nTransforms an iterator into a collection. \n E: Extend,\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_collect_into`)Collects all the items from an iterator into a collection. Read more1.0.0 · source#### fn partition(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend,\n F: FnMut(&Self::Item) -> bool,\n\nConsumes an iterator, creating two collections from it. \n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_is_partitioned`)Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return `true` precede all those that return `false`. Read more1.27.0 · source#### fn try_fold(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more1.27.0 · source#### fn try_for_each(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more1.0.0 · source#### fn fold(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,\n\nFolds every element into an accumulator by applying an operation,\nreturning the final result. Read more1.51.0 · source#### fn reduce(self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,\n\nReduces the elements to a single one, by repeatedly applying a reducing operation. \n &mut self,\n f: F\n) -> <::Residual as Residual::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`iterator_try_reduce`)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · source#### fn all(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if every element of the iterator matches a predicate. Read more1.0.0 · source#### fn any(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if any element of the iterator matches a predicate. Read more1.0.0 · source#### fn find

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nSearches for an element of an iterator that satisfies a predicate. Read more1.30.0 · source#### fn find_map(&mut self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nApplies function to the elements of iterator and returns the first non-none result. \n &mut self,\n f: F\n) -> <::Residual as Residual>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`try_find`)Applies function to the elements of iterator and returns the first true result or the first error. Read more1.0.0 · source#### fn position

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\nSearches for an element in an iterator, returning its index. Read more1.6.0 · source#### fn max_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the maximum value from the specified function. Read more1.15.0 · source#### fn max_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the maximum value with respect to the specified comparison function. Read more1.6.0 · source#### fn min_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the minimum value from the specified function. Read more1.15.0 · source#### fn min_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the minimum value with respect to the specified comparison function. Read more1.0.0 · source#### fn unzip(self) -> (FromA, FromB)where\n FromA: Default + Extend,\n FromB: Default + Extend,\n Self: Sized + Iterator,\n\nConverts an iterator of pairs into a pair of containers. Read more1.36.0 · source#### fn copied<'a, T>(self) -> Copiedwhere\n T: 'a + Copy,\n Self: Sized + Iterator,\n\nCreates an iterator which copies all of its elements. Read more1.0.0 · source#### fn cloned<'a, T>(self) -> Clonedwhere\n T: 'a + Clone,\n Self: Sized + Iterator,\n\nCreates an iterator which `clone`s all of its elements. Read more1.0.0 · source#### fn cycle(self) -> Cyclewhere\n Self: Sized + Clone,\n\nRepeats an iterator endlessly. \n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_array_chunks`)Returns an iterator over `N` elements of the iterator at a time. Read more1.11.0 · source#### fn sum(self) -> Swhere\n Self: Sized,\n S: Sum,\n\nSums the elements of an iterator. Read more1.11.0 · source#### fn product

(self) -> Pwhere\n Self: Sized,\n P: Product,\n\nIterates over the entire iterator, multiplying all the elements \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Ordering,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn partial_cmp(self, other: I) -> Optionwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nLexicographically compares the elements of this `Iterator` with those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn eq(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are equal to those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Determines if the elements of this `Iterator` are equal to those of another with respect to the specified equality function. Read more1.5.0 · source#### fn ne(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are unequal to those of another. Read more1.5.0 · source#### fn lt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less than those of another. Read more1.5.0 · source#### fn le(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less or equal to those of another. Read more1.5.0 · source#### fn gt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than those of another. Read more1.5.0 · source#### fn ge(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than or equal to those of another. \n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given comparator function. \n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given key extraction function. \n---\n\n### impl<'a> RefUnwindSafe for TagRefIter<'a### impl<'a> Send for TagRefIter<'a### impl<'a> Sync for TagRefIter<'a### impl<'a> Unpin for TagRefIter<'a### impl<'a> UnwindSafe for TagRefIter<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl IntoIterator for Iwhere\n I: Iterator,\n\n#### type Item = ::Item\n\nThe type of the elements being iterated over.#### type IntoIter = I\n\nWhich kind of iterator are we turning this into?const: unstable · source#### fn into_iter(self) -> I\n\nCreates an iterator from a value. \n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"TagRefIter<'a>\":\"

Notable traits for TagRefIter&lt;'a&gt;

impl&lt;'a&gt; Iterator for TagRefIter&lt;'a&gt; type Item = Result&lt;Token&lt;'a&gt;, Error&gt;;\"}\n\nStruct git_object::Tree\n===\n\n\n```\npub struct Tree {\n    pub entries: Vec,\n}\n```\nA mutable Tree, containing other trees, blobs or commits.\n\nFields\n---\n\n`entries: Vec`The directories and files contained in this tree. They must be and remain sorted by `filename`.\n\nImplementations\n---\n\n### impl Tree\n\n#### pub fn empty() -> Self\n\nReturn an empty tree which serializes to a well-known hash\n\nTrait Implementations\n---\n\n### impl Clone for Tree\n\n#### fn clone(&self) -> Tree\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(v: Tree) -> Self\n\nConverts to this type from the input type.### impl From> for Tree\n\n#### fn from(other: TreeRef<'_>) -> Tree\n\nConverts to this type from the input type.### impl Hash for Tree\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Tree) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Tree) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Tree\n\n#### fn partial_cmp(&self, other: &Tree) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = Object\n\nThe type returned in the event of a conversion error.#### fn try_from(value: Object) -> Result Result<()Serialize this tree to `out` in the git internal format.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl Eq for Tree\n\n### impl StructuralEq for Tree\n\n### impl StructuralPartialEq for Tree\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Tree\n\n### impl Send for Tree\n\n### impl Sync for Tree\n\n### impl Unpin for Tree\n\n### impl UnwindSafe for Tree\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::TreeRef\n===\n\n\n```\npub struct TreeRef<'a> {\n    pub entries: Vec>,\n}\n```\nA directory snapshot containing files (blobs), directories (trees) and submodules (commits).\n\nFields\n---\n\n`entries: Vec>`The directories and files contained in this tree.\n\nImplementations\n---\n\n### impl<'a> TreeRef<'a#### pub fn from_bytes(data: &'a [u8]) -> Result, ErrorDeserialize a Tree from `data`.\n\n#### pub const fn empty() -> TreeRef<'staticCreate an instance of the empty tree.\n\nIt’s particularly useful as static part of a program.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for TreeRef<'a#### fn clone(&self) -> TreeRef<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(other: TreeRef<'_>) -> Tree\n\nConverts to this type from the input type.### impl<'a> From> for ObjectRef<'a#### fn from(v: TreeRef<'a>) -> Self\n\nConverts to this type from the input type.### impl<'a> Hash for TreeRef<'a#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for TreeRef<'a#### fn partial_cmp(&self, other: &TreeRef<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### fn write_to(&self, out: impl Write) -> Result<()Serialize this tree to `out` in the git internal format.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`). \n\nReturns the type of this object.#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data### impl<'a> Eq for TreeRef<'a### impl<'a> StructuralEq for TreeRef<'a### impl<'a> StructuralPartialEq for TreeRef<'aAuto Trait Implementations\n---\n\n### impl<'a> RefUnwindSafe for TreeRef<'a### impl<'a> Send for TreeRef<'a### impl<'a> Sync for TreeRef<'a### impl<'a> Unpin for TreeRef<'a### impl<'a> UnwindSafe for TreeRef<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_object::TreeRefIter\n===\n\n\n```\npub struct TreeRefIter<'a> { /* private fields */ }\n```\nA directory snapshot containing files (blobs), directories (trees) and submodules (commits), lazily evaluated.\n\nImplementations\n---\n\n### impl<'a> TreeRefIter<'a#### pub fn from_bytes(data: &'a [u8]) -> TreeRefIter<'aInstantiate an iterator from the given tree data.\n\n### impl<'a> TreeRefIter<'a#### pub fn entries(self) -> Result>, ErrorConsume self and return all parsed entries.\n\nTrait Implementations\n---\n\n### impl<'a> Clone for TreeRefIter<'a#### fn clone(&self) -> TreeRefIter<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n &mut self\n) -> Result<[Self::Item; N], IntoIter>where\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_next_chunk`)Advances the iterator and returns an array containing the next `N` values. Read more1.0.0 · source#### fn size_hint(&self) -> (usize, Option)\n\nReturns the bounds on the remaining length of the iterator. Read more1.0.0 · source#### fn count(self) -> usizewhere\n Self: Sized,\n\nConsumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · source#### fn last(self) -> Optionwhere\n Self: Sized,\n\nConsumes the iterator, returning the last element. \n Self: Sized,\n\nCreates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more1.0.0 · source#### fn chain(self, other: U) -> Chain::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\nTakes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · source#### fn zip(self, other: U) -> Zip::IntoIter>where\n Self: Sized,\n U: IntoIterator,\n\n‘Zips up’ two iterators into a single iterator of pairs. \n Self: Sized,\n G: FnMut() -> Self::Item,\n\n🔬This is a nightly-only experimental API. (`iter_intersperse`)Creates a new iterator which places an item generated by `separator`\nbetween adjacent items of the original iterator. Read more1.0.0 · source#### fn map(self, f: F) -> Mapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> B,\n\nTakes a closure and creates an iterator which calls that closure on each element. Read more1.21.0 · source#### fn for_each(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),\n\nCalls a closure on each element of an iterator. Read more1.0.0 · source#### fn filter

(self, predicate: P) -> Filterwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator which uses a closure to determine if an element should be yielded. Read more1.0.0 · source#### fn filter_map(self, f: F) -> FilterMapwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both filters and maps. Read more1.0.0 · source#### fn enumerate(self) -> Enumeratewhere\n Self: Sized,\n\nCreates an iterator which gives the current iteration count as well as the next value. Read more1.0.0 · source#### fn peekable(self) -> Peekablewhere\n Self: Sized,\n\nCreates an iterator which can use the `peek` and `peek_mut` methods to look at the next element of the iterator without consuming it. See their documentation for more information. Read more1.0.0 · source#### fn skip_while

(self, predicate: P) -> SkipWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that `skip`s elements based on a predicate. Read more1.0.0 · source#### fn take_while

(self, predicate: P) -> TakeWhilewhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that yields elements based on a predicate. Read more1.57.0 · source#### fn map_while(self, predicate: P) -> MapWhilewhere\n Self: Sized,\n P: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · source#### fn skip(self, n: usize) -> Skipwhere\n Self: Sized,\n\nCreates an iterator that skips the first `n` elements. Read more1.0.0 · source#### fn take(self, n: usize) -> Takewhere\n Self: Sized,\n\nCreates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. Read more1.0.0 · source#### fn scan(self, initial_state: St, f: F) -> Scanwhere\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option,\n\nAn iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. Read more1.0.0 · source#### fn flat_map(self, f: F) -> FlatMapwhere\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,\n\nCreates an iterator that works like map, but flattens nested structure. Read more1.0.0 · source#### fn fuse(self) -> Fusewhere\n Self: Sized,\n\nCreates an iterator which ends after the first `None`. Read more1.0.0 · source#### fn inspect(self, f: F) -> Inspectwhere\n Self: Sized,\n F: FnMut(&Self::Item),\n\nDoes something with each element of an iterator, passing the value on. Read more1.0.0 · source#### fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,\n\nBorrows an iterator, rather than consuming it. Read more1.0.0 · source#### fn collect(self) -> Bwhere\n B: FromIterator,\n Self: Sized,\n\nTransforms an iterator into a collection. \n E: Extend,\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_collect_into`)Collects all the items from an iterator into a collection. Read more1.0.0 · source#### fn partition(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend,\n F: FnMut(&Self::Item) -> bool,\n\nConsumes an iterator, creating two collections from it. \n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_is_partitioned`)Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return `true` precede all those that return `false`. Read more1.27.0 · source#### fn try_fold(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more1.27.0 · source#### fn try_for_each(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more1.0.0 · source#### fn fold(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,\n\nFolds every element into an accumulator by applying an operation,\nreturning the final result. Read more1.51.0 · source#### fn reduce(self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,\n\nReduces the elements to a single one, by repeatedly applying a reducing operation. \n &mut self,\n f: F\n) -> <::Residual as Residual::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`iterator_try_reduce`)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · source#### fn all(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if every element of the iterator matches a predicate. Read more1.0.0 · source#### fn any(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if any element of the iterator matches a predicate. Read more1.0.0 · source#### fn find

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nSearches for an element of an iterator that satisfies a predicate. Read more1.30.0 · source#### fn find_map(&mut self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nApplies function to the elements of iterator and returns the first non-none result. \n &mut self,\n f: F\n) -> <::Residual as Residual>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`try_find`)Applies function to the elements of iterator and returns the first true result or the first error. Read more1.0.0 · source#### fn position

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\nSearches for an element in an iterator, returning its index. Read more1.6.0 · source#### fn max_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the maximum value from the specified function. Read more1.15.0 · source#### fn max_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the maximum value with respect to the specified comparison function. Read more1.6.0 · source#### fn min_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the minimum value from the specified function. Read more1.15.0 · source#### fn min_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the minimum value with respect to the specified comparison function. Read more1.0.0 · source#### fn unzip(self) -> (FromA, FromB)where\n FromA: Default + Extend,\n FromB: Default + Extend,\n Self: Sized + Iterator,\n\nConverts an iterator of pairs into a pair of containers. Read more1.36.0 · source#### fn copied<'a, T>(self) -> Copiedwhere\n T: 'a + Copy,\n Self: Sized + Iterator,\n\nCreates an iterator which copies all of its elements. Read more1.0.0 · source#### fn cloned<'a, T>(self) -> Clonedwhere\n T: 'a + Clone,\n Self: Sized + Iterator,\n\nCreates an iterator which `clone`s all of its elements. Read more1.0.0 · source#### fn cycle(self) -> Cyclewhere\n Self: Sized + Clone,\n\nRepeats an iterator endlessly. \n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_array_chunks`)Returns an iterator over `N` elements of the iterator at a time. Read more1.11.0 · source#### fn sum(self) -> Swhere\n Self: Sized,\n S: Sum,\n\nSums the elements of an iterator. Read more1.11.0 · source#### fn product

(self) -> Pwhere\n Self: Sized,\n P: Product,\n\nIterates over the entire iterator, multiplying all the elements \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Ordering,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn partial_cmp(self, other: I) -> Optionwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nLexicographically compares the elements of this `Iterator` with those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn eq(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are equal to those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Determines if the elements of this `Iterator` are equal to those of another with respect to the specified equality function. Read more1.5.0 · source#### fn ne(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are unequal to those of another. Read more1.5.0 · source#### fn lt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less than those of another. Read more1.5.0 · source#### fn le(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less or equal to those of another. Read more1.5.0 · source#### fn gt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than those of another. Read more1.5.0 · source#### fn ge(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than or equal to those of another. \n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given comparator function. \n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given key extraction function. \n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> PartialOrd> for TreeRefIter<'a#### fn partial_cmp(&self, other: &TreeRefIter<'a>) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n---\n\n### impl<'a> RefUnwindSafe for TreeRefIter<'a### impl<'a> Send for TreeRefIter<'a### impl<'a> Sync for TreeRefIter<'a### impl<'a> Unpin for TreeRefIter<'a### impl<'a> UnwindSafe for TreeRefIter<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl IntoIterator for Iwhere\n I: Iterator,\n\n#### type Item = ::Item\n\nThe type of the elements being iterated over.#### type IntoIter = I\n\nWhich kind of iterator are we turning this into?const: unstable · source#### fn into_iter(self) -> I\n\nCreates an iterator from a value. \n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"TreeRefIter<'a>\":\"

Notable traits for TreeRefIter&lt;'a&gt;

impl&lt;'a&gt; Iterator for TreeRefIter&lt;'a&gt; type Item = Result&lt;EntryRef&lt;'a&gt;, Error&gt;;\"}\n\nEnum git_object::Kind\n===\n\n\n```\npub enum Kind {\n    Tree,\n    Blob,\n    Commit,\n    Tag,\n}\n```\nThe four types of objects that git differentiates. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]\n\nVariants\n---\n\n### Tree\n\n### Blob\n\n### Commit\n\n### Tag\n\nImplementations\n---\n\n### impl Kind\n\n#### pub fn from_bytes(s: &[u8]) -> Result &[u8] \n\nReturn the name of `self` for use in serialized loose git objects.\n\nTrait Implementations\n---\n\n### impl Clone for Kind\n\n#### fn clone(&self) -> Kind\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Kind) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Kind) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Kind\n\n#### fn partial_cmp(&self, other: &Kind) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n### impl Eq for Kind\n\n### impl StructuralEq for Kind\n\n### impl StructuralPartialEq for Kind\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Kind\n\n### impl Send for Kind\n\n### impl Sync for Kind\n\n### impl Unpin for Kind\n\n### impl UnwindSafe for Kind\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\n{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]impl Write for &amp;mut [u8]\"}\n\nTrait git_object::WriteTo\n===\n\n\n```\npub trait WriteTo {\n    // Required methods\n    fn write_to(&self, out: impl Write) -> Result<()>;\n    fn kind(&self) -> Kind;\n    fn size(&self) -> usize;\n\n    // Provided method\n    fn loose_header(&self) -> SmallVec<[u8; 28]> { ... }\n}\n```\nWriting of objects to a `Write` implementation\n\nRequired Methods\n---\n\n#### fn write_to(&self, out: impl Write) -> Result<()Write a representation of this instance to `out`.\n\n#### fn kind(&self) -> Kind\n\nReturns the type of this object.\n\n#### fn size(&self) -> usize\n\nReturns the size of this object’s representation (the amount of data which would be written by `write_to`).\n\n`size`’s value has no bearing on the validity of the object, as such it’s possible for `size` to return a sensible value but `write_to` to fail because the object was not actually valid in some way.\n\nProvided Methods\n---\n\n#### fn loose_header(&self) -> SmallVec<[u8; 28]Returns a loose object header based on the object’s data\n\nImplementations on Foreign Types\n---\n\n### impl WriteTo for &Twhere\n T: WriteTo,\n\n#### fn write_to(&self, out: impl Write) -> Result<()#### fn size(&self) -> usize\n\n#### fn kind(&self) -> Kind\n\nImplementors\n---\n\n### impl WriteTo for Object\n\nSerialization\n\n### impl WriteTo for Blob\n\n### impl WriteTo for Commit\n\n### impl WriteTo for Tag\n\n### impl WriteTo for Tree\n\nSerialization\n\n### impl<'a> WriteTo for ObjectRef<'aSerialization\n\n### impl<'a> WriteTo for BlobRef<'a### impl<'a> WriteTo for CommitRef<'a### impl<'a> WriteTo for TagRef<'a### impl<'a> WriteTo for TreeRef<'aSerialization"}}},{"rowIdx":447,"cells":{"project":{"kind":"string","value":"esparta_github_io_gitimmersion-spanish"},"source":{"kind":"string","value":"free_programming_book"},"language":{"kind":"string","value":"Unknown"},"content":{"kind":"string","value":"* Configurar git para tenerlo listo para trabajar.\n\n## Configurar Nombre y Correo Electrónico01\n\nSi no ha usado git antes, necesita configurarlo primero. Ejecute los siguientes comandos para que git conozca su nombre y correo electrónico. Si ya tenía configurado git, puede saltarse esta sección.\n\n > git config --global user.name \"\"\n > git config --global user.email \"\"\n\n## Configure las preferencias de fin de línea 02\n\nPara usuarios de Unix/Mac:\n\nPara usuarios de Windows:\n\n* Obtener el material de configuración y estar listos para iniciar.\n\n## Obtener el paquete del Tutorial. 01\n\nObtenga los paquetes del tutorial desde:\n\n* La memorias provistas en este tutorial.\n * La URL del tutorial original http://gitimmersion.com/git_tutorial.zip\n * Clone este tutorial desde https://github.com/esparta/gitimmersion-spanish\n\n## Contenido del tutorial 02\n\nEl paquete contiene un directorio principal “git_tutorial” con tres subdirectorios:\n\n* html — Estos archivos en formato HTML. Apunte su navegador a html/index.html para comenzar a leer offline.\n * work — Un directorio vacío. Cree sus repos aquí.\n * repos — Repositorios Git pre-empacados con los que puede llevar el tutorial en cualquier punto. De llegar a bloquearse, sólo copie el laboratorio deseado en su directorio de trabajo.\n\n* Aprender a crear un repositorio git desde cero.\n\n## Crear un programa “Hola, Mundo” 01\n\n Haga un directorio vacío llamado “hello”, después cree un archivo llamado `hello.rb` con el siguiente contenido. \n\n > mkdir hello\n > cd hello\n\n > puts \"Hello, World\"\n\n## Crear el Repositorio 02\n\nYa tiene un directorio con un archivo. Para crear el repositorio git a partir de este directorio, ejecute el comando git init.\n\n > git init\n\n > $ git init Initialized empty Git repository in /Users/jerrynummi/Projects/edgecase/git_immersion/auto/hello/.git/\n\n## Agregue el programa al repositorio 03\n\nAhora vamos a agregar el programa “Hola, Mundo” al repositorio.\n\n > git add hello.rb\n > git commit -m \"First Commit\"\n\n > $ git add hello.rb $ git commit -m \"First Commit\" [master (root-commit) 3cbf83b] First Commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 hello.rb\n\n* Aprender a revisar el estatus del repositorio.\n\n## Revisar el estatus de el repositorio 01\n\n Use el comando `git status` para revisar el estatus actual del repositorio. \n\nDebería ver\n\nEl comando de status reporta que no hay nada por hacer commit. Esto significa que el repositorio tiene el mismo estado actual que el directorio de trabajo. No hay cambios pendientes de grabar.\n Usaremos el comando `git status` para continuar monitoreando el estado entre el repositorio y el directorio de trabajo.\n\n* Aprender a monitorear el estado del directorio de trabajo.\n\n## Cambie el programa “Hola, Mundo”. 01\n\nEs tiempo de cambiar nuestro programa hello para tomar un argumento desde la línea de comando. Cambie el archivo para que sea:\n\n > puts \"Hello, #{ARGV.first}!\"\n\n > $ git status # On branch master # Changes not staged for commit: # (use \"git add ...\" to update what will be committed) # (use \"git checkout -- ...\" to discard changes in working directory) # # modified: hello.rb # no changes added to commit (use \"git add\" and/or \"git commit -a\")\n La primera cosa a notar es que git sabe que el archivo `hello.rb` ha sido modificado, pero git no ha sido notificado de esos cambios. También note que el mensaje de estatus le proporciona algunos consejos sobre lo que debería hacer a continuación. Si desea agregar estos cambios al repositorio, entonces use el comando `git add` . Mientras tanto, el comando  `git checkout` puede ser usado para descartar los cambios. \n\nPoner en Stage el cambio.\n\n* Aprender cómo poner en Stage cambios para un posterior Commit.\n\n## Agregar cambios 01\n\nDecirle a git que ponga en Stage los cambios. Revisar el estatus.\n\n > git add hello.rb\n > git status\n\n > $ git add hello.rb $ git status # On branch master # Changes to be committed: # (use \"git reset HEAD ...\" to unstage) # # modified: hello.rb #\n El cambio al archivo `hello.rb` se ha puesto en Stage. Esto significa que git ahora tiene conocimiento del cambio, pero todavía no ha sido guardado permanentemente en el repositorio. La siguiente operación de Commit incluirá los cambios en Stage. Si al final decide que no quiere realizar el Commit de los cambios, el comando de estatus le recordará que el commando `git reset` puede ser usado para quitarlo de Stage.\n\nUn paso separado del concepto de Staging está alineado con la filosofía de \"salirse del camino\" hasta que se necesite hacer frente al control de código fuente. Puede continuar haciendo cambios en su directorio de trabajo, y entonces, en el punto en que quiera interactuar con el control de código fuente, git le permitirá grabar los cambios en pequeños Commits que reproducirán exactamente lo que hizo.\n Por ejemplo, suponga que quiere editar tres archivos: `a.rb` ,  `b.rb` , and  `c.rb` . Ahora desea hacer Commit de todos los cambios, pero desea que los cambios en  `a.rb` y  `b.rb` estén en un Commit, mientras que los cambios de  `c.rb` no están relacionados lógicamente con los primeros dos archivos y debería estar en un Commit separado. \nPuede realizar lo siguiente:\n > git add a.rb\n > git add b.rb\n > git commit -m \"Changes for a and b\"\n > git add c.rb\n > git commit -m \"Unrelated change to c\"\n\nSeparando los Staging y Commits le dará la habilidad de afinar con precisión qué pasó en cada Commit.\n\n* Aprender a hacer Commit a los cambios en el repositorio.\n\n## Haga Commit a los cambios 01\n\nOk, suficiente de Staging. Hagamos Commit a lo que hemos tenido en Stage al repositorio.\n Cuando usa el comando `git commit` previamente para confirmar la versión inicial del archivo  `hello.rb` en el repositorio, puede incluir la opción  `-m` que establece un comentario desde la línea de comando. El comando Commit permitirá comentar interactivamente la edición del comentario del Commit. Intentaremos esto ahora mismo. Si omite la opción `-m` en la línea de comando, git lanzará el editor de su preferencia. El editor es escogido de la siguiente lista (en orden de prioridad): \n\n* La variable de ambiente GIT_EDITOR\n * El ajuste en la configuración de core.editor\n * La variable de ambiente VISUAL\n * La variable de ambiente EDITOR\n Yo tengo la variable EDITOR establecida a `emacsclient` . \nHaga un Commit y revise el estatus.\n\n > git commit\n\nDeberá ver lo siguiente en su editor:\n\n > | # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use \"git reset HEAD ...\" to unstage) # # modified: hello.rb #\n\nEn la primera línea, escriba el comentario: “Using ARGV”. Guarde el archivo y salga del editor. Deberá ver …\n\n > git commit Waiting for Emacs... [master 569aa96] Using ARGV 1 files changed, 1 insertions(+), 1 deletions(-)\n La línea “Waiting for Emacs…” es del programa `emacsclient` quien envía el archivo a un programa de emacs y espera que el se cierre el archivo. El resto de la salida es el mensaje estándar del Commit. \n\n## Revise el estatus 02\n\nFinalmente vamos a revisar de nuevo el estatus.\n\nEl directorio de trabajo está limpio y listo para continuar.\n\n* Aprender que git trabaja con cambios, no con archivos.\n\nMuchos sistemas de control de versiones trabajan con archivos. Se agrega un archivo al control de versiones y el sistema rastreará los cambios al archivo al que apunta.\n Git se enfoca en los cambios al archivo en vez del archivo mismo. Cuando escribe `git add file` , no le está diciendo a git que agregue el archivo al repositorio. En vez de eso, se le dice a git que debería notar el estado actual de ese archivo al que se le hará un Commit después. \nIntentaremos explorar esta diferencia en este laboratorio.\n\n## Primer cambio: Permitir un nombre por defecto 01\n\nCambie el programa “” para tener un valor por defecto si no se proporciona el argumento en la línea de comando.\n\n > name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\n## Agregue este cambio 02\n\nAhora agregue este cambio al área de Staging de git.\n\n## Segundo cambio: Agregue un comentario 03\n\nAhora agregue un comentario al programa “”.\n\n## Revise el estatus actual 04\n\n > $ git status # On branch master # Changes to be committed: # (use \"git reset HEAD ...\" to unstage) # # modified: hello.rb # # Changes not staged for commit: # (use \"git add ...\" to update what will be committed) # (use \"git checkout -- ...\" to discard changes in working directory) # # modified: hello.rb #\n Observe cómo se lista `hello.rb` dos veces en el estatus. El primer cambio (agregando un valor por defecto) está en Stage y listo para el Commit. El segundo cambio (agregando un comentario) no está en Stage. Si realizara el Commit ahora mismo, el comentario no será almacenado en el repositorio. \nIntentemos eso.\n\n## Realizando Committ 05\n\nConfirme el cambio en el área de Stage (el valor por defecto),y revise de nuevo es estatus.\n\n > git commit -m \"Added a default value\"\n > git status\n\n > $ git commit -m \"Added a default value\" [master 1b754e9] Added a default value 1 files changed, 3 insertions(+), 1 deletions(-) $ git status # On branch master # Changes not staged for commit: # (use \"git add ...\" to update what will be committed) # (use \"git checkout -- ...\" to discard changes in working directory) # # modified: hello.rb # no changes added to commit (use \"git add\" and/or \"git commit -a\")\n El comando estatus nos dice que `hello.rb` tiene cambios no guardados, pero ya no está en el área de Staging. \n\n## Agregue el segundo cambio 06\n\nAhora agregue el segundo cambio al área de Staging, después ejecute git status.\n\n > git add .\n > git status\n\nNota: Usamos el directorio actual (‘.’) como el archivo a agregar. Esto es un atajo realmente conveniente para agregar todos los cambios en los archivos en el directorio actual. Pero como esto agrega todo, es una realmente buena idea revisar el estatus antes de realizar un \"add .\", sólo para asegurarse de no agregar archivos que no tenía intenciones de agregar.\n\nDeseaba repasar el truco de “add .” , pero continuaré agregando archivos explícitamente en el resto del tutorial sólo para estar seguros.\n\nAhora el segundo cambio está en el Stage y listo para el Commit.\n\n## Commit del segundo cambio 07\n\n > git commit -m \"Added a comment\"\n\n* Aprender a ver el historial de un proyecto.\n La función del comando `git log` es obtener el listado de qué cambios se han realizado. \n\n > $ git log commit 40543214b69016a1f079a0d95ff88cc7421e9b54 Author:   Date: Tue Mar 6 16:12:08 2012 -0500 Added a comment commit 1b754e9e5d528ed7a7d82c3b380fa2b2faa3ce00 Author:   Date: Tue Mar 6 16:12:08 2012 -0500 Added a default value commit 30534911b25d1fab76d13d269ff6215b4c4acddd Author:   Date: Tue Mar 6 16:12:08 2012 -0500 Using ARGV commit 3cbf83b6899697985d2b4fcfae9b254ab6d0ddf7 Author:   Date: Tue Mar 6 16:12:07 2012 -0500 First Commit\n\nÉsta es la lista de los cuatro cambios que hemos hecho en el repositorio hasta ahora.\n\n## Historias en una línea 01\n\n Se tiene un gran reto de controlar exactamente qué despliega el comando `log` .  En lo personal, me gusta en formato de una sola línea: \n\n > $ git log --pretty=oneline 40543214b69016a1f079a0d95ff88cc7421e9b54 Added a comment 1b754e9e5d528ed7a7d82c3b380fa2b2faa3ce00 Added a default value 30534911b25d1fab76d13d269ff6215b4c4acddd Using ARGV 3cbf83b6899697985d2b4fcfae9b254ab6d0ddf7 First Commit\n\n## Controlando cuáles entradas se muestran 02\n\nExisten muchas opciones para seleccionar cuántas entradas se muestran en el log. Juegue con alguna de las siguientes opciones:\n > git log --pretty=oneline --max-count=2\n > git log --pretty=oneline --since='5 minutes ago'\n > git log --pretty=oneline --until='5 minutes ago'\n > git log --pretty=oneline --author=\n > git log --pretty=oneline --all\n\nVea man git-log para todos los detalles.\n\n## Embelleciéndolo 03\n\n Aquí está lo que uso para revisar los cambios hechos en la última semana. Agregaría `--author=jim` si sólo quisiera ver los cambios que yo he hecho.. > git log --all --pretty=format:\"%h %cd %s (%an)\" --since='7 days ago'\n\n## Lo último en formatos de Log 04\n\nConforme pase el tiempo, he decidido que me gusta el siguiente formato para el log en la mayoría de mis trabajos.\n\n > git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short\n\nSe vería así:\n\n > $ git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short * 4054321 2012-03-06 | Added a comment (HEAD, master) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n\nMirémoslo a detalle:\n\n* \n `--pretty=\"...\"` define el formato de la salida. * \n `%h` es el hash abreviado del Commit * \n `%d` son algunos decorados en el Commit (por ejemplo, la cabecera del branch heads o los tags) * \n `%ad` es la fecha en que se realizó * \n `%s` el comentario * \n `%an` el nombre del autor * \n `--graph` informa a git que despliegue el arbol de Commit en un layout gráfico en código ASCII * \n `--date=short` mantiene la fecha en formato bonito y corto \nEsto es mucho como para escribir en cada ocasión que desee ver el log. Afortunadamente aprenderemos sobre los alias en git en el próximo laboratorio.\n\n## Otra herramientas 05\n\n Tanto `gitx` (para Macs) y  `gitk` (cualquier plataforma) son útiles para explorar el historial.\n\n### Goals\n\n* Aprender a configurar alias y atajos para los comandos de git.\n\n## Alias Comunes 01\n\n, , , y son algunos comandos comunes a los cuales es útil tenerle abreviaciones.\n\nAgregue los siguientes al archivo .gitconfig localizado en su directorio $HOME .\n\n# Archivo: $HOME/.gitconfig\n\n > [alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:\\\"%h %ad | %s%d [%an]\\\" --graph --date=short type = cat-file -t dump = cat-file -p\n Ya hemos revisado con anterioridad checkout, commit y status. En el laboratorio previo acabamos de cubrir el comando `log` . Una vez modificado el archivo .gitconfig podrá escribir  `git co` donde solía escribir  `git checkout` .  Lo mismo sucede con  `git st` para  `git status` y  `git ci` para  `git commit` .  El mejor de ellos es  `git hist` , que permitirá evitar el realmente largo comando  `log` visto con anterioridad. \nContinúe e intente estos nuevos comandos.\n\n## Definir el alias\n\n `hist` en su archivo  `.gitconfig` 02 Para la mayor parte de este tutorial, continuaré escribiendo los comandos completos en las instrucciones. La única excepción será el uso del alias `hist` definido anteriormente, en cualquier momento en que necesitemos ver la salida del comando. Asegurese de tener el alias  `hist` configurado en su archivo  `.gitconfig` antes de continuar. \n\n## \n\n `Escribir` y  `Volcar` 03 Hemos agregado unos cuantos alias para comandos que aún no hemos revisamos. El coamdndo `git branch` será visto pronto. Por su parte, el comando  `git cat-file` será util explorando git, como veremos dentro de poco. \n\n## Alias de Shell (Opcional) 04\n\nNota: Esta sección es para los que están ejecutando un shell parecido a posix. Lo usuarios de Windows y otros usuarios con shell no-posix pueden sentirse libres de omitir el siguiente laboratorio.\n\nSi su shell soporta alias y atajos, entonces puede agregar alias en este nivel también. Aquí están los que yo uso:\n\n# Archivo: .profile\n\n > alias gs='git status ' alias ga='git add ' alias gb='git branch ' alias gc='git commit' alias gd='git diff' alias go='git checkout ' alias gk='gitk --all&' alias gx='gitx --all' alias got='git ' alias get='git '\n La abreviatura `go` para  `git checkout` es particularmente buena, ya que permite escribir: > go  git hist\n Nota: ¿No olvidó definir el alias `hist` en su archivo  `.gitconfig` , verdad?  De lo contrario, revise el laboratorio de Alias. \n\n > $ git hist * 4054321 2012-03-06 | Added a comment (HEAD, master) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n Examine la salida del log output y busque el hash de el primer Commit. Debe ser la última línea de la salida de `git hist` . Use el último código hash (con los primeros 7 caracteres será suficiente) en el comando a continuación. Después revise el contenido del archivo hello.rb . \n\n > git checkout \n > cat hello.rb\n\nNota: Los comandos dados son comandos Unix y sirven de igual forma tanto en equipos Mac y Linux. Desafortunadamente, los usuarios de Windows tendrán que trasladarlo a sus comandos nativos.\n\nNota: Muchos comandos dependen del valor del hash en el repositorio. Debido a que los valores hash serán diferentes a los míos, donde sea que vea algo como  o  en la línea de comandos, sustituyalo por el hash correspondiente en su repositorio.\n\n > $ git checkout 3cbf83b Note: checking out '3cbf83b'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 3cbf83b... First Commit $ cat hello.rb puts \"Hello, World\"\n La salida del comando `checkout` explica la situación bastante bien. Las versiones antiguas de git se quejarán de no estar en el branch local. En cualquier caso, no se preocupe sobre eso por ahora. \nObserve que el contenido del archivo hello.rb es el contenido original.\n\n## Regrese a la última versión en el branch master 02\n\n > git checkout master\n > cat hello.rb\n\n > $ git checkout master Previous HEAD position was 3cbf83b... First Commit Switched to branch 'master' $ cat hello.rb # Default is \"World\" name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\n‘master’ es el nombre del branch actual. Al hacer checking out por nombre, se toma la última versión del branch.\n\n### metas\n\n* Aprender a etiquetar Commits con nombres para futuras referencias.\n\nLlamemos a la versión actual de el programa \"version 1 (v1)\".\n\n## Etiquetar version 1 01\n\nAhora puede referirse a la versión actual del programa como v1.\n\n## Etiquetar versiones previas 02\n\n Etiquetemos la versión anterior a la actual como version v1-beta. Primero necesitamos hacer un checkout en la versión anterior. En vez de buscar el hash, usaremos la notación `^` para indicar “el padre de v1”. Nota: Si la notación `v1` ^ le da algún problema, puede tambien intentar con  `v1~1` , lo cuál referencia a la misma versión. Esta notación significa “el primer antecesor de v1”. \n\n > git checkout v1^\n > cat hello.rb\n\n > $ git checkout v1^ Note: checking out 'v1^'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 1b754e9... Added a default value $ cat hello.rb name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\nComo puede observar, esta es la versión con el valor por defecto antes de que agregaramos el comentario. Hagamos esta versión v1-beta.\n\n > git tag v1-beta\n\n## Checking Out usando etiquetas 03\n\nAhora intente ir hacia tras y hacia adelante entre las dos versiones etiquetadas.\n\n > git checkout v1\n > git checkout v1-beta\n\n > $ git checkout v1 Previous HEAD position was 1b754e9... Added a default value HEAD is now at 4054321... Added a comment $ git checkout v1-beta Previous HEAD position was 4054321... Added a comment HEAD is now at 1b754e9... Added a default value\n\n## Viendo las etiquetas usando el comando\n\n `tag` 04 Puede ver qué etiquetas están disponibles usando el comando `git tag` command. \n\n > $ git tag v1 v1-beta\n\n## Viendo etiquetas en los Logs 05\n\nTambién puede revisar las etiquetas en el log.\n\n > git hist master --all\n\n > $ git hist master --all * 4054321 2012-03-06 | Added a comment (v1, master) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value (HEAD, v1-beta) [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n Podrá observar ambas etiquetas ( `v1` y  `v1-beta` ) enlistadas en la salida del comando log output, a un lado del nombre del branch (  `master` ).  También observe que  `HEAD` denota la versión actual en el check out (la cual es  `v1-beta` al momento).\n\n# lab 14 Deshacer Cambios Locales (antes de staging)\n\n# lab 14 Deshacer Cambios Locales\n\n(antes de staging) \n\n* Aprender a revertir cambios en el directorio de trabajo.\n\n## Hacer Checkout en Master 01\n\nAsegúrese que está en el último Commit en la rama Master antes de proceder.\n\n## Cambie hello.rb 02\n\nAlgunas veces tiene que modificar un archivo en su directorio local y desea revertir lo que ya se le ha hecho Commit. El comando checkout se encargará de eso.\n\nCambie hello.rb para tener un mal comentario.\n\n > # This is a bad comment. We want to revert it. name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\n## Revise el estatus 03\n\n > $ git status # On branch master # Changes not staged for commit: # (use \"git add ...\" to update what will be committed) # (use \"git checkout -- ...\" to discard changes in working directory) # # modified: hello.rb # no changes added to commit (use \"git add\" and/or \"git commit -a\")\n Vemos que el archivo `hello.rb` ha sido modificado, pero no está en el Stage aún. \n\n## Revierta los cambios en el directorio de trabajo 04\n\n Use el comando `checkout` para realizar un checkout de la versión del repositorio del archivo  `hello.rb` . \n\n > git checkout hello.rb\n > git status\n > cat hello.rb\n\n > $ git checkout hello.rb $ git status # On branch master nothing to commit (working directory clean) $ cat hello.rb # Default is \"World\" name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\nEl comando status nos muestra que no hay otros cambios en el directorio de trabajo, y el “mal comentario” ya no forma parte del contenido del archivo.\n\n# lab 15 Deshacer Cambios en Stage (antes de commit)\n\n# lab 15 Deshacer Cambios en Stage\n\n(antes de commit) \n\n* Aprender cómo revertir los cambios que están en área de Stage.\n\n## Cambiar el archivo y poner en Stage el cambio 01\n\n Modificar el archivo `hello.rb` para tener un mal comentario. \n\n > # This is an unwanted but staged comment name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\nY entonces, lo ponemos en Stage.\n\nRevisar el estatus de los cambios no deseados.\n\nLa salida de status muestra que el cambio se ha enviado a Stage y está listo para realizar Commit.\n\n## Restablecer el área de Staging 03\n\nAfortunadamente la salida del comando status nos dice exactamente lo que necesitamos hacer para sacar de Staging el cambio.\n\n > git reset HEAD hello.rb\n\n > $ git reset HEAD hello.rb Unstaged changes after reset: M hello.rb\n El comando `reset` revierte el área de Staging para establecerlo en lo que esté en HEAD. Esto limpia el área de Staging del cambio que habíamos hecho. El comando `reset` (por defecto) no cambia el directorio de trabajo. Así que el directorio de trabajo aún tiene el comentario no deseado en él. Podemos usar el comando  `checkout` visto en el laboratorio previo para quitar el cambio del directorio de trabajo. \n\n## Realizar Checkout 04\n\n > git checkout hello.rb\n > git status\n\nCon esto, nuestro directorio de trabajo está limpio una vez más.\n\n* Aprender a revertir los cambios que se enviaron a Commit en un repositorio local.\n\n## Deshacer Commits 01\n\nAlgunas veces se da cuenta que el cambio que ya está confirmado era incorrecto y desea deshacer ese Commit. Hay varias formas de manejar este asunto, y la manera en que vamos a usar en este laboratorio siempre es segura.\n\nEsencialmente desharemos el Commit al crear un nuevo Commit que retorne el cambio no deseado.\n\n## Cambie el archivo y haga el Commit. 02\n\n Cambie el archivo `hello.rb` con lo siguiente. \n\n > # This is an unwanted but committed change name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\n > git add hello.rb\n > git commit -m \"Oops, we didn't want this commit\"\n\n## Crear y Revertir Commit 03\n\nPara deshacer el cambio confirmado, necesitamos generar un commit que quite los cambios introducidos en nuestro Commit no deseado.\n\n > git revert HEAD\n\nEsto hará aparecer el editor. Puede editar el mensaje por defecto del Commit o dejarlo como está. Guarde y cierre el archivo. Debería ver …\n\n > $ git revert HEAD --no-edit [master 9ad227a] Revert \"Oops, we didn't want this commit\" 1 files changed, 1 insertions(+), 1 deletions(-)\n Debido a que estamos deshaciendo el último Commit que hicimos, podemos usar `HEAD` como el argumento a revertir. Podemos revertir arbitrariamente cualquier Commit en el historial simplemente al especificar su hash. Nota: El parámetro `--no-edit` en la salida puede ser ignorado. Esto es necesario para generar la salida sin abrir el editor. \n\n## Revise el log 04\n\nAl revisar el log nos muestra ambos Commit, el no deseado y el Commit paa revertir los cambios en nuestro repositorio.\n\nEsta técnica funcionará con cualquier commit (aunque puede que tenga que resolver conflictos). Es seguro de usar aún en ramas que están públicamente compartirdas en repositorios remotos.\n\n## A Continuación 05\n\nComo siguiente paso, veremos una técnica que puede ser usada para quitar los Commits más recientes del repositorio público.\n\n* Aprender a quitar los Commits más recientes de una ramificación.\n El comando `revert` de la sección previa es un poderoso comando que nos permite deshacer los efectos de cualquier Commit en el repositorio. Sin embrgo, ambos, el Commit original y el Commit “deshecho” están invisibles en el historial de la ramificación (usando el commando  `git log` . Frecuentemente hacemos un Commit e inmediatamente nos damos cuenta que fue un error. Sería bueno tener un comando “recuperador” que nos permitiera hacer de cuenta que ese commit nunca sucedió. El comando “recuperador” incluso prevendría que el Commit defectuoso se mostrara en el historial que arroja `git log` . Sería como el Commit defectuoso nunca hubera sucedido. \n\n## El comando\n\n `reset` 01 Ya hemos visto el comando `reset` y lo hemos usado para establecer el área de Staging para que fuera consistente con un Commit en especial (usamos el Commit HEAD en nuestro anterior lab). Cuando se realiza un Commit referenciado (por ejemplo, un hash, una ramificación o nombre de etiqueta), el comando `reset` realizará lo siguiente … \n\n* Reescribir la ramificación actual y apuntarlo a un Commit en específico\n * Opcionalmente reestablecer el área de Staging para coincidir con el Commit especificado\n * Opcionalmente reestablecer el directorio de trabajo para coincidir con el Commit especificado\n\n## Revisar nuestro historial 02\n\nHagamos una revisión rápida de nuestro historial de Commits.\n\nVemos que tenemos un Commit “Oops” y “Revert Oops” en los últimos dos Commits hechos en esta ramificación. Vamos a quitarlos usando reset.\n\n## Primero, marquemos esta Ramificación 03\n\nPero antes de quitar los Commits, marquemos el último Commit con una etiqueta, así podremos buscarlo de nuevo.\n\n > git tag oops\n\n## Reestablecer el repositorio a como se encontraba antes de Oops 04\n\nAl ver el historial (arriba), podemos ver que el Commit etiquetado como ‘v1’ es el que se encuentra justo antes del mal comentario. Reestablezcamos el branch a ese punto. Debido a que el Branch está etiquetado , podemos usar el nombre de la etiqueta en el comando reset (si no fue etiquetado, podemos usar su hash).\n\n > git reset --hard v1\n > git hist\n\n > $ git reset --hard v1 HEAD is now at 4054321 Added a comment $ git hist * 4054321 2012-03-06 | Added a comment (HEAD, v1, master) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value (v1-beta) [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n Nuestro branch principal ahora apunta al Commit v1 y el commit \"Oops\" y \"Revert Oops commit\" no están más en la rama. El parámetro `--hard` indica que el directorio de trabajo debe ser actualizado para ser consistente con la nueva cabeza del branch. \n\n## Nada se Pierde 05\n\nPero ¿qué les pasó a los malos Commits? Resulta que esos Commits están aún en el repositorio. De hecho, aún podemos referenciarlos. Recuerda que al inicio de este lab etiquetamos el Commit con “oops”. Veamos en todos los Commits.\n\nAquí vemos que los malos Commits no han desaparecido, aún están en el repository. Lo que sucede es que sólo no están listados en el branch principal. Si no los hemos etiquetado, seguirían aún en el repositorio, pero no habría forma de referenciarlos más que usando los valores de hash. Los Commits que no tienen referencia quedan en el repositorio hasta que el sistema ejecuta el software de recolección de basura.\n\n## Peligros del Reset 06\n\nLos Resets en ramificaciones locales son generalmente seguros. Cualquier accidente puede ser recuperado con sólo reestablecerlo al Commit deseado.\n\nSin embargo, si la ramificación está compartido en repositorios remotos, puede confundir a otros usuarios que comparten el branch.\n\n* Quitar la etiqueta \"oops\" (limpeza interna)\n\n## Quitando etiqueta \"oops\" 01\n\nLa etiqueta \"oops\" ha servido para el propósito. Vamos a quitarla y permitir que los Commits a los que hace referencia sean manejados por el recolector de basura.\n\n > git tag -d oops\n > git hist --all\n\n > $ git tag -d oops Deleted tag 'oops' (was 9ad227a) $ git hist --all * 4054321 2012-03-06 | Added a comment (HEAD, v1, master) [] * 1b754e9 2012-03-06 | Added a default value (v1-beta) [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n\nLa etiqueta \"oops\" ya no se encuentra listada en el repositorio.\n\n* Aprender a enmendar un Commit existente\n\n## Cambie el programa, luego haga Commit 01\n\nAgregue un comentario con el nombre del autor.\n\n > git add hello.rb\n > git commit -m \"Add an author comment\"\n\n## Oops, debimos poner también el Email 02\n\nDespués de hacer el Commit, se dió cuenta que debió incluir el correo electrónico. Actualice el programa hello para incluirlo\n\n## Enmiende el anterior Commit 03\n\nRealmente no queremos un Commit por separado sólo para el email. Vamos a enmendar el anterior Commit para incluir el cambio con la introducción del correo electrónico.\n\n > git add hello.rb\n > git commit --amend -m \"Add an author/email comment\"\n\n > $ git add hello.rb $ git commit --amend -m \"Add an author/email comment\" [master 9c78ad8] Add an author/email comment 1 files changed, 2 insertions(+), 1 deletions(-)\n\n## Revise el Historial 04\n\nPodemos ver que Commit original con sólo el autor ha desaparecido, y es remplazado con el Commit de “autor/email”. Puede alcanzar el mismo efecto reestableciendo el branch al Commit anterior y reenviando el Commit con los nuevos cambios.\n\n* Aprender a mover archivos en el repositorio.\n\n## Mover el archivo hello.rb al directorio lib. 01\n\nVamos a construir la estructura de nuestro repositorio, empezaremos moviendo el programa hello al directorio lib.\n\n > mkdir lib\n > git mv hello.rb lib\n > git status\n\n > $ mkdir lib $ git mv hello.rb lib $ git status # On branch master # Changes to be committed: # (use \"git reset HEAD ...\" to unstage) # # renamed: hello.rb -> lib/hello.rb #\n\nAl usar git para hacer el movimiento, informamos a git de dos cosas:\n\n* Que el archivo\n `hello.rb` ha sido borrado. * Que el archivo\n `lib/hello.rb` ha sido creado. \nEstos bits de información son inmediatamente enviados al área de Stage y están listos para hacer Commit. El comando git status reporta que el archivo ha sido movido.\n\n## Otra manera de mover archivos 02\n\nUna de las cosas bonitas de git es que puede olvidarse del control de versiones hasta el punto en que esté listo de realizar confirmaciones vía Commit. ¿Qué hubiera pasado si usamos los comandos del sistemas operativos para mover el archivo en vez del comando de git?\n\nResulta que el siguiente conjunto de comandos es idéntico a lo que acabamos de hacer. Es un poco de más trabajo, pero el resultado es el mismo.\n\nPudimos haber hecho:\n > mkdir lib\n > mv hello.rb lib\n > git add lib/hello.rb\n > git rm hello.rb\n\n## Realizar Commit del nuevo directorio 03\n\nVamos a hacer el Commit de lo anterior.\n\n > git commit -m \"Moved hello.rb to lib\"\n\n* Agregar otro archivo a nuestro repositorio.\n\n## Ahora agregaremos un Rakefile 01\n\nVamos a agregar un Rakefile a nuestro repositorio. El siguiente archivo lo hará correctamente.\n\n > #!/usr/bin/ruby -wKU task :default => :run task :run do require './lib/hello' end\n\nAgregar y realizar Commit de los cambios.\n\n > git add Rakefile\n > git commit -m \"Added a Rakefile.\"\n\nAhora debería poder usar el Rake para ejecutar su programa hello.\n\n > rake\n\n > $ rake Hello, World!\n\n# lab 22 Al Interior de Git: El directorio .git/h1# lab 22 Al Interior de Git:\n\nEl directorio .git/h1* Aprender sobre la estructura de el directorio\n `.git` . \n\n## El Directorio\n\n `.git` 01 \nEs tiempo de explorar un poco. Primero, iniciando desde la raíz del directorio de su proyecto …\n\n > ls -C .git\n\n > $ ls -C .git COMMIT_EDITMSG config index objects HEAD description info refs ORIG_HEAD hooks logs\n\nÉste es el directorio mágico donde son almacenadas todas las “cosas” de git. Echemos un vistazo en el directorio de objetos\n\n## El Almacenamiento de Objetos 02\n\n > ls -C .git/objects\n\n > $ ls -C .git/objects 09 24 30 43 69 78 9c b8 e4 pack 11 27 3c 49 6b 97 af c4 e7 1b 28 40 59 76 9a b5 d2 info\n\nDebería ver un monton de directorios con nombres de dos letras. Los nombres de los directorios son las dos primeras letras del hash sha1 del objeto almacenado en git.\n\n## A Profundidad en el Almacenamiento de Objetos 03\n\n > ls -C .git/objects/ $ ls -C .git/objects/09 6b74c56bfc6b40e754fc0725b8c70b2038b91e 9fb6f9d3a104feb32fcac22354c4d0e8a182c1\n\nMire en alguno de los directorios de dos letras. Verá algunos archivos con nombres de 38 caracteres. Estos son los archivos que contienen los objetos almacenados en git. Estos archivos están compresos y codificados, así que no será de mucha ayuda el mirar directamente en el contenido, pero daremos un vistazo más a detalle.\n\n## Archivo de Configuración 04\n\n > cat .git/config\n\n > $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [user] name =  email = jim (at) edgecase.com\n Este es el archivo de configuración específico del proyecto. Las entradas en la configuración serán sobrepuestas con las configuraciones que se encuentran en el archivo `.gitconfig` en su directorio raíz, al menos para este proyecto. \n\n## Ramas y Etiquetas 05\n\n > ls .git/refs\n > ls .git/refs/heads\n > ls .git/refs/tags\n > cat .git/refs/tags/v1\n\n > $ ls .git/refs heads tags $ ls .git/refs/heads master $ ls .git/refs/tags v1 v1-beta $ cat .git/refs/tags/v1 40543214b69016a1f079a0d95ff88cc7421e9b54\n Podría reconocer los archivos en el subdirectorio \"tags\". Cada archivo corresponde a una etiqueta que se creó anteriormente con el comando `git tag` . Su contenido es sólo el hash del Commit atado a la etiqueta. \nAlgo similar sucede con los directorios \"heads\", pero ellos son usado con las ramificaciones en vez de las etiquetas. En este momento sólo tenemos una rama, así que veremos \"master\" en este directorio.\n\n## El Archivo HEAD 06\n\n > cat .git/HEAD\n\n > $ cat .git/HEAD ref: refs/heads/master\n\nEl archivo HEAD contiene una referencia a la ramificación actual. Esto debería ser una referencia a \"master\" en este punto.\n\n# lab 23 Al Interior de Git: Directorio de trabajo con Objetos de Git\n\n# lab 23 Al Interior de Git:\n\nDirectorio de trabajo con Objetos de Git \n\n* Explorar la estructura del almacenamiento de objetos.\n * Aprender a usar los hash SHA1 para encontrar contenido en el repositorio.\n\nAhora vamos a usar algunas herramientas para probar los objetos de git directamente.\n\n## Encontrando el último Commit 01\n\n > git hist --max-count=1\n\nEsto debería mostrar el último Commit hecho en el repositorio. El hash SHA1 en su sistema es seguramente diferente al mío, pero verá algo como esto:\n\n > $ git hist --max-count=1 * 76ba0a7 2012-03-06 | Added a Rakefile. (HEAD, master) [Jim Weirich]\n\n## Extrayendo el último Commit 02\n\nUsando el hash SHA1 del listado anterior …\n\n > git cat-file -t \n > git cat-file -p  $ git cat-file -t 76ba0a7 commit $ git cat-file -p 76ba0a7 tree 096b74c56bfc6b40e754fc0725b8c70b2038b91e parent b8f15c35ac4e42485773fec06e7155203a16c986 author   1331068328 -0500 committer   1331068328 -0500 Added a Rakefile.\n NOTA: Si definió los alias ‘type’ y ‘dump’ en el laboratorio de alias, entonces podrá escribir `git type` y  `git dump` en vez de el comando más largo cat-file (el cuál nunca puedo recordar). \nEste es el vaciado de el objeto Commit que está en el encabezado de la rama \"master\". Se parece mucho al objeto Commit de la presentación anterior.\n\n## Buscando el Árbol 03\n\nPodemos vaciar el árbol referenciado en el Commit. Debería ser una descripción de los archivos de más alto nivel en nuestro proyecto (para ese Commit). Use el valor del hash SHA1 de la propiedad “tree” listado arriba.\n\n > git cat-file -p  $ git cat-file -p 096b74c 100644 blob 28e0e9d6ea7e25f35ec64a43f569b550e8386f90 Rakefile 040000 tree e46f374f5b36c6f02fb3e9e922b79044f754d795 lib\n\nSí, veo el Rakefile y el directorio lib.\n\n## Volcando el directorio lib 04\n\n > git cat-file -p  $ git cat-file -p e46f374 100644 blob c45f26b6fdc7db6ba779fc4c385d9d24fc12cf72 hello.rb\n Aquí está el archivo `hello.rb` . \n\n## Volcando el archivo\n\n `hello.rb` 05 \n\n > git cat-file -p  $ git cat-file -p c45f26b # Default is World # Author:  () name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n\nAquí lo tiene. Hemos volcado los objetos Commit, tree y blob directamente desde el repositorio git. Es todo lo que hay: blobs, árboles y commits.\n\n## Explore usted mismo 06\n\nExplore por su cuenta el repositorio git manualmente. Vea si puede encontrar el archivo origina hello.rb desde el primer Commit siguiendo manualmente las referencias de los hash SHA1 iniciando desde el último Commit.\n\n* Aprender a crear una ramificación local en un repositorio.\n\nEs tiempo de hacer una reescritura mayor de la funcionalidad del programa hello world. Debido a que esto tomara un poco de tiempo, queremos poner estos cambios en una ramificación separada para aislarlo de los cambios en \"master\".\n\n## Crear una Ramificación 01\n\nLlamemos a nuestra nueva rama ‘greet’.\n\n > git checkout -b greet\n > git status\n NOTA:\n\n```\ngit checkout -b \n```\n\nes un atajo para \n\n```\ngit branch \n```\n\nseguido de \n\n```\ngit checkout \n```\n\n. \nObserve que el comando git status reporta que está en la rama ‘greet’.\n\n## Cambios para Greet: Agregar una clase Greeter. 02\n\n# Archivo: lib/greeter.rb\n\n > class Greeter def initialize(who) @who = who end def greet \"Hello, #{@who}\" end end\n\n > git add lib/greeter.rb\n > git commit -m \"Added greeter class\"\n\n## Cambios para Greet: Modificar el archivo principal 03\n\nActualice el archivo hello.rb para hacer uso de greeter.\n\n > require 'greeter' # Default is World name = ARGV.first || \"World\" greeter = Greeter.new(name) puts greeter.greet\n\n > git add lib/hello.rb\n > git commit -m \"Hello uses Greeter\"\n\n## Cambios para Greet: Actualizar el Rakefile 04\n\nActualice el Rakefile para hacer uso de un proceso externo de ruby.\n\n > #!/usr/bin/ruby -wKU task :default => :run task :run do ruby '-Ilib', 'lib/hello.rb' end\n\n > git add Rakefile\n > git commit -m \"Updated Rakefile\"\n\n## A continuación 05\n\nAhora tenemos una ramificación llamada greet con tres Commits en él. A continuación aprenderemos a navegar y cambiarnos entre ramas.\n\n* Aprender a navegar entre las distintas ramificaciones de un repositorio.\n\nAhora tenemos dos ramificaciones en nuestro proyecto:\n\n## Cambie a la Ramificación \"Master\" 01\n\n Just use the `git checkout` command to switch between branches. \n\n > git checkout master\n > cat lib/hello.rb\n\n > $ git checkout master Switched to branch 'master' $ cat lib/hello.rb # Default is World # Author:  () name = ARGV.first || \"World\" puts \"Hello, #{name}!\"\n Ahora se encuentra en la ramificación principal. Puede saberlo porque el archivo hello.rb no usa la clase `Greeter` . \n\n## Cambiar a la Ramificación \"Greet\". 02\n\n > git checkout greet\n > cat lib/hello.rb\n\n > $ git checkout greet Switched to branch 'greet' $ cat lib/hello.rb require 'greeter' # Default is World name = ARGV.first || \"World\" greeter = Greeter.new(name) puts greeter.greet\n El contenido de `lib/hello.rb` confirma que estamos de regreso a la ramificación greet.\n\n* Aprender a trabajar con múltiples Ramificaciones con diferentes (y posiblemente conflictivos) cambios.\n\nMientras estaba cambiando la rama \"greet\", alguien más decidió actualizar la ramificación \"master\". Agregó un archivo README.\n\n## Cambiar a la ramificación \"master\". 01\n\n## Cree el archivo README. 02\n\n## Haga Commit del archivo README en master. 03\n\n > git add README\n > git commit -m \"Added README\"\n\n* Aprender a ver las ramificaciones divergentes en el repositorio.\n\n## Ver la Ramificación Actual 01\n\nAhora tenemos dos ramificaciones divergentes en el repositorio. Use el siguiente comando de log para ver las ramas y cómo divergen.\n\n > $ git hist --all * e2257cb 2012-03-06 | Updated Rakefile (greet) [Jim Weirich] * a93f079 2012-03-06 | Hello uses Greeter [Jim Weirich] * 4b9457a 2012-03-06 | Added greeter class [Jim Weirich] | * 3ce0095 2012-03-06 | Added README (HEAD, master) [Jim Weirich] |/ * 76ba0a7 2012-03-06 | Added a Rakefile. [Jim Weirich] * b8f15c3 2012-03-06 | Moved hello.rb to lib [Jim Weirich] * 9c78ad8 2012-03-06 | Add an author/email comment [Jim Weirich] * 4054321 2012-03-06 | Added a comment (v1) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value (v1-beta) [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [Jim Weirich] * 3cbf83b 2012-03-06 | First Commit [Jim Weirich]\n Aquí está nuestro primera oportunidad para ver en acción la opción `--graph` del  `git hist` , esto causa que se dibuje en pantalla el arbol de Commit usando unos sencillos caracteres ASCII. Ahora podemos ver que tenemos dos ramificaciones (greet y master), y que la ramificación principal es el actual HEAD (encabezamiento). El antecesor común de ambas ramas es el “Added a Rakefile”. La bandera `--all` nos asegura que veremos todas las ramificaciones. El valor por defecto es mostrar sólo la gráfica de la rama actual.\n\n* Aprender a fusionar dos ramificaciones divergentes para llevar los cambios de nuevo a una sola rama\n\n## Fusionar las ramificaciones 01\n\nLa fusión junta los cambios de dos ramificaciones. Regresemos a la rama \"greet\" y fusionemosla con la rama \"master\".\n\n > git checkout greet\n > git merge master\n > git hist --all\n\nAl fusionar \"master\" con \"greet\" periódicamente puede hacer que los cambios en greet sean más compatibles con la línea principal de desarrollo (\"master\").\n\nSin embargo, esto produce unas feas gráficas de Commits. Más adelante veremos la opción de rebasar en vez de fusionar.\n\n## A continuación 02\n\nPero antes, ¿Qué tal si los cambios en master tienen conflicto con los cambios en greet?\n\n* Crear un cambio conflictivo en la ramificación principal.\n\n## Cambie a la ramificación principal y cree un conflicto 01\n\nCambiese a la ramificación principal y haga este cambio:\n\n > puts \"What's your name\" my_name = gets.strip puts \"Hello, #{my_name}!\"\n\n > git add lib/hello.rb\n > git commit -m \"Made interactive\"\n\n## Vea la ramificación 02\n\nLa ramificación principal en su Commit “Added README” ha sido fusionado con la rama \"greet\", pero hay un Commit adicional en Master que no ha sido fusionado con \"greet\".\n\n## A Continuación 03\n\nEl último cambio en Master se conflictúa con algunos cambios existentes en \"greet\". A continuación resolveremos este problema.\n\n* Aprender a manejar conflictos en una fusión\n\n## Fusionar \"master\" a \"greet\" 01\n\nRegrese a la rama \"greet\" e intente fusionar el nuevo \"master\".\n\n > $ git checkout greet Switched to branch 'greet' $ git merge master Auto-merging lib/hello.rb CONFLICT (content): Merge conflict in lib/hello.rb Automatic merge failed; fix conflicts and then commit the result.\n\nSi abre lib/hello.rb, podrá ver:\n\n > <<<<<<< HEAD require 'greeter' # Default is World name = ARGV.first || \"World\" greeter = Greeter.new(name) puts greeter.greet ======= # Default is World puts \"What's your name\" my_name = gets.strip puts \"Hello, #{my_name}!\" >>>>>>> master\n\nLa primera sección es la versión en el encabezamiento de la ramificación actual (greet). La segunda sección es la versión en la rama \"master\".\n\n## Corija el Conflicto 02\n\n Necesita resolver el conflicto manualmente. Modifique `lib/hello.rb` para tener lo siguiente: \n\n > require 'greeter' puts \"What's your name\" my_name = gets.strip greeter = Greeter.new(my_name) puts greeter.greet\n\n## Commit the Conflict Resolution 03\n\n > git add lib/hello.rb\n > git commit -m \"Merged master fixed conflict.\"\n\n > $ git add lib/hello.rb $ git commit -m \"Merged master fixed conflict.\" [greet 3165f66] Merged master fixed conflict.\n\n## Fusión Avanzada 04\n\ngit no provee una herramienta gráfica para fusionar, pero funcionará correctamente con cualquier herramienta de terceros que desee utilizar. Vea http://onestepback.org/index.cgi/Tech/Git/UsingP4MergeWithGit.red para una descripción de cómo utilizar \"Perforce\", una herramienta para fusión con git.\n\n* Aprender la diferencia entre Cambio de Base (Rebasing) y Fusión (Merging).\n\nExploremos la diferencia entre Cambio de Base y Fusión. Para lograrlo necesitamos regresar el repositorio al momento antes de la primera fusión, después de eso rehacer los mismos pasos, pero usando el Cambio de Base en vez de la Fusión.\n Haremos uso de el comando `reset` para cambiar la ramificación en el historial.\n\n* Reestablecer la ramificación \"greet\" al punto anterior de la primera fusión.\n\nVamos a regresar en el tiempo a la ramificación \"greet\" en el punto antes de que lo fusionaramos. Podemos reestablecer una ramificación en el Commit que deseemos. Esto es, esencialmente, modificiar el apuntador de la ramificación a cualquier punto dentro del arbol de Commits.\n\nEn este caso deseamos regresar la ramificación \"greet\" en el punto antes de la fusión con \"master\". Necesitamos encontrar el último Commit antes de la fusión.\n\n > git checkout greet\n > git hist\n\nEsto es un poco difícil de leer, pero observando los datos podemos ver que el Commit “Updated Rakefile” fue el último antes de fusionaramos la ramificación \"greet\". Vamos a reestablecer la ramificación \"greet\" a ese Commit.\n\n > git reset --hard  $ git reset --hard e2257cb HEAD is now at e2257cb Updated Rakefile\n\n## Revise la ramificación. 02\n\nBusque en el log la ramificación \"greet\". Ya no tenemos los Commits de la fusión en el historial.\n\n* Reestablecer la ramificación principal al punto antes del Commit conflictivo.\n\nCuando añadimos el modo interactivo a la ramificación principal, hicimos un cambio que tenía conflictos con los cambios en la ramificación greet. Vamos a regresar la ramificación principal al punto antes del cambio conflictivo. Esto nos permite demostrar el Cambio de Base sin preocuparnos sobre los conflictos.\n\n > git checkout master\n > git hist\n\nEl Commit ‘Added README’ está justo antes del modo interactivo con conflicto. Reestableceremos la ramificación principal a ese Commit.\n\n > git reset --hard \n > git hist --all\n\nRevise el log. Se debe mostrar justo como estaba el repositorio antes de que hicieramos la fusión.\n\n* Usar el comando rebase en vez del comando merge.\n\nRegresamos en el tiempo antes de la primera fusión y deseamos tener los cambios de la ramificación principal en greet.\n\nEsta vez usaremos el comando rebase en vez del comando merge para traer los cambios desde la ramificación principal.\n\n > git checkout greet\n > git rebase master\n > git hist\n\n > $ go greet Switched to branch 'greet' $ $ git rebase master First, rewinding head to replay your work on top of it... Applying: added Greeter class Applying: hello uses Greeter Applying: updated Rakefile $ $ git hist * e1399d1 2012-03-06 | Updated Rakefile (HEAD, greet) [Jim Weirich] * 183c6ad 2012-03-06 | Hello uses Greeter [Jim Weirich] * 297678c 2012-03-06 | Added greeter class [Jim Weirich] * 3ce0095 2012-03-06 | Added README (master) [Jim Weirich] * 76ba0a7 2012-03-06 | Added a Rakefile. [Jim Weirich] * b8f15c3 2012-03-06 | Moved hello.rb to lib [Jim Weirich] * 9c78ad8 2012-03-06 | Add an author/email comment [Jim Weirich] * 4054321 2012-03-06 | Added a comment (v1) [Jim Weirich] * 1b754e9 2012-03-06 | Added a default value (v1-beta) [Jim Weirich] * 3053491 2012-03-06 | Using ARGV [] * 3cbf83b 2012-03-06 | First Commit []\n\n## Merge VS Rebase 01\n\nEl resultado final del Cambio de Base es muy similar a la Fusión. La ramificación \"greet\" ahora contiene todos sus cambios, así como los cambios en la ramificación principal. Sin embargo, el árbol de Commits es un poco diferente. El árbol de Commits para la ramificación \"greet\" ha sido reescrito para la ramificación principal forme parte del historial de Commit. Esto deja la cadena de commits lineal y mucho má fácil de leer.\n\n## ¿Cuándo usar el comando Rebase, cuándo Merge? 02\n\nNo use Rebase\n\n* Si la ramificación es pública y compartida con otros. Reescribir ramificaciones públicas tiende a hacer enojar a otros miembros del equipo.\n * Cuando la exactitud del historial es importante (debido a que rebase reescribe el historial de Commits).\n\nDada las directrices anteriores, yo tiendo a usar el coamdno rebase para ramificaciones locales de corta vida, y el comando merge para ramificaciones en repositorios públicos.\n\n* Hemos mantenido nuestra ramificación \"greet\" al día con la principal (vía rebase), ahora vamos a fusionar los cambios en \"greet\" con la ramificación principal.\n\n## Fusionar greet en la ramificación principal 01\n\n > $ git checkout master Switched to branch 'master' $ $ git merge greet Updating 3ce0095..e1399d1 Fast-forward Rakefile | 2 +- lib/greeter.rb | 8 ++++++++ lib/hello.rb | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 lib/greeter.rb\n\nDebido a que el encabezado de la ramificación principal es el antecesor director del encabezado en \"greet\", git puede hacer una fusión \"hacia adelante\". Cuando adelantamos (fast-forwarding), el apuntador de la ramificación simplemente se mueve hacia adelante para apuntar al mismo commit que la ramificación \"greet\".\n\nNunca habrá conflictos cuando se realiza una fusión \"hacia adelante\".\n\n## Revisar los logs 02\n\nAhora las ramificaciones \"greet\" y \"master\" son idénticas.\n\nHasta este punto hemos trabajado con un único repositorio git. Sin embargo, git es excelente para trabajar con múltiples repositorios. Estos repositorios extra pueden ser almacenados localmente, o quizás ser accedidos a través de una conexión de red.\n\nEn la siguiente sección crearemos un nuevo repositorio llamado “cloned_hello”. Mostraremos cómo mover los cambios desde un repositorio a otro, y también a manejar conflictos cuando surjan problemas entre los dos repositorios.\n\nPor ahora, estaremos trabajando con repositorios locales (por ejemplo, repositorios almacenados en su disco duro local), sin embargo, muchas de las cosas aprendidas en esta sección aplicarán tanto para trabajo local como a remoto a través de la red.\n\nNOTA: Vamos a hacer cambios en ambas copias de nuestros repositorios. Asegúrese de poner atención en cuál repositorio está en cada paso de los siguientes laboratorios.\n\n* Aprender a hacer copias de repositorios.\n\n## Vaya al directorio de trabajo 01\n\nVaya al directorio de trabajo y haga un clon de nuestro repositorio hello.\n\n > cd ..\n > pwd\n > ls\n\nNOTA: En nuestro directorio de trabajo.\n\n > $ cd .. $ pwd /Users/jerrynummi/Projects/edgecase/git_immersion/auto $ ls hello\n\nEn este punto debe estar en su directorio de trabajo. Debe haber un único repositorio llamado “hello”.\n\n## Crear un clon del repositorio hello 02\n\nVamos a clonar el repositorio.\n\n > git clone hello cloned_hello\n > ls\n\n > $ git clone hello cloned_hello Cloning into 'cloned_hello'... done. $ ls cloned_hello hello\n\nAhora debe haber dos repositorios en el directorio de trabajo: el repositorio “hello” original y el nuevo repositorio clonado “cloned_hello”.\n\n* Aprender sobre ramificaciones en repositorios remotos.\n\n## Vea el repositorio clonado 01\n\nVamos a observar el repositorio clonado.\n\n > cd cloned_hello\n > ls\n\n > $ cd cloned_hello $ ls README Rakefile lib\n Debe ver una lista de todos los archivos en el directorio nivel superior del repositorio original ( `README` ,  `Rakefile` y  `lib` ). \n\n## Revise el Historial del Repositorio 02\n\nAhora debe ver un listado de todos los Commits en el nuevo repositorio, y este debería coincidir (más o menos) con el historial de Commits en el repositorio original. La única diferencia debería ser los nombre de las ramificaciones.\n\n## Ramificaciones Remotas 03\n\nDebe ver una ramificación master (junto con HEAD) en el listado del historial. Pero tambien tendrá una cantidad de ramificaciones con nombre extraño (origin/master, origin/greet y origin/HEAD). Hablaremos de esto en un momento más.\n\n* Aprender sobre los nombres de repositorios remotos.\n\n > git remote\n\n > $ git remote origin\n\nVemos que el repositorio clonado sabe sobre un repositorio llamado \"origin\". Veremos si podemos obtener más información sobre origin:\n\n > git remote show origin\n\n > $ git remote show origin * remote origin Fetch URL: /Users/jerrynummi/Projects/edgecase/git_immersion/auto/hello Push URL: /Users/jerrynummi/Projects/edgecase/git_immersion/auto/hello HEAD branch (remote HEAD is ambiguous, may be one of the following): greet master Remote branches: greet tracked master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date)\n\nAhora vemos que el repositorio remoto “origin” es simplemente el repositorio original hello. Los repositorios remotos viven típicamente en una máquina separada, posiblemente en un servidor centralizado. Como podemos ver aquí, sin embargo, también pueden apuntar a repositorios en la misma máquina. No hay nada particularmente especial sobre el nombre “origin”, pero la convención generalizada es usar el nombre “origin” para el repositorio principal centralizado.\n\n* Aprender sobre ramificaciones locales VS remotas\n\nVeamos las ramificaciones disponibles en el repositorio clonado.\n\n > git branch\n\n > $ git branch * master\n\nEsto es, sólo la ramificación principal está en el listado. ¿Dónde está la ramificación \"greet\"? El comando git branch sólo lista la ramificación local por defecto.\n\n## Listar Ramificaciones Remotas 01\n\nIntente esto para ver todas las ramificaciones:\n\n > git branch -a\n\n > $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/greet remotes/origin/master\n\nGit tiene todos los Commits desde el repositorio original, pero las ramificaciones en el repositorio remoto no son tratadas como locales aquí. Si deseamos nuestra ramificación greet, tenemos que crearla por nosotros mismos. Veremos cómo hacerlo en unos minutos.\n\n* Realizar algunos cambios en el repositorio original así podemos tratar de enviar los cambios remotamente.\n\n## Haga un cambio en el repositorio original hello 01\n\n > cd ../hello\n > # (Debería estar en el repositorio hello original)\n\nNOTA: En el repositorio hello\n\nHaga el siguiente cambio a README:\n\nAhora agregue y realice Commit de esto cambios\n\n > git add README\n > git commit -m \"Changed README in original repo\"\n\n## Continuando 02\n\nEl repositorio original ahora tiene cambios posteriores que no están en la versión clonada. A continuación enviaremos esos cambios hacia el repositorio clonado.\n\n* Aprender como recibir cambios de un repositorio remoto.\n\n > cd ../cloned_hello\n > git fetch\n > git hist --all\n\nNOTA: En el repositorio cloned_hello\n\nEn este punto el repositorio tiene todos los Commits del repositorio original, pero no están integrados en las ramificaciones locales del repositorio clonado.\n\nEncuentre el Commit “Changed README in original repo” en el repositorio arriba mostrado. Note que el Commit incluye “origin/master” y “origin/HEAD”.\n\nAhora mire en el Commit “Updated Rakefile”. Verá que la ramificación principal apuna a éste Commit, no al nuevo commit que acabamos de recibir.\n\nEl resultado de ésto es que el comando “git fetch” traerá los nuevos commits desde el repositorio remoto, pero no los fusionará en las ramificaciones locales.\n\n## Revise el archivo README 01\n\nPodemos demostrar que el README está sin cambios.\n\n¿Puede verlo?, no hay cambios.\n\n* Aprender a obtener los cambios (vía comando pull) en la ramificación y directorio de trabajo actual.\n\n## Fusionar los cambios recibidos en el repositorio principal (master) 01\n\n > git merge origin/master\n\n > $ git merge origin/master Updating e1399d1..e18658c Fast-forward README | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)\n\n## Revise el archivo README una vez más 02\n\nDebería pode ver los cambio.\n\nExisten cambios. Incluso aunque “git fetch” no fusione los cambios, aún podemos fusionar manualmente los cambios del repositorio remoto.\n\nVeremos una combinación del proceso de fetch y merge en un sólo comando.\n\n* Aprender que\n `git pull` es equivalente a  `git fetch` seguido de  `git merge` . \n\nNo vamos a ir por el proceso completo de crear otro cambio y recibirlo remotamente de nuevo, pero sí saber que haciendo lo siguiente:\n > git pull\n\nEs equivalente a los dos pasos vistos anteriormente:\n > git fetch\n > git merge origin/master\n\n* Aprender a agregar una ramificación local que rastree una ramificación remota.\n\nLas ramificaciones que inician con remotes/origin son ramificaciones de un repositorio original. Note que no tiene una ramificación llamada \"greet\", pero es conocido que el repositorio original sí la tiene.\n\n## Agregue una ramificación loal que haga rastreo a una ramificación remota. 01\n\n > git branch --track greet origin/greet\n > git branch -a\n > git hist --max-count=2\n\n > $ git branch --track greet origin/greet Branch greet set up to track remote branch greet from origin. $ git branch -a greet * master remotes/origin/HEAD -> origin/master remotes/origin/greet remotes/origin/master $ git hist --max-count=2 * e18658c 2012-03-06 | Changed README in original repo (HEAD, origin/master, origin/HEAD, master) [Jim Weirich] * e1399d1 2012-03-06 | Updated Rakefile (origin/greet, greet) [Jim Weirich]\n\nAhora podemos ver la ramificación \"greet\" en la lista de ramificaciones del comando log.\n\n* Aprender cómo crear un repositorio escueto.\n\nLos repositorios escuetos (sin directorio de trabajo) son generalmente usados para compartir ).\n\n## Crear un repositorio escueto. 01\n\n > cd ..\n > git clone --bare hello hello.git\n > ls hello.git\n\nNOTA: En el directorio de trabajo\n\n > $ git clone --bare hello hello.git Cloning into bare repository 'hello.git'... done. $ ls hello.git HEAD config description hooks info objects packed-refs refs\n\nLa convención generalmente aceptada es que los repositorios terminados en ‘.git’ son repositorios escuetos. Podemos ver que no hay un directorio de trabajo en el repositorio hello.git.\n\n* Agregar el repositorio escueto como uno remoto en nuestro repositorio original.\n\nAgreguemos el repositorio hello.git a nuestro repositorio original.\n\n > cd hello\n > git remote add shared ../hello.git\n\nNOTA: En el repositorio .\n\n* Aprender a enviar cambios a un repositorio remoto.\n\nDebido a que los repositorios escuetos son usualmente compartidos en algún tipo de servidor de red, es usualmente difícil hacer un cambio de directorio en el repositorio y recibir cambios, así que necesitamos enviar nuestros cambios desde otro repositorio.\n\nIniciemos creando un cambio a ser enviado remotamente. Edite el archivo README y realice un Commit con él.\n\n > This is the Hello World example from the git tutorial. (Changed in the original and pushed to shared)\n\n > git checkout master\n > git add README\n > git commit -m \"Added shared comment to readme\"\n\nAhora envíe el cambio al repositorio remoto.\n\n > git push shared master\n\nshared es el nombre del repositorio que está recibiendo los cambios que estamos enviados. (Recuerde, lo agregamos como repositorio remoto en laboratorio previo.)\n\n > $ git push shared master To ../hello.git e18658c..e4b00d1 master -> master\n\nNOTA: Tenemos que nombrar explícitamente la ramificación principal que está recibiendo el cambio remoto. Es posible configurarlo automáticamente, pero en mi caso nunca recuerdo el comando para hacerlo. Revise la documentación de “Git Remote Branch” para una fácil administración de ramificaciones remotas.\n\n* Aprender a recibir cambios desde un repositorio compartido.\n\nPase por el repositorio clonado y reciba los cambios que acabamos de enviar al repositorio compartido.\n\n > cd ../cloned_hello\n\nNOTA: En el repositorio cloned_hello.\n\nContinúe con …\n\n > git remote add shared ../hello.git\n > git branch --track shared master\n > git pull shared master\n > cat README\n\n* Aprender a configurar un servidor git para compartir repositorios.\n\nTHay muchas formas para compartir un repositorio git en la red. Aquí está la manera rápida y sucia.\n\n## Iniciar el servidor git 01\n\n > # (Desde el directorio de trabajo)\n > git daemon --verbose --export-all --base-path=.\n\nAhora, desde una ventana de terminal por separado, vaya al directorio de trabajo.\n\n > # (Desde el directorio de trabajo)\n > git clone git://localhost/hello.git network_hello\n > cd network_hello\n > ls\n\nDeberá ver una copia del proyecto hello.\n\n## Enviando cambios al Demonio Git 02\n\n Si desea enviar los cambios al repositorio git, agregue el parámetro\n\n```\n--enable=receive-pack\n```\n\nal comando del demonio git. Tenga cuidado porque aún no hay autentificación en este servidor, cualquiera podría envíar cambios a su repositorio.\n\n* Aprender a compartir repositorio a través del WIFI.\n\nVea si su vecino está ejecutando un demonio git. Intercambie direcciones IP y vea si puede enviar cambios entre sus repositorios.\n\nNOTA: El paquete gitjour es realmente útil al estar compartiendo repositorios.\n\nAquí están algunos tópicos que podría desar investigar por su cuenta:\n\n* Revertir cambios realizados\n * Final de Línea en diversos sistemas operativos\n * Servidores Remotos\n * Protocolos\n * Configuración SSH\n * Administración de Ramificaciones Remotas\n * Encontrando Commits con Bugs (git bisect)\n * Flujos de trabajo\n * Herramientas gráficas (gitx, gitk, magit)\n * Trabajando con GitHub"}}},{"rowIdx":448,"cells":{"project":{"kind":"string","value":"djangogrpcframework"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"Python"},"content":{"kind":"string","value":"django-grpc-framework 0.2 documentation\n\nDjango gRPC Framework[¶](#django-grpc-framework)\n===\n\nDjango gRPC framework is a toolkit for building gRPC services with Django.\nOfficially we only support proto3.\n\nUser’s Guide[¶](#user-s-guide)\n---\n\nThis part of the documentation begins with installation, followed by more instructions for building services.\n\n### Installation[¶](#installation)\n\n#### Requirements[¶](#requirements)\n\nWe requires the following:\n\n* Python (3.6, 3.7, 3.8)\n* Django (2.2, 3.0)\n* Django REST Framework (3.10.x, 3.11.x)\n* gRPC\n* gRPC tools\n* proto3\n\n#### virtualenv[¶](#virtualenv)\n\nVirtualenv might be something you want to use for development! let’s create one working environment:\n```\n$ mkdir myproject\n$ cd myproject\n$ python3 -m venv env\n$ source env/bin/activate\n```\nIt is time to get the django grpc framework:\n```\n$ pip install djangogrpcframework\n$ pip install django\n$ pip install djangorestframework\n$ pip install grpcio\n$ pip install grpcio-tools\n```\n#### System Wide[¶](#system-wide)\n\nInstall it for all users on the system:\n```\n$ sudo pip install djangogrpcframework\n```\n#### Development Version[¶](#development-version)\n\nTry the latest version:\n```\n$ source env/bin/activate\n$ git clone https://github.com/fengsp/django-grpc-framework.git\n$ cd django-grpc-framework\n$ python setup.py develop\n```\n### Quickstart[¶](#quickstart)\n\nWe’re going to create a simple service to allow clients to retrieve and edit the users in the system.\n\n#### Project setup[¶](#project-setup)\n\nCreate a new Django project named `quickstart`, then start a new app called\n`account`:\n```\n# Create a virtual environment python3 -m venv env source env/bin/activate\n# Install Django and Django gRPC framework pip install django pip install djangorestframework pip install djangogrpcframework pip install grpcio pip install grpcio-tools\n# Create a new project and a new application django-admin startproject quickstart cd quickstart django-admin startapp account\n```\nNow sync the database:\n```\npython manage.py migrate\n```\n#### Update settings[¶](#update-settings)\n\nAdd `django_grpc_framework` to `INSTALLED_APPS`, settings module is in\n`quickstart/settings.py`:\n```\nINSTALLED_APPS = [\n    ...\n    'django_grpc_framework',\n]\n```\n#### Defining protos[¶](#defining-protos)\n\nOur first step is to define the gRPC service and messages, create a file\n`quickstart/account.proto` next to `quickstart/manage.py`:\n```\nsyntax = \"proto3\";\n\npackage account;\n\nimport \"google/protobuf/empty.proto\";\n\nservice UserController {\n    rpc List(UserListRequest) returns (stream User) {}\n    rpc Create(User) returns (User) {}\n    rpc Retrieve(UserRetrieveRequest) returns (User) {}\n    rpc Update(User) returns (User) {}\n    rpc Destroy(User) returns (google.protobuf.Empty) {}\n}\n\nmessage User {\n    int32 id = 1;\n    string username = 2;\n    string email = 3;\n    repeated int32 groups = 4;\n}\n\nmessage UserListRequest {\n}\n\nmessage UserRetrieveRequest {\n    int32 id = 1;\n}\n```\nOr you can generate it automatically based on `User` model:\n```\npython manage.py generateproto --model django.contrib.auth.models.User --fields id,username,email,groups --file account.proto\n```\nNext we need to generate gRPC code, from the `quickstart` directory, run:\n```\npython -m grpc_tools.protoc --proto_path=./ --python_out=./ --grpc_python_out=./ ./account.proto\n```\n#### Writing serializers[¶](#writing-serializers)\n\nThen we’re going to define a serializer, let’s create a new module named\n`account/serializers.py`:\n```\nfrom django.contrib.auth.models import User from django_grpc_framework import proto_serializers import account_pb2\n\nclass UserProtoSerializer(proto_serializers.ModelProtoSerializer):\n    class Meta:\n        model = User\n        proto_class = account_pb2.User\n        fields = ['id', 'username', 'email', 'groups']\n```\n#### Writing services[¶](#writing-services)\n\nNow we’d write some a service, create `account/services.py`:\n```\nfrom django.contrib.auth.models import User from django_grpc_framework import generics from account.serializers import UserProtoSerializer\n\nclass UserService(generics.ModelService):\n    \"\"\"\n gRPC service that allows users to be retrieved or updated.\n \"\"\"\n    queryset = User.objects.all().order_by('-date_joined')\n    serializer_class = UserProtoSerializer\n```\n#### Register handlers[¶](#register-handlers)\n\nOk, let’s wire up the gRPC handlers, edit `quickstart/urls.py`:\n```\nimport account_pb2_grpc from account.services import UserService\n\nurlpatterns = []\n\ndef grpc_handlers(server):\n    account_pb2_grpc.add_UserControllerServicer_to_server(UserService.as_servicer(), server)\n```\nWe’re done, the project layout should look like:\n```\n.\n./quickstart\n./quickstart/asgi.py\n./quickstart/__init__.py\n./quickstart/settings.py\n./quickstart/urls.py\n./quickstart/wsgi.py\n./manage.py\n./account\n./account/migrations\n./account/migrations/__init__.py\n./account/services.py\n./account/models.py\n./account/serializers.py\n./account/__init__.py\n./account/apps.py\n./account/admin.py\n./account/tests.py\n./account.proto\n./account_pb2_grpc.py\n./account_pb2.py\n```\n#### Calling our service[¶](#calling-our-service)\n\nFire up the server with development mode:\n```\npython manage.py grpcrunserver --dev\n```\nWe can now access our service from the gRPC client:\n```\nimport grpc import account_pb2 import account_pb2_grpc\n\nwith grpc.insecure_channel('localhost:50051') as channel:\n    stub = account_pb2_grpc.UserControllerStub(channel)\n    for user in stub.List(account_pb2.UserListRequest()):\n        print(user, end='')\n```\n### Tutorial[¶](#tutorial)\n\nThis part provides a basic introduction to work with Django gRPC framework.\nIn this tutorial, we will create a simple blog rpc server. You can get the source code in [tutorial example](https://github.com/fengsp/django-grpc-framework/tree/master/examples/tutorial).\n\n#### Building Services[¶](#building-services)\n\nThis tutorial will create a simple blog gRPC Service.\n\n##### Environment setup[¶](#environment-setup)\n\nCreate a new virtual environment for our project:\n```\npython3 -m venv env source env/bin/activate\n```\nInstall our packages:\n```\npip install django pip install djangorestframework   # we need the serialization pip install djangogrpcframework pip install grpcio pip install grpcio-tools\n```\n##### Project setup[¶](#project-setup)\n\nLet’s create a new project to work with:\n```\ndjango-admin startproject tutorial cd tutorial\n```\nNow we can create an app that we’ll use to create a simple gRPC Service:\n```\npython manage.py startapp blog\n```\nWe’ll need to add our new `blog` app and the `django_grpc_framework` app to\n`INSTALLED_APPS`. Let’s edit the `tutorial/settings.py` file:\n```\nINSTALLED_APPS = [\n    ...\n    'django_grpc_framework',\n    'blog',\n]\n```\n##### Create a model[¶](#create-a-model)\n\nNow we’re going to create a simple `Post` model that is used to store blog posts. Edit the `blog/models.py` file:\n```\nfrom django.db import models\n\nclass Post(models.Model):\n    title = models.CharField(max_length=100)\n    content = models.TextField()\n    created = models.DateTimeField(auto_now_add=True)\n\n    class Meta:\n        ordering = ['created']\n```\nWe also need to create a migration for our post model, and sync the database:\n```\npython manage.py makemigrations blog python manage.py migrate\n```\n##### Defining a service[¶](#defining-a-service)\n\nOur first step is to define the gRPC service and messages, create a directory\n`tutorial/protos` that sits next to `tutorial/manage.py`, create another directory `protos/blog_proto` and create the `protos/blog_proto/post.proto`\nfile:\n```\nsyntax = \"proto3\";\n\npackage blog_proto;\n\nimport \"google/protobuf/empty.proto\";\n\nservice PostController {\n    rpc List(PostListRequest) returns (stream Post) {}\n    rpc Create(Post) returns (Post) {}\n    rpc Retrieve(PostRetrieveRequest) returns (Post) {}\n    rpc Update(Post) returns (Post) {}\n    rpc Destroy(Post) returns (google.protobuf.Empty) {}\n}\n\nmessage Post {\n    int32 id = 1;\n    string title = 2;\n    string content = 3;\n}\n\nmessage PostListRequest {\n}\n\nmessage PostRetrieveRequest {\n    int32 id = 1;\n}\n```\nFor a model-backed service, you could also just run the model proto generator:\n```\npython manage.py generateproto --model blog.models.Post --fields=id,title,content --file protos/blog_proto/post.proto\n```\nThen edit it as needed, here the package name can’t be automatically inferred by the proto generator, change `package post` to `package blog_proto`.\n\nNext we need to generate gRPC code, from the `tutorial` directory, run:\n```\npython -m grpc_tools.protoc --proto_path=./protos --python_out=./ --grpc_python_out=./ ./protos/blog_proto/post.proto\n```\n##### Create a Serializer class[¶](#create-a-serializer-class)\n\nBefore we implement our gRPC service, we need to provide a way of serializing and deserializing the post instances into protocol buffer messages. We can do this by declaring serializers, create a file in the `blog` directory named `serializers.py` and add the following:\n```\nfrom django_grpc_framework import proto_serializerss from blog.models import Post from blog_proto import post_pb2\n\nclass PostProtoSerializer(proto_serializers.ModelProtoSerializer):\n    class Meta:\n        model = Post\n        proto_class = post_pb2.Post\n        fields = ['id', 'title', 'content']\n```\n##### Write a service[¶](#write-a-service)\n\nWith our serializer class, we’ll write a regular grpc service, create a file in the `blog` directory named `services.py` and add the following:\n```\nimport grpc from google.protobuf import empty_pb2 from django_grpc_framework.services import Service from blog.models import Post from blog.serializers import PostProtoSerializer\n\nclass PostService(Service):\n    def List(self, request, context):\n        posts = Post.objects.all()\n        serializer = PostProtoSerializer(posts, many=True)\n        for msg in serializer.message:\n            yield msg\n\n    def Create(self, request, context):\n        serializer = PostProtoSerializer(message=request)\n        serializer.is_valid(raise_exception=True)\n        serializer.save()\n        return serializer.message\n\n    def get_object(self, pk):\n        try:\n            return Post.objects.get(pk=pk)\n        except Post.DoesNotExist:\n            self.context.abort(grpc.StatusCode.NOT_FOUND, 'Post:%s not found!' % pk)\n\n    def Retrieve(self, request, context):\n        post = self.get_object(request.id)\n        serializer = PostProtoSerializer(post)\n        return serializer.message\n\n    def Update(self, request, context):\n        post = self.get_object(request.id)\n        serializer = PostProtoSerializer(post, message=request)\n        serializer.is_valid(raise_exception=True)\n        serializer.save()\n        return serializer.message\n\n    def Destroy(self, request, context):\n        post = self.get_object(request.id)\n        post.delete()\n        return empty_pb2.Empty()\n```\nFinally we need to wire there services up, create `blog/handlers.py` file:\n```\nfrom blog._services import PostService from blog_proto import post_pb2_grpc\n\ndef grpc_handlers(server):\n    post_pb2_grpc.add_PostControllerServicer_to_server(PostService.as_servicer(), server)\n```\nAlso we need to wire up the root handlers conf, in `tutorial/urls.py`\nfile, include our blog app’s grpc handlers:\n```\nfrom blog.handlers import grpc_handlers as blog_grpc_handlers\n\nurlpatterns = []\n\ndef grpc_handlers(server):\n    blog_grpc_handlers(server)\n```\n##### Calling our service[¶](#calling-our-service)\n\nNow we can start up a gRPC server so that clients can actually use our service:\n```\npython manage.py grpcrunserver --dev\n```\nIn another terminal window, we can test the server:\n```\nimport grpc from blog_proto import post_pb2, post_pb2_grpc\n\nwith grpc.insecure_channel('localhost:50051') as channel:\n    stub = post_pb2_grpc.PostControllerStub(channel)\n    print('--- Create ---')\n    response = stub.Create(post_pb2.Post(title='t1', content='c1'))\n    print(response, end='')\n    print('--- List ---')\n    for post in stub.List(post_pb2.PostListRequest()):\n        print(post, end='')\n    print('--- Retrieve ---')\n    response = stub.Retrieve(post_pb2.PostRetrieveRequest(id=response.id))\n    print(response, end='')\n    print('--- Update ---')\n    response = stub.Update(post_pb2.Post(id=response.id, title='t2', content='c2'))\n    print(response, end='')\n    print('--- Delete ---')\n    stub.Destroy(post_pb2.Post(id=response.id))\n```\n#### Using Generic Services[¶](#using-generic-services)\n\nWe provide a number of pre-built services as a shortcut for common usage patterns. The generic services allow you to quickly build services that map closely to database models.\n\n##### Using mixins[¶](#using-mixins)\n\nThe create/list/retrieve/update/destroy operations that we’ve been using so far are going to be similar for any model-backend services. Those operations are implemented in gRPC framework’s mixin classes.\n\nLet’s take a look at how we can compose the services by using the mixin classes, here is our `blog/services` file again:\n```\nfrom blog.models import Post from blog.serializers import PostProtoSerializer from django_grpc_framework import mixins from django_grpc_framework import generics\n\nclass PostService(mixins.ListModelMixin,\n                  mixins.CreateModelMixin,\n                  mixins.RetrieveModelMixin,\n                  mixins.UpdateModelMixin,\n                  mixins.DestroyModelMixin,\n                  generics.GenericService):\n    queryset = Post.objects.all()\n    serializer_class = PostProtoSerializer\n```\nWe are building our service with `GenericService`, and adding in\n`ListModelMixin`,``CreateModelMixin``, etc. The base class provides the core functionality, and the mixin classes provice the `.List()` and\n`.Create()` handlers.\n\n##### Using model service[¶](#using-model-service)\n\nIf you want all operations of create/list/retrieve/update/destroy, we provide one already mixed-in generic services:\n```\nclass PostService(generics.ModelService):\n    queryset = Post.objects.all()\n    serializer_class = PostProtoSerializer\n```\n#### Writing and running tests[¶](#writing-and-running-tests)\n\nLet’s write some tests for our service and run them.\n\n##### Writing tests[¶](#id1)\n\nLet’s edit the `blog/tests.py` file:\n```\nimport grpc from django_grpc_framework.test import RPCTestCase from blog_proto import post_pb2, post_pb2_grpc from blog.models import Post\n\nclass PostServiceTest(RPCTestCase):\n    def test_create_post(self):\n        stub = post_pb2_grpc.PostControllerStub(self.channel)\n        response = stub.Create(post_pb2.Post(title='title', content='content'))\n        self.assertEqual(response.title, 'title')\n        self.assertEqual(response.content, 'content')\n        self.assertEqual(Post.objects.count(), 1)\n\n    def test_list_posts(self):\n        Post.objects.create(title='title1', content='content1')\n        Post.objects.create(title='title2', content='content2')\n        stub = post_pb2_grpc.PostControllerStub(self.channel)\n        post_list = list(stub.List(post_pb2.PostListRequest()))\n        self.assertEqual(len(post_list), 2)\n```\n##### Running tests[¶](#running-tests)\n\nOnce you’ve written tests, run them:\n```\npython manage.py test\n```\n### Services[¶](#services)\n\nDjango gRPC framework provides an `Service` class, which is pretty much the same as using a regular gRPC generated servicer interface. For example:\n```\nimport grpc from django_grpc_framework.services import Service from blog.models import Post from blog.serializers import PostProtoSerializer\n\nclass PostService(Service):\n    def get_object(self, pk):\n        try:\n            return Post.objects.get(pk=pk)\n        except Post.DoesNotExist:\n            self.context.abort(grpc.StatusCode.NOT_FOUND, 'Post:%s not found!' % pk)\n\n    def Retrieve(self, request, context):\n        post = self.get_object(request.id)\n        serializer = PostProtoSerializer(post)\n        return serializer.message\n```\n#### Service instance attributes[¶](#service-instance-attributes)\n\nThe following attributes are available in a service instance.\n\n* `.request` - the gRPC request object\n* `.context` - the `grpc.ServicerContext` object\n* `.action` - the name of the current service method\n\n#### As servicer method[¶](#as-servicer-method)\n\n*classmethod* `Service.``as_servicer`(***initkwargs*)[¶](#django_grpc_framework.services.Service.as_servicer)\nReturns a gRPC servicer instance:\n```\nservicer = PostService.as_servicer()\nadd_PostControllerServicer_to_server(servicer, server)\n```\n#### Root handlers hook[¶](#root-handlers-hook)\n\nWe need a hanlders hook function to add all servicers to the server, for example:\n```\ndef grpc_handlers(server):\n    demo_pb2_grpc.add_UserControllerServicer_to_server(UserService.as_servicer(), server)\n```\nYou can set the root handlers hook using the `ROOT_HANDLERS_HOOK` setting key, for example set the following in your `settings.py` file:\n```\nGRPC_FRAMEWORK = {\n    ...\n    'ROOT_HANDLERS_HOOK': 'path.to.your.curtom_grpc_handlers',\n}\n```\nThe default setting is `'{settings.ROOT_URLCONF}.grpc_handlers'`.\n\n### Generic services[¶](#generic-services)\n\nThe generic services provided by gRPC framework allow you to quickly build gRPC services that map closely to your database models. If the generic services don’t suit your needs, use the regular `Service` class, or reuse the mixins and base classes used by the generic services to compose your own set of ressable generic services.\n\nFor example:\n```\nfrom blog.models import Post from blog.serializers import PostProtoSerializer from django_grpc_framework import generics\n\nclass PostService(generics.ModelService):\n   queryset = Post.objects.all()\n   serializer_class = PostProtoSerializer\n```\n#### GenericService[¶](#genericservice)\n\nThis class extends `Service` class, adding commonly required behavior for standard list and detail services. All concrete generic services is built by composing `GenericService`, with one or more mixin classes.\n\n##### Attributes[¶](#attributes)\n\n**Basic settings:**\n\nThe following attributes control the basic service behavior:\n\n* `queryset` - The queryset that should be used for returning objects from this service. You must set this or override the `get_queryset` method, you should call `get_queryset` instead of accessing this property directly, as `queryset`\nwill get evaluated once, and those results will be cached for all subsequent requests.\n* `serializer_class` - The serializer class that should be used for validating and deserializing input, and for serializing output. You must either set this attribute, or override the `get_serializer_class()` method.\n* `lookup_field` - The model field that should be used to for performing object lookup of individual model instances. Defaults to primary key field name.\n* `lookup_request_field` - The request field that should be used for object lookup. If unset this defaults to using the same value as `lookup_field`.\n\n##### Methods[¶](#methods)\n\n*class* `django_grpc_framework.generics.``GenericService`(***kwargs*)[¶](#django_grpc_framework.generics.GenericService)\nBase class for all other generic services.\n\n`filter_queryset`(*queryset*)[¶](#django_grpc_framework.generics.GenericService.filter_queryset)\nGiven a queryset, filter it, returning a new queryset.\n\n`get_object`()[¶](#django_grpc_framework.generics.GenericService.get_object)\nReturns an object instance that should be used for detail services.\nDefaults to using the lookup_field parameter to filter the base queryset.\n\n`get_queryset`()[¶](#django_grpc_framework.generics.GenericService.get_queryset)\nGet the list of items for this service.\nThis must be an iterable, and may be a queryset.\nDefaults to using `self.queryset`.\n\nIf you are overriding a handler method, it is important that you call\n`get_queryset()` instead of accessing the `queryset` attribute as\n`queryset` will get evaluated only once.\n\nOverride this to provide dynamic behavior, for example:\n```\ndef get_queryset(self):\n    if self.action == 'ListSpecialUser':\n        return SpecialUser.objects.all()\n    return super().get_queryset()\n```\n`get_serializer`(**args*, ***kwargs*)[¶](#django_grpc_framework.generics.GenericService.get_serializer)\nReturn the serializer instance that should be used for validating and deserializing input, and for serializing output.\n\n`get_serializer_class`()[¶](#django_grpc_framework.generics.GenericService.get_serializer_class)\nReturn the class to use for the serializer. Defaults to using self.serializer_class.\n\n`get_serializer_context`()[¶](#django_grpc_framework.generics.GenericService.get_serializer_context)\nExtra context provided to the serializer class. Defaults to including\n`grpc_request`, `grpc_context`, and `service` keys.\n\n#### Mixins[¶](#mixins)\n\nThe mixin classes provide the actions that are used to privide the basic service behavior. The mixin classes can be imported from\n`django_grpc_framework.mixins`.\n\n*class* `django_grpc_framework.mixins.``ListModelMixin`[¶](#django_grpc_framework.mixins.ListModelMixin)\n\n`List`(*request*, *context*)[¶](#django_grpc_framework.mixins.ListModelMixin.List)\nList a queryset. This sends a sequence of messages of\n`serializer.Meta.proto_class` to the client.\n\nNote\n\nThis is a server streaming RPC.\n\n*class* `django_grpc_framework.mixins.``CreateModelMixin`[¶](#django_grpc_framework.mixins.CreateModelMixin)\n\n`Create`(*request*, *context*)[¶](#django_grpc_framework.mixins.CreateModelMixin.Create)\nCreate a model instance.\n\nThe request shoule be a proto message of `serializer.Meta.proto_class`.\nIf an object is created this returns a proto message of\n`serializer.Meta.proto_class`.\n\n`perform_create`(*serializer*)[¶](#django_grpc_framework.mixins.CreateModelMixin.perform_create)\nSave a new object instance.\n\n*class* `django_grpc_framework.mixins.``RetrieveModelMixin`[¶](#django_grpc_framework.mixins.RetrieveModelMixin)\n\n`Retrieve`(*request*, *context*)[¶](#django_grpc_framework.mixins.RetrieveModelMixin.Retrieve)\nRetrieve a model instance.\n\nThe request have to include a field corresponding to\n`lookup_request_field`. If an object can be retrieved this returns a proto message of `serializer.Meta.proto_class`.\n\n*class* `django_grpc_framework.mixins.``UpdateModelMixin`[¶](#django_grpc_framework.mixins.UpdateModelMixin)\n\n`Update`(*request*, *context*)[¶](#django_grpc_framework.mixins.UpdateModelMixin.Update)\nUpdate a model instance.\n\nThe request shoule be a proto message of `serializer.Meta.proto_class`.\nIf an object is updated this returns a proto message of\n`serializer.Meta.proto_class`.\n\n`perform_update`(*serializer*)[¶](#django_grpc_framework.mixins.UpdateModelMixin.perform_update)\nSave an existing object instance.\n\n*class* `django_grpc_framework.mixins.``DestroyModelMixin`[¶](#django_grpc_framework.mixins.DestroyModelMixin)\n\n`Destroy`(*request*, *context*)[¶](#django_grpc_framework.mixins.DestroyModelMixin.Destroy)\nDestroy a model instance.\n\nThe request have to include a field corresponding to\n`lookup_request_field`. If an object is deleted this returns a proto message of `google.protobuf.empty_pb2.Empty`.\n\n`perform_destroy`(*instance*)[¶](#django_grpc_framework.mixins.DestroyModelMixin.perform_destroy)\nDelete an object instance.\n\n#### Concrete service classes[¶](#concrete-service-classes)\n\nThe following classes are the concrete generic services. They can be imported from `django_grpc_framework.generics`.\n\n*class* `django_grpc_framework.generics.``CreateService`(***kwargs*)[¶](#django_grpc_framework.generics.CreateService)\nConcrete service for creating a model instance that provides a `Create()`\nhandler.\n\n*class* `django_grpc_framework.generics.``ListService`(***kwargs*)[¶](#django_grpc_framework.generics.ListService)\nConcrete service for listing a queryset that provides a `List()` handler.\n\n*class* `django_grpc_framework.generics.``RetrieveService`(***kwargs*)[¶](#django_grpc_framework.generics.RetrieveService)\nConcrete service for retrieving a model instance that provides a\n`Retrieve()` handler.\n\n*class* `django_grpc_framework.generics.``DestroyService`(***kwargs*)[¶](#django_grpc_framework.generics.DestroyService)\nConcrete service for deleting a model instance that provides a `Destroy()`\nhandler.\n\n*class* `django_grpc_framework.generics.``UpdateService`(***kwargs*)[¶](#django_grpc_framework.generics.UpdateService)\nConcrete service for updating a model instance that provides a\n`Update()` handler.\n\n*class* `django_grpc_framework.generics.``ReadOnlyModelService`(***kwargs*)[¶](#django_grpc_framework.generics.ReadOnlyModelService)\nConcrete service that provides default `List()` and `Retrieve()`\nhandlers.\n\n*class* `django_grpc_framework.generics.``ModelService`(***kwargs*)[¶](#django_grpc_framework.generics.ModelService)\nConcrete service that provides default `Create()`, `Retrieve()`,\n`Update()`, `Destroy()` and `List()` handlers.\n\nYou may need to provide custom classes that have certain actions, to create a base class that provides `List()` and `Create()` handlers, inherit from\n`GenericService` and mixin the required handlers:\n```\nfrom django_grpc_framework import mixins from django_grpc_framework import generics\n\nclass ListCreateService(mixins.CreateModelMixin,\n                        mixins.ListModelMixin,\n                        GenericService):\n    \"\"\"\n Concrete service that provides ``Create()`` and ``List()`` handlers.\n \"\"\"\n    pass\n```\n### Proto Serializers[¶](#proto-serializers)\n\nThe serializers work almost exactly the same with REST framework’s `Serializer`\nclass and `ModelSerializer`, but use `message` instead of `data` as input and output.\n\n#### Declaring serializers[¶](#declaring-serializers)\n\nDeclaring a serializer looks very similar to declaring a rest framework serializer:\n```\nfrom rest_framework import serializers from django_grpc_framework import proto_serializers\n\nclass PersonProtoSerializer(proto_serializers.ProtoSerializer):\n    name = serializers.CharField(max_length=100)\n    email = serializers.EmailField(max_length=100)\n\n    class Meta:\n        proto_class = hrm_pb2.Person\n```\n#### Overriding serialization and deserialization behavior[¶](#overriding-serialization-and-deserialization-behavior)\n\nA proto serializer is the same as one rest framework serializer, but we are adding the following logic:\n\n* Protobuf message -> Dict of python primitive datatypes.\n* Protobuf message <- Dict of python primitive datatypes.\n\nIf you need to alter the convert behavior of a serializer class, you can do so by overriding the `.message_to_data()` or `.data_to_message` methods.\n\nHere is the default implementation:\n```\nfrom google.protobuf.json_format import MessageToDict, ParseDict\n\nclass ProtoSerializer(BaseProtoSerializer, Serializer):\n    def message_to_data(self, message):\n        \"\"\"Protobuf message -> Dict of python primitive datatypes.\n \"\"\"\n        return MessageToDict(\n            message, including_default_value_fields=True,\n            preserving_proto_field_name=True\n        )\n\n    def data_to_message(self, data):\n        \"\"\"Protobuf message <- Dict of python primitive datatypes.\"\"\"\n        return ParseDict(\n            data, self.Meta.proto_class(),\n            ignore_unknown_fields=True\n        )\n```\nThe default behavior requires you to provide `ProtoSerializer.Meta.proto_class`,\nit is the protobuf class that should be used for create output proto message object. You must either set this attribute, or override the\n`data_to_message()` method.\n\n#### Serializing objects[¶](#serializing-objects)\n\nWe can now use `PersonProtoSerializer` to serialize a person object:\n```\n>>> serializer = PersonProtoSerializer(person)\n>>> serializer.message name: \"amy\"\nemail: \"\"\n>>> type(serializer.message)\n\n```\n#### Deserializing objects[¶](#deserializing-objects)\n\nDeserialization is similar:\n```\n>>> serializer = PersonProtoSerializer(message=message)\n>>> serializer.is_valid()\nTrue\n>>> serializer.validated_data OrderedDict([('name', 'amy'), ('email', '')])\n```\n#### ModelProtoSerializer[¶](#modelprotoserializer)\n\nThis is the same as a rest framework `ModelSerializer`:\n```\nfrom django_grpc_framework import proto_serializers from hrm.models import Person import hrm_pb2\n\nclass PersonProtoSerializer(proto_serializers.ModelProtoSerializer):\n    class Meta:\n        model = Person\n        proto_class = hrm_pb2.Person\n        fields = '__all__'\n```\n### Proto[¶](#proto)\n\nDjango gRPC framework provides support for automatic generation of [proto](https://developers.google.com/protocol-buffers/docs/proto3).\n\n#### Generate proto for model[¶](#generate-proto-for-model)\n\nIf you want to automatically generate proto definition based on a model,\nyou can use the `generateproto` management command:\n```\npython manage.py generateproto --model django.contrib.auth.models.User\n```\nTo specify fields and save it to a file, use:\n```\npython manage.py generateproto --model django.contrib.auth.models.User --fields id,username,email --file demo.proto\n```\nOnce you’ve generated a proto file in this way, you can edit it as you wish.\n\n### Server[¶](#server)\n\n#### grpcrunserver[¶](#grpcrunserver)\n\nRun a grpc server:\n```\n$ python manage.py grpcrunserver\n```\nRun a grpc development server, this tells Django to use the auto-reloader and run checks:\n```\n$ python manage.py grpcrunserver --dev\n```\nRun the server with a certain address:\n```\n$ python manage.py grpcrunserver 127.0.0.1:8000 --max-workers 5\n```\n#### Configuration[¶](#configuration)\n\n##### Setting the server interceptors[¶](#setting-the-server-interceptors)\n\nIf you need to add server interceptors, you can do so by setting the\n\n`SERVER_INTERCEPTORS` setting. For example, have something like this in your `settings.py` file:\n```\nGRPC_FRAMEWORK = {\n    ...\n    'SERVER_INTERCEPTORS': [\n        'path.to.DoSomethingInterceptor',\n        'path.to.DoAnotherThingInterceptor',\n    ]\n}\n```\n### Testing[¶](#testing)\n\nDjango gRPC framework includes a few helper classes that come in handy when writing tests for services.\n\n#### The test channel[¶](#the-test-channel)\n\nThe test channel is a Python class that acts as a dummy gRPC channel,\nallowing you to test you services. You can simulate gRPC requests on a service method and get the response. Here is a quick example, let’s open Django shell `python manage.py shell`:\n```\n>>> from django_grpc_framework.test import Channel\n>>> channel = Channel()\n>>> stub = post_pb2_grpc.PostControllerStub(channel)\n>>> response = stub.Retrieve(post_pb2.PostRetrieveRequest(id=post_id))\n>>> response.title\n'This is a title'\n```\n#### RPC test cases[¶](#rpc-test-cases)\n\nDjango gRPC framework includes the following test case classes, that mirror the existing Django test case classes, but provide a test `Channel`\ninstead of `Client`.\n\n* `RPCSimpleTestCase`\n* `RPCTransactionTestCase`\n* `RPCTestCase`\n\nYou can use these test case classes as you would for the regular Django test case classes, the `self.channel` attribute will be an `Channel` instance:\n```\nfrom django_grpc_framework.test import RPCTestCase from django.contrib.auth.models import User import account_pb2 import account_pb2_grpc\n\nclass UserServiceTest(RPCTestCase):\n    def test_create_user(self):\n        stub = account_pb2_grpc.UserControllerStub(self.channel)\n        response = stub.Create(account_pb2.User(username='tom', email=''))\n        self.assertEqual(response.username, 'tom')\n        self.assertEqual(response.email, '')\n        self.assertEqual(User.objects.count(), 1)\n```\n### Settings[¶](#settings)\n\nConfiguration for gRPC framework is all namespaced inside a single Django setting, named `GRPC_FRAMEWORK`, for example your project’s `settings.py`\nfile might look like this:\n```\nGRPC_FRAMEWORK = {\n    'ROOT_HANDLERS_HOOK': 'project.urls.grpc_handlers',\n}\n```\n#### Accessing settings[¶](#accessing-settings)\n\nIf you need to access the values of gRPC framework’s settings in your project,\nyou should use the `grpc_settings` object. For example:\n```\nfrom django_grpc_framework.settings import grpc_settings print(grpc_settings.ROOT_HANDLERS_HOOK)\n```\nThe `grpc_settings` object will check for any user-defined settings, and otherwise fall back to the default values. Any setting that uses string import paths to refer to a class will automatically import and return the referenced class, instead of the string literal.\n\n#### Configuration values[¶](#configuration-values)\n\n`ROOT_HANDLERS_HOOK`[¶](#ROOT_HANDLERS_HOOK)\nA hook function that takes gRPC server object as a single parameter and add all servicers to the server.\n\nDefault: `'{settings.ROOT_URLCONF}.grpc_handlers'`\n\nOne example for the hook function:\n```\ndef grpc_handlers(server):\n    demo_pb2_grpc.add_UserControllerServicer_to_server(UserService.as_servicer(), server)\n```\n`SERVER_INTERCEPTORS`[¶](#SERVER_INTERCEPTORS)\nAn optional list of ServerInterceptor objects that observe and optionally manipulate the incoming RPCs before handing them over to handlers.\n\nDefault: `None`\n\n### Patterns for gRPC[¶](#patterns-for-grpc)\n\nThis part contains some snippets and patterns for Django gRPC framework.\n\n#### Handling Partial Update[¶](#handling-partial-update)\n\nIn proto3:\n\n1. All fields are optional 2. Singular primitive fields, repeated fields, and map fields are initialized with default values (0, empty list, etc). There’s no way of telling whether a field was explicitly set to the default value (for example whether a boolean was set to false) or just not set at all.\n\nIf we want to do a partial update on resources, we need to know whether a field was set or not set at all. There are different strategies that can be used to represent `unset`, we’ll use a pattern called `\"Has Pattern\"` here.\n\n##### Singular field absence[¶](#singular-field-absence)\n\nIn proto3, for singular field types, you can use the parent message’s\n`HasField()` method to check if a message type field value has been set,\nbut you can’t do it with non-message singular types.\n\nFor primitive types if you need `HasField` to you could use\n`\"google/protobuf/wrappers.proto\"`. Wrappers are useful for places where you need to distinguish between the absence of a primitive typed field and its default value:\n```\nimport \"google/protobuf/wrappers.proto\";\n\nservice PersonController {\n    rpc PartialUpdate(PersonPartialUpdateRequest) returns (Person) {}\n}\n\nmessage Person {\n    int32 id = 1;\n    string name = 2;\n    string email = 3;\n}\n\nmessage PersonPartialUpdateRequest {\n    int32 id = 1;\n    google.protobuf.StringValue name = 2;\n    google.protobuf.StringValue email = 3;\n}\n```\nHere is the client usage:\n```\nfrom google.protobuf.wrappers_pb2 import StringValue\n\nwith grpc.insecure_channel('localhost:50051') as channel:\n    stub = hrm_pb2_grpc.PersonControllerStub(channel)\n    request = hrm_pb2.PersonPartialUpdateRequest(id=1, name=StringValue(value=\"amy\"))\n    response = stub.PartialUpdate(request)\n    print(response, end='')\n```\nThe service implementation:\n```\nclass PersonService(generics.GenericService):\n    queryset = Person.objects.all()\n    serializer_class = PersonProtoSerializer\n\n    def PartialUpdate(self, request, context):\n        instance = self.get_object()\n        serializer = self.get_serializer(instance, message=request, partial=True)\n        serializer.is_valid(raise_exception=True)\n        serializer.save()\n        return serializer.message\n```\nOr you can just use `PartialUpdateModelMixin` to get the same behavior:\n```\nclass PersonService(mixins.PartialUpdateModelMixin,\n                    generics.GenericService):\n    queryset = Person.objects.all()\n    serializer_class = PersonProtoSerializer\n```\n##### Repeated and map field absence[¶](#repeated-and-map-field-absence)\n\nIf you need to check whether repeated fields and map fields are set or not,\nyou need to do it manually:\n```\nmessage PersonPartialUpdateRequest {\n    int32 id = 1;\n    google.protobuf.StringValue name = 2;\n    google.protobuf.StringValue email = 3;\n    repeated int32 groups = 4;\n    bool is_groups_set = 5;\n}\n```\n#### Null Support[¶](#null-support)\n\nIn proto3, all fields are never null. However, we can use `Oneof` to define a nullable type, for example:\n```\nsyntax = \"proto3\";\n\npackage snippets;\n\nimport \"google/protobuf/struct.proto\";\n\nservice SnippetController {\n    rpc Update(Snippet) returns (Snippet) {}\n}\n\nmessage NullableString {\n    oneof kind {\n        string value = 1;\n        google.protobuf.NullValue null = 2;\n    }\n}\n\nmessage Snippet {\n    int32 id = 1;\n    string title = 2;\n    NullableString language = 3;\n}\n```\nThe client example:\n```\nimport grpc import snippets_pb2 import snippets_pb2_grpc from google.protobuf.struct_pb2 import NullValue\n\nwith grpc.insecure_channel('localhost:50051') as channel:\n    stub = snippets_pb2_grpc.SnippetControllerStub(channel)\n    request = snippets_pb2.Snippet(id=1, title='snippet title')\n    # send non-null value\n    # request.language.value = \"python\"\n    # send null value\n    request.language.null = NullValue.NULL_VALUE\n    response = stub.Update(request)\n    print(response, end='')\n```\nThe service implementation:\n```\nfrom django_grpc_framework import generics, mixins from django_grpc_framework import proto_serializers from snippets.models import Snippet import snippets_pb2 from google.protobuf.struct_pb2 import NullValue\n\nclass SnippetProtoSerializer(proto_serializers.ModelProtoSerializer):\n    class Meta:\n        model = Snippet\n        fields = '__all__'\n\n    def message_to_data(self, message):\n        data = {\n            'title': message.title,\n        }\n        if message.language.HasField('value'):\n            data['language'] = message.language.value\n        elif message.language.HasField('null'):\n            data['language'] = None\n        return data\n\n    def data_to_message(self, data):\n        message = snippets_pb2.Snippet(\n            id=data['id'],\n            title=data['title'],\n        )\n        if data['language'] is None:\n            message.language.null = NullValue.NULL_VALUE\n        else:\n            message.language.value = data['language']\n        return message\n\nclass SnippetService(mixins.UpdateModelMixin,\n                     generics.GenericService):\n    queryset = Snippet.objects.all()\n    serializer_class = SnippetProtoSerializer\n```\nAdditional Stuff[¶](#additional-stuff)\n---\n\nChangelog and license here if you are interested.\n\n### Changelog[¶](#changelog)\n\n#### Version 0.2[¶](#version-0-2)\n\n* Added test module\n* Added proto serializers\n* Added proto generators\n\n#### Version 0.1[¶](#version-0-1)\n\nFirst public release.\n\n### License[¶](#license)\n\nThis library is licensed under Apache License.\n\n> > > > > > > > > > > > > Apache License\n> > > > > > > Version 2.0, January 2004\n> > > > > > > > > > \n> > > > TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n> 1. Definitions.\n> “License” shall mean the terms and conditions for use, reproduction,\n> and distribution as defined by Sections 1 through 9 of this document.\n> “Licensor” shall mean the copyright owner or entity authorized by\n> the copyright owner that is granting the License.\n> “Legal Entity” shall mean the union of the acting entity and all\n> other entities that control, are controlled by, or are under common\n> control with that entity. For the purposes of this definition,\n> “control” means (i) the power, direct or indirect, to cause the\n> direction or management of such entity, whether by contract or\n> otherwise, or (ii) ownership of fifty percent (50%) or more of the\n> outstanding shares, or (iii) beneficial ownership of such entity.\n> “You” (or “Your”) shall mean an individual or Legal Entity\n> exercising permissions granted by this License.\n> “Source” form shall mean the preferred form for making modifications,\n> including but not limited to software source code, documentation\n> source, and configuration files.\n> “Object” form shall mean any form resulting from mechanical\n> transformation or translation of a Source form, including but\n> not limited to compiled object code, generated documentation,\n> and conversions to other media types.\n> “Work” shall mean the work of authorship, whether in Source or\n> Object form, made available under the License, as indicated by a\n> copyright notice that is included in or attached to the work\n> (an example is provided in the Appendix below).\n> “Derivative Works” shall mean any work, whether in Source or Object\n> form, that is based on (or derived from) the Work and for which the\n> editorial revisions, annotations, elaborations, or other modifications\n> represent, as a whole, an original work of authorship. For the purposes\n> of this License, Derivative Works shall not include works that remain\n> separable from, or merely link (or bind by name) to the interfaces of,\n> the Work and Derivative Works thereof.\n> “Contribution” shall mean any work of authorship, including\n> the original version of the Work and any modifications or additions\n> to that Work or Derivative Works thereof, that is intentionally\n> submitted to Licensor for inclusion in the Work by the copyright owner\n> or by an individual or Legal Entity authorized to submit on behalf of\n> the copyright owner. For the purposes of this definition, “submitted”\n> means any form of electronic, verbal, or written communication sent\n> to the Licensor or its representatives, including but not limited to\n> communication on electronic mailing lists, source code control systems,\n> and issue tracking systems that are managed by, or on behalf of, the\n> Licensor for the purpose of discussing and improving the Work, but\n> excluding communication that is conspicuously marked or otherwise\n> designated in writing by the copyright owner as “Not a Contribution.”\n> “Contributor” shall mean Licensor and any individual or Legal Entity\n> on behalf of whom a Contribution has been received by Licensor and\n> subsequently incorporated within the Work.\n> 2. Grant of Copyright License. Subject to the terms and conditions of\n> this License, each Contributor hereby grants to You a perpetual,\n> worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n> copyright license to reproduce, prepare Derivative Works of,\n> publicly display, publicly perform, sublicense, and distribute the\n> Work and such Derivative Works in Source or Object form.\n> 3. Grant of Patent License. Subject to the terms and conditions of\n> this License, each Contributor hereby grants to You a perpetual,\n> worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n> (except as stated in this section) patent license to make, have made,\n> use, offer to sell, sell, import, and otherwise transfer the Work,\n> where such license applies only to those patent claims licensable\n> by such Contributor that are necessarily infringed by their\n> Contribution(s) alone or by combination of their Contribution(s)\n> with the Work to which such Contribution(s) was submitted. If You\n> institute patent litigation against any entity (including a\n> cross-claim or counterclaim in a lawsuit) alleging that the Work\n> or a Contribution incorporated within the Work constitutes direct\n> or contributory patent infringement, then any patent licenses\n> granted to You under this License for that Work shall terminate\n> as of the date such litigation is filed.\n> 4. Redistribution. You may reproduce and distribute copies of the\n> Work or Derivative Works thereof in any medium, with or without\n> modifications, and in Source or Object form, provided that You\n> meet the following conditions:\n> \t1. You must give any other recipients of the Work or\n> \tDerivative Works a copy of this License; and\n> \t2. You must cause any modified files to carry prominent notices\n> \tstating that You changed the files; and\n> \t3. You must retain, in the Source form of any Derivative Works\n> \tthat You distribute, all copyright, patent, trademark, and\n> \tattribution notices from the Source form of the Work,\n> \texcluding those notices that do not pertain to any part of\n> \tthe Derivative Works; and\n> \t4. If the Work includes a “NOTICE” text file as part of its\n> \tdistribution, then any Derivative Works that You distribute must\n> \tinclude a readable copy of the attribution notices contained\n> \twithin such NOTICE file, excluding those notices that do not\n> \tpertain to any part of the Derivative Works, in at least one\n> \tof the following places: within a NOTICE text file distributed\n> \tas part of the Derivative Works; within the Source form or\n> \tdocumentation, if provided along with the Derivative Works; or,\n> \twithin a display generated by the Derivative Works, if and\n> \twherever such third-party notices normally appear. The contents\n> \tof the NOTICE file are for informational purposes only and\n> \tdo not modify the License. You may add Your own attribution\n> \tnotices within Derivative Works that You distribute, alongside\n> \tor as an addendum to the NOTICE text from the Work, provided\n> \tthat such additional attribution notices cannot be construed\n> \tas modifying the License.You may add Your own copyright statement to Your modifications and\n> may provide additional or different license terms and conditions\n> for use, reproduction, or distribution of Your modifications, or\n> for any such Derivative Works as a whole, provided Your use,\n> reproduction, and distribution of the Work otherwise complies with\n> the conditions stated in this License.\n> 5. Submission of Contributions. Unless You explicitly state otherwise,\n> any Contribution intentionally submitted for inclusion in the Work\n> by You to the Licensor shall be under the terms and conditions of\n> this License, without any additional terms or conditions.\n> Notwithstanding the above, nothing herein shall supersede or modify\n> the terms of any separate license agreement you may have executed\n> with Licensor regarding such Contributions.\n> 6. Trademarks. This License does not grant permission to use the trade\n> names, trademarks, service marks, or product names of the Licensor,\n> except as required for reasonable and customary use in describing the\n> origin of the Work and reproducing the content of the NOTICE file.\n> 7. Disclaimer of Warranty. Unless required by applicable law or\n> agreed to in writing, Licensor provides the Work (and each\n> Contributor provides its Contributions) on an “AS IS” BASIS,\n> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n> implied, including, without limitation, any warranties or conditions\n> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n> PARTICULAR PURPOSE. You are solely responsible for determining the\n> appropriateness of using or redistributing the Work and assume any\n> risks associated with Your exercise of permissions under this License.\n> 8. Limitation of Liability. In no event and under no legal theory,\n> whether in tort (including negligence), contract, or otherwise,\n> unless required by applicable law (such as deliberate and grossly\n> negligent acts) or agreed to in writing, shall any Contributor be\n> liable to You for damages, including any direct, indirect, special,\n> incidental, or consequential damages of any character arising as a\n> result of this License or out of the use or inability to use the\n> Work (including but not limited to damages for loss of goodwill,\n> work stoppage, computer failure or malfunction, or any and all\n> other commercial damages or losses), even if such Contributor\n> has been advised of the possibility of such damages.\n> 9. Accepting Warranty or Additional Liability. While redistributing\n> the Work or Derivative Works thereof, You may choose to offer,\n> and charge a fee for, acceptance of support, warranty, indemnity,\n> or other liability obligations and/or rights consistent with this\n> License. However, in accepting such obligations, You may act only\n> on Your own behalf and on Your sole responsibility, not on behalf\n> of any other Contributor, and only if You agree to indemnify,\n> defend, and hold each Contributor harmless for any liability\n> incurred by, or claims asserted against, such Contributor by reason\n> of your accepting any such warranty or additional liability.\n> END OF TERMS AND CONDITIONS\n> APPENDIX: How to apply the Apache License to your work.\n> > > To apply the Apache License to your work, attach the following\n> > boilerplate notice, with the fields enclosed by brackets “[]”\n> > replaced with your own identifying information. (Don’t include\n> > the brackets!) The text should be enclosed in the appropriate\n> > comment syntax for the file format. We also recommend that a\n> > file or class name and description of purpose be included on the\n> > same “printed page” as the copyright notice for easier\n> > identification within third-party archives.\n> Copyright [yyyy] [name of copyright owner]\n> Licensed under the Apache License, Version 2.0 (the “License”);\n> you may not use this file except in compliance with the License.\n> You may obtain a copy of the License at\n> > > \n> Unless required by applicable law or agreed to in writing, software\n> distributed under the License is distributed on an “AS IS” BASIS,\n> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n> See the License for the specific language governing permissions and\n> limitations under the License.\n[django-grpc-framework](index.html#document-index)\n===\n\n### Navigation\n\n* [Installation](index.html#document-installation)\n* [Quickstart](index.html#document-quickstart)\n* [Tutorial](index.html#document-tutorial/index)\n* [Services](index.html#document-services)\n* [Generic services](index.html#document-generics)\n* [Proto Serializers](index.html#document-proto_serializers)\n* [Proto](index.html#document-protos)\n* [Server](index.html#document-server)\n* [Testing](index.html#document-testing)\n* [Settings](index.html#document-settings)\n* [Patterns for gRPC](index.html#document-patterns/index)\n\n* [Changelog](index.html#document-changelog)\n* [License](index.html#document-license)\n\n### Related Topics\n\n* [Documentation overview](index.html#document-index)\n\n### Quick search"}}},{"rowIdx":449,"cells":{"project":{"kind":"string","value":"github.com/go-mangos/mangos"},"source":{"kind":"string","value":"go"},"language":{"kind":"string","value":"Go"},"content":{"kind":"string","value":"README\n [¶](#section-readme)\n---\n\n### mangos\n\n[![Linux Status](https://img.shields.io/travis/go-mangos/mangos.svg?label=linux)](https://travis-ci.org/go-mangos/mangos)\n[![Windows Status](https://img.shields.io/appveyor/ci/gdamore/mangos.svg?label=windows)](https://ci.appveyor.com/project/gdamore/mangos)\n[![Apache License](https://img.shields.io/badge/license-APACHE2-blue.svg)](https://github.com/nanomsg/mangos/raw/master/LICENSE)\n[![Gitter](https://img.shields.io/badge/gitter-join-brightgreen.svg)](https://gitter.im/go-mangos/mangos)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/nanomsg.org/go-mangos)\n[![Go Report Card](https://goreportcard.com/badge/nanomsg.org/go-mangos)](https://goreportcard.com/report/nanomsg.org/go-mangos)\n\nPackage mangos is an implementation in pure Go of the SP\n(\"Scalability Protocols\")\nmessaging system.\nThis makes heavy use of go channels, internally, but it can operate on systems that lack support for cgo.\n\nNOTE: The repository has moved from github.com/go-mangos/mangos.\nPlease import using nanomsg.org/go-mangos. Also, be advised that the master branch of this repository may contain breaking changes.\nTherefore, consider using a tag, such as v1, to ensure that you have the latest stable version.\n\nThe reference implementation of the SP protocols is available as\n[nanomsg™](http://www.nanomsg.org); there is also an effort to implement an improved and more capable version of nanomsg called\n[NNG™](https://github.com/nanomsg/nng).\n\nThe design is intended to make it easy to add new transports with almost trivial effort, as well as new topologies (\"protocols\" in SP terminology.)\n\nAt present, all of the Req/Rep, Pub/Sub, Pair, Bus, Push/Pull, and Surveyor/Respondent patterns are supported.\n\nAdditionally, there is an experimental new pattern called STAR available. This pattern is like Bus, except that the messages are delivered not just to immediate peers, but to all members of the topology. Developers must be careful not to create cycles in their network when using this pattern, otherwise infinite loops can occur.\n\nSupported transports include TCP, inproc, IPC, Websocket, Websocket/TLS and TLS.\nUse addresses of the form \"tls+tcp://:\" to access TLS.\nNote that ipc:// is not supported on Windows (by either this or the reference implementation.) Forcing the local TCP port in Dial is not supported yet (this is rarely useful).\n\nBasic interoperability with nanomsg and NNG has been verified (you can do so yourself with nanocat and macat) for all protocols and transports that NNG and nanomsg support.\nAdditionally there are a number of projects that use the two products together.\n\nThere is a third party experimental QUIC transport available at\n[quic-mangos](https://github.com/lthibault/quic-mangos). (An RFE to make this transport official exists.)\n\nIf you find this useful, I would appreciate knowing about it. I can be reached via my email address, garrett -at- damore -dot- org\n\n### Installing\n\n#### Using *go get*\n```\n$ go get -u github.com/nanomsg/go-mangos\n```\nAfter this command *mangos* is ready to use. Its source will be in:\n```\n$GOPATH/src/pkg/github.com/nanomsg.org/go-mangos\n```\nYou can use `go get -u -a` to update all installed packages.\n\n### Documentation\n\nFor docs, see  or run:\n```\n$ godoc nanomsg.org/go-mangos\n```\n### Testing\n\nThis package supports internal self tests, which can be run in the idiomatic Go way. (Note that most of the tests are in a test subdirectory.)\n```\n$ go test nanomsg.org/go-mangos/...\n```\nThere are also internal benchmarks available:\n```\n$ go test -bench=. nanomsg.org/go-mangos/test\n```\n### Commercial Support\n\n[Staysail Systems, Inc.](mailto:) offers\n[commercial support](http://staysail.tech/support/mangos) for mangos.\n\n### Examples\n\nSome examples are posted in the directories under examples/\nin this project.\n\nThese examples are rewrites (in Go) of 's\n[Getting Started with Nanomsg](http://nanomsg.org/gettingstarted/index.html).\n\ngodoc in the example directories will yield information about how to run each example program.\n\nEnjoy!\n\nCopyright 2018 The Mangos Authors\n\nmangos™, Nanomsg™ and NNG™ are [trademarks](http://nanomsg.org/trademarks.html) of .\n\nDocumentation\n [¶](#section-documentation)\n---\n\n[Rendered for](https://go.dev/about#build-context)\n\nlinux/amd64 windows/amd64 darwin/amd64 js/wasm\n\n \n### Overview [¶](#pkg-overview)\n\nPackage mangos provides a pure Go implementation of the Scalability Protocols. These are more familiarily known as \"nanomsg\" which is the C-based software package that is also their reference implementation.\n\nThese protocols facilitate the rapid creation of applications which rely on multiple participants in sometimes complex communications topologies, including Request/Reply, Publish/Subscribe, Push/Pull,\nSurveyor/Respondant, etc.\n\nFor more information, see www.nanomsg.org.\n\n### Index [¶](#pkg-index)\n\n* [Constants](#pkg-constants)\n* [Variables](#pkg-variables)\n* [func Device(s1 Socket, s2 Socket) error](#Device)\n* [func DrainChannel(ch chan<- *Message, expire time.Time) bool](#DrainChannel)\n* [func NullRecv(ep Endpoint)](#NullRecv)\n* [func ProtocolName(number uint16) string](#ProtocolName)\n* [func ResolveTCPAddr(addr string) (*net.TCPAddr, error)](#ResolveTCPAddr)\n* [func StripScheme(t Transport, addr string) (string, error)](#StripScheme)\n* [func ValidPeers(p1, p2 Protocol) bool](#ValidPeers)\n* [type CondTimed](#CondTimed)\n* + [func (cv *CondTimed) WaitAbsTimeout(when time.Time) bool](#CondTimed.WaitAbsTimeout)\n\t+ [func (cv *CondTimed) WaitRelTimeout(when time.Duration) bool](#CondTimed.WaitRelTimeout)\n* [type Dialer](#Dialer)\n* [type Endpoint](#Endpoint)\n* [type Listener](#Listener)\n* [type Message](#Message)\n* + [func NewMessage(sz int) *Message](#NewMessage)\n* + [func (m *Message) Dup() *Message](#Message.Dup)\n\t+ [func (m *Message) Expired() bool](#Message.Expired)\n\t+ [func (m *Message) Free()](#Message.Free)\n* [type Pipe](#Pipe)\n* + [func NewConnPipe(c net.Conn, sock Socket, props ...interface{}) (Pipe, error)](#NewConnPipe)\n\t+ [func NewConnPipeIPC(c net.Conn, sock Socket, props ...interface{}) (Pipe, error)](#NewConnPipeIPC)\n* [type PipeDialer](#PipeDialer)\n* [type PipeListener](#PipeListener)\n* [type Port](#Port)\n* [type PortAction](#PortAction)\n* [type PortHook](#PortHook)\n* [type Protocol](#Protocol)\n* [type ProtocolRecvHook](#ProtocolRecvHook)\n* [type ProtocolSendHook](#ProtocolSendHook)\n* [type ProtocolSocket](#ProtocolSocket)\n* [type Socket](#Socket)\n* + [func MakeSocket(proto Protocol) Socket](#MakeSocket)\n* [type Transport](#Transport)\n* [type Waiter](#Waiter)\n* + [func (w *Waiter) Add()](#Waiter.Add)\n\t+ [func (w *Waiter) Done()](#Waiter.Done)\n\t+ [func (w *Waiter) Init()](#Waiter.Init)\n\t+ [func (w *Waiter) Wait()](#Waiter.Wait)\n\t+ [func (w *Waiter) WaitAbsTimeout(t time.Time) bool](#Waiter.WaitAbsTimeout)\n\t+ [func (w *Waiter) WaitRelTimeout(d time.Duration) bool](#Waiter.WaitRelTimeout)\n\n### Constants [¶](#pkg-constants)\n\n```\nconst (\n // OptionRaw is used to enable RAW mode processing. The details of\n\t// how this varies from normal mode vary from protocol to protocol.\n\t// RAW mode corresponds to AF_SP_RAW in the C variant, and must be\n\t// used with Devices. In particular, RAW mode sockets are completely\n\t// stateless -- any state between recv/send messages is included in\n\t// the message headers. Protocol names starting with \"X\" default\n\t// to the RAW mode of the same protocol without the leading \"X\".\n\t// The value passed is a bool.\n\tOptionRaw = \"RAW\"\n\n // OptionRecvDeadline is the time until the next Recv times out. The\n\t// value is a time.Duration. Zero value may be passed to indicate that\n\t// no timeout should be applied. A negative value indicates a\n\t// non-blocking operation. By default there is no timeout.\n\tOptionRecvDeadline = \"RECV-DEADLINE\"\n\n // OptionSendDeadline is the time until the next Send times out. The\n\t// value is a time.Duration. Zero value may be passed to indicate that\n\t// no timeout should be applied. A negative value indicates a\n\t// non-blocking operation. By default there is no timeout.\n\tOptionSendDeadline = \"SEND-DEADLINE\"\n\n // OptionRetryTime is used by REQ. The argument is a time.Duration.\n\t// When a request has not been replied to within the given duration,\n\t// the request will automatically be resent to an available peer.\n\t// This value should be longer than the maximum possible processing\n\t// and transport time. The value zero indicates that no automatic\n\t// retries should be sent. The default value is one minute.\n\t//\n\t// Note that changing this option is only guaranteed to affect requests\n\t// sent after the option is set. Changing the value while a request\n\t// is outstanding may not have the desired effect.\n\tOptionRetryTime = \"RETRY-TIME\"\n\n // OptionSubscribe is used by SUB/XSUB. The argument is a []byte.\n\t// The application will receive messages that start with this prefix.\n\t// Multiple subscriptions may be in effect on a given socket. The\n\t// application will not receive messages that do not match any current\n\t// subscriptions. (If there are no subscriptions for a SUB/XSUB\n\t// socket, then the application will not receive any messages. An\n\t// empty prefix can be used to subscribe to all messages.)\n\tOptionSubscribe = \"SUBSCRIBE\"\n\n // OptionUnsubscribe is used by SUB/XSUB. The argument is a []byte,\n\t// representing a previously established subscription, which will be\n\t// removed from the socket.\n\tOptionUnsubscribe = \"UNSUBSCRIBE\"\n\n // OptionSurveyTime is used to indicate the deadline for survey\n\t// responses, when used with a SURVEYOR socket. Messages arriving\n\t// after this will be discarded. Additionally, this will set the\n\t// OptionRecvDeadline when starting the survey, so that attempts to\n\t// receive messages fail with ErrRecvTimeout when the survey is\n\t// concluded. The value is a time.Duration. Zero can be passed to\n\t// indicate an infinite time. Default is 1 second.\n\tOptionSurveyTime = \"SURVEY-TIME\"\n\n // OptionTLSConfig is used to supply TLS configuration details. It\n\t// can be set using the ListenOptions or DialOptions.\n\t// The parameter is a tls.Config pointer.\n\tOptionTLSConfig = \"TLS-CONFIG\"\n\n // OptionWriteQLen is used to set the size, in messages, of the write\n\t// queue channel. By default, it's 128. This option cannot be set if\n\t// Dial or Listen has been called on the socket.\n\tOptionWriteQLen = \"WRITEQ-LEN\"\n\n // OptionReadQLen is used to set the size, in messages, of the read\n\t// queue channel. By default, it's 128. This option cannot be set if\n\t// Dial or Listen has been called on the socket.\n\tOptionReadQLen = \"READQ-LEN\"\n\n // OptionKeepAlive is used to set TCP KeepAlive. Value is a boolean.\n\t// Default is true.\n\tOptionKeepAlive = \"KEEPALIVE\"\n\n // OptionNoDelay is used to configure Nagle -- when true messages are\n\t// sent as soon as possible, otherwise some buffering may occur.\n\t// Value is a boolean. Default is true.\n\tOptionNoDelay = \"NO-DELAY\"\n\n // OptionLinger is used to set the linger property. This is the amount\n\t// of time to wait for send queues to drain when Close() is called.\n\t// Close() may block for up to this long if there is unsent data, but\n\t// will return as soon as all data is delivered to the transport.\n\t// Value is a time.Duration. Default is one second.\n\tOptionLinger = \"LINGER\"\n\n // OptionTTL is used to set the maximum time-to-live for messages.\n\t// Note that not all protocols can honor this at this time, but for\n\t// those that do, if a message traverses more than this many devices,\n\t// it will be dropped. This is used to provide protection against\n\t// loops in the topology. The default is protocol specific.\n\tOptionTTL = \"TTL\"\n\n // OptionMaxRecvSize supplies the maximum receive size for inbound\n\t// messages. This option exists because the wire protocol allows\n\t// the sender to specify the size of the incoming message, and\n\t// if the size were overly large, a bad remote actor could perform a\n\t// remote Denial-Of-Service by requesting ridiculously large message\n\t// sizes and then stalling on send. The default value is 1MB.\n\t//\n\t// A value of 0 removes the limit, but should not be used unless\n\t// absolutely sure that the peer is trustworthy.\n\t//\n\t// Not all transports honor this lmit. For example, this limit\n\t// makes no sense when used with inproc.\n\t//\n\t// Note that the size includes any Protocol specific header. It is\n\t// better to pick a value that is a little too big, than too small.\n\t//\n\t// This option is only intended to prevent gross abuse of the system,\n\t// and not a substitute for proper application message verification.\n\tOptionMaxRecvSize = \"MAX-RCV-SIZE\"\n\n // OptionReconnectTime is the initial interval used for connection\n\t// attempts. If a connection attempt does not succeed, then ths socket\n\t// will wait this long before trying again. An optional exponential\n\t// backoff may cause this value to grow. See OptionMaxReconnectTime\n\t// for more details. This is a time.Duration whose default value is\n\t// 100msec. This option must be set before starting any dialers.\n\tOptionReconnectTime = \"RECONNECT-TIME\"\n\n // OptionMaxReconnectTime is the maximum value of the time between\n\t// connection attempts, when an exponential backoff is used. If this\n\t// value is zero, then exponential backoff is disabled, otherwise\n\t// the value to wait between attempts is doubled until it hits this\n\t// limit. This value is a time.Duration, with initial value 0.\n\t// This option must be set before starting any dialers.\n\tOptionMaxReconnectTime = \"MAX-RECONNECT-TIME\"\n\n // OptionBestEffort enables non-blocking send operations on the\n\t// socket. Normally (for some socket types), a socket will block if\n\t// there are no receivers, or the receivers are unable to keep up\n\t// with the sender. (Multicast sockets types like Bus or Star do not\n\t// behave this way.) If this option is set, instead of blocking, the\n\t// message will be silently discarded. The value is a boolean, and\n\t// defaults to False.\n\tOptionBestEffort = \"BEST-EFFORT\"\n)\n```\n\n```\nconst (\n PortActionAdd = [iota](/builtin#iota)\n PortActionRemove\n)\n```\nPortAction values.\n\n```\nconst (\n // PropLocalAddr expresses a local address. For dialers, this is\n\t// the (often random) address that was locally bound. For listeners,\n\t// it is usually the service address. The value is a net.Addr.\n\tPropLocalAddr = \"LOCAL-ADDR\"\n\n // PropRemoteAddr expresses a remote address. For dialers, this is\n\t// the service address. For listeners, its the address of the far\n\t// end dialer. The value is a net.Addr.\n\tPropRemoteAddr = \"REMOTE-ADDR\"\n\n // PropTLSConnState is used to supply TLS connection details. The\n\t// value is a tls.ConnectionState. It is only valid when TLS is used.\n\tPropTLSConnState = \"TLS-STATE\"\n\n // PropHTTPRequest conveys an *http.Request. This property only exists\n\t// for websocket connections.\n\tPropHTTPRequest = \"HTTP-REQUEST\"\n)\n```\n\n```\nconst (\n ProtoPair = (1 * 16)\n ProtoPub = (2 * 16)\n ProtoSub = (2 * 16) + 1\n ProtoReq = (3 * 16)\n ProtoRep = (3 * 16) + 1\n ProtoPush = (5 * 16)\n ProtoPull = (5 * 16) + 1\n ProtoSurveyor = (6 * 16) + 2\n ProtoRespondent = (6 * 16) + 3\n ProtoBus = (7 * 16)\n\n ProtoStar = (100 * 16)\n)\n```\nUseful constants for protocol numbers. Note that the major protocol number is stored in the upper 12 bits, and the minor (subprotocol) is located in the bottom 4 bits.\n\n### Variables [¶](#pkg-variables)\n\n```\nvar (\n ErrBadAddr = [errors](/errors).[New](/errors#New)(\"invalid address\")\n ErrBadHeader = [errors](/errors).[New](/errors#New)(\"invalid header received\")\n ErrBadVersion = [errors](/errors).[New](/errors#New)(\"invalid protocol version\")\n ErrTooShort = [errors](/errors).[New](/errors#New)(\"message is too short\")\n ErrTooLong = [errors](/errors).[New](/errors#New)(\"message is too long\")\n ErrClosed = [errors](/errors).[New](/errors#New)(\"connection closed\")\n ErrConnRefused = [errors](/errors).[New](/errors#New)(\"connection refused\")\n ErrSendTimeout = [errors](/errors).[New](/errors#New)(\"send time out\")\n ErrRecvTimeout = [errors](/errors).[New](/errors#New)(\"receive time out\")\n ErrProtoState = [errors](/errors).[New](/errors#New)(\"incorrect protocol state\")\n ErrProtoOp = [errors](/errors).[New](/errors#New)(\"invalid operation for protocol\")\n ErrBadTran = [errors](/errors).[New](/errors#New)(\"invalid or unsupported transport\")\n ErrBadProto = [errors](/errors).[New](/errors#New)(\"invalid or unsupported protocol\")\n ErrPipeFull = [errors](/errors).[New](/errors#New)(\"pipe full\")\n ErrPipeEmpty = [errors](/errors).[New](/errors#New)(\"pipe empty\")\n ErrBadOption = [errors](/errors).[New](/errors#New)(\"invalid or unsupported option\")\n ErrBadValue = [errors](/errors).[New](/errors#New)(\"invalid option value\")\n ErrGarbled = [errors](/errors).[New](/errors#New)(\"message garbled\")\n ErrAddrInUse = [errors](/errors).[New](/errors#New)(\"address in use\")\n ErrBadProperty = [errors](/errors).[New](/errors#New)(\"invalid property name\")\n ErrTLSNoConfig = [errors](/errors).[New](/errors#New)(\"missing TLS configuration\")\n ErrTLSNoCert = [errors](/errors).[New](/errors#New)(\"missing TLS certificates\")\n)\n```\nVarious error codes.\n\n### Functions [¶](#pkg-functions)\n\n#### \nfunc [Device](https://github.com/go-mangos/mangos/blob/v1.4.0/device.go#L30) [¶](#Device)\n```\nfunc Device(s1 [Socket](#Socket), s2 [Socket](#Socket)) [error](/builtin#error)\n```\nDevice is used to create a forwarding loop between two sockets. If the same socket is listed (or either socket is nil), then a loopback device is established instead. Note that the single socket case is only valid for protocols where the underlying protocol can peer for itself (e.g. PAIR,\nor BUS, but not REQ/REP or PUB/SUB!) Both sockets will be placed into RAW mode.\n\nIf the plumbing is successful, nil will be returned. Two threads will be established to forward messages in each direction. If either socket returns error on receive or send, the goroutine doing the forwarding will exit.\nThis means that closing either socket will generally cause the goroutines to exit. Apart from closing the socket(s), no further operations should be performed against the socket.\n\n#### \nfunc [DrainChannel](https://github.com/go-mangos/mangos/blob/v1.4.0/util.go#L58) [¶](#DrainChannel)\n\nadded in v1.2.0\n```\nfunc DrainChannel(ch chan<- *[Message](#Message), expire [time](/time).[Time](/time#Time)) [bool](/builtin#bool)\n```\nDrainChannel waits for the channel of Messages to finish emptying (draining) for up to the expiration. It returns true if the drain completed (the channel is empty), false otherwise.\n\n#### \nfunc [NullRecv](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L213) [¶](#NullRecv)\n\nadded in v1.2.0\n```\nfunc NullRecv(ep [Endpoint](#Endpoint))\n```\nNullRecv simply loops, receiving and discarding messages, until the Endpoint returns back a nil message. This allows the Endpoint to notice a dropped connection. It is intended for use by Protocols that are write only -- it lets them become aware of a loss of connectivity even when they have no data to send.\n\n#### \nfunc [ProtocolName](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L180) [¶](#ProtocolName)\n```\nfunc ProtocolName(number [uint16](/builtin#uint16)) [string](/builtin#string)\n```\nProtocolName returns the name corresponding to a given protocol number.\nThis is useful for transports like WebSocket, which use a text name rather than the number in the handshake.\n\n#### \nfunc [ResolveTCPAddr](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L157) [¶](#ResolveTCPAddr)\n\nadded in v1.2.0\n```\nfunc ResolveTCPAddr(addr [string](/builtin#string)) (*[net](/net).[TCPAddr](/net#TCPAddr), [error](/builtin#error))\n```\nResolveTCPAddr is like net.ResolveTCPAddr, but it handles the wildcard used in nanomsg URLs, replacing it with an empty string to indicate that all local interfaces be used.\n\n#### \nfunc [StripScheme](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L147) [¶](#StripScheme)\n```\nfunc StripScheme(t [Transport](#Transport), addr [string](/builtin#string)) ([string](/builtin#string), [error](/builtin#error))\n```\nStripScheme removes the leading scheme (such as \"http://\") from an address string. This is mostly a utility for benefit of transport providers.\n\n#### \nfunc [ValidPeers](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L198) [¶](#ValidPeers)\n```\nfunc ValidPeers(p1, p2 [Protocol](#Protocol)) [bool](/builtin#bool)\n```\nValidPeers returns true if the two sockets are capable of peering to one another. For example, REQ can peer with REP,\nbut not with BUS.\n\n### Types [¶](#pkg-types)\n\n#### \ntype [CondTimed](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L23) [¶](#CondTimed)\n```\ntype CondTimed struct {\n [sync](/sync).[Cond](/sync#Cond)\n}\n```\nCondTimed is a condition variable (ala sync.Cond) but inclues a timeout.\n\n#### \nfunc (*CondTimed) [WaitAbsTimeout](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L43) [¶](#CondTimed.WaitAbsTimeout)\n```\nfunc (cv *[CondTimed](#CondTimed)) WaitAbsTimeout(when [time](/time).[Time](/time#Time)) [bool](/builtin#bool)\n```\nWaitAbsTimeout is like WaitRelTimeout, but expires on an absolute time instead of a relative one.\n\n#### \nfunc (*CondTimed) [WaitRelTimeout](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L31) [¶](#CondTimed.WaitRelTimeout)\n```\nfunc (cv *[CondTimed](#CondTimed)) WaitRelTimeout(when [time](/time).[Duration](/time#Duration)) [bool](/builtin#bool)\n```\nWaitRelTimeout is like Wait, but it times out. The fact that it timed out can be determined by checking the return value. True indicates that it woke up without a timeout (signaled another way),\nwhereas false indicates a timeout occurred.\n\n#### \ntype [Dialer](https://github.com/go-mangos/mangos/blob/v1.4.0/dialer.go#L19) [¶](#Dialer)\n```\ntype Dialer interface {\n // Close closes the dialer, and removes it from any active socket.\n\t// Further operations on the Dialer will return ErrClosed.\n\tClose() [error](/builtin#error)\n\n // Dial starts connecting on the address. If a connection fails,\n\t// it will restart.\n\tDial() [error](/builtin#error)\n\n // Address returns the string (full URL) of the Listener.\n\tAddress() [string](/builtin#string)\n\n // SetOption sets an option the Listener. Setting options\n\t// can only be done before Listen() has been called.\n\tSetOption(name [string](/builtin#string), value interface{}) [error](/builtin#error)\n\n // GetOption gets an option value from the Listener.\n\tGetOption(name [string](/builtin#string)) (interface{}, [error](/builtin#error))\n}\n```\nDialer is an interface to the underlying dialer for a transport and address.\n\n#### \ntype [Endpoint](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L24) [¶](#Endpoint)\n```\ntype Endpoint interface {\n // GetID returns a unique 31-bit value associated with the Endpoint.\n\t// The value is unique for a given socket, at a given time.\n\tGetID() [uint32](/builtin#uint32)\n\n // Close does what you think.\n\tClose() [error](/builtin#error)\n\n // SendMsg sends a message. On success it returns nil. This is a\n\t// blocking call.\n\tSendMsg(*[Message](#Message)) [error](/builtin#error)\n\n // RecvMsg receives a message. It blocks until the message is\n\t// received. On error, the pipe is closed and nil is returned.\n\tRecvMsg() *[Message](#Message)\n}\n```\nEndpoint represents the handle that a Protocol implementation has to the underlying stream transport. It can be thought of as one side of a TCP, IPC, or other type of connection.\n\n#### \ntype [Listener](https://github.com/go-mangos/mangos/blob/v1.4.0/listener.go#L19) [¶](#Listener)\n```\ntype Listener interface {\n // Close closes the listener, and removes it from any active socket.\n\t// Further operations on the Listener will return ErrClosed.\n\tClose() [error](/builtin#error)\n\n // Listen starts listening for new connectons on the address.\n\tListen() [error](/builtin#error)\n\n // Address returns the string (full URL) of the Listener.\n\tAddress() [string](/builtin#string)\n\n // SetOption sets an option the Listener. Setting options\n\t// can only be done before Listen() has been called.\n\tSetOption(name [string](/builtin#string), value interface{}) [error](/builtin#error)\n\n // GetOption gets an option value from the Listener.\n\tGetOption(name [string](/builtin#string)) (interface{}, [error](/builtin#error))\n}\n```\nListener is an interface to the underlying listener for a transport and address.\n\n#### \ntype [Message](https://github.com/go-mangos/mangos/blob/v1.4.0/message.go#L28) [¶](#Message)\n```\ntype Message struct {\n // Header carries any protocol (SP) specific header. Applications\n\t// should not modify or use this unless they are using Raw mode.\n\t// No user data may be placed here.\n\tHeader [][byte](/builtin#byte)\n\n // Body carries the body of the message. This can also be thought\n\t// of as the message \"payload\".\n\tBody [][byte](/builtin#byte)\n\n // Port may be set on message receipt, to indicate the Port from\n\t// which the Message was received. There are no guarantees that the\n\t// Port is still active, and applications should only use this for\n\t// informational purposes.\n\tPort [Port](#Port)\n\t// contains filtered or unexported fields\n}\n```\nMessage encapsulates the messages that we exchange back and forth. The meaning of the Header and Body fields, and where the splits occur, will vary depending on the protocol. Note however that any headers applied by transport layers (including TCP/ethernet headers, and SP protocol independent length headers), are *not* included in the Header.\n\n#### \nfunc [NewMessage](https://github.com/go-mangos/mangos/blob/v1.4.0/message.go#L156) [¶](#NewMessage)\n```\nfunc NewMessage(sz [int](/builtin#int)) *[Message](#Message)\n```\nNewMessage is the supported way to obtain a new Message. This makes use of a \"cache\" which greatly reduces the load on the garbage collector.\n\n#### \nfunc (*Message) [Dup](https://github.com/go-mangos/mangos/blob/v1.4.0/message.go#L134) [¶](#Message.Dup)\n```\nfunc (m *[Message](#Message)) Dup() *[Message](#Message)\n```\nDup creates a \"duplicate\" message. What it really does is simply increment the reference count on the message. Note that since the underlying message is actually shared, consumers must take care not to modify the message. (We might revise this API in the future to add a copy-on-write facility, but for now modification is neither needed nor supported.) Applications should *NOT* make use of this function -- it is intended for Protocol, Transport and internal use only.\n\n#### \nfunc (*Message) [Expired](https://github.com/go-mangos/mangos/blob/v1.4.0/message.go#L144) [¶](#Message.Expired)\n\nadded in v1.2.0\n```\nfunc (m *[Message](#Message)) Expired() [bool](/builtin#bool)\n```\nExpired returns true if the message has \"expired\". This is used by transport implementations to discard messages that have been stuck in the write queue for too long, and should be discarded rather than delivered across the transport. This is only used on the TX path, there is no sense of \"expiration\" on the RX path.\n\n#### \nfunc (*Message) [Free](https://github.com/go-mangos/mangos/blob/v1.4.0/message.go#L115) [¶](#Message.Free)\n```\nfunc (m *[Message](#Message)) Free()\n```\nFree decrements the reference count on a message, and releases its resources if no further references remain. While this is not strictly necessary thanks to GC, doing so allows for the resources to be recycled without engaging GC. This can have rather substantial benefits for performance.\n\n#### \ntype [Pipe](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L29) [¶](#Pipe)\n```\ntype Pipe interface {\n\n // Send sends a complete message. In the event of a partial send,\n\t// the Pipe will be closed, and an error is returned. For reasons\n\t// of efficiency, we allow the message to be sent in a scatter/gather\n\t// list.\n\tSend(*[Message](#Message)) [error](/builtin#error)\n\n // Recv receives a complete message. In the event that either a\n\t// complete message could not be received, an error is returned\n\t// to the caller and the Pipe is closed.\n\t//\n\t// To mitigate Denial-of-Service attacks, we limit the max message\n\t// size to 1M.\n\tRecv() (*[Message](#Message), [error](/builtin#error))\n\n // Close closes the underlying transport. Further operations on\n\t// the Pipe will result in errors. Note that messages that are\n\t// queued in transport buffers may still be received by the remote\n\t// peer.\n\tClose() [error](/builtin#error)\n\n // LocalProtocol returns the 16-bit SP protocol number used by the\n\t// local side. This will normally be sent to the peer during\n\t// connection establishment.\n\tLocalProtocol() [uint16](/builtin#uint16)\n\n // RemoteProtocol returns the 16-bit SP protocol number used by the\n\t// remote side. This will normally be received from the peer during\n\t// connection establishment.\n\tRemoteProtocol() [uint16](/builtin#uint16)\n\n // IsOpen returns true if the underlying connection is open.\n\tIsOpen() [bool](/builtin#bool)\n\n // GetProp returns an arbitrary transport specific property.\n\t// These are like options, but are read-only and specific to a single\n\t// connection. If the property doesn't exist, then ErrBadProperty\n\t// should be returned.\n\tGetProp([string](/builtin#string)) (interface{}, [error](/builtin#error))\n}\n```\nPipe behaves like a full-duplex message-oriented connection between two peers. Callers may call operations on a Pipe simultaneously from different goroutines. (These are different from net.Conn because they provide message oriented semantics.)\n\nPipe is only intended for use by transport implementors, and should not be directly used in applications.\n\n#### \nfunc [NewConnPipe](https://github.com/go-mangos/mangos/blob/v1.4.0/conn.go#L138) [¶](#NewConnPipe)\n```\nfunc NewConnPipe(c [net](/net).[Conn](/net#Conn), sock [Socket](#Socket), props ...interface{}) ([Pipe](#Pipe), [error](/builtin#error))\n```\nNewConnPipe allocates a new Pipe using the supplied net.Conn, and initializes it. It performs the handshake required at the SP layer,\nonly returning the Pipe once the SP layer negotiation is complete.\n\nStream oriented transports can utilize this to implement a Transport.\nThe implementation will also need to implement PipeDialer, PipeAccepter,\nand the Transport enclosing structure. Using this layered interface,\nthe implementation needn't bother concerning itself with passing actual SP messages once the lower layer connection is established.\n\n#### \nfunc [NewConnPipeIPC](https://github.com/go-mangos/mangos/blob/v1.4.0/connipc_posix.go#L26) [¶](#NewConnPipeIPC)\n```\nfunc NewConnPipeIPC(c [net](/net).[Conn](/net#Conn), sock [Socket](#Socket), props ...interface{}) ([Pipe](#Pipe), [error](/builtin#error))\n```\nNewConnPipeIPC allocates a new Pipe using the IPC exchange protocol.\n\n#### \ntype [PipeDialer](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L76) [¶](#PipeDialer)\n```\ntype PipeDialer interface {\n // Dial is used to initiate a connection to a remote peer.\n\tDial() ([Pipe](#Pipe), [error](/builtin#error))\n\n // SetOption sets a local option on the dialer.\n\t// ErrBadOption can be returned for unrecognized options.\n\t// ErrBadValue can be returned for incorrect value types.\n\tSetOption(name [string](/builtin#string), value interface{}) [error](/builtin#error)\n\n // GetOption gets a local option from the dialer.\n\t// ErrBadOption can be returned for unrecognized options.\n\tGetOption(name [string](/builtin#string)) (value interface{}, err [error](/builtin#error))\n}\n```\nPipeDialer represents the client side of a connection. Clients initiate the connection.\n\nPipeDialer is only intended for use by transport implementors, and should not be directly used in applications.\n\n#### \ntype [PipeListener](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L95) [¶](#PipeListener)\n```\ntype PipeListener interface {\n\n // Listen actually begins listening on the interface. It is\n\t// called just prior to the Accept() routine normally. It is\n\t// the socket equivalent of bind()+listen().\n\tListen() [error](/builtin#error)\n\n // Accept completes the server side of a connection. Once the\n\t// connection is established and initial handshaking is complete,\n\t// the resulting connection is returned to the client.\n\tAccept() ([Pipe](#Pipe), [error](/builtin#error))\n\n // Close ceases any listening activity, and will specifically close\n\t// any underlying file descriptor. Once this is done, the only way\n\t// to resume listening is to create a new Server instance. Presumably\n\t// this function is only called when the last reference to the server\n\t// is about to go away. Established connections are unaffected.\n\tClose() [error](/builtin#error)\n\n // SetOption sets a local option on the listener.\n\t// ErrBadOption can be returned for unrecognized options.\n\t// ErrBadValue can be returned for incorrect value types.\n\tSetOption(name [string](/builtin#string), value interface{}) [error](/builtin#error)\n\n // GetOption gets a local option from the listener.\n\t// ErrBadOption can be returned for unrecognized options.\n\tGetOption(name [string](/builtin#string)) (value interface{}, err [error](/builtin#error))\n\n // Address gets the local address. The value may not be meaningful\n\t// until Listen() has been called.\n\tAddress() [string](/builtin#string)\n}\n```\nPipeListener represents the server side of a connection. Servers respond to a connection request from clients.\n\nPipeListener is only intended for use by transport implementors, and should not be directly used in applications.\n\n#### \ntype [Port](https://github.com/go-mangos/mangos/blob/v1.4.0/port.go#L22) [¶](#Port)\n```\ntype Port interface {\n\n // Address returns the address (URL form) associated with the port.\n\t// This matches the string passed to Dial() or Listen().\n\tAddress() [string](/builtin#string)\n\n // GetProp returns an arbitrary property. The details will vary\n\t// for different transport types.\n\tGetProp(name [string](/builtin#string)) (interface{}, [error](/builtin#error))\n\n // IsOpen determines whether this is open or not.\n\tIsOpen() [bool](/builtin#bool)\n\n // Close closes the Conn. This does a disconnect, or something similar.\n\t// Note that if a dialer is present and active, it will redial.\n\tClose() [error](/builtin#error)\n\n // IsServer returns true if the connection is from a server (Listen).\n\tIsServer() [bool](/builtin#bool)\n\n // IsClient returns true if the connection is from a client (Dial).\n\tIsClient() [bool](/builtin#bool)\n\n // LocalProtocol returns the local protocol number.\n\tLocalProtocol() [uint16](/builtin#uint16)\n\n // RemoteProtocol returns the remote protocol number.\n\tRemoteProtocol() [uint16](/builtin#uint16)\n\n // Dialer returns the dialer for this Port, or nil if a server.\n\tDialer() [Dialer](#Dialer)\n\n // Listener returns the listener for this Port, or nil if a client.\n\tListener() [Listener](#Listener)\n}\n```\nPort represents the high level interface to a low level communications channel. There is one of these associated with a given TCP connection,\nfor example. This interface is intended for application use.\n\nNote that applicatons cannot send or receive data on a Port directly.\n\n#### \ntype [PortAction](https://github.com/go-mangos/mangos/blob/v1.4.0/port.go#L59) [¶](#PortAction)\n```\ntype PortAction [int](/builtin#int)\n```\nPortAction determines whether the action on a Port is addition or removal.\n\n#### \ntype [PortHook](https://github.com/go-mangos/mangos/blob/v1.4.0/port.go#L70) [¶](#PortHook)\n```\ntype PortHook func([PortAction](#PortAction), [Port](#Port)) [bool](/builtin#bool)\n```\nPortHook is a function that is called when a port is added or removed to or from a Socket. In the case of PortActionAdd, the function may return false to indicate that the port should not be added.\n\n#### \ntype [Protocol](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L44) [¶](#Protocol)\n```\ntype Protocol interface {\n\n // Init is called by the core to allow the protocol to perform\n\t// any initialization steps it needs. It should save the handle\n\t// for future use, as well.\n\tInit([ProtocolSocket](#ProtocolSocket))\n\n // Shutdown is used to drain the send side. It is only ever called\n\t// when the socket is being shutdown cleanly. Protocols should use\n\t// the linger time, and wait up to that time for sockets to drain.\n\tShutdown([time](/time).[Time](/time#Time))\n\n // AddEndpoint is called when a new Endpoint is added to the socket.\n\t// Typically this is as a result of connect or accept completing.\n\tAddEndpoint([Endpoint](#Endpoint))\n\n // RemoveEndpoint is called when an Endpoint is removed from the socket.\n\t// Typically this indicates a disconnected or closed connection.\n\tRemoveEndpoint([Endpoint](#Endpoint))\n\n // ProtocolNumber returns a 16-bit value for the protocol number,\n\t// as assigned by the SP governing body. (IANA?)\n\tNumber() [uint16](/builtin#uint16)\n\n // Name returns our name.\n\tName() [string](/builtin#string)\n\n // PeerNumber() returns a 16-bit number for our peer protocol.\n\tPeerNumber() [uint16](/builtin#uint16)\n\n // PeerName() returns the name of our peer protocol.\n\tPeerName() [string](/builtin#string)\n\n // GetOption is used to retrieve the current value of an option.\n\t// If the protocol doesn't recognize the option, EBadOption should\n\t// be returned.\n\tGetOption([string](/builtin#string)) (interface{}, [error](/builtin#error))\n\n // SetOption is used to set an option. EBadOption is returned if\n\t// the option name is not recognized, EBadValue if the value is\n\t// invalid.\n\tSetOption([string](/builtin#string), interface{}) [error](/builtin#error)\n}\n```\nProtocol implementations handle the \"meat\" of protocol processing. Each protocol type will implement one of these. For protocol pairs (REP/REQ),\nthere will be one for each half of the protocol.\n\n#### \ntype [ProtocolRecvHook](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L92) [¶](#ProtocolRecvHook)\n```\ntype ProtocolRecvHook interface {\n // RecvHook is called just before the message is handed to the\n\t// application. The message may be modified. If false is returned,\n\t// then the message is dropped.\n\tRecvHook(*[Message](#Message)) [bool](/builtin#bool)\n}\n```\nProtocolRecvHook is intended to be an additional extension to the Protocol interface.\n\n#### \ntype [ProtocolSendHook](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L101) [¶](#ProtocolSendHook)\n```\ntype ProtocolSendHook interface {\n // SendHook is called when the application calls Send.\n\t// If false is returned, the message will be silently dropped.\n\t// Note that the message may be dropped for other reasons,\n\t// such as if backpressure is applied.\n\tSendHook(*[Message](#Message)) [bool](/builtin#bool)\n}\n```\nProtocolSendHook is intended to be an additional extension to the Protocol interface.\n\n#### \ntype [ProtocolSocket](https://github.com/go-mangos/mangos/blob/v1.4.0/protocol.go#L113) [¶](#ProtocolSocket)\n```\ntype ProtocolSocket interface {\n // SendChannel represents the channel used to send messages. The\n\t// application injects messages to it, and the protocol consumes\n\t// messages from it. The channel may be closed when the core needs to\n\t// create a new channel, typically after an option is set that requires\n\t// the channel to be reconfigured. (OptionWriteQLen) When the protocol\n\t// implementation notices this, it should call this function again to obtain\n\t// the value of the new channel.\n\tSendChannel() <-chan *[Message](#Message)\n\n // RecvChannel is the channel used to receive messages. The protocol\n\t// should inject messages to it, and the application will consume them\n\t// later.\n\tRecvChannel() chan<- *[Message](#Message)\n\n // The protocol can wait on this channel to close. When it is closed,\n\t// it indicates that the application has closed the upper read socket,\n\t// and the protocol should stop any further read operations on this\n\t// instance.\n\tCloseChannel() <-chan struct{}\n\n // GetOption may be used by the protocol to retrieve an option from\n\t// the socket. This can ultimately wind up calling into the socket's\n\t// own GetOption handler, so care should be used!\n\tGetOption([string](/builtin#string)) (interface{}, [error](/builtin#error))\n\n // SetOption is used by the Protocol to set an option on the socket.\n\t// Note that this may set transport options, or even call back down\n\t// into the protocol's own SetOption interface!\n\tSetOption([string](/builtin#string), interface{}) [error](/builtin#error)\n\n // SetRecvError is used to cause socket RX callers to report an\n\t// error. This can be used to force an error return rather than\n\t// waiting for a message that will never arrive (e.g. due to state).\n\t// If set to nil, then RX works normally.\n\tSetRecvError([error](/builtin#error))\n\n // SetSendError is used to cause socket TX callers to report an\n\t// error. This can be used to force an error return rather than\n\t// waiting to send a message that will never be delivered (e.g. due\n\t// to incorrect state.) If set to nil, then TX works normally.\n\tSetSendError([error](/builtin#error))\n}\n```\nProtocolSocket is the \"handle\" given to protocols to interface with the socket. The Protocol implementation should not access any sockets or pipes except by using functions made available on the ProtocolSocket. Note that all functions listed here are non-blocking.\n\n#### \ntype [Socket](https://github.com/go-mangos/mangos/blob/v1.4.0/socket.go#L21) [¶](#Socket)\n```\ntype Socket interface {\n // Close closes the open Socket. Further operations on the socket\n\t// will return ErrClosed.\n\tClose() [error](/builtin#error)\n\n // Send puts the message on the outbound send queue. It blocks\n\t// until the message can be queued, or the send deadline expires.\n\t// If a queued message is later dropped for any reason,\n\t// there will be no notification back to the application.\n\tSend([][byte](/builtin#byte)) [error](/builtin#error)\n\n // Recv receives a complete message. The entire message is received.\n\tRecv() ([][byte](/builtin#byte), [error](/builtin#error))\n\n // SendMsg puts the message on the outbound send. It works like Send,\n\t// but allows the caller to supply message headers. AGAIN, the Socket\n\t// ASSUMES OWNERSHIP OF THE MESSAGE.\n\tSendMsg(*[Message](#Message)) [error](/builtin#error)\n\n // RecvMsg receives a complete message, including the message header,\n\t// which is useful for protocols in raw mode.\n\tRecvMsg() (*[Message](#Message), [error](/builtin#error))\n\n // Dial connects a remote endpoint to the Socket. The function\n\t// returns immediately, and an asynchronous goroutine is started to\n\t// establish and maintain the connection, reconnecting as needed.\n\t// If the address is invalid, then an error is returned.\n\tDial(addr [string](/builtin#string)) [error](/builtin#error)\n\n DialOptions(addr [string](/builtin#string), options map[[string](/builtin#string)]interface{}) [error](/builtin#error)\n\n // NewDialer returns a Dialer object which can be used to get\n\t// access to the underlying configuration for dialing.\n\tNewDialer(addr [string](/builtin#string), options map[[string](/builtin#string)]interface{}) ([Dialer](#Dialer), [error](/builtin#error))\n\n // Listen connects a local endpoint to the Socket. Remote peers\n\t// may connect (e.g. with Dial) and will each be \"connected\" to\n\t// the Socket. The accepter logic is run in a separate goroutine.\n\t// The only error possible is if the address is invalid.\n\tListen(addr [string](/builtin#string)) [error](/builtin#error)\n\n ListenOptions(addr [string](/builtin#string), options map[[string](/builtin#string)]interface{}) [error](/builtin#error)\n\n NewListener(addr [string](/builtin#string), options map[[string](/builtin#string)]interface{}) ([Listener](#Listener), [error](/builtin#error))\n\n // GetOption is used to retrieve an option for a socket.\n\tGetOption(name [string](/builtin#string)) (interface{}, [error](/builtin#error))\n\n // SetOption is used to set an option for a socket.\n\tSetOption(name [string](/builtin#string), value interface{}) [error](/builtin#error)\n\n // Protocol is used to get the underlying Protocol.\n\tGetProtocol() [Protocol](#Protocol)\n\n // AddTransport adds a new Transport to the socket. Transport specific\n\t// options may have been configured on the Transport prior to this.\n\tAddTransport([Transport](#Transport))\n\n // SetPortHook sets a PortHook function to be called when a Port is\n\t// added or removed from this socket (connect/disconnect). The previous\n\t// hook is returned (nil if none.)\n\tSetPortHook([PortHook](#PortHook)) [PortHook](#PortHook)\n}\n```\nSocket is the main access handle applications use to access the SP system. It is an abstraction of an application's \"connection\" to a messaging topology. Applications can have more than one Socket open at a time.\n\n#### \nfunc [MakeSocket](https://github.com/go-mangos/mangos/blob/v1.4.0/core.go#L142) [¶](#MakeSocket)\n```\nfunc MakeSocket(proto [Protocol](#Protocol)) [Socket](#Socket)\n```\nMakeSocket is intended for use by Protocol implementations. The intention is that they can wrap this to provide a \"proto.NewSocket()\" implementation.\n\n#### \ntype [Transport](https://github.com/go-mangos/mangos/blob/v1.4.0/transport.go#L129) [¶](#Transport)\n```\ntype Transport interface {\n // Scheme returns a string used as the prefix for SP \"addresses\".\n\t// This is similar to a URI scheme. For example, schemes can be\n\t// \"tcp\" (for \"tcp://xxx...\"), \"ipc\", \"inproc\", etc.\n\tScheme() [string](/builtin#string)\n\n // NewDialer creates a new Dialer for this Transport.\n\tNewDialer(url [string](/builtin#string), sock [Socket](#Socket)) ([PipeDialer](#PipeDialer), [error](/builtin#error))\n\n // NewListener creates a new PipeListener for this Transport.\n\t// This generally also arranges for an OS-level file descriptor to be\n\t// opened, and bound to the the given address, as well as establishing\n\t// any \"listen\" backlog.\n\tNewListener(url [string](/builtin#string), sock [Socket](#Socket)) ([PipeListener](#PipeListener), [error](/builtin#error))\n}\n```\nTransport is the interface for transport suppliers to implement.\n\n#### \ntype [Waiter](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L53) [¶](#Waiter)\n```\ntype Waiter struct {\n [sync](/sync).[Mutex](/sync#Mutex)\n\t// contains filtered or unexported fields\n}\n```\nWaiter is a way to wait for completion, but it includes a timeout. It is similar in some respects to sync.WaitGroup.\n\n#### \nfunc (*Waiter) [Add](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L67) [¶](#Waiter.Add)\n```\nfunc (w *[Waiter](#Waiter)) Add()\n```\nAdd adds a new go routine/item to wait for. This should be called before starting go routines you want to wait for, for example.\n\n#### \nfunc (*Waiter) [Done](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L77) [¶](#Waiter.Done)\n```\nfunc (w *[Waiter](#Waiter)) Done()\n```\nDone is called when the item to wait for is done. There should be a one to one correspondance between Add and Done. When the count drops to zero,\nany callers blocked in Wait() are woken. If the count drops below zero,\nit panics.\n\n#### \nfunc (*Waiter) [Init](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L60) [¶](#Waiter.Init)\n```\nfunc (w *[Waiter](#Waiter)) Init()\n```\nInit must be called to initialize the Waiter.\n\n#### \nfunc (*Waiter) [Wait](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L91) [¶](#Waiter.Wait)\n```\nfunc (w *[Waiter](#Waiter)) Wait()\n```\nWait waits without a timeout. It only completes when the count drops to zero.\n\n#### \nfunc (*Waiter) [WaitAbsTimeout](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L114) [¶](#Waiter.WaitAbsTimeout)\n```\nfunc (w *[Waiter](#Waiter)) WaitAbsTimeout(t [time](/time).[Time](/time#Time)) [bool](/builtin#bool)\n```\nWaitAbsTimeout is like WaitRelTimeout, but waits until an absolute time.\n\n#### \nfunc (*Waiter) [WaitRelTimeout](https://github.com/go-mangos/mangos/blob/v1.4.0/waiter.go#L101) [¶](#Waiter.WaitRelTimeout)\n```\nfunc (w *[Waiter](#Waiter)) WaitRelTimeout(d [time](/time).[Duration](/time#Duration)) [bool](/builtin#bool)\n```\nWaitRelTimeout waits until either the count drops to zero, or the timeout expires. It returns true if the count is zero, false otherwise."}}},{"rowIdx":450,"cells":{"project":{"kind":"string","value":"SIT"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘SIT’\n                                          December 20, 2022\nTitle Association Measurement Through Sliced Independence Test (SIT)\nVersion 0.1.0\nDescription Computes the sit coefficient between two vectors x and y,\n      possibly all paired coefficients for a matrix. The reference for the methods implemented here is\n      Zhang, Yilin, , and . 2022. ``Sliced Independence Test.'' Statis-\n      tica Sinica. .\n      This package incorporates the Galton peas example.\nLicense MIT + file LICENSE\nEncoding UTF-8\nRoxygenNote 7.2.1\nLinkingTo Rcpp, RcppArmadillo\nImports Rcpp, stats\nDate 2022-12-19\nSuggests ggplot2, psychTools\nNeedsCompilation yes\nAuthor  [aut, cre] ()\nMaintainer  <>\nRepository CRAN\nDate/Publication 2022-12-20 11:00:05 UTC\nR topics documented:\nblocksu... 2\ncalculateSI... 2\nsitco... 3\n  blocksum                     Compute the block-wise sum of a vector.\nDescription\n    Compute the block-wise sum of a vector.\nUsage\n    blocksum(r, c)\nArguments\n    r                  An integer vector\n    c                  The number of observations in each block\nValue\n    The function returns the block sum of the vector.\n  calculateSIT                 Compute the cross rank coefficient sit on two vectors.\nDescription\n    This function computes the sit coefficient between two vectors x and y.\nUsage\n    calculateSIT(x, y, c = 2)\nArguments\n    x                  Vector of numeric values in the first coordinate.\n    y                  Vector of numeric values in the second coordinate.\n    c                  The number of observations in each slice.\nValue\n    The function returns the value of the sit coefficient.\nNote\n    Auxiliary function with no checks for NA, etc.\nAuthor(s)\n     ,  & \nReferences\n     ., ., & . (2021). Sliced Independence Test. Statistica Sinica. https://doi.org/10.5705/ss.202021.0203.\nSee Also\n     sitcor\nExamples\n     # Compute one of the coefficients\n     library(\"psychTools\")\n     data(peas)\n     calculateSIT(peas$parent,peas$child)\n     calculateSIT(peas$child,peas$parent)\n   sitcor                        Conduct the sliced independence test.\nDescription\n     This function computes the sit coefficient between two vectors x and y, possibly all paired coeffi-\n     cients for a matrix.\nUsage\n     sitcor(\n        x,\n        y = NULL,\n        c = 2,\n        pvalue = FALSE,\n        ties = FALSE,\n        method = \"asymptotic\",\n        nperm = 199,\n        factor = FALSE\n     )\nArguments\n     x                    Vector of numeric values in the first coordinate.\n     y                    Vector of numeric values in the second coordinate.\n     c                    The number of observations in each slice.\n     pvalue               Whether or not to return the p-value of rejecting independence, if TRUE the\n                          function also returns the standard deviation of sit.\n    ties                Do we need to handle ties? If ties=TRUE the algorithm assumes that the data\n                        has ties and employs the more elaborated theory for calculating s.d. and P-value.\n                        Otherwise, it uses the simpler theory. There is no harm in putting ties = TRUE\n                        even if there are no ties.\n    method              If method = \"asymptotic\" the function returns P-values computed by the asymp-\n                        totic theory (not available in the presence of ties). If method = \"permutation\", a\n                        permutation test with nperm permutations is employed to estimate the P-value.\n                        Usually, there is no need for the permutation test. The asymptotic theory is good\n                        enough.\n    nperm               In the case of a permutation test, nperm is the number of permutations to do.\n    factor              Whether to transform integers into factors, the default is to leave them alone.\nValue\n    In the case pvalue=FALSE, function returns the value of the sit coefficient, if the input is a matrix,\n    a matrix of coefficients is returned. In the case pvalue=TRUE is chosen, the function returns a list:\n    sitcor The value of the sit coefficient.\n    sd The standard deviation.\n    pval The test p-value.\nAuthor(s)\n    ,  & \nReferences\n    ., ., & . (2022). Sliced Independence Test. Statistica Sinica. https://doi.org/10.5705/ss.202021.0203.\nExamples\n    ##---- Should be DIRECTLY executable !! ----\n    library(\"psychTools\")\n    data(peas)\n    # Visualize          the peas data\n    library(ggplot2)\n    ggplot(peas,aes(parent,child)) +\n    geom_count() + scale_radius(range=c(0,5)) +\n            xlim(c(13.5,24))+ylim(c(13.5,24))+               coord_fixed() +\n            theme(legend.position=\"bottom\")\n    # Compute one of the coefficients\n    sitcor(peas$parent,peas$child, c = 4, pvalue=TRUE)\n    sitcor(peas$child,peas$parent, c = 4)\n    # Compute all the coefficients\n    sitcor(peas, c = 4)"}}},{"rowIdx":451,"cells":{"project":{"kind":"string","value":"phylopath"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘phylopath’\n                                         October 10, 2023\nType Package\nTitle Perform Phylogenetic Path Analysis\nVersion 1.2.0\nMaintainer  <>\nDescription A comprehensive and easy to use R implementation of confirmatory\n      phylogenetic path analysis as described by  and Gonzalez-Voyer\n      (2012) .\nURL https://Ax3man.github.io/phylopath/\nBugReports https://github.com/Ax3man/phylopath/issues\nLicense GPL-3\nLazyData TRUE\nDepends R (>= 2.10)\nImports ape (>= 4.1), future.apply, ggm (>= 2.3), ggplot2 (>= 3.0.0),\n      ggraph (>= 1.0.0), igraph (>= 1.0.1), MuMIn (>= 1.15.6),\n      phylolm (>= 2.5), purrr (>= 0.2.3), tibble\nRoxygenNote 7.2.3\nSuggests knitr, rmarkdown, testthat\nVignetteBuilder knitr\nEncoding UTF-8\nNeedsCompilation no\nAuthor  [aut, cre]\nRepository CRAN\nDate/Publication 2023-10-09 23:10:03 UTC\nR topics documented:\naverag... 2\naverage_DAG... 3\nbes... 4\nchoic... 5\ncichlid... 6\ncichlids_tre... 7\ncoef_plo... 7\nDA... 8\ndefine_model_se... 9\nest_DA... 10\nphylo_pat... 11\nplot.DA... 13\nplot.fitted_DA... 15\nplot_model_se... 16\nred_lis... 18\nred_list_tre... 19\nrhin... 19\nrhino_tre... 20\nshow_warning... 20\n  average                       Extract and average the best supported models from a phylogenetic\n                                path analysis.\nDescription\n    Extract and average the best supported models from a phylogenetic path analysis.\nUsage\n    average(phylopath, cut_off = 2, avg_method = \"conditional\", ...)\nArguments\n    phylopath           An object of class phylopath.\n    cut_off             The CICc cut-off used to select the best models. Use Inf to average over all\n                        models. Use the best() function to only use the top model, or choice() to\n                        select any single model.\n    avg_method          Either \"full\" or \"conditional\". The methods differ in how they deal with\n                        averaging a path coefficient where the path is absent in some of the models.\n                        The full method sets the coefficient (and the variance) for the missing paths\n                        to zero, meaning paths that are missing in some models will shrink towards\n                        zero. The conditional method only averages over models where the path ap-\n                        pears, making it more sensitive to small effects. Following von Hardenberg\n                        & Gonzalez-Voyer 2013, conditional averaging is set as the default. Also see\n                        MuMIn::model.avg().\n    ...                 Arguments to pass to phylolm::phylolm and phylolm::phyloglm. Provide boot\n                        = K parameter to enable bootstrapping, where K is the number of bootstrap repli-\n                        cates. If you specified other options in the original phylo_path call you don’t\n                        need to specify them again.\nValue\n    An object of class fitted_DAG.\nExamples\n      candidates <- define_model_set(\n        A = NL ~ RS,\n        B = RS ~ NL + BM,\n        .common = c(LS ~ BM, DD ~ NL, NL ~ BM)\n      )\n      p <- phylo_path(candidates, rhino, rhino_tree)\n      summary(p)\n      # Models A and B have similar support, so we may decide to take\n      # their average.\n      avg_model <- average(p)\n      # Print the average model to see coefficients, se and ci:\n      avg_model\n      ## Not run:\n      # Plot to show the weighted graph:\n      plot(avg_model)\n      # One can see that an averaged model is not necessarily a DAG itself.\n      # This model actually has a path in two directions.\n      # Note that coefficients that only occur in one of the models become much\n      # smaller when we use full averaging:\n      coef_plot(avg_model)\n      coef_plot(average(p, method = 'full'))\n    ## End(Not run)\n  average_DAGs               Perform model averaging on a list of DAGs.\nDescription\n    Perform model averaging on a list of DAGs.\nUsage\n    average_DAGs(\n      fitted_DAGs,\n      weights = rep(1, length(coef)),\n      avg_method = \"conditional\",\n      ...\n    )\nArguments\n    fitted_DAGs         A list of fitted_DAG objects containing coefficients and standard errors, usually\n                        obtained by using est_DAG() on several DAGs.\n    weights             A vector of associated model weights.\n    avg_method          Either \"full\" or \"conditional\". The methods differ in how they deal with\n                        averaging a path coefficient where the path is absent in some of the models.\n                        The full method sets the coefficient (and the variance) for the missing paths\n                        to zero, meaning paths that are missing in some models will shrink towards\n                        zero. The conditional method only averages over models where the path ap-\n                        pears, making it more sensitive to small effects. Following \n                        & Gonzalez-Voyer 2013, conditional averaging is set as the default. Also see\n                        MuMIn::model.avg().\n    ...                 Additional arguments passed to MuMIn::par.avg().\n                        For details on the error calculations, see MuMIn::par.avg().\nValue\n    An object of class fitted_DAG, including standard errors and confidence intervals.\nExamples\n      # Normally, I would advocate the use of the phylo_path and average\n      # functions, but this code shows how to average any set of models. Note\n      # that not many checks are implemented, so you may want to be careful and\n      # make sure the DAGs make sense and contain the same variables!\n      candidates <- define_model_set(\n        A = NL ~ BM,\n        B = NL ~ LS,\n        .common = c(LS ~ BM, DD ~ NL)\n      )\n      fit_cand <- lapply(candidates, est_DAG, rhino, rhino_tree,\n                             model = 'lambda', method = 'logistic_MPLE')\n      ave_cand <- average_DAGs(fit_cand)\n      coef_plot(ave_cand)\n  best                          Extract and estimate the best supported model from a phylogenetic\n                                path analysis.\nDescription\n    Extract and estimate the best supported model from a phylogenetic path analysis.\nUsage\n    best(phylopath, ...)\nArguments\n    phylopath           An object of class phylopath.\n    ...                 Arguments to pass to phylolm::phylolm and phylolm::phyloglm. Provide boot\n                        = K parameter to enable bootstrapping, where K is the number of bootstrap repli-\n                        cates. If you specified other options in the original phylo_path call you don’t\n                        need to specify them again.\nValue\n    An object of class fitted_DAG.\nExamples\n       candidates <- define_model_set(\n         A = NL ~ BM,\n         B = NL ~ LS,\n         .common = c(LS ~ BM, DD ~ NL)\n       )\n       p <- phylo_path(candidates, rhino, rhino_tree)\n       best_model <- best(p)\n       # Print the best model to see coefficients, se and ci:\n       best_model\n       # Plot to show the weighted graph:\n       plot(best_model)\n  choice                       Extract and estimate an arbitrary model from a phylogenetic path\n                               analysis.\nDescription\n    Extract and estimate an arbitrary model from a phylogenetic path analysis.\nUsage\n    choice(phylopath, choice, ...)\nArguments\n    phylopath           An object of class phylopath.\n    choice              A character string of the name of the model to be chosen, or the index in\n                        model_set.\n    ...                 Arguments to pass to phylolm::phylolm and phylolm::phyloglm. Provide boot\n                        = K parameter to enable bootstrapping, where K is the number of bootstrap repli-\n                        cates. If you specified other options in the original phylo_path call you don’t\n                        need to specify them again.\nValue\n    An object of class fitted_DAG.\nExamples\n       candidates <- define_model_set(\n         A = NL ~ BM,\n         B = NL ~ LS,\n         .common = c(LS ~ BM, DD ~ NL)\n       )\n       p <- phylo_path(candidates, rhino, rhino_tree)\n       my_model <- choice(p, \"B\")\n       # Print the best model to see coefficients, se and ci:\n       my_model\n       # Plot to show the weighted graph:\n       plot(my_model)\n  cichlids                     Cichlid traits and the evolution of cooperative breeding.\nDescription\n    A data set with binary traits, used in an analysis on the evolution of cooperative breeding by Dey\n    et al 2017. Variable names are shortened for easy of use and consist of cooperative breeding (C),\n    mating system (M), parental care (P), social grouping (G) and diet (D). All traits are coded as two\n    level factors.\nUsage\n    cichlids\nFormat\n    An object of class data.frame with 69 rows and 5 columns.\nSource\n     ., ., ., ., . & . 2017. Direct\n     benefits and evolutionary transitions to complex societies. Nat Ecol Evol 1: 137.\n   cichlids_tree                 Cichlid phylogeny.\nDescription\n     The phylogenetic tree of cichlid species that accompanies the cichlids dataset. The phylogeny is\n     based on five nuclear genes and three mitochondrial genes.\nUsage\n     cichlids_tree\nFormat\n     An object of class phylo of length 4.\nSource\n     ., ., ., ., . & . 2017. Direct\n     benefits and evolutionary transitions to complex societies. Nat Ecol Evol 1: 137.\n   coef_plot                     Plot path coefficients and their confidence intervals or standard errors.\nDescription\n     Plot path coefficients and their confidence intervals or standard errors.\nUsage\n     coef_plot(\n       fitted_DAG,\n       error_bar = \"ci\",\n       order_by = \"default\",\n       from = NULL,\n       to = NULL,\n       reverse_order = FALSE\n     )\nArguments\n    fitted_DAG          A fitted DAG, usually obtained by best(), average() or est_DAG().\n    error_bar           Whether to use confidence intervals (\"ci\") or standard errors (\"se\") as error\n                        bars. Will force standard errors with a message if confidence intervals are not\n                        available.\n    order_by            By \"default\", the paths are ordered as in the the model that is supplied. Usually\n                        this is in the order that was established by [phylo_path()] for all combined\n                        graphs. This can be change to \"causal\" to do a reordering based on the model at\n                        hand, or to \"strength\" to order them by the standardized regression coefficient.\n    from                Only show path coefficients from these nodes. Supply as a character vector.\n    to                  Only show path coefficients to these nodes. Supply as a character vector.\n    reverse_order       If TRUE, the paths are plotted in reverse order. Particularly useful in combination\n                        with ggplot2::coord_flip() to create horizontal versions of the plot.\nValue\n    A ggplot object.\nExamples\n      d <- DAG(LS ~ BM, NL ~ BM, DD ~ NL + LS)\n      plot(d)\n      d_fitted <- est_DAG(d, rhino, rhino_tree, 'lambda')\n      plot(d_fitted)\n      coef_plot(d_fitted, error_bar = \"se\")\n      # to create a horizontal version, use this:\n      coef_plot(d_fitted, error_bar = \"se\", reverse_order = TRUE) + ggplot2::coord_flip()\n  DAG                           Directed acyclic graphs (DAGs)\nDescription\n    This function is a simple wrapper around the function from the ggm package with the same name.\n    The only differences are that the order argument defaults to TRUE and that it adds a DAG class for\n    easy plotting. Typically, one would use define_model_set() to create models for use with the\n    phylopath package.\nUsage\n    DAG(..., order = TRUE)\nArguments\n     ...                 a sequence of model formulae\n     order               logical, defaulting to TRUE. If TRUE the nodes of the DAG are permuted accord-\n                         ing to the topological order. If FALSE the nodes are in the order they first appear\n                         in the model formulae (from left to right). For use in the phylopath package,\n                         this should always be kept to TRUE, but the argument is available to avoid poten-\n                         tial problems with masking the function from other packages.\nDetails\n     Supply a formulas for the model as arguments. Formulas should be of the form child ~ parent`` and describe each path\n     ~ parent1 + parent2. Finally, an isolate (unconnected variable) can be included as being connected to itsel\n     late ~ isolate‘.\nValue\n     An object of classes matrix and DAG\nExamples\n        # Use formula notation to create DAGs:\n        plot(DAG(A~B, B~C))\n        # Use + to easily add multiple parents to a node:\n        plot(DAG(A~B+C))\n        # Add a node as it's own parent to create an isolate:\n        plot(DAG(A~B+C, D~D))\n  define_model_set               Define a model set.\nDescription\n     This is a convenience function to quickly and clearly define a set of causal models. Supply a list\n     of formulas for each model, using either c(). Formulas should be of the form child ~ parent and\n     describe each path in your model. Multiple children of a single parent can be combined into a single\n     formula: child ~ parent1 + parent2.\nUsage\n     define_model_set(..., .common = NULL)\nArguments\n     ...                 Named arguments, which each are a lists of formulas defining the paths of a\n                         causal model.\n     .common             A list of formulas that contain causal paths that are common to each model.\nDetails\n     This function uses ggm::DAG().\nValue\n     A list of models, each of class matrix and DAG.\nExamples\n     (m <- define_model_set(\n       A = c(a~b, b~c),\n       B = c(b~a, c~b),\n       .common = c(d~a)))\n     plot_model_set(m)\n   est_DAG                      Add standardized path coefficients to a DAG.\nDescription\n     Add standardized path coefficients to a DAG.\nUsage\n     est_DAG(DAG, data, tree, model, method, boot = 0, ...)\nArguments\n     DAG                 A directed acyclic graph, typically created with DAG.\n     data                A data.frame with data. If you have binary variables, make sure they are either\n                         character values or factors!\n     tree                A phylogenetic tree of class phylo.\n     model               The evolutionary model used for the regressions on continuous variables. See\n                         phylolm::phylolm for options and details. Defaults to Pagel’s lambda model\n     method              The estimation method for the binary models. See phylolm::phyloglm for op-\n                         tions and details. Defaults to logistic MPLE.\n     boot                The number of bootstrap replicates used to estimate confidence intervals.\n     ...                 Arguments passed on to phylolm:\n                         lower.bound: optional lower bound for the optimization of the phylogenetic\n                         model parameter.\n                         upper.bound: optional upper bound for the optimization of the phylogenetic\n                         model parameter.\n                         starting.value: optional starting value for the optimization of the phyloge-\n                         netic model parameter.\n                        measurement_error: a logical value indicating whether there is measurement\n                        error sigma2_error (see Details).\n                        Arguments passed on to phyloglm:\n                        btol: bound on the linear predictor to bound the searching space.\n                        log.alpha.bound: bound for the log of the parameter alpha.\n                        start.beta: starting values for beta coefficients.\n                        start.alpha: starting values for alpha (phylogenetic correlation).\nValue\n    An object of class fitted_DAG.\nExamples\n      d <- DAG(LS ~ BM, NL ~ BM, DD ~ NL + LS)\n      plot(d)\n      d_fitted <- est_DAG(d, rhino, rhino_tree, 'lambda')\n      plot(d_fitted)\n  phylo_path                    Compare causal models in a phylogenetic context.\nDescription\n    Continuous variables are modeled using phylolm::phylolm, while binary traits are modeled using\n    phylolm::phyloglm.\nUsage\n    phylo_path(\n      model_set,\n      data,\n      tree,\n      model = \"lambda\",\n      method = \"logistic_MPLE\",\n      order = NULL,\n      parallel = NULL,\n      na.rm = TRUE,\n      ...\n    )\nArguments\n    model_set           A list of directed acyclic graphs. These are matrices, typically created with\n                        define_model_set.\n    data                A data.frame with data. If you have binary variables, make sure they are either\n                        character values or factors!\n    tree                A phylogenetic tree of class phylo.\n    model               The evolutionary model used for the regressions on continuous variables. See\n                        phylolm::phylolm for options and details. Defaults to Pagel’s lambda model\n    method              The estimation method for the binary models. See phylolm::phyloglm for op-\n                        tions and details. Defaults to logistic MPLE.\n    order               Causal order of the included variable, given as a character vector. This is used to\n                        determine which variable should be the dependent in the dsep regression equa-\n                        tions. If left unspecified, the order will be automatically determined. If the\n                        combination of all included models is itself a DAG, then the ordering of that\n                        full model is used. Otherwise, the most common ordering between each pair of\n                        variables is used to create a general ordering.\n    parallel            Superseded From v1.2 phylopath uses the future package for all parallel pro-\n                        cessing, see details.\n    na.rm               Should rows that contain missing values be dropped from the data as necessary\n                        (with a message)?\n    ...                 Arguments passed on to phylolm:\n                        lower.bound: optional lower bound for the optimization of the phylogenetic\n                        model parameter.\n                        upper.bound: optional upper bound for the optimization of the phylogenetic\n                        model parameter.\n                        starting.value: optional starting value for the optimization of the phyloge-\n                        netic model parameter.\n                        measurement_error: a logical value indicating whether there is measurement\n                        error sigma2_error (see Details).\n                        Arguments passed on to phyloglm:\n                        btol: bound on the linear predictor to bound the searching space.\n                        log.alpha.bound: bound for the log of the parameter alpha.\n                        start.beta: starting values for beta coefficients.\n                        start.alpha: starting values for alpha (phylogenetic correlation).\nDetails\n    Parallel processing: From v1.2, phylopath uses the future framework for parallel processing.\n    This is compatible with the parallel computation within the underlying phylolm, making it easy to\n    enable parallel processing of multiple models, and of bootstrap replicates. To enable, simply set a\n    parallel plan() using the future package. Typically, you’ll want to run future::plan(\"multisession\",\n    workers = n), where n is the number of cores. Now parallel processing is enabled. Return to se-\n    quantial processing using future::plan(\"sequential\")\nValue\n    A phylopath object, with the following components:\n    d_sep for each model a table with separation statements and statistics.\n    model_set the DAGs\n    data the supplied data\n     tree the supplied tree\n     model the employed model of evolution in phylolm\n     method the employed method in phyloglm\n     dots any additional arguments given, these are passed on to downstream functions\n     warnings any warnings generated by the models\nExamples\n       #see vignette('intro_to_phylopath') for more details\n       candidates <- define_model_set(\n          A = NL ~ BM,\n          B = NL ~ LS,\n          .common = c(LS ~ BM, DD ~ NL)\n       )\n       p <- phylo_path(candidates, rhino, rhino_tree)\n       # Printing p gives some general information:\n       p\n       # And the summary gives statistics to compare the models:\n       summary(p)\n   plot.DAG                     Plot a directed acyclic graph.\nDescription\n     Plot a directed acyclic graph.\nUsage\n     ## S3 method for class 'DAG'\n     plot(\n        x,\n        labels = NULL,\n        algorithm = \"sugiyama\",\n        manual_layout = NULL,\n        text_size = 6,\n        box_x = 12,\n        box_y = 8,\n        edge_width = 1.5,\n        curvature = 0.02,\n        rotation = 0,\n        flip_x = FALSE,\n        flip_y = FALSE,\n        arrow = grid::arrow(type = \"closed\", 18, grid::unit(15, \"points\")),\n        ...\n     )\nArguments\n   x                A ‘DAG“ object, usually created with the define_model_set() or DAG() func-\n                    tion.\n   labels           An optional set of labels to use for the nodes. This should be a named vec-\n                    tor, of the form c(var1 = \"label1\", var2 = \"label2\"). If left at ‘NULL“, the\n                    variable names of the DAGs are used.\n   algorithm        A layout algorithm from igraph, see ggraph::create_layout(). By default,\n                    uses the Sugiyama layout algorithm, which is designed to minimize edge cross-\n                    ing in DAGs.\n   manual_layout    Alternatively, precisely define the layout yourself, by providing a data.frame\n                    that at least has a column name with all variable names, and columns x and y\n                    with positions to be plotted. Setting this parameter overrides algorithm but\n                    other changes, such as rotation and flips will still be applied.\n   text_size        Size of the node label text.\n   box_x            To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                    of an invisible box around each node. If you have long labels, you need to\n                    increase this.\n   box_y            To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                    of an invisible box around each node. If you have multi-line labels, you need to\n                    increase this.\n   edge_width       Width of the edges.\n   curvature        Curvature of the edges. A slight curvature can look pretty.\n   rotation         Supply the degrees you want to rotate the layout by. This is useful in order to\n                    put rotate your upstream nodes towards the top if needed.\n   flip_x           Whether to flip the node positions horizontally.\n   flip_y           Whether to flip the node positions vertically.\n   arrow            A grid::arrow object, specifying the shape and size of the arrowheads.\n                    The order of facets is taken from the ordering of the list, with the facet labels\n                    coming from the names of the list. If the list is unnamed, sequential lettering is\n                    used.\n   ...              Not used.\nExamples\n     d <- DAG(a ~ b + c + d)\n     plot(d)\n     # Plot with manually defined positions:\n     ml <- data.frame(\n       name = c('a', 'b', 'c', 'd'),\n       x = c(1, 1, 2, 2),\n       y = c(1, 2, 1, 2)\n     )\n     plot(d, manual_layout = ml)\n   plot.fitted_DAG                Plot a directed acyclic graph with path coefficients.\nDescription\n     Plot a directed acyclic graph with path coefficients.\nUsage\n     ## S3 method for class 'fitted_DAG'\n     plot(\n         x,\n         type = \"width\",\n         labels = NULL,\n         algorithm = \"sugiyama\",\n         manual_layout = NULL,\n         text_size = 6,\n         box_x = 12,\n         box_y = 8,\n         edge_width = 1.25,\n         curvature = 0.02,\n         rotation = 0,\n         flip_x = FALSE,\n         flip_y = FALSE,\n         arrow = grid::arrow(type = \"closed\", 18, grid::unit(15, \"points\")),\n         colors = c(\"firebrick\", \"navy\"),\n         show.legend = TRUE,\n         width_const = NULL,\n         ...\n     )\nArguments\n     x                   An object of class fitted_DAG.\n     type                How to express the weight of the path. Either \"width\", or \"color\".\n     labels              An optional set of labels to use for the nodes. This should be a named vec-\n                         tor, of the form c(var1 = \"label1\", var2 = \"label2\"). If left at ‘NULL“, the\n                         variable names of the DAGs are used.\n     algorithm           A layout algorithm from igraph, see ggraph::create_layout(). By default,\n                         uses the Sugiyama layout algorithm, which is designed to minimize edge cross-\n                         ing in DAGs.\n     manual_layout       Alternatively, precisely define the layout yourself, by providing a data.frame\n                         that at least has a column name with all variable names, and columns x and y\n                         with positions to be plotted. Setting this parameter overrides algorithm but\n                         other changes, such as rotation and flips will still be applied.\n     text_size           Size of the node label text.\n     box_x               To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                         of an invisible box around each node. If you have long labels, you need to\n                         increase this.\n     box_y               To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                         of an invisible box around each node. If you have multi-line labels, you need to\n                         increase this.\n     edge_width          Width of the edges.\n     curvature           Curvature of the edges. A slight curvature can look pretty.\n     rotation            Supply the degrees you want to rotate the layout by. This is useful in order to\n                         put rotate your upstream nodes towards the top if needed.\n     flip_x              Whether to flip the node positions horizontally.\n     flip_y              Whether to flip the node positions vertically.\n     arrow               A grid::arrow object, specifying the shape and size of the arrowheads.\n                         The order of facets is taken from the ordering of the list, with the facet labels\n                         coming from the names of the list. If the list is unnamed, sequential lettering is\n                         used.\n     colors              The end points of the continuous color scale. Keep in mind that red and green\n                         are obvious colors to use, but are better to be avoided because of color blind\n                         users.\n     show.legend         Whether a legend for the color scale should be shown.\n     width_const         Deprecated.\n     ...                 Not used.\nExamples\n       d <- DAG(LS ~ BM, NL ~ BM, DD ~ NL + LS)\n       d_fitted <- est_DAG(d, rhino, rhino_tree, 'lambda')\n       plot(d_fitted)\n   plot_model_set                Plot several causal hypothesis at once.\nDescription\n     Plot several causal hypothesis at once.\nUsage\n     plot_model_set(\n       model_set,\n       labels = NULL,\n       algorithm = \"kk\",\n       manual_layout = NULL,\n       text_size = 5,\n       box_x = 12,\n       box_y = 10,\n       edge_width = 1,\n       curvature = 0.05,\n       rotation = 0,\n       flip_x = FALSE,\n       flip_y = FALSE,\n       nrow = NULL,\n       arrow = grid::arrow(type = \"closed\", 15, grid::unit(10, \"points\"))\n     )\nArguments\n     model_set       A list of DAG objects, usually created with define_model_set().\n     labels          An optional set of labels to use for the nodes. This should be a named vec-\n                     tor, of the form c(var1 = \"label1\", var2 = \"label2\"). If left at ‘NULL“, the\n                     variable names of the DAGs are used.\n     algorithm       A layout algorithm from igraph, see ggraph::create_layout(). By default,\n                     uses the Kamada-Kawai layout algorithm. Another good option is \"sugiyama\",\n                     which is designed to minimize edge crossing in DAGs. However, it can often\n                     plot nodes too close together.\n     manual_layout   Alternatively, precisely define the layout yourself, by providing a data.frame\n                     that at least has a column name with all variable names, and columns x and y\n                     with positions to be plotted. Setting this parameter overrides algorithm but\n                     other changes, such as rotation and flips will still be applied.\n     text_size       Size of the node label text.\n     box_x           To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                     of an invisible box around each node. If you have long labels, you need to\n                     increase this.\n     box_y           To avoid the arrows colliding with the nodes, specify the rectangular dimensions\n                     of an invisible box around each node. If you have multi-line labels, you need to\n                     increase this.\n     edge_width      Width of the edges.\n     curvature       Curvature of the edges. A slight curvature can look pretty.\n     rotation        Supply the degrees you want to rotate the layout by. This is useful in order to\n                     put rotate your upstream nodes towards the top if needed.\n     flip_x          Whether to flip the node positions horizontally.\n     flip_y          Whether to flip the node positions vertically.\n     nrow                 Number of rows to display the models on.\n     arrow                A grid::arrow object, specifying the shape and size of the arrowheads.\n                          The order of facets is taken from the ordering of the list, with the facet labels\n                          coming from the names of the list. If the list is unnamed, sequential lettering is\n                          used.\nValue\n     A ggplot object.\nExamples\n     m <- list(one = DAG(a ~ b + c + d), two = DAG(a ~ b, b ~ c, d ~ d))\n     plot_model_set(m)\n     plot_model_set(m, algorithm = \"sugiyama\")\n   red_list                     Data on brain size, life history and vulnerability to extinction\nDescription\n     A dataset with continuous variables affecting the conservation Status of mammalian species (the\n     IUCN red list of threatened species).\nUsage\n     red_list\nFormat\n     An object of class data.frame with 474 rows and 7 columns.\nDetails\n     It includes the following variables: brain size (Br), body size (B), gestation period (G), litter size (L),\n     weening age (W), population density (P) and vulnerability to extinction (Status).\nSource\n     , , , Revilla E (2016) Larger brain size indirectly in-\n     creases vulnerability to extinction in mammals. Evolution 70:1364-1375. doi: 10.1111/evo.12943\n   red_list_tree                 Mammalian phylogeny\nDescription\n     This is the accompanying phylogeny for the red_list data set. It is based on the updated mammalian\n     supertree by Bininda-Emonds et al. 2007 & Fritz et al. 2009.\nUsage\n     red_list_tree\nFormat\n     An object of class phylo of length 4.\nSource\n     Gonzalez-Voyer, . . and . 2016. Larger brain size indirectly\n     increases vulnerability to extinction in mammals. Evolution 70:1364-1375. doi: 10.1111/evo.12943.\n     Bininda-Emonds, ., , , , , ,\n     , , , and . 2007. The delayed rise of present-day\n     mammals. Nature 446:507-512.\n     ., . Bininda-Emonds, and . 2009. Geographical variation in predictors of\n     mammalian extinction risk: big is bad, but only in the tropics. Ecol. Lett. 12:538-549.\n   rhino                         Rhinogrades traits.\nDescription\n     A simulated dataset, as used by Gonzalez-Voyer and  as an example, containing\n     variables on body mass (BM), litter size (LS), nose length (NL), dispersal distance (DD) and range\n     size (RS).\nUsage\n     rhino\nFormat\n     An object of class data.frame with 100 rows and 6 columns.\nSource\n      & . 2014. An Introduction to Phylogenetic Path Analysis.\n     Chapter 8. In: Garamszegi LZ (ed.), Modern Phylogenetic Comparative Methods and Their Appli-\n     cation in Evolutionary Biology. pp. 201-229. Springer-Verlag Berlin Heidelberg. doi:10.1111/j.1558-\n     5646.2012.01790.x\n   rhino_tree                   Rhinogrades phylogeny.\nDescription\n     A phylogenetic tree for the 100 species of the rhino dataset.\nUsage\n     rhino_tree\nFormat\n     An object of class phylo of length 4.\nSource\n      & . 2014. An Introduction to Phylogenetic Path Analysis.\n     Chapter 8. In: Garamszegi LZ (ed.), Modern Phylogenetic Comparative Methods and Their Appli-\n     cation in Evolutionary Biology. pp. 201-229. Springer-Verlag Berlin Heidelberg. doi:10.1111/j.1558-\n     5646.2012.01790.x\n   show_warnings                Print out warnings from a phylopath analysis.\nDescription\n     Use this function after running phylo_path() to conveniently print any generated warnings to the\n     screen. You can either provide no arguments, which will only work if you run it directly after the\n     analysis, or you have to provide the phylopath object manually.\nUsage\n     show_warnings(phylopath = NULL)\nArguments\n     phylopath           A phylopath object of which the warnings should be printed."}}},{"rowIdx":452,"cells":{"project":{"kind":"string","value":"r_enum"},"source":{"kind":"string","value":"hex"},"language":{"kind":"string","value":"Erlang"},"content":{"kind":"string","value":"README\n===\n\n[![hex.pm version](https://img.shields.io/hexpm/v/r_enum.svg)](https://hex.pm/packages/r_enum)\n[![CI](https://github.com/tashirosota/ex-r_enum/actions/workflows/ci.yml/badge.svg)](https://github.com/tashirosota/ex-r_enum/actions/workflows/ci.yml)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tashirosota/ex-r_enum)\n\nREnum\n===\n\nREnum is Enum extended with convenient functions inspired by Ruby and Rails ActiveSupport.\nIt also provides full support for native functions through metaprogramming.\nIn addition to REnum, modules such as RList, RMap, RRange can also be used.\n\n* [REnum](#renum)\n\t+ [Installation](#installation)\n\t+ [About REnum](#about-renum)\n\t\t- [compact/1](#compact-1)\n\t\t- [each_slice/2](#each_slice-2)\n\t\t- [grep/2](#grep-2)\n\t\t- [reverse_each/2](#reverse_each-2)\n\t\t- [pluck/2](#pluck-2)\n\t\t- [exclude?/2](#exclude-2)\n\t\t- [without/2](#without-2)\n\t\t- [many?/2](#many-2)\n\t\t- [list_and_not_keyword?/1](#list_and_not_keyword-1)\n\t\t- [map_and_not_range?/1](#map_and_not_range-1)\n\t+ [About RList](#about-rlist)\n\t\t- [push/2](#push-2)\n\t\t- [combination/2](#combination-2)\n\t\t- [fill/3](#fill-3)\n\t\t- [dig/3](#dig-3)\n\t\t- [intersection/2](#intersection-2)\n\t\t- [sample/2](#sample-2)\n\t\t- [values_at/1](#values_at-1)\n\t\t- [second/1](#second-1)\n\t\t- [from/2](#from-2)\n\t\t- [to_sentence/2](#to_sentence-2)\n\t\t- [new/2](#new-2)\n\t+ [About RMap](#about-rmap)\n\t\t- [dig/2](#dig-2)\n\t\t- [each_key/2](#each_key-2)\n\t\t- [except/2](#except-2)\n\t\t- [invert/1](#invert-1)\n\t\t- [values_at/2](#values_at-2)\n\t\t- [deep_atomize_keys/1](#deep_atomize_keys-1)\n\t\t- [deep_transform_keys/2](#deep_transform_keys-2)\n\t+ [About RRange](#about-rrange)\n\t\t- [begin/1](#begin-1)\n\t\t- [step/2](#step-2)\n\t\t- [overlaps?/2](#overlaps-2)\n\t+ [About RUtils](#about-rutils)\n\t\t- [blank?/1](#blank-1)\n\t\t- [present?/1](#present-1)\n\t\t- [define_all_functions!/2](#define_all_functions-2)\n\t+ [Progress](#progress)\n\n Installation\n---\n```\ndef deps do\n [\n {:r_enum, \"~> 0.6\"}\n ]\nend\n```\nFor the full list of available functions, see [API Reference](https://hexdocs.pm/r_enum/api-reference.html).\n\n About [REnum](https://hexdocs.pm/r_enum/REnum.html)\n---\n\n**All the functions are available defined in**\n\n* [Enum](https://hexdocs.pm/r_enum/REnum.Native.html)\n* [REnum.Ruby](https://hexdocs.pm/r_enum/REnum.Ruby.html)\n* [REnum.ActiveSupport](https://hexdocs.pm/r_enum/REnum.ActiveSupport.html)\n* [REnum.Support](https://hexdocs.pm/r_enum/REnum.Support.html)\n\n### \n\n compact/1\n\nReturns an list of all non-nil elements.\n```\niex> REnum.compact([1, nil, 2, 3])\n[1, 2, 3]\n# See also REnum.ActiveSupport.compact_blank\n```\n### \n\n each_slice/2\n\nReturns Stream given enumerable sliced by each amount.\n```\niex> [\"a\", \"b\", \"c\", \"d\", \"e\"]\niex> |> REnum.each_slice(2)\niex> |> Enum.to_list()\n[[\"a\", \"b\"], [\"c\", \"d\"], [\"e\"]]\n```\n### \n\n grep/2\n\nReturns elements selected by a given pattern or function.\n```\niex> [\"foo\", \"bar\", \"car\", \"moo\"]\niex> |> REnum.grep(~r/ar/)\n[\"bar\", \"car\"]\n\niex> 1..10 iex> |> REnum.grep(3..8)\n[3, 4, 5, 6, 7, 8]\n```\n### \n\n reverse_each/2\n\nCalls the function with each element, but in reverse order; returns given enumerable.\n```\niex> REnum.reverse_each([1, 2, 3], &IO.inspect(&1))\n# 3\n# 2\n# 1\n[1, 2, 3]\n```\n### \n\n pluck/2\n\nExtract the given key from each element in the enumerable.\n```\niex> payments = [\n...>  %Payment{dollars: 5, cents: 99},\n...>  %Payment{dollars: 10, cents: 0},\n...>  %Payment{dollars: 0, cents: 5}\n...> ]\niex> REnum.pluck(payments, [:dollars, :cents])\n[[5, 99], [10, 0], [0, 5]]\niex> REnum.pluck(payments, :dollars)\n[5, 10, 0]\niex> REnum.pluck([], :dollars)\n[]\n```\n### \n\n exclude?/2\n\nThe negative of the `Enum.member?`.Returns true+if the collection does not include the object.\n```\niex> REnum.exclude?([2], 1)\ntrue\n\niex> REnum.exclude?([2], 2)\nfalse\n# See also REnum.ActiveSupport.include?\n```\n### \n\n without/2\n\nReturns enumerable excluded the specified elements.\n```\niex> REnum.without(1..5, [1, 5])\n[2, 3, 4]\n\niex> REnum.without(%{foo: 1, bar: 2, baz: 3}, [:bar])\n%{foo: 1, baz: 3}\n# See also REnum.ActiveSupport.including\n```\n### \n\n many?/2\n\nReturns true if the enumerable has more than 1 element.\n```\niex>  REnum.many?([])\nfalse\n\niex> REnum.many?([1])\nfalse\n\niex> REnum.many?([1, 2])\ntrue\n\niex> REnum.many?(%{})\nfalse\n\niex> REnum.many?(%{a: 1})\nfalse\n\niex> REnum.many?(%{a: 1, b: 2})\ntrue\n```\n### \n\n list_and_not_keyword?/1\n\nReturns true if argument is list and not keyword list.\n```\niex> REnum.list_and_not_keyword?([1, 2, 3])\ntrue\n\niex> REnum.list_and_not_keyword?([a: 1, b: 2])\nfalse\n```\n### \n\n map_and_not_range?/1\n\nReturns true if argument is map and not range.\n```\niex> REnum.map_and_not_range?(%{})\ntrue\n\niex> REnum.map_and_not_range?(1..3)\nfalse\n```\n About [RList](https://hexdocs.pm/r_enum/RList.html)\n---\n\nRList is List extended with convenient functions inspired by Ruby and Rails ActiveSupport.\n**All the functions are available defined in**\n\n* [List](https://hexdocs.pm/r_enum/RList.Native.html)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html)\n* [RList.Ruby](https://hexdocs.pm/r_enum/RList.Ruby.html)\n* [RList.ActiveSupport](https://hexdocs.pm/r_enum/RList.ActiveSupport.html)\n* [RList.Support](https://hexdocs.pm/r_enum/RList.Support.html)\n\n### \n\n push/2\n\nAppends trailing elements.\n```\niex> [:foo, 'bar', 2]\niex> |> RList.push([:baz, :bat])\n[:foo, 'bar', 2, :baz, :bat]\n\niex> [:foo, 'bar', 2]\niex> |> RList.push(:baz)\n[:foo, 'bar', 2, :baz]\n# See also REnum.Ruby.shift, REnum.Ruby.pop, REnum.Ruby.unshift\n```\n### \n\n combination/2\n\nReturns Stream that is each repeated combinations of elements of given list. The order of combinations is indeterminate.\n```\niex> RList.combination([1, 2, 3, 4], 1)\niex> |> Enum.to_list()\n[[1],[2],[3],[4]]\n\niex> RList.combination([1, 2, 3, 4], 3)\niex> |> Enum.to_list()\n[[1,2,3],[1,2,4],[1,3,4],[2,3,4]]\n\niex> RList.combination([1, 2, 3, 4], 0)\niex> |> Enum.to_list()\n[[]]\n\niex> RList.combination([1, 2, 3, 4], 5)\niex> |> Enum.to_list()\n[]\n# See also RList.Ruby.repeated_combination, RList.Ruby.permutation, RList.Ruby.repeated_permutation\n```\n### \n\n fill/3\n\nFills the list with the provided value. The filler can be either a function or a fixed value.\n```\niex> RList.fill(~w[a b c d], \"x\")\n[\"x\", \"x\", \"x\", \"x\"]\n\niex> RList.fill(~w[a b c d], \"x\", 0..1)\n[\"x\", \"x\", \"c\", \"d\"]\n\niex> RList.fill(~w[a b c d], fn _, i -> i * i end)\n[0, 1, 4, 9]\n\niex> RList.fill(~w[a b c d], fn _, i -> i * 2 end, 0..1)\n[0, 2, \"c\", \"d\"]\n```\n### \n\n dig/3\n\nFinds and returns the element in nested elements that is specified by index and identifiers.\n```\niex> [:foo, [:bar, :baz, [:bat, :bam]]]\niex> |> RList.dig(1)\n[:bar, :baz, [:bat, :bam]]\n\niex> [:foo, [:bar, :baz, [:bat, :bam]]]\niex> |> RList.dig(1, [2])\n[:bat, :bam]\n\niex> [:foo, [:bar, :baz, [:bat, :bam]]]\niex> |> RList.dig(1, [2, 0])\n:bat\n\niex> [:foo, [:bar, :baz, [:bat, :bam]]]\niex> |> RList.dig(1, [2, 3])\nnil\n```\n### \n\n intersection/2\n\nReturns a new list containing each element found both in list1 and in all of the given list2; duplicates are omitted.\n```\niex> [1, 2, 3]\niex> |> RList.intersection([3, 4, 5])\n[3]\n\niex> [1, 2, 3]\niex> |> RList.intersection([5, 6, 7])\n[]\n\niex> [1, 2, 3]\niex> |> RList.intersection([1, 2, 3])\n[1, 2, 3]\n\"\"\"\n```\n### \n\n sample/2\n\nReturns one or more random elements.\n\n### \n\n values_at/1\n\nReturns a list containing the elements in list corresponding to the given selector(s).The selectors may be either integer indices or ranges.\n```\niex> RList.values_at(~w[a b c d e f], [1, 3, 5])\n[\"b\", \"d\", \"f\"]\n\niex> RList.values_at(~w[a b c d e f], [1, 3, 5, 7])\n[\"b\", \"d\", \"f\", nil]\n\niex> RList.values_at(~w[a b c d e f], [-1, -2, -2, -7])\n[\"f\", \"e\", \"e\", nil]\n\niex> RList.values_at(~w[a b c d e f], [4..6, 3..5])\n[\"e\", \"f\", nil, \"d\", \"e\", \"f\"]\n\niex> RList.values_at(~w[a b c d e f], 4..6)\n[\"e\", \"f\", nil]\n```\n### \n\n second/1\n\nEqual to `Enum.at(list, 1)`.\n```\niex> ~w[a b c d]\niex> |> RList.second()\n\"b\"\n# See also RList.ActiveSupport.third, RList.ActiveSupport.fourth, RList.ActiveSupport.fifth and RList.ActiveSupport.forty_two\n```\n### \n\n from/2\n\nReturns the tail of the list from position.\n```\niex> ~w[a b c d]\niex> |> RList.from(0)\n[\"a\", \"b\", \"c\", \"d\"]\n\niex> ~w[a b c d]\niex> |> RList.from(2)\n[\"c\", \"d\"]\n\niex> ~w[a b c d]\niex> |> RList.from(10)\n[]\n\niex> ~w[]\niex> |> RList.from(0)\n[]\n\niex> ~w[a b c d]\niex> |> RList.from(-2)\n[\"c\", \"d\"]\n\niex> ~w[a b c d]\niex> |> RList.from(-10)\n[]\n# See also RList.ActiveSupport.to\n```\n### \n\n to_sentence/2\n\nConverts the list to a comma-separated sentence where the last element is joined by the connector word.\n\nYou can pass the following options to change the default behavior. If you pass an option key that doesn't exist in the list below, it will raise an\n\n**Options**\n\n* `:words_connector` - The sign or word used to join all but the last element in lists with three or more elements (default: \", \").\n* `:last_word_connector` - The sign or word used to join the last element in lists with three or more elements (default: \", and \").\n* `:two_words_connector` - The sign or word used to join the elements in lists with two elements (default: \" and \").\n```\niex> [\"one\", \"two\"]\niex> |> RList.to_sentence()\n\"one and two\"\n\niex> [\"one\", \"two\", \"three\"]\niex> |> RList.to_sentence()\n\"one, two, and three\"\n\niex> [\"one\", \"two\"]\niex> |> RList.to_sentence(two_words_connector: \"-\")\n\"one-two\"\n\niex> [\"one\", \"two\", \"three\"]\niex> |> RList.to_sentence(words_connector: \" or \", last_word_connector: \" or at least \")\n\"one or two or at least three\"\n\niex> [\"one\", \"two\", \"three\"]\niex> |> RList.to_sentence()\n\"one, two, and three\"\n```\n### \n\n new/2\n\nMake a list of size amount.\n```\niex> 1 iex> |> RList.new(3)\n[1, 1, 1]\n```\n About [RMap](https://hexdocs.pm/r_enum/RMap.html)\n---\n\nRMap is Map extended with convenient functions inspired by Ruby and Rails ActiveSupport.\n**All the functions are available defined in**\n\n* [Map](https://hexdocs.pm/r_enum/RMap.Native.html)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html)\n* [RMap.Ruby](https://hexdocs.pm/r_enum/RMap.Ruby.html)\n* [RMap.ActiveSupport](https://hexdocs.pm/r_enum/RMap.ActiveSupport.html)\n* [RMap.Support](https://hexdocs.pm/r_enum/RMap.Support.html)\n\n### \n\n dig/2\n\nReturns the object in nested map that is specified by a given key and additional arguments.\n```\niex> RMap.dig(%{a: %{b: %{c: 1}}}, [:a, :b, :c])\n1\n\niex> RMap.dig(%{a: %{b: %{c: 1}}}, [:a, :c, :b])\nnil\n```\n### \n\n each_key/2\n\nCalls the function with each key; returns :ok.\n```\niex> RMap.each_key(%{a: 1, b: 2, c: 3}, &IO.inspect(&1))\n# :a\n# :b\n# :c\n:ok\n# See also RMap.Ruby.each_value, RMap.Ruby.each_pair\n```\n### \n\n except/2\n\nReturns a map excluding entries for the given keys.\n```\niex> RMap.except(%{a: 1, b: 2, c: 3}, [:a, :b])\n%{c: 3}\n```\n### \n\n invert/1\n\nReturns a map object with the each key-value pair inverted.\n```\niex> RMap.invert(%{\"a\" => 0, \"b\" => 100, \"c\" => 200, \"d\" => 300, \"e\" => 300})\n%{0 => \"a\", 100 => \"b\", 200 => \"c\", 300 => \"e\"}\n\niex> RMap.invert(%{a: 1, b: 1, c: %{d: 2}})\n%{1 => :b, %{d: 2} => :c}\n```\n### \n\n values_at/2\n\nReturns a list containing values for the given keys.\n```\niex> RMap.values_at(%{a: 1, b: 2, c: 3}, [:a, :b, :d])\n[1, 2, nil]\n```\n### \n\n deep_atomize_keys/1\n\nReturns a list with all keys converted to atom.\nThis includes the keys from the root map and from all nested maps and arrays.\n```\niex> RMap.deep_atomize_keys(%{\"name\" => \"Rob\", \"years\" => \"28\", \"nested\" => %{ \"a\" => 1 }})\n%{name: \"Rob\", nested: %{a: 1}, years: \"28\"}\n\niex> RMap.deep_atomize_keys(%{\"a\" => %{\"b\" => %{\"c\" => 1}, \"d\" => [%{\"a\" => 1, \"b\" => %{\"c\" => 2}}]}})\n%{a: %{b: %{c: 1}, d: [%{a: 1, b: %{c: 2}}]}}\n# See also RList.ActiveSupport.deep_symbolize_keys, RList.ActiveSupport.symbolize_keys, RList.ActiveSupport.deep_stringify_keys, RList.ActiveSupport.stringify_keys,\n```\n### \n\n deep_transform_keys/2\n\nReturns a list with all keys converted to atom.\nThis includes the keys from the root map and from all nested maps and arrays.\n```\niex> RMap.deep_transform_keys(%{a: %{b: %{c: 1}}}, &to_string(&1))\n%{\"a\" => %{\"b\" => %{\"c\" => 1}}}\n\niex> RMap.deep_transform_keys(%{a: %{b: %{c: 1}, d: [%{a: 1, b: %{c: 2}}]}}, &inspect(&1))\n%{\":a\" => %{\":b\" => %{\":c\" => 1}, \":d\" => [%{\":a\" => 1, \":b\" => %{\":c\" => 2}}]}}\n# See also RList.ActiveSupport.deep_transform_values\n```\n About [RRange](https://hexdocs.pm/r_enum/RRange.html)\n---\n\n**All the functions are available defined in**\n\n* [Range](https://hexdocs.pm/r_enum/RRange.Native.html)\n* [RRange.Ruby](https://hexdocs.pm/r_enum/RRange.Ruby.html)\n* [RRange.ActiveSupport](https://hexdocs.pm/r_enum/RRange.ActiveSupport.html)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html)\n\n### \n\n begin/1\n\nReturns the first element of range.\n```\niex> RList.begin(1..3)\n1\n# See also RRange.Ruby.end\n```\n### \n\n step/2\n\nReturns Stream that from given range split into by given step.\n```\niex> RList.step(1..10, 2)\niex> |> Enum.to_list()\n[1, 3, 5, 7, 9]\n\"\"\"\n```\n### \n\n overlaps?/2\n\nCompare two ranges and see if they overlap each other.\n```\niex> RList.overlaps?(1..5, 4..6)\ntrue\n\niex> RList.overlaps?(1..5, 7..9)\nfalse\n```\n About [RUtils](https://hexdocs.pm/r_enum/RUtils.html)\n---\n\nSome useful functions.\n\n### \n\n blank?/1\n\nReturn true if object is blank, false, empty, or a whitespace string.\nFor example, +nil+, '', ' ', [], {}, and +false+ are all blank.\n```\niex>  RUtils.blank?(%{})\ntrue\n\niex> RUtils.blank?([1])\nfalse\n\niex> RUtils.blank?(\" \")\ntrue\n```\n### \n\n present?/1\n\nReturns true if not `RUtils.blank?`\n```\niex> RUtils.present?(%{})\nfalse\n\niex> RUtils.present?([1])\ntrue\n\niex> RUtils.present?(\" \")\nfalse\n```\n### \n\n define_all_functions!/2\n\nDefines in the module that called all the functions of the argument module.\n```\niex> defmodule A do\n...>  defmacro __using__(_opts) do\n...>  RUtils.define_all_functions!(__MODULE__)\n...>  end\n...>\n...>  def test do\n...>  :test\n...>  end\n...> end iex> defmodule B do\n...>  use A\n...> end iex> B.test\n:test\n```\n Progress\n---\n\n| REnum | Elixir Module | Ruby Class | Elixir | Ruby | ActiveSupport |\n| --- | --- | --- | --- | --- | --- |\n| REnum | Enum | Enumerable | ✅ | ✅ | ✅ |\n| RList | List | Array | ✅ | ✅ | ✅ |\n| RMap | Map | Hash | ✅ | ✅ | ✅ |\n| RRange | Range | Range | ✅ | ✅ | ✅ |\n| RStream | Stream | Enumerator::Lazy | ✅ | TODO | TODO |\n\n[API Reference](api-reference.html)\n\nMapKeyError exception\n===\n\nREnum\n===\n\nEntry point of Enum extensions, and can use all of REnum.* functions.\nSee also\n\n* [REnum.Native](https://hexdocs.pm/r_enum/REnum.Native.html#content)\n* [REnum.Ruby](https://hexdocs.pm/r_enum/REnum.Ruby.html#content)\n* [REnum.ActiveSupport](https://hexdocs.pm/r_enum/REnum.ActiveSupport.html#content)\n* [REnum.Support](https://hexdocs.pm/r_enum/REnum.Support.html#content)\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[all?(arg1)](#all?/1)\n\nSee [`Enum.all?/1`](https://hexdocs.pm/elixir/Enum.html#all?/1).\n\n[all?(arg1, arg2)](#all?/2)\n\nSee [`Enum.all?/2`](https://hexdocs.pm/elixir/Enum.html#all?/2).\n\n[any?(arg1)](#any?/1)\n\nSee [`Enum.any?/1`](https://hexdocs.pm/elixir/Enum.html#any?/1).\n\n[any?(arg1, arg2)](#any?/2)\n\nSee [`Enum.any?/2`](https://hexdocs.pm/elixir/Enum.html#any?/2).\n\n[at(arg1, arg2)](#at/2)\n\nSee [`Enum.at/2`](https://hexdocs.pm/elixir/Enum.html#at/2).\n\n[at(arg1, arg2, arg3)](#at/3)\n\nSee [`Enum.at/3`](https://hexdocs.pm/elixir/Enum.html#at/3).\n\n[chain(arg1)](#chain/1)\n\nSee [`REnum.Ruby.chain/1`](REnum.Ruby.html#chain/1).\n\n[chain(arg1, arg2)](#chain/2)\n\nSee [`REnum.Ruby.chain/2`](REnum.Ruby.html#chain/2).\n\n[chunk_by(arg1, arg2)](#chunk_by/2)\n\nSee [`Enum.chunk_by/2`](https://hexdocs.pm/elixir/Enum.html#chunk_by/2).\n\n[chunk_every(arg1, arg2)](#chunk_every/2)\n\nSee [`Enum.chunk_every/2`](https://hexdocs.pm/elixir/Enum.html#chunk_every/2).\n\n[chunk_every(arg1, arg2, arg3)](#chunk_every/3)\n\nSee [`Enum.chunk_every/3`](https://hexdocs.pm/elixir/Enum.html#chunk_every/3).\n\n[chunk_every(arg1, arg2, arg3, arg4)](#chunk_every/4)\n\nSee [`Enum.chunk_every/4`](https://hexdocs.pm/elixir/Enum.html#chunk_every/4).\n\n[chunk_while(arg1, arg2, arg3, arg4)](#chunk_while/4)\n\nSee [`Enum.chunk_while/4`](https://hexdocs.pm/elixir/Enum.html#chunk_while/4).\n\n[collect(arg1, arg2)](#collect/2)\n\nSee [`REnum.Ruby.collect/2`](REnum.Ruby.html#collect/2).\n\n[collect_concat(arg1, arg2)](#collect_concat/2)\n\nSee [`REnum.Ruby.collect_concat/2`](REnum.Ruby.html#collect_concat/2).\n\n[compact(arg1)](#compact/1)\n\nSee [`REnum.Ruby.compact/1`](REnum.Ruby.html#compact/1).\n\n[compact_blank(arg1)](#compact_blank/1)\n\nSee [`REnum.ActiveSupport.compact_blank/1`](REnum.ActiveSupport.html#compact_blank/1).\n\n[concat(arg1)](#concat/1)\n\nSee [`Enum.concat/1`](https://hexdocs.pm/elixir/Enum.html#concat/1).\n\n[concat(arg1, arg2)](#concat/2)\n\nSee [`Enum.concat/2`](https://hexdocs.pm/elixir/Enum.html#concat/2).\n\n[count(arg1)](#count/1)\n\nSee [`Enum.count/1`](https://hexdocs.pm/elixir/Enum.html#count/1).\n\n[count(arg1, arg2)](#count/2)\n\nSee [`Enum.count/2`](https://hexdocs.pm/elixir/Enum.html#count/2).\n\n[count_until(arg1, arg2)](#count_until/2)\n\nSee [`Enum.count_until/2`](https://hexdocs.pm/elixir/Enum.html#count_until/2).\n\n[count_until(arg1, arg2, arg3)](#count_until/3)\n\nSee [`Enum.count_until/3`](https://hexdocs.pm/elixir/Enum.html#count_until/3).\n\n[cycle(arg1, arg2, arg3)](#cycle/3)\n\nSee [`REnum.Ruby.cycle/3`](REnum.Ruby.html#cycle/3).\n\n[dedup(arg1)](#dedup/1)\n\nSee [`Enum.dedup/1`](https://hexdocs.pm/elixir/Enum.html#dedup/1).\n\n[dedup_by(arg1, arg2)](#dedup_by/2)\n\nSee [`Enum.dedup_by/2`](https://hexdocs.pm/elixir/Enum.html#dedup_by/2).\n\n[detect(arg1, arg2)](#detect/2)\n\nSee [`REnum.Ruby.detect/2`](REnum.Ruby.html#detect/2).\n\n[detect(arg1, arg2, arg3)](#detect/3)\n\nSee [`REnum.Ruby.detect/3`](REnum.Ruby.html#detect/3).\n\n[drop(arg1, arg2)](#drop/2)\n\nSee [`Enum.drop/2`](https://hexdocs.pm/elixir/Enum.html#drop/2).\n\n[drop_every(arg1, arg2)](#drop_every/2)\n\nSee [`Enum.drop_every/2`](https://hexdocs.pm/elixir/Enum.html#drop_every/2).\n\n[drop_while(arg1, arg2)](#drop_while/2)\n\nSee [`Enum.drop_while/2`](https://hexdocs.pm/elixir/Enum.html#drop_while/2).\n\n[each(arg1, arg2)](#each/2)\n\nSee [`Enum.each/2`](https://hexdocs.pm/elixir/Enum.html#each/2).\n\n[each_cons(arg1, arg2, arg3)](#each_cons/3)\n\nSee [`REnum.Ruby.each_cons/3`](REnum.Ruby.html#each_cons/3).\n\n[each_entry(arg1, arg2)](#each_entry/2)\n\nSee [`REnum.Ruby.each_entry/2`](REnum.Ruby.html#each_entry/2).\n\n[each_slice(arg1, arg2)](#each_slice/2)\n\nSee [`REnum.Ruby.each_slice/2`](REnum.Ruby.html#each_slice/2).\n\n[each_slice(arg1, arg2, arg3)](#each_slice/3)\n\nSee [`REnum.Ruby.each_slice/3`](REnum.Ruby.html#each_slice/3).\n\n[each_with_index(arg1)](#each_with_index/1)\n\nSee [`REnum.Ruby.each_with_index/1`](REnum.Ruby.html#each_with_index/1).\n\n[each_with_index(arg1, arg2)](#each_with_index/2)\n\nSee [`REnum.Ruby.each_with_index/2`](REnum.Ruby.html#each_with_index/2).\n\n[each_with_object(arg1, arg2, arg3)](#each_with_object/3)\n\nSee [`REnum.Ruby.each_with_object/3`](REnum.Ruby.html#each_with_object/3).\n\n[empty?(arg1)](#empty?/1)\n\nSee [`Enum.empty?/1`](https://hexdocs.pm/elixir/Enum.html#empty?/1).\n\n[entries(arg1)](#entries/1)\n\nSee [`REnum.Ruby.entries/1`](REnum.Ruby.html#entries/1).\n\n[exclude?(arg1, arg2)](#exclude?/2)\n\nSee [`REnum.ActiveSupport.exclude?/2`](REnum.ActiveSupport.html#exclude?/2).\n\n[excluding(arg1, arg2)](#excluding/2)\n\nSee [`REnum.ActiveSupport.excluding/2`](REnum.ActiveSupport.html#excluding/2).\n\n[fetch(arg1, arg2)](#fetch/2)\n\nSee [`Enum.fetch/2`](https://hexdocs.pm/elixir/Enum.html#fetch/2).\n\n[fetch!(arg1, arg2)](#fetch!/2)\n\nSee [`Enum.fetch!/2`](https://hexdocs.pm/elixir/Enum.html#fetch!/2).\n\n[filter(arg1, arg2)](#filter/2)\n\nSee [`Enum.filter/2`](https://hexdocs.pm/elixir/Enum.html#filter/2).\n\n[find(arg1, arg2)](#find/2)\n\nSee [`Enum.find/2`](https://hexdocs.pm/elixir/Enum.html#find/2).\n\n[find(arg1, arg2, arg3)](#find/3)\n\nSee [`Enum.find/3`](https://hexdocs.pm/elixir/Enum.html#find/3).\n\n[find_all(arg1, arg2)](#find_all/2)\n\nSee [`REnum.Ruby.find_all/2`](REnum.Ruby.html#find_all/2).\n\n[find_index(arg1, arg2)](#find_index/2)\n\nSee [`Enum.find_index/2`](https://hexdocs.pm/elixir/Enum.html#find_index/2).\n\n[find_index_with_index(arg1, arg2)](#find_index_with_index/2)\n\nSee [`REnum.Support.find_index_with_index/2`](REnum.Support.html#find_index_with_index/2).\n\n[find_value(arg1, arg2)](#find_value/2)\n\nSee [`Enum.find_value/2`](https://hexdocs.pm/elixir/Enum.html#find_value/2).\n\n[find_value(arg1, arg2, arg3)](#find_value/3)\n\nSee [`Enum.find_value/3`](https://hexdocs.pm/elixir/Enum.html#find_value/3).\n\n[first(arg1)](#first/1)\n\nSee [`REnum.Ruby.first/1`](REnum.Ruby.html#first/1).\n\n[first(arg1, arg2)](#first/2)\n\nSee [`REnum.Ruby.first/2`](REnum.Ruby.html#first/2).\n\n[flat_map(arg1, arg2)](#flat_map/2)\n\nSee [`Enum.flat_map/2`](https://hexdocs.pm/elixir/Enum.html#flat_map/2).\n\n[flat_map_reduce(arg1, arg2, arg3)](#flat_map_reduce/3)\n\nSee [`Enum.flat_map_reduce/3`](https://hexdocs.pm/elixir/Enum.html#flat_map_reduce/3).\n\n[frequencies(arg1)](#frequencies/1)\n\nSee [`Enum.frequencies/1`](https://hexdocs.pm/elixir/Enum.html#frequencies/1).\n\n[frequencies_by(arg1, arg2)](#frequencies_by/2)\n\nSee [`Enum.frequencies_by/2`](https://hexdocs.pm/elixir/Enum.html#frequencies_by/2).\n\n[grep(arg1, arg2)](#grep/2)\n\nSee [`REnum.Ruby.grep/2`](REnum.Ruby.html#grep/2).\n\n[grep(arg1, arg2, arg3)](#grep/3)\n\nSee [`REnum.Ruby.grep/3`](REnum.Ruby.html#grep/3).\n\n[grep_v(arg1, arg2)](#grep_v/2)\n\nSee [`REnum.Ruby.grep_v/2`](REnum.Ruby.html#grep_v/2).\n\n[grep_v(arg1, arg2, arg3)](#grep_v/3)\n\nSee [`REnum.Ruby.grep_v/3`](REnum.Ruby.html#grep_v/3).\n\n[group_by(arg1, arg2)](#group_by/2)\n\nSee [`Enum.group_by/2`](https://hexdocs.pm/elixir/Enum.html#group_by/2).\n\n[group_by(arg1, arg2, arg3)](#group_by/3)\n\nSee [`Enum.group_by/3`](https://hexdocs.pm/elixir/Enum.html#group_by/3).\n\n[in_order_of(arg1, arg2, arg3)](#in_order_of/3)\n\nSee [`REnum.ActiveSupport.in_order_of/3`](REnum.ActiveSupport.html#in_order_of/3).\n\n[include?(arg1, arg2)](#include?/2)\n\nSee [`REnum.Ruby.include?/2`](REnum.Ruby.html#include?/2).\n\n[including(arg1, arg2)](#including/2)\n\nSee [`REnum.ActiveSupport.including/2`](REnum.ActiveSupport.html#including/2).\n\n[index_by(arg1, arg2)](#index_by/2)\n\nSee [`REnum.ActiveSupport.index_by/2`](REnum.ActiveSupport.html#index_by/2).\n\n[index_with(arg1, arg2)](#index_with/2)\n\nSee [`REnum.ActiveSupport.index_with/2`](REnum.ActiveSupport.html#index_with/2).\n\n[inject(arg1, arg2)](#inject/2)\n\nSee [`REnum.Ruby.inject/2`](REnum.Ruby.html#inject/2).\n\n[inject(arg1, arg2, arg3)](#inject/3)\n\nSee [`REnum.Ruby.inject/3`](REnum.Ruby.html#inject/3).\n\n[intersperse(arg1, arg2)](#intersperse/2)\n\nSee [`Enum.intersperse/2`](https://hexdocs.pm/elixir/Enum.html#intersperse/2).\n\n[into(arg1, arg2)](#into/2)\n\nSee [`Enum.into/2`](https://hexdocs.pm/elixir/Enum.html#into/2).\n\n[into(arg1, arg2, arg3)](#into/3)\n\nSee [`Enum.into/3`](https://hexdocs.pm/elixir/Enum.html#into/3).\n\n[join(arg1)](#join/1)\n\nSee [`Enum.join/1`](https://hexdocs.pm/elixir/Enum.html#join/1).\n\n[join(arg1, arg2)](#join/2)\n\nSee [`Enum.join/2`](https://hexdocs.pm/elixir/Enum.html#join/2).\n\n[lazy(arg1)](#lazy/1)\n\nSee [`REnum.Ruby.lazy/1`](REnum.Ruby.html#lazy/1).\n\n[list_and_not_keyword?(arg1)](#list_and_not_keyword?/1)\n\nSee [`REnum.Support.list_and_not_keyword?/1`](REnum.Support.html#list_and_not_keyword?/1).\n\n[many?(arg1)](#many?/1)\n\nSee [`REnum.ActiveSupport.many?/1`](REnum.ActiveSupport.html#many?/1).\n\n[many?(arg1, arg2)](#many?/2)\n\nSee [`REnum.ActiveSupport.many?/2`](REnum.ActiveSupport.html#many?/2).\n\n[map(arg1, arg2)](#map/2)\n\nSee [`Enum.map/2`](https://hexdocs.pm/elixir/Enum.html#map/2).\n\n[map_and_not_range?(arg1)](#map_and_not_range?/1)\n\nSee [`REnum.Support.map_and_not_range?/1`](REnum.Support.html#map_and_not_range?/1).\n\n[map_every(arg1, arg2, arg3)](#map_every/3)\n\nSee [`Enum.map_every/3`](https://hexdocs.pm/elixir/Enum.html#map_every/3).\n\n[map_intersperse(arg1, arg2, arg3)](#map_intersperse/3)\n\nSee [`Enum.map_intersperse/3`](https://hexdocs.pm/elixir/Enum.html#map_intersperse/3).\n\n[map_join(arg1, arg2)](#map_join/2)\n\nSee [`Enum.map_join/2`](https://hexdocs.pm/elixir/Enum.html#map_join/2).\n\n[map_join(arg1, arg2, arg3)](#map_join/3)\n\nSee [`Enum.map_join/3`](https://hexdocs.pm/elixir/Enum.html#map_join/3).\n\n[map_reduce(arg1, arg2, arg3)](#map_reduce/3)\n\nSee [`Enum.map_reduce/3`](https://hexdocs.pm/elixir/Enum.html#map_reduce/3).\n\n[match_function(arg1)](#match_function/1)\n\nSee [`REnum.Support.match_function/1`](REnum.Support.html#match_function/1).\n\n[max(arg1)](#max/1)\n\nSee [`Enum.max/1`](https://hexdocs.pm/elixir/Enum.html#max/1).\n\n[max(arg1, arg2)](#max/2)\n\nSee [`Enum.max/2`](https://hexdocs.pm/elixir/Enum.html#max/2).\n\n[max(arg1, arg2, arg3)](#max/3)\n\nSee [`Enum.max/3`](https://hexdocs.pm/elixir/Enum.html#max/3).\n\n[max_by(arg1, arg2)](#max_by/2)\n\nSee [`Enum.max_by/2`](https://hexdocs.pm/elixir/Enum.html#max_by/2).\n\n[max_by(arg1, arg2, arg3)](#max_by/3)\n\nSee [`Enum.max_by/3`](https://hexdocs.pm/elixir/Enum.html#max_by/3).\n\n[max_by(arg1, arg2, arg3, arg4)](#max_by/4)\n\nSee [`Enum.max_by/4`](https://hexdocs.pm/elixir/Enum.html#max_by/4).\n\n[maximum(arg1, arg2)](#maximum/2)\n\nSee [`REnum.ActiveSupport.maximum/2`](REnum.ActiveSupport.html#maximum/2).\n\n[member?(arg1, arg2)](#member?/2)\n\nSee [`Enum.member?/2`](https://hexdocs.pm/elixir/Enum.html#member?/2).\n\n[min(arg1)](#min/1)\n\nSee [`Enum.min/1`](https://hexdocs.pm/elixir/Enum.html#min/1).\n\n[min(arg1, arg2)](#min/2)\n\nSee [`Enum.min/2`](https://hexdocs.pm/elixir/Enum.html#min/2).\n\n[min(arg1, arg2, arg3)](#min/3)\n\nSee [`Enum.min/3`](https://hexdocs.pm/elixir/Enum.html#min/3).\n\n[min_by(arg1, arg2)](#min_by/2)\n\nSee [`Enum.min_by/2`](https://hexdocs.pm/elixir/Enum.html#min_by/2).\n\n[min_by(arg1, arg2, arg3)](#min_by/3)\n\nSee [`Enum.min_by/3`](https://hexdocs.pm/elixir/Enum.html#min_by/3).\n\n[min_by(arg1, arg2, arg3, arg4)](#min_by/4)\n\nSee [`Enum.min_by/4`](https://hexdocs.pm/elixir/Enum.html#min_by/4).\n\n[min_max(arg1)](#min_max/1)\n\nSee [`Enum.min_max/1`](https://hexdocs.pm/elixir/Enum.html#min_max/1).\n\n[min_max(arg1, arg2)](#min_max/2)\n\nSee [`Enum.min_max/2`](https://hexdocs.pm/elixir/Enum.html#min_max/2).\n\n[min_max_by(arg1, arg2)](#min_max_by/2)\n\nSee [`Enum.min_max_by/2`](https://hexdocs.pm/elixir/Enum.html#min_max_by/2).\n\n[min_max_by(arg1, arg2, arg3)](#min_max_by/3)\n\nSee [`Enum.min_max_by/3`](https://hexdocs.pm/elixir/Enum.html#min_max_by/3).\n\n[min_max_by(arg1, arg2, arg3, arg4)](#min_max_by/4)\n\nSee [`Enum.min_max_by/4`](https://hexdocs.pm/elixir/Enum.html#min_max_by/4).\n\n[minimum(arg1, arg2)](#minimum/2)\n\nSee [`REnum.ActiveSupport.minimum/2`](REnum.ActiveSupport.html#minimum/2).\n\n[minmax(arg1)](#minmax/1)\n\nSee [`REnum.Ruby.minmax/1`](REnum.Ruby.html#minmax/1).\n\n[minmax(arg1, arg2)](#minmax/2)\n\nSee [`REnum.Ruby.minmax/2`](REnum.Ruby.html#minmax/2).\n\n[minmax_by(arg1, arg2)](#minmax_by/2)\n\nSee [`REnum.Ruby.minmax_by/2`](REnum.Ruby.html#minmax_by/2).\n\n[minmax_by(arg1, arg2, arg3)](#minmax_by/3)\n\nSee [`REnum.Ruby.minmax_by/3`](REnum.Ruby.html#minmax_by/3).\n\n[minmax_by(arg1, arg2, arg3, arg4)](#minmax_by/4)\n\nSee [`REnum.Ruby.minmax_by/4`](REnum.Ruby.html#minmax_by/4).\n\n[none?(arg1)](#none?/1)\n\nSee [`REnum.Ruby.none?/1`](REnum.Ruby.html#none?/1).\n\n[none?(arg1, arg2)](#none?/2)\n\nSee [`REnum.Ruby.none?/2`](REnum.Ruby.html#none?/2).\n\n[one?(arg1)](#one?/1)\n\nSee [`REnum.Ruby.one?/1`](REnum.Ruby.html#one?/1).\n\n[one?(arg1, arg2)](#one?/2)\n\nSee [`REnum.Ruby.one?/2`](REnum.Ruby.html#one?/2).\n\n[pick(arg1, arg2)](#pick/2)\n\nSee [`REnum.ActiveSupport.pick/2`](REnum.ActiveSupport.html#pick/2).\n\n[pluck(arg1, arg2)](#pluck/2)\n\nSee [`REnum.ActiveSupport.pluck/2`](REnum.ActiveSupport.html#pluck/2).\n\n[product(arg1)](#product/1)\n\nSee [`Enum.product/1`](https://hexdocs.pm/elixir/Enum.html#product/1).\n\n[random(arg1)](#random/1)\n\nSee [`Enum.random/1`](https://hexdocs.pm/elixir/Enum.html#random/1).\n\n[range?(arg1)](#range?/1)\n\nSee [`REnum.Support.range?/1`](REnum.Support.html#range?/1).\n\n[reduce(arg1, arg2)](#reduce/2)\n\nSee [`Enum.reduce/2`](https://hexdocs.pm/elixir/Enum.html#reduce/2).\n\n[reduce(arg1, arg2, arg3)](#reduce/3)\n\nSee [`Enum.reduce/3`](https://hexdocs.pm/elixir/Enum.html#reduce/3).\n\n[reduce_while(arg1, arg2, arg3)](#reduce_while/3)\n\nSee [`Enum.reduce_while/3`](https://hexdocs.pm/elixir/Enum.html#reduce_while/3).\n\n[reject(arg1, arg2)](#reject/2)\n\nSee [`Enum.reject/2`](https://hexdocs.pm/elixir/Enum.html#reject/2).\n\n[reverse(arg1)](#reverse/1)\n\nSee [`Enum.reverse/1`](https://hexdocs.pm/elixir/Enum.html#reverse/1).\n\n[reverse(arg1, arg2)](#reverse/2)\n\nSee [`Enum.reverse/2`](https://hexdocs.pm/elixir/Enum.html#reverse/2).\n\n[reverse_each(arg1, arg2)](#reverse_each/2)\n\nSee [`REnum.Ruby.reverse_each/2`](REnum.Ruby.html#reverse_each/2).\n\n[reverse_slice(arg1, arg2, arg3)](#reverse_slice/3)\n\nSee [`Enum.reverse_slice/3`](https://hexdocs.pm/elixir/Enum.html#reverse_slice/3).\n\n[scan(arg1, arg2)](#scan/2)\n\nSee [`Enum.scan/2`](https://hexdocs.pm/elixir/Enum.html#scan/2).\n\n[scan(arg1, arg2, arg3)](#scan/3)\n\nSee [`Enum.scan/3`](https://hexdocs.pm/elixir/Enum.html#scan/3).\n\n[select(arg1, arg2)](#select/2)\n\nSee [`REnum.Ruby.select/2`](REnum.Ruby.html#select/2).\n\n[shuffle(arg1)](#shuffle/1)\n\nSee [`Enum.shuffle/1`](https://hexdocs.pm/elixir/Enum.html#shuffle/1).\n\n[slice(arg1, arg2)](#slice/2)\n\nSee [`Enum.slice/2`](https://hexdocs.pm/elixir/Enum.html#slice/2).\n\n[slice(arg1, arg2, arg3)](#slice/3)\n\nSee [`Enum.slice/3`](https://hexdocs.pm/elixir/Enum.html#slice/3).\n\n[slice_after(arg1, arg2)](#slice_after/2)\n\nSee [`REnum.Ruby.slice_after/2`](REnum.Ruby.html#slice_after/2).\n\n[slice_before(arg1, arg2)](#slice_before/2)\n\nSee [`REnum.Ruby.slice_before/2`](REnum.Ruby.html#slice_before/2).\n\n[slice_when(arg1, arg2)](#slice_when/2)\n\nSee [`REnum.Ruby.slice_when/2`](REnum.Ruby.html#slice_when/2).\n\n[slide(arg1, arg2, arg3)](#slide/3)\n\nSee [`Enum.slide/3`](https://hexdocs.pm/elixir/Enum.html#slide/3).\n\n[sole(arg1)](#sole/1)\n\nSee [`REnum.ActiveSupport.sole/1`](REnum.ActiveSupport.html#sole/1).\n\n[sort(arg1)](#sort/1)\n\nSee [`Enum.sort/1`](https://hexdocs.pm/elixir/Enum.html#sort/1).\n\n[sort(arg1, arg2)](#sort/2)\n\nSee [`Enum.sort/2`](https://hexdocs.pm/elixir/Enum.html#sort/2).\n\n[sort_by(arg1, arg2)](#sort_by/2)\n\nSee [`Enum.sort_by/2`](https://hexdocs.pm/elixir/Enum.html#sort_by/2).\n\n[sort_by(arg1, arg2, arg3)](#sort_by/3)\n\nSee [`Enum.sort_by/3`](https://hexdocs.pm/elixir/Enum.html#sort_by/3).\n\n[split(arg1, arg2)](#split/2)\n\nSee [`Enum.split/2`](https://hexdocs.pm/elixir/Enum.html#split/2).\n\n[split_while(arg1, arg2)](#split_while/2)\n\nSee [`Enum.split_while/2`](https://hexdocs.pm/elixir/Enum.html#split_while/2).\n\n[split_with(arg1, arg2)](#split_with/2)\n\nSee [`Enum.split_with/2`](https://hexdocs.pm/elixir/Enum.html#split_with/2).\n\n[sum(arg1)](#sum/1)\n\nSee [`Enum.sum/1`](https://hexdocs.pm/elixir/Enum.html#sum/1).\n\n[take(arg1, arg2)](#take/2)\n\nSee [`Enum.take/2`](https://hexdocs.pm/elixir/Enum.html#take/2).\n\n[take_every(arg1, arg2)](#take_every/2)\n\nSee [`Enum.take_every/2`](https://hexdocs.pm/elixir/Enum.html#take_every/2).\n\n[take_random(arg1, arg2)](#take_random/2)\n\nSee [`Enum.take_random/2`](https://hexdocs.pm/elixir/Enum.html#take_random/2).\n\n[take_while(arg1, arg2)](#take_while/2)\n\nSee [`Enum.take_while/2`](https://hexdocs.pm/elixir/Enum.html#take_while/2).\n\n[tally(arg1)](#tally/1)\n\nSee [`REnum.Ruby.tally/1`](REnum.Ruby.html#tally/1).\n\n[to_a(arg1)](#to_a/1)\n\nSee [`REnum.Ruby.to_a/1`](REnum.Ruby.html#to_a/1).\n\n[to_h(arg1)](#to_h/1)\n\nSee [`REnum.Ruby.to_h/1`](REnum.Ruby.html#to_h/1).\n\n[to_h(arg1, arg2)](#to_h/2)\n\nSee [`REnum.Ruby.to_h/2`](REnum.Ruby.html#to_h/2).\n\n[to_l(arg1)](#to_l/1)\n\nSee [`REnum.Ruby.to_l/1`](REnum.Ruby.html#to_l/1).\n\n[to_list(arg1)](#to_list/1)\n\nSee [`Enum.to_list/1`](https://hexdocs.pm/elixir/Enum.html#to_list/1).\n\n[truthy_count(arg1)](#truthy_count/1)\n\nSee [`REnum.Support.truthy_count/1`](REnum.Support.html#truthy_count/1).\n\n[truthy_count(arg1, arg2)](#truthy_count/2)\n\nSee [`REnum.Support.truthy_count/2`](REnum.Support.html#truthy_count/2).\n\n[uniq_by(arg1, arg2)](#uniq_by/2)\n\nSee [`Enum.uniq_by/2`](https://hexdocs.pm/elixir/Enum.html#uniq_by/2).\n\n[unzip(arg1)](#unzip/1)\n\nSee [`Enum.unzip/1`](https://hexdocs.pm/elixir/Enum.html#unzip/1).\n\n[with_index(arg1)](#with_index/1)\n\nSee [`Enum.with_index/1`](https://hexdocs.pm/elixir/Enum.html#with_index/1).\n\n[with_index(arg1, arg2)](#with_index/2)\n\nSee [`Enum.with_index/2`](https://hexdocs.pm/elixir/Enum.html#with_index/2).\n\n[without(arg1, arg2)](#without/2)\n\nSee [`REnum.ActiveSupport.without/2`](REnum.ActiveSupport.html#without/2).\n\n[zip(arg1)](#zip/1)\n\nSee [`Enum.zip/1`](https://hexdocs.pm/elixir/Enum.html#zip/1).\n\n[zip(arg1, arg2)](#zip/2)\n\nSee [`Enum.zip/2`](https://hexdocs.pm/elixir/Enum.html#zip/2).\n\n[zip_reduce(arg1, arg2, arg3)](#zip_reduce/3)\n\nSee [`Enum.zip_reduce/3`](https://hexdocs.pm/elixir/Enum.html#zip_reduce/3).\n\n[zip_reduce(arg1, arg2, arg3, arg4)](#zip_reduce/4)\n\nSee [`Enum.zip_reduce/4`](https://hexdocs.pm/elixir/Enum.html#zip_reduce/4).\n\n[zip_with(arg1, arg2)](#zip_with/2)\n\nSee [`Enum.zip_with/2`](https://hexdocs.pm/elixir/Enum.html#zip_with/2).\n\n[zip_with(arg1, arg2, arg3)](#zip_with/3)\n\nSee [`Enum.zip_with/3`](https://hexdocs.pm/elixir/Enum.html#zip_with/3).\n\n[Link to this section](#functions)\nFunctions\n===\n\nREnum.ActiveSupport\n===\n\nSummarized all of Enumerable functions in Rails.ActiveSupport.\nIf a function with the same name already exists in Elixir, that is not implemented.\nDefines all of here functions when `use ActiveSupport`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[type_enumerable()](#t:type_enumerable/0)\n\n[type_map_list()](#t:type_map_list/0)\n\n[type_pattern()](#t:type_pattern/0)\n\n[Functions](#functions)\n---\n\n[compact_blank(enumerable)](#compact_blank/1)\n\nReturns a new enumerable without the blank items.\nUses `RUtils.blank?` for determining if an item is blank.\n\n[exclude?(enumerable, element)](#exclude?/2)\n\nThe negative of the `Enum.member?`.\nReturns +true+ if the collection does not include the object.\n\n[excluding(enumerable, elements)](#excluding/2)\n\nReturns enumerable excluded the specified elements.\n\n[in_order_of(enumerable, key, series)](#in_order_of/3)\n\nReturns a list where the order has been set to that provided in the series, based on the key of the elements in the original enumerable.\n\n[including(enumerable, elements)](#including/2)\n\nReturns enumerable included the specified elements.\n\n[index_by(enumerable, key)](#index_by/2)\n\nConverts an enumerable to a mao, using the function result or key as the key and the element as the value.\n\n[index_with(keys, func)](#index_with/2)\n\nConvert an enumerable to a map, using the element as the key and the function result or given value as the value.\n\n[many?(enumerable)](#many?/1)\n\nReturns true if the enumerable has more than 1 element.\n\n[many?(enumerable, pattern_or_func)](#many?/2)\n\nReturns true if the enumerable has more than 1 element matched given function result or pattern.\n\n[maximum(map_list, key)](#maximum/2)\n\nCalculates the maximum from the extracted elements.\n\n[minimum(map_list, key)](#minimum/2)\n\nCalculates the minimum from the extracted elements.\n\n[pick(map_list, keys)](#pick/2)\n\nExtract the given key from the first element in the enumerable.\n\n[pluck(map_list, keys)](#pluck/2)\n\nExtract the given key from each element in the enumerable.\n\n[sole(enumerable)](#sole/1)\n\nReturns the sole item in the enumerable.\nIf there are no items, or more than one item, raises SoleItemExpectedError.\n\n[without(enumerable, elements)](#without/2)\n\nSee [`REnum.ActiveSupport.excluding/2`](#excluding/2).\n\n[Link to this section](#types)\nTypes\n===\n\n[Link to this section](#functions)\nFunctions\n===\n\nREnum.Native\n===\n\nA module defines all of native Enum functions when `use REnum.Native`.\n[See also.](https://hexdocs.pm/elixir/Enum.html)\n\nREnum.Ruby\n===\n\nSummarized all of Ruby's Enumerable functions.\nIf a function with the same name already exists in Elixir, that is not implemented.\nAlso, the function that returns Enumerator in Ruby is customized each behavior on the characteristics.\nDefines all of here functions when `use REnum.Ruby`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[type_enumerable()](#t:type_enumerable/0)\n\n[type_pattern()](#t:type_pattern/0)\n\n[Functions](#functions)\n---\n\n[chain(enumerables)](#chain/1)\n\nSee [`Stream.concat/1`](https://hexdocs.pm/elixir/Stream.html#concat/1).\n\n[chain(first, second)](#chain/2)\n\nSee [`Stream.concat/2`](https://hexdocs.pm/elixir/Stream.html#concat/2).\n\n[collect(enumerable, func)](#collect/2)\n\nSee [`Enum.map/2`](https://hexdocs.pm/elixir/Enum.html#map/2).\n\n[collect_concat(enumerable, func)](#collect_concat/2)\n\nSee [`Enum.flat_map/2`](https://hexdocs.pm/elixir/Enum.html#flat_map/2).\n\n[compact(enumerable)](#compact/1)\n\nReturns an list of all non-nil elements.\n\n[cycle(enumerable, n, func)](#cycle/3)\n\nWhen called with positive integer argument n and a function, calls the block with each element, then does so again, until it has done so n times; returns given enumerable When called with a function and n is nil, returns Stream cycled forever.\n\n[detect(enumerable, func)](#detect/2)\n\nSee [`Enum.find/2`](https://hexdocs.pm/elixir/Enum.html#find/2).\n\n[detect(enumerable, default, func)](#detect/3)\n\nSee [`Enum.find/3`](https://hexdocs.pm/elixir/Enum.html#find/3).\n\n[each_cons(enumerable, n, func)](#each_cons/3)\n\nCalls the function with each successive overlapped n-list of elements; returns given enumerable.\n\n[each_entry(enumerable, func)](#each_entry/2)\n\nCalls the given function with each element, returns given enumerable\n\n[each_slice(enumerable, amount)](#each_slice/2)\n\nReturns Stream given enumerable sliced by each amount.\n\n[each_slice(enumerable, start_index, amount_or_func)](#each_slice/3)\n\nCalls the given function with each element, returns given enumerable.\n\n[each_with_index(enumerable)](#each_with_index/1)\n\nSee [`Enum.with_index/1`](https://hexdocs.pm/elixir/Enum.html#with_index/1).\n\n[each_with_index(enumerable, func)](#each_with_index/2)\n\nSee [`Enum.with_index/2`](https://hexdocs.pm/elixir/Enum.html#with_index/2).\n\n[each_with_object(enumerable, collectable, func)](#each_with_object/3)\n\nSee [`Enum.reduce/3`](https://hexdocs.pm/elixir/Enum.html#reduce/3).\n\n[entries(enumerable)](#entries/1)\n\nSee [`REnum.Ruby.to_a/1`](#to_a/1).\n\n[find_all(enumerable, func)](#find_all/2)\n\nSee [`Enum.filter/2`](https://hexdocs.pm/elixir/Enum.html#filter/2).\n\n[first(enumerable)](#first/1)\n\nReturns the first element.\n\n[first(enumerable, n)](#first/2)\n\nReturns leading elements.\n\n[grep(enumerable, func)](#grep/2)\n\nReturns elements selected by a given pattern or function.\n\n[grep(enumerable, pattern, func)](#grep/3)\n\nCalls the function with each matching element and returned.\n\n[grep_v(enumerable, pattern)](#grep_v/2)\n\nReturns elements rejected by a given pattern or function.\n\n[grep_v(enumerable, pattern, func)](#grep_v/3)\n\nCalls the function with each unmatching element and returned.\n\n[include?(enumerable, element)](#include?/2)\n\nSee [`Enum.member?/2`](https://hexdocs.pm/elixir/Enum.html#member?/2).\n\n[inject(enumerable, func)](#inject/2)\n\nSee [`Enum.reduce/2`](https://hexdocs.pm/elixir/Enum.html#reduce/2).\n\n[inject(enumerable, acc, func)](#inject/3)\n\nSee [`Enum.reduce/3`](https://hexdocs.pm/elixir/Enum.html#reduce/3).\n\n[lazy(enumerable)](#lazy/1)\n\nReturns Stream, which redefines most Enumerable functions to postpone enumeration and enumerate values only on an as-needed basis.\n\n[minmax(enumerable)](#minmax/1)\n\nSee [`Enum.min_max/1`](https://hexdocs.pm/elixir/Enum.html#min_max/1).\n\n[minmax(enumerable, func)](#minmax/2)\n\nSee [`Enum.min_max/2`](https://hexdocs.pm/elixir/Enum.html#min_max/2).\n\n[minmax_by(enumerable, func)](#minmax_by/2)\n\nSee [`Enum.min_max_by/2`](https://hexdocs.pm/elixir/Enum.html#min_max_by/2).\n\n[minmax_by(enumerable, func1, func2)](#minmax_by/3)\n\nSee [`Enum.min_max_by/3`](https://hexdocs.pm/elixir/Enum.html#min_max_by/3).\n\n[minmax_by(enumerable, func1, func2, func3)](#minmax_by/4)\n\nSee [`Enum.min_max_by/4`](https://hexdocs.pm/elixir/Enum.html#min_max_by/4).\n\n[none?(enumerable)](#none?/1)\n\nReturns true if enumerable does not include truthy value; false otherwise.\n\n[none?(enumerable, pattern_or_func)](#none?/2)\n\nReturns whether no element meets a given criterion.\n\n[one?(enumerable)](#one?/1)\n\nReturn true if enumerable has only one truthy element; false otherwise.\n\n[one?(enumerable, pattern_or_func)](#one?/2)\n\nReturns true if exactly one element meets a specified criterion; false otherwise.\n\n[reverse_each(enumerable, func)](#reverse_each/2)\n\nCalls the function with each element, but in reverse order; returns given enumerable.\n\n[select(enumerable, func)](#select/2)\n\nSee [`Enum.filter/2`](https://hexdocs.pm/elixir/Enum.html#filter/2).\n\n[slice_after(enumerable, func)](#slice_after/2)\n\nWith argument pattern, returns an elements that uses the pattern to partition elements into lists (“slices”).\nAn element ends the current slice if element matches pattern.\nWith a function, returns an elements that uses the function to partition elements into list.\nAn element ends the current slice if its function return is a truthy value.\n\n[slice_before(enumerable, func)](#slice_before/2)\n\nWith argument pattern, returns an elements that uses the pattern to partition elements into lists (“slices”).\nAn element begins a new slice if element matches pattern. (or if it is the first element).\nWith a function, returns an elements that uses the function to partition elements into list.\nAn element ends the current slice if its function return is a truthy value.\n\n[slice_when(enumerable, func)](#slice_when/2)\n\nThe returned elements uses the function to partition elements into lists (“slices”).\nIt calls the function with each element and its successor.\nBegins a new slice if and only if the function returns a truthy value.\n&1 is current_element and &2 is next_element in function arguments.\n\n[tally(enumerable)](#tally/1)\n\nSee [`Enum.frequencies/1`](https://hexdocs.pm/elixir/Enum.html#frequencies/1).\n\n[to_a(enumerables)](#to_a/1)\n\nSee [`Enum.to_list/1`](https://hexdocs.pm/elixir/Enum.html#to_list/1).\n\n[to_h(enumerable)](#to_h/1)\n\nReturns a map each of whose entries is the key-value pair formed from one of those list.\n\n[to_h(enumerable, func)](#to_h/2)\n\nThe function is called with each element.\nThe function should return a 2-element tuple which becomes a key-value pair in the returned map.\n\n[to_l(enumerables)](#to_l/1)\n\nSee [`Enum.to_list/1`](https://hexdocs.pm/elixir/Enum.html#to_list/1).\n\n[Link to this section](#types)\nTypes\n===\n\n[Link to this section](#functions)\nFunctions\n===\n\nREnum.Support\n===\n\nSummarized other useful functions related to enumerable.\nDefines all of here functions when `use REnum.Support`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[type_enumerable()](#t:type_enumerable/0)\n\n[type_pattern()](#t:type_pattern/0)\n\n[Functions](#functions)\n---\n\n[find_index_with_index(enumerable, func)](#find_index_with_index/2)\n\nReturns the first element for which function(with each element index) returns a truthy value.\n\n[list_and_not_keyword?(enumerable)](#list_and_not_keyword?/1)\n\nReturns true if argument is list and not keyword list.\n\n[map_and_not_range?(enumerable)](#map_and_not_range?/1)\n\nReturns true if argument is map and not range.\n\n[match_function(pattern)](#match_function/1)\n\nReturns matching function required one argument by given pattern.\n\n[range?(arg1)](#range?/1)\n\nReturns true if argument is range.\n\n[truthy_count(enumerable)](#truthy_count/1)\n\nReturns truthy count.\n\n[truthy_count(enumerable, func)](#truthy_count/2)\n\nReturns truthy count that judged by given function.\n\n[Link to this section](#types)\nTypes\n===\n\n[Link to this section](#functions)\nFunctions\n===\n\nRList\n===\n\nEntry point of List extensions, and can use all of RList.* and REnum functions.\nSee also.\n\n* [RList.Native](https://hexdocs.pm/r_enum/RList.Native.html#content)\n* [RList.Ruby](https://hexdocs.pm/r_enum/RList.Ruby.html#content)\n* [RList.ActiveSupport](https://hexdocs.pm/r_enum/RList.ActiveSupport.html#content)\n* [RList.Support](https://hexdocs.pm/r_enum/RList.SupportSupport.html#content)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html#content)\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[all?(arg1)](#all?/1)\n\nSee [`REnum.all?/1`](REnum.html#all?/1).\n\n[all?(arg1, arg2)](#all?/2)\n\nSee [`REnum.all?/2`](REnum.html#all?/2).\n\n[all_combination(arg1, arg2)](#all_combination/2)\n\nSee [`RList.Ruby.all_combination/2`](RList.Ruby.html#all_combination/2).\n\n[all_combination(arg1, arg2, arg3)](#all_combination/3)\n\nSee [`RList.Ruby.all_combination/3`](RList.Ruby.html#all_combination/3).\n\n[any?(arg1)](#any?/1)\n\nSee [`REnum.any?/1`](REnum.html#any?/1).\n\n[any?(arg1, arg2)](#any?/2)\n\nSee [`REnum.any?/2`](REnum.html#any?/2).\n\n[append(arg1, arg2)](#append/2)\n\nSee [`RList.Ruby.append/2`](RList.Ruby.html#append/2).\n\n[ascii_printable?(arg1)](#ascii_printable?/1)\n\nSee [`List.ascii_printable?/1`](https://hexdocs.pm/elixir/List.html#ascii_printable?/1).\n\n[ascii_printable?(arg1, arg2)](#ascii_printable?/2)\n\nSee [`List.ascii_printable?/2`](https://hexdocs.pm/elixir/List.html#ascii_printable?/2).\n\n[assoc(arg1, arg2)](#assoc/2)\n\nSee [`RList.Ruby.assoc/2`](RList.Ruby.html#assoc/2).\n\n[at(arg1, arg2)](#at/2)\n\nSee [`REnum.at/2`](REnum.html#at/2).\n\n[at(arg1, arg2, arg3)](#at/3)\n\nSee [`REnum.at/3`](REnum.html#at/3).\n\n[chain(arg1)](#chain/1)\n\nSee [`REnum.chain/1`](REnum.html#chain/1).\n\n[chain(arg1, arg2)](#chain/2)\n\nSee [`REnum.chain/2`](REnum.html#chain/2).\n\n[chunk_by(arg1, arg2)](#chunk_by/2)\n\nSee [`REnum.chunk_by/2`](REnum.html#chunk_by/2).\n\n[chunk_every(arg1, arg2)](#chunk_every/2)\n\nSee [`REnum.chunk_every/2`](REnum.html#chunk_every/2).\n\n[chunk_every(arg1, arg2, arg3)](#chunk_every/3)\n\nSee [`REnum.chunk_every/3`](REnum.html#chunk_every/3).\n\n[chunk_every(arg1, arg2, arg3, arg4)](#chunk_every/4)\n\nSee [`REnum.chunk_every/4`](REnum.html#chunk_every/4).\n\n[chunk_while(arg1, arg2, arg3, arg4)](#chunk_while/4)\n\nSee [`REnum.chunk_while/4`](REnum.html#chunk_while/4).\n\n[clear(arg1)](#clear/1)\n\nSee [`RList.Ruby.clear/1`](RList.Ruby.html#clear/1).\n\n[collect(arg1, arg2)](#collect/2)\n\nSee [`REnum.collect/2`](REnum.html#collect/2).\n\n[collect_concat(arg1, arg2)](#collect_concat/2)\n\nSee [`REnum.collect_concat/2`](REnum.html#collect_concat/2).\n\n[combination(arg1, arg2)](#combination/2)\n\nSee [`RList.Ruby.combination/2`](RList.Ruby.html#combination/2).\n\n[combination(arg1, arg2, arg3)](#combination/3)\n\nSee [`RList.Ruby.combination/3`](RList.Ruby.html#combination/3).\n\n[compact(arg1)](#compact/1)\n\nSee [`REnum.compact/1`](REnum.html#compact/1).\n\n[compact_blank(arg1)](#compact_blank/1)\n\nSee [`REnum.compact_blank/1`](REnum.html#compact_blank/1).\n\n[concat(arg1)](#concat/1)\n\nSee [`REnum.concat/1`](REnum.html#concat/1).\n\n[concat(arg1, arg2)](#concat/2)\n\nSee [`REnum.concat/2`](REnum.html#concat/2).\n\n[count(arg1)](#count/1)\n\nSee [`REnum.count/1`](REnum.html#count/1).\n\n[count(arg1, arg2)](#count/2)\n\nSee [`REnum.count/2`](REnum.html#count/2).\n\n[count_until(arg1, arg2)](#count_until/2)\n\nSee [`REnum.count_until/2`](REnum.html#count_until/2).\n\n[count_until(arg1, arg2, arg3)](#count_until/3)\n\nSee [`REnum.count_until/3`](REnum.html#count_until/3).\n\n[cycle(arg1, arg2, arg3)](#cycle/3)\n\nSee [`REnum.cycle/3`](REnum.html#cycle/3).\n\n[dedup(arg1)](#dedup/1)\n\nSee [`REnum.dedup/1`](REnum.html#dedup/1).\n\n[dedup_by(arg1, arg2)](#dedup_by/2)\n\nSee [`REnum.dedup_by/2`](REnum.html#dedup_by/2).\n\n[delete(arg1, arg2)](#delete/2)\n\nSee [`List.delete/2`](https://hexdocs.pm/elixir/List.html#delete/2).\n\n[delete_at(arg1, arg2)](#delete_at/2)\n\nSee [`List.delete_at/2`](https://hexdocs.pm/elixir/List.html#delete_at/2).\n\n[delete_if(arg1, arg2)](#delete_if/2)\n\nSee [`RList.Ruby.delete_if/2`](RList.Ruby.html#delete_if/2).\n\n[detect(arg1, arg2)](#detect/2)\n\nSee [`REnum.detect/2`](REnum.html#detect/2).\n\n[detect(arg1, arg2, arg3)](#detect/3)\n\nSee [`REnum.detect/3`](REnum.html#detect/3).\n\n[difference(arg1, arg2)](#difference/2)\n\nSee [`RList.Ruby.difference/2`](RList.Ruby.html#difference/2).\n\n[dig(arg1, arg2)](#dig/2)\n\nSee [`RList.Ruby.dig/2`](RList.Ruby.html#dig/2).\n\n[dig(arg1, arg2, arg3)](#dig/3)\n\nSee [`RList.Ruby.dig/3`](RList.Ruby.html#dig/3).\n\n[drop(arg1, arg2)](#drop/2)\n\nSee [`REnum.drop/2`](REnum.html#drop/2).\n\n[drop_every(arg1, arg2)](#drop_every/2)\n\nSee [`REnum.drop_every/2`](REnum.html#drop_every/2).\n\n[drop_while(arg1, arg2)](#drop_while/2)\n\nSee [`REnum.drop_while/2`](REnum.html#drop_while/2).\n\n[duplicate(arg1, arg2)](#duplicate/2)\n\nSee [`List.duplicate/2`](https://hexdocs.pm/elixir/List.html#duplicate/2).\n\n[each(arg1, arg2)](#each/2)\n\nSee [`REnum.each/2`](REnum.html#each/2).\n\n[each_cons(arg1, arg2, arg3)](#each_cons/3)\n\nSee [`REnum.each_cons/3`](REnum.html#each_cons/3).\n\n[each_entry(arg1, arg2)](#each_entry/2)\n\nSee [`REnum.each_entry/2`](REnum.html#each_entry/2).\n\n[each_index(arg1, arg2)](#each_index/2)\n\nSee [`RList.Ruby.each_index/2`](RList.Ruby.html#each_index/2).\n\n[each_slice(arg1, arg2)](#each_slice/2)\n\nSee [`REnum.each_slice/2`](REnum.html#each_slice/2).\n\n[each_slice(arg1, arg2, arg3)](#each_slice/3)\n\nSee [`REnum.each_slice/3`](REnum.html#each_slice/3).\n\n[each_with_index(arg1)](#each_with_index/1)\n\nSee [`REnum.each_with_index/1`](REnum.html#each_with_index/1).\n\n[each_with_index(arg1, arg2)](#each_with_index/2)\n\nSee [`REnum.each_with_index/2`](REnum.html#each_with_index/2).\n\n[each_with_object(arg1, arg2, arg3)](#each_with_object/3)\n\nSee [`REnum.each_with_object/3`](REnum.html#each_with_object/3).\n\n[empty?(arg1)](#empty?/1)\n\nSee [`REnum.empty?/1`](REnum.html#empty?/1).\n\n[entries(arg1)](#entries/1)\n\nSee [`REnum.entries/1`](REnum.html#entries/1).\n\n[eql?(arg1, arg2)](#eql?/2)\n\nSee [`RList.Ruby.eql?/2`](RList.Ruby.html#eql?/2).\n\n[exclude?(arg1, arg2)](#exclude?/2)\n\nSee [`REnum.exclude?/2`](REnum.html#exclude?/2).\n\n[excluding(arg1, arg2)](#excluding/2)\n\nSee [`REnum.excluding/2`](REnum.html#excluding/2).\n\n[fetch(arg1, arg2)](#fetch/2)\n\nSee [`REnum.fetch/2`](REnum.html#fetch/2).\n\n[fetch!(arg1, arg2)](#fetch!/2)\n\nSee [`REnum.fetch!/2`](REnum.html#fetch!/2).\n\n[fifth(arg1)](#fifth/1)\n\nSee [`RList.ActiveSupport.fifth/1`](RList.ActiveSupport.html#fifth/1).\n\n[fill(arg1, arg2)](#fill/2)\n\nSee [`RList.Ruby.fill/2`](RList.Ruby.html#fill/2).\n\n[fill(arg1, arg2, arg3)](#fill/3)\n\nSee [`RList.Ruby.fill/3`](RList.Ruby.html#fill/3).\n\n[filter(arg1, arg2)](#filter/2)\n\nSee [`REnum.filter/2`](REnum.html#filter/2).\n\n[find(arg1, arg2)](#find/2)\n\nSee [`REnum.find/2`](REnum.html#find/2).\n\n[find(arg1, arg2, arg3)](#find/3)\n\nSee [`REnum.find/3`](REnum.html#find/3).\n\n[find_all(arg1, arg2)](#find_all/2)\n\nSee [`REnum.find_all/2`](REnum.html#find_all/2).\n\n[find_index(arg1, arg2)](#find_index/2)\n\nSee [`REnum.find_index/2`](REnum.html#find_index/2).\n\n[find_index_with_index(arg1, arg2)](#find_index_with_index/2)\n\nSee [`REnum.find_index_with_index/2`](REnum.html#find_index_with_index/2).\n\n[find_value(arg1, arg2)](#find_value/2)\n\nSee [`REnum.find_value/2`](REnum.html#find_value/2).\n\n[find_value(arg1, arg2, arg3)](#find_value/3)\n\nSee [`REnum.find_value/3`](REnum.html#find_value/3).\n\n[first(arg1)](#first/1)\n\nSee [`List.first/1`](https://hexdocs.pm/elixir/List.html#first/1).\n\n[first(arg1, arg2)](#first/2)\n\nSee [`List.first/2`](https://hexdocs.pm/elixir/List.html#first/2).\n\n[flat_map(arg1, arg2)](#flat_map/2)\n\nSee [`REnum.flat_map/2`](REnum.html#flat_map/2).\n\n[flat_map_reduce(arg1, arg2, arg3)](#flat_map_reduce/3)\n\nSee [`REnum.flat_map_reduce/3`](REnum.html#flat_map_reduce/3).\n\n[flatten(arg1)](#flatten/1)\n\nSee [`List.flatten/1`](https://hexdocs.pm/elixir/List.html#flatten/1).\n\n[flatten(arg1, arg2)](#flatten/2)\n\nSee [`List.flatten/2`](https://hexdocs.pm/elixir/List.html#flatten/2).\n\n[foldl(arg1, arg2, arg3)](#foldl/3)\n\nSee [`List.foldl/3`](https://hexdocs.pm/elixir/List.html#foldl/3).\n\n[foldr(arg1, arg2, arg3)](#foldr/3)\n\nSee [`List.foldr/3`](https://hexdocs.pm/elixir/List.html#foldr/3).\n\n[forty_two(arg1)](#forty_two/1)\n\nSee [`RList.ActiveSupport.forty_two/1`](RList.ActiveSupport.html#forty_two/1).\n\n[fourth(arg1)](#fourth/1)\n\nSee [`RList.ActiveSupport.fourth/1`](RList.ActiveSupport.html#fourth/1).\n\n[frequencies(arg1)](#frequencies/1)\n\nSee [`REnum.frequencies/1`](REnum.html#frequencies/1).\n\n[frequencies_by(arg1, arg2)](#frequencies_by/2)\n\nSee [`REnum.frequencies_by/2`](REnum.html#frequencies_by/2).\n\n[from(arg1, arg2)](#from/2)\n\nSee [`RList.ActiveSupport.from/2`](RList.ActiveSupport.html#from/2).\n\n[grep(arg1, arg2)](#grep/2)\n\nSee [`REnum.grep/2`](REnum.html#grep/2).\n\n[grep(arg1, arg2, arg3)](#grep/3)\n\nSee [`REnum.grep/3`](REnum.html#grep/3).\n\n[grep_v(arg1, arg2)](#grep_v/2)\n\nSee [`REnum.grep_v/2`](REnum.html#grep_v/2).\n\n[grep_v(arg1, arg2, arg3)](#grep_v/3)\n\nSee [`REnum.grep_v/3`](REnum.html#grep_v/3).\n\n[group_by(arg1, arg2)](#group_by/2)\n\nSee [`REnum.group_by/2`](REnum.html#group_by/2).\n\n[group_by(arg1, arg2, arg3)](#group_by/3)\n\nSee [`REnum.group_by/3`](REnum.html#group_by/3).\n\n[improper?(arg1)](#improper?/1)\n\nSee [`List.improper?/1`](https://hexdocs.pm/elixir/List.html#improper?/1).\n\n[in_groups(arg1, arg2)](#in_groups/2)\n\nSee [`RList.ActiveSupport.in_groups/2`](RList.ActiveSupport.html#in_groups/2).\n\n[in_groups(arg1, arg2, arg3)](#in_groups/3)\n\nSee [`RList.ActiveSupport.in_groups/3`](RList.ActiveSupport.html#in_groups/3).\n\n[in_groups_of(arg1, arg2)](#in_groups_of/2)\n\nSee [`RList.ActiveSupport.in_groups_of/2`](RList.ActiveSupport.html#in_groups_of/2).\n\n[in_groups_of(arg1, arg2, arg3)](#in_groups_of/3)\n\nSee [`RList.ActiveSupport.in_groups_of/3`](RList.ActiveSupport.html#in_groups_of/3).\n\n[in_order_of(arg1, arg2, arg3)](#in_order_of/3)\n\nSee [`REnum.in_order_of/3`](REnum.html#in_order_of/3).\n\n[include?(arg1, arg2)](#include?/2)\n\nSee [`REnum.include?/2`](REnum.html#include?/2).\n\n[including(arg1, arg2)](#including/2)\n\nSee [`REnum.including/2`](REnum.html#including/2).\n\n[index(arg1, arg2)](#index/2)\n\nSee [`RList.Ruby.index/2`](RList.Ruby.html#index/2).\n\n[index_by(arg1, arg2)](#index_by/2)\n\nSee [`REnum.index_by/2`](REnum.html#index_by/2).\n\n[index_with(arg1, arg2)](#index_with/2)\n\nSee [`REnum.index_with/2`](REnum.html#index_with/2).\n\n[inject(arg1, arg2)](#inject/2)\n\nSee [`REnum.inject/2`](REnum.html#inject/2).\n\n[inject(arg1, arg2, arg3)](#inject/3)\n\nSee [`REnum.inject/3`](REnum.html#inject/3).\n\n[insert(arg1, arg2, arg3)](#insert/3)\n\nSee [`RList.Ruby.insert/3`](RList.Ruby.html#insert/3).\n\n[insert_at(arg1, arg2, arg3)](#insert_at/3)\n\nSee [`List.insert_at/3`](https://hexdocs.pm/elixir/List.html#insert_at/3).\n\n[inspect(arg1)](#inspect/1)\n\nSee [`RList.Ruby.inspect/1`](RList.Ruby.html#inspect/1).\n\n[intersect?(arg1, arg2)](#intersect?/2)\n\nSee [`RList.Ruby.intersect?/2`](RList.Ruby.html#intersect?/2).\n\n[intersection(arg1, arg2)](#intersection/2)\n\nSee [`RList.Ruby.intersection/2`](RList.Ruby.html#intersection/2).\n\n[intersperse(arg1, arg2)](#intersperse/2)\n\nSee [`REnum.intersperse/2`](REnum.html#intersperse/2).\n\n[into(arg1, arg2)](#into/2)\n\nSee [`REnum.into/2`](REnum.html#into/2).\n\n[into(arg1, arg2, arg3)](#into/3)\n\nSee [`REnum.into/3`](REnum.html#into/3).\n\n[join(arg1)](#join/1)\n\nSee [`REnum.join/1`](REnum.html#join/1).\n\n[join(arg1, arg2)](#join/2)\n\nSee [`REnum.join/2`](REnum.html#join/2).\n\n[keep_if(arg1, arg2)](#keep_if/2)\n\nSee [`RList.Ruby.keep_if/2`](RList.Ruby.html#keep_if/2).\n\n[keydelete(arg1, arg2, arg3)](#keydelete/3)\n\nSee [`List.keydelete/3`](https://hexdocs.pm/elixir/List.html#keydelete/3).\n\n[keyfind(arg1, arg2, arg3)](#keyfind/3)\n\nSee [`List.keyfind/3`](https://hexdocs.pm/elixir/List.html#keyfind/3).\n\n[keyfind(arg1, arg2, arg3, arg4)](#keyfind/4)\n\nSee [`List.keyfind/4`](https://hexdocs.pm/elixir/List.html#keyfind/4).\n\n[keyfind!(arg1, arg2, arg3)](#keyfind!/3)\n\nSee [`List.keyfind!/3`](https://hexdocs.pm/elixir/List.html#keyfind!/3).\n\n[keymember?(arg1, arg2, arg3)](#keymember?/3)\n\nSee [`List.keymember?/3`](https://hexdocs.pm/elixir/List.html#keymember?/3).\n\n[keyreplace(arg1, arg2, arg3, arg4)](#keyreplace/4)\n\nSee [`List.keyreplace/4`](https://hexdocs.pm/elixir/List.html#keyreplace/4).\n\n[keysort(arg1, arg2)](#keysort/2)\n\nSee [`List.keysort/2`](https://hexdocs.pm/elixir/List.html#keysort/2).\n\n[keystore(arg1, arg2, arg3, arg4)](#keystore/4)\n\nSee [`List.keystore/4`](https://hexdocs.pm/elixir/List.html#keystore/4).\n\n[keytake(arg1, arg2, arg3)](#keytake/3)\n\nSee [`List.keytake/3`](https://hexdocs.pm/elixir/List.html#keytake/3).\n\n[last(arg1)](#last/1)\n\nSee [`List.last/1`](https://hexdocs.pm/elixir/List.html#last/1).\n\n[last(arg1, arg2)](#last/2)\n\nSee [`List.last/2`](https://hexdocs.pm/elixir/List.html#last/2).\n\n[lazy(arg1)](#lazy/1)\n\nSee [`REnum.lazy/1`](REnum.html#lazy/1).\n\n[length(arg1)](#length/1)\n\nSee [`RList.Ruby.length/1`](RList.Ruby.html#length/1).\n\n[list_and_not_keyword?(arg1)](#list_and_not_keyword?/1)\n\nSee [`REnum.list_and_not_keyword?/1`](REnum.html#list_and_not_keyword?/1).\n\n[many?(arg1)](#many?/1)\n\nSee [`REnum.many?/1`](REnum.html#many?/1).\n\n[many?(arg1, arg2)](#many?/2)\n\nSee [`REnum.many?/2`](REnum.html#many?/2).\n\n[map(arg1, arg2)](#map/2)\n\nSee [`REnum.map/2`](REnum.html#map/2).\n\n[map_and_not_range?(arg1)](#map_and_not_range?/1)\n\nSee [`REnum.map_and_not_range?/1`](REnum.html#map_and_not_range?/1).\n\n[map_every(arg1, arg2, arg3)](#map_every/3)\n\nSee [`REnum.map_every/3`](REnum.html#map_every/3).\n\n[map_intersperse(arg1, arg2, arg3)](#map_intersperse/3)\n\nSee [`REnum.map_intersperse/3`](REnum.html#map_intersperse/3).\n\n[map_join(arg1, arg2)](#map_join/2)\n\nSee [`REnum.map_join/2`](REnum.html#map_join/2).\n\n[map_join(arg1, arg2, arg3)](#map_join/3)\n\nSee [`REnum.map_join/3`](REnum.html#map_join/3).\n\n[map_reduce(arg1, arg2, arg3)](#map_reduce/3)\n\nSee [`REnum.map_reduce/3`](REnum.html#map_reduce/3).\n\n[match_function(arg1)](#match_function/1)\n\nSee [`REnum.match_function/1`](REnum.html#match_function/1).\n\n[max(arg1)](#max/1)\n\nSee [`REnum.max/1`](REnum.html#max/1).\n\n[max(arg1, arg2)](#max/2)\n\nSee [`REnum.max/2`](REnum.html#max/2).\n\n[max(arg1, arg2, arg3)](#max/3)\n\nSee [`REnum.max/3`](REnum.html#max/3).\n\n[max_by(arg1, arg2)](#max_by/2)\n\nSee [`REnum.max_by/2`](REnum.html#max_by/2).\n\n[max_by(arg1, arg2, arg3)](#max_by/3)\n\nSee [`REnum.max_by/3`](REnum.html#max_by/3).\n\n[max_by(arg1, arg2, arg3, arg4)](#max_by/4)\n\nSee [`REnum.max_by/4`](REnum.html#max_by/4).\n\n[maximum(arg1, arg2)](#maximum/2)\n\nSee [`REnum.maximum/2`](REnum.html#maximum/2).\n\n[member?(arg1, arg2)](#member?/2)\n\nSee [`REnum.member?/2`](REnum.html#member?/2).\n\n[min(arg1)](#min/1)\n\nSee [`REnum.min/1`](REnum.html#min/1).\n\n[min(arg1, arg2)](#min/2)\n\nSee [`REnum.min/2`](REnum.html#min/2).\n\n[min(arg1, arg2, arg3)](#min/3)\n\nSee [`REnum.min/3`](REnum.html#min/3).\n\n[min_by(arg1, arg2)](#min_by/2)\n\nSee [`REnum.min_by/2`](REnum.html#min_by/2).\n\n[min_by(arg1, arg2, arg3)](#min_by/3)\n\nSee [`REnum.min_by/3`](REnum.html#min_by/3).\n\n[min_by(arg1, arg2, arg3, arg4)](#min_by/4)\n\nSee [`REnum.min_by/4`](REnum.html#min_by/4).\n\n[min_max(arg1)](#min_max/1)\n\nSee [`REnum.min_max/1`](REnum.html#min_max/1).\n\n[min_max(arg1, arg2)](#min_max/2)\n\nSee [`REnum.min_max/2`](REnum.html#min_max/2).\n\n[min_max_by(arg1, arg2)](#min_max_by/2)\n\nSee [`REnum.min_max_by/2`](REnum.html#min_max_by/2).\n\n[min_max_by(arg1, arg2, arg3)](#min_max_by/3)\n\nSee [`REnum.min_max_by/3`](REnum.html#min_max_by/3).\n\n[min_max_by(arg1, arg2, arg3, arg4)](#min_max_by/4)\n\nSee [`REnum.min_max_by/4`](REnum.html#min_max_by/4).\n\n[minimum(arg1, arg2)](#minimum/2)\n\nSee [`REnum.minimum/2`](REnum.html#minimum/2).\n\n[minmax(arg1)](#minmax/1)\n\nSee [`REnum.minmax/1`](REnum.html#minmax/1).\n\n[minmax(arg1, arg2)](#minmax/2)\n\nSee [`REnum.minmax/2`](REnum.html#minmax/2).\n\n[minmax_by(arg1, arg2)](#minmax_by/2)\n\nSee [`REnum.minmax_by/2`](REnum.html#minmax_by/2).\n\n[minmax_by(arg1, arg2, arg3)](#minmax_by/3)\n\nSee [`REnum.minmax_by/3`](REnum.html#minmax_by/3).\n\n[minmax_by(arg1, arg2, arg3, arg4)](#minmax_by/4)\n\nSee [`REnum.minmax_by/4`](REnum.html#minmax_by/4).\n\n[myers_difference(arg1, arg2)](#myers_difference/2)\n\nSee [`List.myers_difference/2`](https://hexdocs.pm/elixir/List.html#myers_difference/2).\n\n[myers_difference(arg1, arg2, arg3)](#myers_difference/3)\n\nSee [`List.myers_difference/3`](https://hexdocs.pm/elixir/List.html#myers_difference/3).\n\n[new(arg1)](#new/1)\n\nSee [`RList.Support.new/1`](RList.Support.html#new/1).\n\n[new(arg1, arg2)](#new/2)\n\nSee [`RList.Support.new/2`](RList.Support.html#new/2).\n\n[none?(arg1)](#none?/1)\n\nSee [`REnum.none?/1`](REnum.html#none?/1).\n\n[none?(arg1, arg2)](#none?/2)\n\nSee [`REnum.none?/2`](REnum.html#none?/2).\n\n[one?(arg1)](#one?/1)\n\nSee [`REnum.one?/1`](REnum.html#one?/1).\n\n[one?(arg1, arg2)](#one?/2)\n\nSee [`REnum.one?/2`](REnum.html#one?/2).\n\n[permutation(arg1)](#permutation/1)\n\nSee [`RList.Ruby.permutation/1`](RList.Ruby.html#permutation/1).\n\n[permutation(arg1, arg2)](#permutation/2)\n\nSee [`RList.Ruby.permutation/2`](RList.Ruby.html#permutation/2).\n\n[pick(arg1, arg2)](#pick/2)\n\nSee [`REnum.pick/2`](REnum.html#pick/2).\n\n[pluck(arg1, arg2)](#pluck/2)\n\nSee [`REnum.pluck/2`](REnum.html#pluck/2).\n\n[pop(arg1)](#pop/1)\n\nSee [`RList.Ruby.pop/1`](RList.Ruby.html#pop/1).\n\n[pop(arg1, arg2)](#pop/2)\n\nSee [`RList.Ruby.pop/2`](RList.Ruby.html#pop/2).\n\n[pop_at(arg1, arg2)](#pop_at/2)\n\nSee [`List.pop_at/2`](https://hexdocs.pm/elixir/List.html#pop_at/2).\n\n[pop_at(arg1, arg2, arg3)](#pop_at/3)\n\nSee [`List.pop_at/3`](https://hexdocs.pm/elixir/List.html#pop_at/3).\n\n[prepend(arg1)](#prepend/1)\n\nSee [`RList.Ruby.prepend/1`](RList.Ruby.html#prepend/1).\n\n[prepend(arg1, arg2)](#prepend/2)\n\nSee [`RList.Ruby.prepend/2`](RList.Ruby.html#prepend/2).\n\n[product(arg1)](#product/1)\n\nSee [`REnum.product/1`](REnum.html#product/1).\n\n[push(arg1, arg2)](#push/2)\n\nSee [`RList.Ruby.push/2`](RList.Ruby.html#push/2).\n\n[random(arg1)](#random/1)\n\nSee [`REnum.random/1`](REnum.html#random/1).\n\n[range?(arg1)](#range?/1)\n\nSee [`REnum.range?/1`](REnum.html#range?/1).\n\n[rassoc(arg1, arg2)](#rassoc/2)\n\nSee [`RList.Ruby.rassoc/2`](RList.Ruby.html#rassoc/2).\n\n[reduce(arg1, arg2)](#reduce/2)\n\nSee [`REnum.reduce/2`](REnum.html#reduce/2).\n\n[reduce(arg1, arg2, arg3)](#reduce/3)\n\nSee [`REnum.reduce/3`](REnum.html#reduce/3).\n\n[reduce_while(arg1, arg2, arg3)](#reduce_while/3)\n\nSee [`REnum.reduce_while/3`](REnum.html#reduce_while/3).\n\n[reject(arg1, arg2)](#reject/2)\n\nSee [`REnum.reject/2`](REnum.html#reject/2).\n\n[repeated_combination(arg1, arg2)](#repeated_combination/2)\n\nSee [`RList.Ruby.repeated_combination/2`](RList.Ruby.html#repeated_combination/2).\n\n[repeated_combination(arg1, arg2, arg3)](#repeated_combination/3)\n\nSee [`RList.Ruby.repeated_combination/3`](RList.Ruby.html#repeated_combination/3).\n\n[repeated_permutation(arg1, arg2)](#repeated_permutation/2)\n\nSee [`RList.Ruby.repeated_permutation/2`](RList.Ruby.html#repeated_permutation/2).\n\n[replace_at(arg1, arg2, arg3)](#replace_at/3)\n\nSee [`List.replace_at/3`](https://hexdocs.pm/elixir/List.html#replace_at/3).\n\n[reverse(arg1)](#reverse/1)\n\nSee [`REnum.reverse/1`](REnum.html#reverse/1).\n\n[reverse(arg1, arg2)](#reverse/2)\n\nSee [`REnum.reverse/2`](REnum.html#reverse/2).\n\n[reverse_each(arg1, arg2)](#reverse_each/2)\n\nSee [`REnum.reverse_each/2`](REnum.html#reverse_each/2).\n\n[reverse_slice(arg1, arg2, arg3)](#reverse_slice/3)\n\nSee [`REnum.reverse_slice/3`](REnum.html#reverse_slice/3).\n\n[rindex(arg1, arg2)](#rindex/2)\n\nSee [`RList.Ruby.rindex/2`](RList.Ruby.html#rindex/2).\n\n[rotate(arg1)](#rotate/1)\n\nSee [`RList.Ruby.rotate/1`](RList.Ruby.html#rotate/1).\n\n[rotate(arg1, arg2)](#rotate/2)\n\nSee [`RList.Ruby.rotate/2`](RList.Ruby.html#rotate/2).\n\n[sample(arg1)](#sample/1)\n\nSee [`RList.Ruby.sample/1`](RList.Ruby.html#sample/1).\n\n[sample(arg1, arg2)](#sample/2)\n\nSee [`RList.Ruby.sample/2`](RList.Ruby.html#sample/2).\n\n[scan(arg1, arg2)](#scan/2)\n\nSee [`REnum.scan/2`](REnum.html#scan/2).\n\n[scan(arg1, arg2, arg3)](#scan/3)\n\nSee [`REnum.scan/3`](REnum.html#scan/3).\n\n[second(arg1)](#second/1)\n\nSee [`RList.ActiveSupport.second/1`](RList.ActiveSupport.html#second/1).\n\n[second_to_last(arg1)](#second_to_last/1)\n\nSee [`RList.ActiveSupport.second_to_last/1`](RList.ActiveSupport.html#second_to_last/1).\n\n[select(arg1, arg2)](#select/2)\n\nSee [`REnum.select/2`](REnum.html#select/2).\n\n[shift(arg1)](#shift/1)\n\nSee [`RList.Ruby.shift/1`](RList.Ruby.html#shift/1).\n\n[shift(arg1, arg2)](#shift/2)\n\nSee [`RList.Ruby.shift/2`](RList.Ruby.html#shift/2).\n\n[shuffle(arg1)](#shuffle/1)\n\nSee [`REnum.shuffle/1`](REnum.html#shuffle/1).\n\n[size(arg1)](#size/1)\n\nSee [`RList.Ruby.size/1`](RList.Ruby.html#size/1).\n\n[slice(arg1, arg2)](#slice/2)\n\nSee [`REnum.slice/2`](REnum.html#slice/2).\n\n[slice(arg1, arg2, arg3)](#slice/3)\n\nSee [`REnum.slice/3`](REnum.html#slice/3).\n\n[slice_after(arg1, arg2)](#slice_after/2)\n\nSee [`REnum.slice_after/2`](REnum.html#slice_after/2).\n\n[slice_before(arg1, arg2)](#slice_before/2)\n\nSee [`REnum.slice_before/2`](REnum.html#slice_before/2).\n\n[slice_when(arg1, arg2)](#slice_when/2)\n\nSee [`REnum.slice_when/2`](REnum.html#slice_when/2).\n\n[slide(arg1, arg2, arg3)](#slide/3)\n\nSee [`REnum.slide/3`](REnum.html#slide/3).\n\n[sole(arg1)](#sole/1)\n\nSee [`REnum.sole/1`](REnum.html#sole/1).\n\n[sort(arg1)](#sort/1)\n\nSee [`REnum.sort/1`](REnum.html#sort/1).\n\n[sort(arg1, arg2)](#sort/2)\n\nSee [`REnum.sort/2`](REnum.html#sort/2).\n\n[sort_by(arg1, arg2)](#sort_by/2)\n\nSee [`REnum.sort_by/2`](REnum.html#sort_by/2).\n\n[sort_by(arg1, arg2, arg3)](#sort_by/3)\n\nSee [`REnum.sort_by/3`](REnum.html#sort_by/3).\n\n[split(arg1, arg2)](#split/2)\n\nSee [`REnum.split/2`](REnum.html#split/2).\n\n[split_while(arg1, arg2)](#split_while/2)\n\nSee [`REnum.split_while/2`](REnum.html#split_while/2).\n\n[split_with(arg1, arg2)](#split_with/2)\n\nSee [`REnum.split_with/2`](REnum.html#split_with/2).\n\n[starts_with?(arg1, arg2)](#starts_with?/2)\n\nSee [`List.starts_with?/2`](https://hexdocs.pm/elixir/List.html#starts_with?/2).\n\n[sum(arg1)](#sum/1)\n\nSee [`REnum.sum/1`](REnum.html#sum/1).\n\n[take(arg1, arg2)](#take/2)\n\nSee [`REnum.take/2`](REnum.html#take/2).\n\n[take_every(arg1, arg2)](#take_every/2)\n\nSee [`REnum.take_every/2`](REnum.html#take_every/2).\n\n[take_random(arg1, arg2)](#take_random/2)\n\nSee [`REnum.take_random/2`](REnum.html#take_random/2).\n\n[take_while(arg1, arg2)](#take_while/2)\n\nSee [`REnum.take_while/2`](REnum.html#take_while/2).\n\n[tally(arg1)](#tally/1)\n\nSee [`REnum.tally/1`](REnum.html#tally/1).\n\n[third(arg1)](#third/1)\n\nSee [`RList.ActiveSupport.third/1`](RList.ActiveSupport.html#third/1).\n\n[third_to_last(arg1)](#third_to_last/1)\n\nSee [`RList.ActiveSupport.third_to_last/1`](RList.ActiveSupport.html#third_to_last/1).\n\n[to(arg1, arg2)](#to/2)\n\nSee [`RList.ActiveSupport.to/2`](RList.ActiveSupport.html#to/2).\n\n[to_a(arg1)](#to_a/1)\n\nSee [`REnum.to_a/1`](REnum.html#to_a/1).\n\n[to_ary(arg1)](#to_ary/1)\n\nSee [`RList.Ruby.to_ary/1`](RList.Ruby.html#to_ary/1).\n\n[to_atom(arg1)](#to_atom/1)\n\nSee [`List.to_atom/1`](https://hexdocs.pm/elixir/List.html#to_atom/1).\n\n[to_charlist(arg1)](#to_charlist/1)\n\nSee [`List.to_charlist/1`](https://hexdocs.pm/elixir/List.html#to_charlist/1).\n\n[to_default_s(arg1)](#to_default_s/1)\n\nSee [`RList.ActiveSupport.to_default_s/1`](RList.ActiveSupport.html#to_default_s/1).\n\n[to_existing_atom(arg1)](#to_existing_atom/1)\n\nSee [`List.to_existing_atom/1`](https://hexdocs.pm/elixir/List.html#to_existing_atom/1).\n\n[to_float(arg1)](#to_float/1)\n\nSee [`List.to_float/1`](https://hexdocs.pm/elixir/List.html#to_float/1).\n\n[to_h(arg1)](#to_h/1)\n\nSee [`REnum.to_h/1`](REnum.html#to_h/1).\n\n[to_h(arg1, arg2)](#to_h/2)\n\nSee [`REnum.to_h/2`](REnum.html#to_h/2).\n\n[to_integer(arg1)](#to_integer/1)\n\nSee [`List.to_integer/1`](https://hexdocs.pm/elixir/List.html#to_integer/1).\n\n[to_integer(arg1, arg2)](#to_integer/2)\n\nSee [`List.to_integer/2`](https://hexdocs.pm/elixir/List.html#to_integer/2).\n\n[to_l(arg1)](#to_l/1)\n\nSee [`REnum.to_l/1`](REnum.html#to_l/1).\n\n[to_list(arg1)](#to_list/1)\n\nSee [`REnum.to_list/1`](REnum.html#to_list/1).\n\n[to_s(arg1)](#to_s/1)\n\nSee [`RList.Ruby.to_s/1`](RList.Ruby.html#to_s/1).\n\n[to_sentence(arg1)](#to_sentence/1)\n\nSee [`RList.ActiveSupport.to_sentence/1`](RList.ActiveSupport.html#to_sentence/1).\n\n[to_sentence(arg1, arg2)](#to_sentence/2)\n\nSee [`RList.ActiveSupport.to_sentence/2`](RList.ActiveSupport.html#to_sentence/2).\n\n[to_string(arg1)](#to_string/1)\n\nSee [`List.to_string/1`](https://hexdocs.pm/elixir/List.html#to_string/1).\n\n[to_tuple(arg1)](#to_tuple/1)\n\nSee [`List.to_tuple/1`](https://hexdocs.pm/elixir/List.html#to_tuple/1).\n\n[transpose(arg1)](#transpose/1)\n\nSee [`RList.Ruby.transpose/1`](RList.Ruby.html#transpose/1).\n\n[truthy_count(arg1)](#truthy_count/1)\n\nSee [`REnum.truthy_count/1`](REnum.html#truthy_count/1).\n\n[truthy_count(arg1, arg2)](#truthy_count/2)\n\nSee [`REnum.truthy_count/2`](REnum.html#truthy_count/2).\n\n[union(arg1, arg2)](#union/2)\n\nSee [`RList.Ruby.union/2`](RList.Ruby.html#union/2).\n\n[uniq_by(arg1, arg2)](#uniq_by/2)\n\nSee [`REnum.uniq_by/2`](REnum.html#uniq_by/2).\n\n[unshift(arg1, arg2)](#unshift/2)\n\nSee [`RList.Ruby.unshift/2`](RList.Ruby.html#unshift/2).\n\n[unzip(arg1)](#unzip/1)\n\nSee [`REnum.unzip/1`](REnum.html#unzip/1).\n\n[update_at(arg1, arg2, arg3)](#update_at/3)\n\nSee [`List.update_at/3`](https://hexdocs.pm/elixir/List.html#update_at/3).\n\n[values_at(arg1, arg2)](#values_at/2)\n\nSee [`RList.Ruby.values_at/2`](RList.Ruby.html#values_at/2).\n\n[with_index(arg1)](#with_index/1)\n\nSee [`REnum.with_index/1`](REnum.html#with_index/1).\n\n[with_index(arg1, arg2)](#with_index/2)\n\nSee [`REnum.with_index/2`](REnum.html#with_index/2).\n\n[without(arg1, arg2)](#without/2)\n\nSee [`REnum.without/2`](REnum.html#without/2).\n\n[wrap(arg1)](#wrap/1)\n\nSee [`List.wrap/1`](https://hexdocs.pm/elixir/List.html#wrap/1).\n\n[zip(arg1)](#zip/1)\n\nSee [`List.zip/1`](https://hexdocs.pm/elixir/List.html#zip/1).\n\n[zip_reduce(arg1, arg2, arg3)](#zip_reduce/3)\n\nSee [`REnum.zip_reduce/3`](REnum.html#zip_reduce/3).\n\n[zip_reduce(arg1, arg2, arg3, arg4)](#zip_reduce/4)\n\nSee [`REnum.zip_reduce/4`](REnum.html#zip_reduce/4).\n\n[zip_with(arg1, arg2)](#zip_with/2)\n\nSee [`REnum.zip_with/2`](REnum.html#zip_with/2).\n\n[zip_with(arg1, arg2, arg3)](#zip_with/3)\n\nSee [`REnum.zip_with/3`](REnum.html#zip_with/3).\n\n[Link to this section](#functions)\nFunctions\n===\n\nRList.ActiveSupport\n===\n\nSummarized all of List functions in Rails.ActiveSupport.\nIf a function with the same name already exists in Elixir, that is not implemented.\nDefines all of here functions when `use RList.ActiveSupport`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[fifth(list)](#fifth/1)\n\nEqual to `Enum.at(list, 4)`.\n\n[forty_two(list)](#forty_two/1)\n\nEqual to `Enum.at(list, 41)`. Also known as accessing \"the reddit\".\n\n[fourth(list)](#fourth/1)\n\nEqual to `Enum.at(list, 3)`.\n\n[from(list, position)](#from/2)\n\nReturns the tail of the list from position.\n\n[in_groups(list, number, fill_with \\\\ nil)](#in_groups/3)\n\nSplits or iterates over the list in number of groups, padding any remaining slots with fill_with unless it is false.\n\n[in_groups_of(list, number, fill_with \\\\ nil)](#in_groups_of/3)\n\nSplits or iterates over the list in groups of size number, padding any remaining slots with fill_with unless it is +false+.\n\n[second(list)](#second/1)\n\nEqual to `Enum.at(list, 1)`.\n\n[second_to_last(list)](#second_to_last/1)\n\nEqual to `Enum.at(list, -2)`.\n\n[third(list)](#third/1)\n\nEqual to `Enum.at(list, 2)`.\n\n[third_to_last(list)](#third_to_last/1)\n\nEqual to `Enum.at(list, -3)`.\n\n[to(list, position)](#to/2)\n\nReturns the beginning of the list up to position.\n\n[to_default_s(list)](#to_default_s/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[to_sentence(list, opts \\\\ [])](#to_sentence/2)\n\nConverts the list to a comma-separated sentence where the last element is joined by the connector word.\n\n[Link to this section](#functions)\nFunctions\n===\n\nRList.Native\n===\n\nA module defines all of native List functions when `use RList.Native`.\n[See also.](https://hexdocs.pm/elixir/List.html)\n\nRList.Ruby\n===\n\nSummarized all of Ruby's Array functions.\nFunctions corresponding to the following patterns are not implemented\n\n* When a function with the same name already exists in Elixir.\n* When a method name includes `!`.\n* &, *, +, -, <<, <=>, ==, [], []=.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[type_enumerable()](#t:type_enumerable/0)\n\n[type_pattern()](#t:type_pattern/0)\n\n[Functions](#functions)\n---\n\n[all_combination(list, length)](#all_combination/2)\n\nSee [`RList.Ruby.repeated_combination/2`](#repeated_combination/2).\n\n[all_combination(list, length, func)](#all_combination/3)\n\nSee [`RList.Ruby.repeated_combination/3`](#repeated_combination/3).\n\n[append(list, elements)](#append/2)\n\nSee [`RList.Ruby.push/2`](#push/2).\n\n[assoc(list, key)](#assoc/2)\n\nReturns the first element in list that is an List whose first key == obj\n\n[clear(list)](#clear/1)\n\nReturns [].\n\n[combination(list, length)](#combination/2)\n\nReturns Stream that is each repeated combinations of elements of given list. The order of combinations is indeterminate.\n\n[combination(list, n, func)](#combination/3)\n\nCalls the function with combinations of elements of given list; returns :ok. The order of combinations is indeterminate.\n\n[delete_if(list, func)](#delete_if/2)\n\nSee [`Enum.reject/2`](https://hexdocs.pm/elixir/Enum.html#reject/2).\n\n[difference(list1, list2)](#difference/2)\n\nReturns differences between list1 and list2.\n\n[dig(list, index, identifiers \\\\ [])](#dig/3)\n\nFinds and returns the element in nested elements that is specified by index and identifiers.\n\n[each_index(list, func)](#each_index/2)\n\nSee [`Enum.with_index/2`](https://hexdocs.pm/elixir/Enum.html#with_index/2).\n\n[eql?(list1, list2)](#eql?/2)\n\nReturns true if list1 == list2.\n\n[fill(list, filler_fun)](#fill/2)\n\nFills the list with the provided value. The filler can be either a function or a fixed value.\n\n[fill(list, filler_fun, fill_range)](#fill/3)\n\n[index(list, func_or_pattern)](#index/2)\n\nReturns the index of a specified element.\n\n[insert(list, index, element)](#insert/3)\n\nSee [`List.insert_at/3`](https://hexdocs.pm/elixir/List.html#insert_at/3).\n\n[inspect(list)](#inspect/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[intersect?(list1, list2)](#intersect?/2)\n\nReturns true if the list1 and list2 have at least one element in common, otherwise returns false.\n\n[intersection(list1, list2)](#intersection/2)\n\nReturns a new list containing each element found both in list1 and in all of the given list2; duplicates are omitted.\n\n[keep_if(list, func)](#keep_if/2)\n\nSee [`Enum.filter/2`](https://hexdocs.pm/elixir/Enum.html#filter/2).\n\n[length(list)](#length/1)\n\nSee [`Enum.count/1`](https://hexdocs.pm/elixir/Enum.html#count/1).\n\n[permutation(list, length \\\\ nil)](#permutation/2)\n\nReturns Stream that is each repeated permutations of elements of given list. The order of permutations is indeterminate.\n\n[pop(list, count \\\\ 1)](#pop/2)\n\nSplits the list into the last n elements and the rest. Returns nil if the list is empty.\n\n[prepend(list, count \\\\ 1)](#prepend/2)\n\nSee [`RList.Ruby.shift/2`](#shift/2).\n\n[push(list, elements_or_element)](#push/2)\n\nAppends trailing elements.\n\n[rassoc(list, key)](#rassoc/2)\n\nReturns the first element that is a List whose last element `==` the specified term.\n\n[repeated_combination(list, length)](#repeated_combination/2)\n\nReturns Stream that is each repeated combinations of elements of given list. The order of combinations is indeterminate.\n\n[repeated_combination(list, n, func)](#repeated_combination/3)\n\nCalls the function with each repeated combinations of elements of given list; returns :ok. The order of combinations is indeterminate.\n\n[repeated_permutation(list, length)](#repeated_permutation/2)\n\nReturns Stream that is each repeated permutations of elements of given list. The order of permutations is indeterminate.\n\n[rindex(list, finder)](#rindex/2)\n\nReturns the index of the last element found in in the list. Returns nil if no match is found.\n\n[rotate(list, count \\\\ 1)](#rotate/2)\n\nRotate the list so that the element at count is the first element of the list.\n\n[sample(list, n \\\\ 1)](#sample/2)\n\nReturns one or more random elements.\n\n[shift(list, count \\\\ 1)](#shift/2)\n\nSplits the list into the first n elements and the rest. Returns nil if the list is empty.\n\n[size(list)](#size/1)\n\nSee [`Enum.count/1`](https://hexdocs.pm/elixir/Enum.html#count/1).\n\n[to_ary(list)](#to_ary/1)\n\nReturns list.\n\n[to_s(list)](#to_s/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[transpose(list_of_lists)](#transpose/1)\n\nSee [`List.zip/1`](https://hexdocs.pm/elixir/List.html#zip/1).\n\n[union(list_a, list_b)](#union/2)\n\nReturns a new list by joining two lists, excluding any duplicates and preserving the order from the given lists.\n\n[unshift(list, prepend)](#unshift/2)\n\nPrepends elements to the front of the list, moving other elements upwards.\n\n[values_at(list, indices)](#values_at/2)\n\nReturns a list containing the elements in list corresponding to the given selector(s).\nThe selectors may be either integer indices or ranges.\n\n[Link to this section](#types)\nTypes\n===\n\n[Link to this section](#functions)\nFunctions\n===\n\nRList.Support\n===\n\nSummarized other useful functions related to Lit.\nDefines all of here functions when `use RList.Support`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[type_enumerable()](#t:type_enumerable/0)\n\n[Functions](#functions)\n---\n\n[new(el)](#new/1)\n\nEqual to `[el]`.\n\n[new(el, amount)](#new/2)\n\nMake a list of size amount.\n\n[Link to this section](#types)\nTypes\n===\n\n[Link to this section](#functions)\nFunctions\n===\n\nRMap\n===\n\nEntry point of Map extensions, and can use all of RMap.* and REnum functions.\nSee also.\n\n* [RMap.Native](https://hexdocs.pm/r_enum/RMap.Native.html#content)\n* [RMap.Ruby](https://hexdocs.pm/r_enum/RMap.Ruby.html#content)\n* [RMap.ActiveSupport](https://hexdocs.pm/r_enum/RMap.ActiveSupport.html#content)\n* [RMap.Support](https://hexdocs.pm/r_enum/RMap.Support.html#content)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html#content)\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[all?(arg1)](#all?/1)\n\nSee [`REnum.all?/1`](REnum.html#all?/1).\n\n[all?(arg1, arg2)](#all?/2)\n\nSee [`REnum.all?/2`](REnum.html#all?/2).\n\n[any?(arg1)](#any?/1)\n\nSee [`REnum.any?/1`](REnum.html#any?/1).\n\n[any?(arg1, arg2)](#any?/2)\n\nSee [`REnum.any?/2`](REnum.html#any?/2).\n\n[assert_valid_keys(arg1, arg2)](#assert_valid_keys/2)\n\nSee [`RMap.ActiveSupport.assert_valid_keys/2`](RMap.ActiveSupport.html#assert_valid_keys/2).\n\n[assoc(arg1, arg2)](#assoc/2)\n\nSee [`RMap.Ruby.assoc/2`](RMap.Ruby.html#assoc/2).\n\n[at(arg1, arg2)](#at/2)\n\nSee [`REnum.at/2`](REnum.html#at/2).\n\n[at(arg1, arg2, arg3)](#at/3)\n\nSee [`REnum.at/3`](REnum.html#at/3).\n\n[atomize_keys(arg1)](#atomize_keys/1)\n\nSee [`RMap.ActiveSupport.atomize_keys/1`](RMap.ActiveSupport.html#atomize_keys/1).\n\n[chain(arg1)](#chain/1)\n\nSee [`REnum.chain/1`](REnum.html#chain/1).\n\n[chain(arg1, arg2)](#chain/2)\n\nSee [`REnum.chain/2`](REnum.html#chain/2).\n\n[chunk_by(arg1, arg2)](#chunk_by/2)\n\nSee [`REnum.chunk_by/2`](REnum.html#chunk_by/2).\n\n[chunk_every(arg1, arg2)](#chunk_every/2)\n\nSee [`REnum.chunk_every/2`](REnum.html#chunk_every/2).\n\n[chunk_every(arg1, arg2, arg3)](#chunk_every/3)\n\nSee [`REnum.chunk_every/3`](REnum.html#chunk_every/3).\n\n[chunk_every(arg1, arg2, arg3, arg4)](#chunk_every/4)\n\nSee [`REnum.chunk_every/4`](REnum.html#chunk_every/4).\n\n[chunk_while(arg1, arg2, arg3, arg4)](#chunk_while/4)\n\nSee [`REnum.chunk_while/4`](REnum.html#chunk_while/4).\n\n[clear(arg1)](#clear/1)\n\nSee [`RMap.Ruby.clear/1`](RMap.Ruby.html#clear/1).\n\n[collect(arg1, arg2)](#collect/2)\n\nSee [`REnum.collect/2`](REnum.html#collect/2).\n\n[collect_concat(arg1, arg2)](#collect_concat/2)\n\nSee [`REnum.collect_concat/2`](REnum.html#collect_concat/2).\n\n[compact(arg1)](#compact/1)\n\nSee [`REnum.compact/1`](REnum.html#compact/1).\n\n[compact_blank(arg1)](#compact_blank/1)\n\nSee [`REnum.compact_blank/1`](REnum.html#compact_blank/1).\n\n[concat(arg1)](#concat/1)\n\nSee [`REnum.concat/1`](REnum.html#concat/1).\n\n[concat(arg1, arg2)](#concat/2)\n\nSee [`REnum.concat/2`](REnum.html#concat/2).\n\n[count(arg1)](#count/1)\n\nSee [`REnum.count/1`](REnum.html#count/1).\n\n[count(arg1, arg2)](#count/2)\n\nSee [`REnum.count/2`](REnum.html#count/2).\n\n[count_until(arg1, arg2)](#count_until/2)\n\nSee [`REnum.count_until/2`](REnum.html#count_until/2).\n\n[count_until(arg1, arg2, arg3)](#count_until/3)\n\nSee [`REnum.count_until/3`](REnum.html#count_until/3).\n\n[cycle(arg1, arg2, arg3)](#cycle/3)\n\nSee [`REnum.cycle/3`](REnum.html#cycle/3).\n\n[dedup(arg1)](#dedup/1)\n\nSee [`REnum.dedup/1`](REnum.html#dedup/1).\n\n[dedup_by(arg1, arg2)](#dedup_by/2)\n\nSee [`REnum.dedup_by/2`](REnum.html#dedup_by/2).\n\n[deep_atomize_keys(arg1)](#deep_atomize_keys/1)\n\nSee [`RMap.ActiveSupport.deep_atomize_keys/1`](RMap.ActiveSupport.html#deep_atomize_keys/1).\n\n[deep_stringify_keys(arg1)](#deep_stringify_keys/1)\n\nSee [`RMap.ActiveSupport.deep_stringify_keys/1`](RMap.ActiveSupport.html#deep_stringify_keys/1).\n\n[deep_symbolize_keys(arg1)](#deep_symbolize_keys/1)\n\nSee [`RMap.ActiveSupport.deep_symbolize_keys/1`](RMap.ActiveSupport.html#deep_symbolize_keys/1).\n\n[deep_to_list(arg1)](#deep_to_list/1)\n\nSee [`RMap.Support.deep_to_list/1`](RMap.Support.html#deep_to_list/1).\n\n[deep_transform_keys(arg1, arg2)](#deep_transform_keys/2)\n\nSee [`RMap.ActiveSupport.deep_transform_keys/2`](RMap.ActiveSupport.html#deep_transform_keys/2).\n\n[deep_transform_values(arg1, arg2)](#deep_transform_values/2)\n\nSee [`RMap.ActiveSupport.deep_transform_values/2`](RMap.ActiveSupport.html#deep_transform_values/2).\n\n[delete(arg1, arg2)](#delete/2)\n\nSee [`Map.delete/2`](https://hexdocs.pm/elixir/Map.html#delete/2).\n\n[delete_if(arg1, arg2)](#delete_if/2)\n\nSee [`RMap.Ruby.delete_if/2`](RMap.Ruby.html#delete_if/2).\n\n[detect(arg1, arg2)](#detect/2)\n\nSee [`REnum.detect/2`](REnum.html#detect/2).\n\n[detect(arg1, arg2, arg3)](#detect/3)\n\nSee [`REnum.detect/3`](REnum.html#detect/3).\n\n[dig(arg1, arg2)](#dig/2)\n\nSee [`RMap.Ruby.dig/2`](RMap.Ruby.html#dig/2).\n\n[drop(arg1, arg2)](#drop/2)\n\nSee [`Map.drop/2`](https://hexdocs.pm/elixir/Map.html#drop/2).\n\n[drop_every(arg1, arg2)](#drop_every/2)\n\nSee [`REnum.drop_every/2`](REnum.html#drop_every/2).\n\n[drop_while(arg1, arg2)](#drop_while/2)\n\nSee [`REnum.drop_while/2`](REnum.html#drop_while/2).\n\n[each(arg1, arg2)](#each/2)\n\nSee [`REnum.each/2`](REnum.html#each/2).\n\n[each_cons(arg1, arg2, arg3)](#each_cons/3)\n\nSee [`REnum.each_cons/3`](REnum.html#each_cons/3).\n\n[each_entry(arg1, arg2)](#each_entry/2)\n\nSee [`REnum.each_entry/2`](REnum.html#each_entry/2).\n\n[each_key(arg1, arg2)](#each_key/2)\n\nSee [`RMap.Ruby.each_key/2`](RMap.Ruby.html#each_key/2).\n\n[each_pair(arg1, arg2)](#each_pair/2)\n\nSee [`RMap.Ruby.each_pair/2`](RMap.Ruby.html#each_pair/2).\n\n[each_slice(arg1, arg2)](#each_slice/2)\n\nSee [`REnum.each_slice/2`](REnum.html#each_slice/2).\n\n[each_slice(arg1, arg2, arg3)](#each_slice/3)\n\nSee [`REnum.each_slice/3`](REnum.html#each_slice/3).\n\n[each_value(arg1, arg2)](#each_value/2)\n\nSee [`RMap.Ruby.each_value/2`](RMap.Ruby.html#each_value/2).\n\n[each_with_index(arg1)](#each_with_index/1)\n\nSee [`REnum.each_with_index/1`](REnum.html#each_with_index/1).\n\n[each_with_index(arg1, arg2)](#each_with_index/2)\n\nSee [`REnum.each_with_index/2`](REnum.html#each_with_index/2).\n\n[each_with_object(arg1, arg2, arg3)](#each_with_object/3)\n\nSee [`REnum.each_with_object/3`](REnum.html#each_with_object/3).\n\n[empty?(arg1)](#empty?/1)\n\nSee [`REnum.empty?/1`](REnum.html#empty?/1).\n\n[entries(arg1)](#entries/1)\n\nSee [`REnum.entries/1`](REnum.html#entries/1).\n\n[eql?(arg1, arg2)](#eql?/2)\n\nSee [`RMap.Ruby.eql?/2`](RMap.Ruby.html#eql?/2).\n\n[equal?(arg1, arg2)](#equal?/2)\n\nSee [`Map.equal?/2`](https://hexdocs.pm/elixir/Map.html#equal?/2).\n\n[except(arg1, arg2)](#except/2)\n\nSee [`RMap.Ruby.except/2`](RMap.Ruby.html#except/2).\n\n[exclude?(arg1, arg2)](#exclude?/2)\n\nSee [`REnum.exclude?/2`](REnum.html#exclude?/2).\n\n[excluding(arg1, arg2)](#excluding/2)\n\nSee [`REnum.excluding/2`](REnum.html#excluding/2).\n\n[fetch(arg1, arg2)](#fetch/2)\n\nSee [`Map.fetch/2`](https://hexdocs.pm/elixir/Map.html#fetch/2).\n\n[fetch!(arg1, arg2)](#fetch!/2)\n\nSee [`Map.fetch!/2`](https://hexdocs.pm/elixir/Map.html#fetch!/2).\n\n[fetch_values(arg1, arg2)](#fetch_values/2)\n\nSee [`RMap.Ruby.fetch_values/2`](RMap.Ruby.html#fetch_values/2).\n\n[fetch_values(arg1, arg2, arg3)](#fetch_values/3)\n\nSee [`RMap.Ruby.fetch_values/3`](RMap.Ruby.html#fetch_values/3).\n\n[filter(arg1, arg2)](#filter/2)\n\nSee [`RMap.Ruby.filter/2`](RMap.Ruby.html#filter/2).\n\n[find(arg1, arg2)](#find/2)\n\nSee [`REnum.find/2`](REnum.html#find/2).\n\n[find(arg1, arg2, arg3)](#find/3)\n\nSee [`REnum.find/3`](REnum.html#find/3).\n\n[find_all(arg1, arg2)](#find_all/2)\n\nSee [`REnum.find_all/2`](REnum.html#find_all/2).\n\n[find_index(arg1, arg2)](#find_index/2)\n\nSee [`REnum.find_index/2`](REnum.html#find_index/2).\n\n[find_index_with_index(arg1, arg2)](#find_index_with_index/2)\n\nSee [`REnum.find_index_with_index/2`](REnum.html#find_index_with_index/2).\n\n[find_value(arg1, arg2)](#find_value/2)\n\nSee [`REnum.find_value/2`](REnum.html#find_value/2).\n\n[find_value(arg1, arg2, arg3)](#find_value/3)\n\nSee [`REnum.find_value/3`](REnum.html#find_value/3).\n\n[first(arg1)](#first/1)\n\nSee [`REnum.first/1`](REnum.html#first/1).\n\n[first(arg1, arg2)](#first/2)\n\nSee [`REnum.first/2`](REnum.html#first/2).\n\n[flat_map(arg1, arg2)](#flat_map/2)\n\nSee [`REnum.flat_map/2`](REnum.html#flat_map/2).\n\n[flat_map_reduce(arg1, arg2, arg3)](#flat_map_reduce/3)\n\nSee [`REnum.flat_map_reduce/3`](REnum.html#flat_map_reduce/3).\n\n[flatten(arg1)](#flatten/1)\n\nSee [`RMap.Ruby.flatten/1`](RMap.Ruby.html#flatten/1).\n\n[frequencies(arg1)](#frequencies/1)\n\nSee [`REnum.frequencies/1`](REnum.html#frequencies/1).\n\n[frequencies_by(arg1, arg2)](#frequencies_by/2)\n\nSee [`REnum.frequencies_by/2`](REnum.html#frequencies_by/2).\n\n[from_struct(arg1)](#from_struct/1)\n\nSee [`Map.from_struct/1`](https://hexdocs.pm/elixir/Map.html#from_struct/1).\n\n[get(arg1, arg2)](#get/2)\n\nSee [`Map.get/2`](https://hexdocs.pm/elixir/Map.html#get/2).\n\n[get(arg1, arg2, arg3)](#get/3)\n\nSee [`Map.get/3`](https://hexdocs.pm/elixir/Map.html#get/3).\n\n[get_and_update(arg1, arg2, arg3)](#get_and_update/3)\n\nSee [`Map.get_and_update/3`](https://hexdocs.pm/elixir/Map.html#get_and_update/3).\n\n[get_and_update!(arg1, arg2, arg3)](#get_and_update!/3)\n\nSee [`Map.get_and_update!/3`](https://hexdocs.pm/elixir/Map.html#get_and_update!/3).\n\n[get_lazy(arg1, arg2, arg3)](#get_lazy/3)\n\nSee [`Map.get_lazy/3`](https://hexdocs.pm/elixir/Map.html#get_lazy/3).\n\n[grep(arg1, arg2)](#grep/2)\n\nSee [`REnum.grep/2`](REnum.html#grep/2).\n\n[grep(arg1, arg2, arg3)](#grep/3)\n\nSee [`REnum.grep/3`](REnum.html#grep/3).\n\n[grep_v(arg1, arg2)](#grep_v/2)\n\nSee [`REnum.grep_v/2`](REnum.html#grep_v/2).\n\n[grep_v(arg1, arg2, arg3)](#grep_v/3)\n\nSee [`REnum.grep_v/3`](REnum.html#grep_v/3).\n\n[group_by(arg1, arg2)](#group_by/2)\n\nSee [`REnum.group_by/2`](REnum.html#group_by/2).\n\n[group_by(arg1, arg2, arg3)](#group_by/3)\n\nSee [`REnum.group_by/3`](REnum.html#group_by/3).\n\n[has_key?(arg1, arg2)](#has_key?/2)\n\nSee [`Map.has_key?/2`](https://hexdocs.pm/elixir/Map.html#has_key?/2).\n\n[has_value?(arg1, arg2)](#has_value?/2)\n\nSee [`RMap.Ruby.has_value?/2`](RMap.Ruby.html#has_value?/2).\n\n[in_order_of(arg1, arg2, arg3)](#in_order_of/3)\n\nSee [`REnum.in_order_of/3`](REnum.html#in_order_of/3).\n\n[include?(arg1, arg2)](#include?/2)\n\nSee [`REnum.include?/2`](REnum.html#include?/2).\n\n[including(arg1, arg2)](#including/2)\n\nSee [`REnum.including/2`](REnum.html#including/2).\n\n[index_by(arg1, arg2)](#index_by/2)\n\nSee [`REnum.index_by/2`](REnum.html#index_by/2).\n\n[index_with(arg1, arg2)](#index_with/2)\n\nSee [`REnum.index_with/2`](REnum.html#index_with/2).\n\n[inject(arg1, arg2)](#inject/2)\n\nSee [`REnum.inject/2`](REnum.html#inject/2).\n\n[inject(arg1, arg2, arg3)](#inject/3)\n\nSee [`REnum.inject/3`](REnum.html#inject/3).\n\n[inspect(arg1)](#inspect/1)\n\nSee [`RMap.Ruby.inspect/1`](RMap.Ruby.html#inspect/1).\n\n[intersperse(arg1, arg2)](#intersperse/2)\n\nSee [`REnum.intersperse/2`](REnum.html#intersperse/2).\n\n[into(arg1, arg2)](#into/2)\n\nSee [`REnum.into/2`](REnum.html#into/2).\n\n[into(arg1, arg2, arg3)](#into/3)\n\nSee [`REnum.into/3`](REnum.html#into/3).\n\n[invert(arg1)](#invert/1)\n\nSee [`RMap.Ruby.invert/1`](RMap.Ruby.html#invert/1).\n\n[join(arg1)](#join/1)\n\nSee [`REnum.join/1`](REnum.html#join/1).\n\n[join(arg1, arg2)](#join/2)\n\nSee [`REnum.join/2`](REnum.html#join/2).\n\n[keep_if(arg1, arg2)](#keep_if/2)\n\nSee [`RMap.Ruby.keep_if/2`](RMap.Ruby.html#keep_if/2).\n\n[key(arg1, arg2)](#key/2)\n\nSee [`RMap.Ruby.key/2`](RMap.Ruby.html#key/2).\n\n[key(arg1, arg2, arg3)](#key/3)\n\nSee [`RMap.Ruby.key/3`](RMap.Ruby.html#key/3).\n\n[key?(arg1, arg2)](#key?/2)\n\nSee [`RMap.Ruby.key?/2`](RMap.Ruby.html#key?/2).\n\n[keys(arg1)](#keys/1)\n\nSee [`Map.keys/1`](https://hexdocs.pm/elixir/Map.html#keys/1).\n\n[lazy(arg1)](#lazy/1)\n\nSee [`REnum.lazy/1`](REnum.html#lazy/1).\n\n[length(arg1)](#length/1)\n\nSee [`RMap.Ruby.length/1`](RMap.Ruby.html#length/1).\n\n[list_and_not_keyword?(arg1)](#list_and_not_keyword?/1)\n\nSee [`REnum.list_and_not_keyword?/1`](REnum.html#list_and_not_keyword?/1).\n\n[many?(arg1)](#many?/1)\n\nSee [`REnum.many?/1`](REnum.html#many?/1).\n\n[many?(arg1, arg2)](#many?/2)\n\nSee [`REnum.many?/2`](REnum.html#many?/2).\n\n[map_and_not_range?(arg1)](#map_and_not_range?/1)\n\nSee [`REnum.map_and_not_range?/1`](REnum.html#map_and_not_range?/1).\n\n[map_every(arg1, arg2, arg3)](#map_every/3)\n\nSee [`REnum.map_every/3`](REnum.html#map_every/3).\n\n[map_intersperse(arg1, arg2, arg3)](#map_intersperse/3)\n\nSee [`REnum.map_intersperse/3`](REnum.html#map_intersperse/3).\n\n[map_join(arg1, arg2)](#map_join/2)\n\nSee [`REnum.map_join/2`](REnum.html#map_join/2).\n\n[map_join(arg1, arg2, arg3)](#map_join/3)\n\nSee [`REnum.map_join/3`](REnum.html#map_join/3).\n\n[map_reduce(arg1, arg2, arg3)](#map_reduce/3)\n\nSee [`REnum.map_reduce/3`](REnum.html#map_reduce/3).\n\n[match_function(arg1)](#match_function/1)\n\nSee [`REnum.match_function/1`](REnum.html#match_function/1).\n\n[max(arg1)](#max/1)\n\nSee [`REnum.max/1`](REnum.html#max/1).\n\n[max(arg1, arg2)](#max/2)\n\nSee [`REnum.max/2`](REnum.html#max/2).\n\n[max(arg1, arg2, arg3)](#max/3)\n\nSee [`REnum.max/3`](REnum.html#max/3).\n\n[max_by(arg1, arg2)](#max_by/2)\n\nSee [`REnum.max_by/2`](REnum.html#max_by/2).\n\n[max_by(arg1, arg2, arg3)](#max_by/3)\n\nSee [`REnum.max_by/3`](REnum.html#max_by/3).\n\n[max_by(arg1, arg2, arg3, arg4)](#max_by/4)\n\nSee [`REnum.max_by/4`](REnum.html#max_by/4).\n\n[maximum(arg1, arg2)](#maximum/2)\n\nSee [`REnum.maximum/2`](REnum.html#maximum/2).\n\n[member?(arg1, arg2)](#member?/2)\n\nSee [`REnum.member?/2`](REnum.html#member?/2).\n\n[merge(arg1, arg2)](#merge/2)\n\nSee [`Map.merge/2`](https://hexdocs.pm/elixir/Map.html#merge/2).\n\n[merge(arg1, arg2, arg3)](#merge/3)\n\nSee [`Map.merge/3`](https://hexdocs.pm/elixir/Map.html#merge/3).\n\n[min(arg1)](#min/1)\n\nSee [`REnum.min/1`](REnum.html#min/1).\n\n[min(arg1, arg2)](#min/2)\n\nSee [`REnum.min/2`](REnum.html#min/2).\n\n[min(arg1, arg2, arg3)](#min/3)\n\nSee [`REnum.min/3`](REnum.html#min/3).\n\n[min_by(arg1, arg2)](#min_by/2)\n\nSee [`REnum.min_by/2`](REnum.html#min_by/2).\n\n[min_by(arg1, arg2, arg3)](#min_by/3)\n\nSee [`REnum.min_by/3`](REnum.html#min_by/3).\n\n[min_by(arg1, arg2, arg3, arg4)](#min_by/4)\n\nSee [`REnum.min_by/4`](REnum.html#min_by/4).\n\n[min_max(arg1)](#min_max/1)\n\nSee [`REnum.min_max/1`](REnum.html#min_max/1).\n\n[min_max(arg1, arg2)](#min_max/2)\n\nSee [`REnum.min_max/2`](REnum.html#min_max/2).\n\n[min_max_by(arg1, arg2)](#min_max_by/2)\n\nSee [`REnum.min_max_by/2`](REnum.html#min_max_by/2).\n\n[min_max_by(arg1, arg2, arg3)](#min_max_by/3)\n\nSee [`REnum.min_max_by/3`](REnum.html#min_max_by/3).\n\n[min_max_by(arg1, arg2, arg3, arg4)](#min_max_by/4)\n\nSee [`REnum.min_max_by/4`](REnum.html#min_max_by/4).\n\n[minimum(arg1, arg2)](#minimum/2)\n\nSee [`REnum.minimum/2`](REnum.html#minimum/2).\n\n[minmax(arg1)](#minmax/1)\n\nSee [`REnum.minmax/1`](REnum.html#minmax/1).\n\n[minmax(arg1, arg2)](#minmax/2)\n\nSee [`REnum.minmax/2`](REnum.html#minmax/2).\n\n[minmax_by(arg1, arg2)](#minmax_by/2)\n\nSee [`REnum.minmax_by/2`](REnum.html#minmax_by/2).\n\n[minmax_by(arg1, arg2, arg3)](#minmax_by/3)\n\nSee [`REnum.minmax_by/3`](REnum.html#minmax_by/3).\n\n[minmax_by(arg1, arg2, arg3, arg4)](#minmax_by/4)\n\nSee [`REnum.minmax_by/4`](REnum.html#minmax_by/4).\n\n[new()](#new/0)\n\nSee [`Map.new/0`](https://hexdocs.pm/elixir/Map.html#new/0).\n\n[new(arg1)](#new/1)\n\nSee [`Map.new/1`](https://hexdocs.pm/elixir/Map.html#new/1).\n\n[new(arg1, arg2)](#new/2)\n\nSee [`Map.new/2`](https://hexdocs.pm/elixir/Map.html#new/2).\n\n[none?(arg1)](#none?/1)\n\nSee [`REnum.none?/1`](REnum.html#none?/1).\n\n[none?(arg1, arg2)](#none?/2)\n\nSee [`REnum.none?/2`](REnum.html#none?/2).\n\n[one?(arg1)](#one?/1)\n\nSee [`REnum.one?/1`](REnum.html#one?/1).\n\n[one?(arg1, arg2)](#one?/2)\n\nSee [`REnum.one?/2`](REnum.html#one?/2).\n\n[pick(arg1, arg2)](#pick/2)\n\nSee [`REnum.pick/2`](REnum.html#pick/2).\n\n[pluck(arg1, arg2)](#pluck/2)\n\nSee [`REnum.pluck/2`](REnum.html#pluck/2).\n\n[pop(arg1, arg2)](#pop/2)\n\nSee [`Map.pop/2`](https://hexdocs.pm/elixir/Map.html#pop/2).\n\n[pop(arg1, arg2, arg3)](#pop/3)\n\nSee [`Map.pop/3`](https://hexdocs.pm/elixir/Map.html#pop/3).\n\n[pop!(arg1, arg2)](#pop!/2)\n\nSee [`Map.pop!/2`](https://hexdocs.pm/elixir/Map.html#pop!/2).\n\n[pop_lazy(arg1, arg2, arg3)](#pop_lazy/3)\n\nSee [`Map.pop_lazy/3`](https://hexdocs.pm/elixir/Map.html#pop_lazy/3).\n\n[product(arg1)](#product/1)\n\nSee [`REnum.product/1`](REnum.html#product/1).\n\n[put(arg1, arg2, arg3)](#put/3)\n\nSee [`Map.put/3`](https://hexdocs.pm/elixir/Map.html#put/3).\n\n[put_new(arg1, arg2, arg3)](#put_new/3)\n\nSee [`Map.put_new/3`](https://hexdocs.pm/elixir/Map.html#put_new/3).\n\n[put_new_lazy(arg1, arg2, arg3)](#put_new_lazy/3)\n\nSee [`Map.put_new_lazy/3`](https://hexdocs.pm/elixir/Map.html#put_new_lazy/3).\n\n[random(arg1)](#random/1)\n\nSee [`REnum.random/1`](REnum.html#random/1).\n\n[range?(arg1)](#range?/1)\n\nSee [`REnum.range?/1`](REnum.html#range?/1).\n\n[rassoc(arg1, arg2)](#rassoc/2)\n\nSee [`RMap.Ruby.rassoc/2`](RMap.Ruby.html#rassoc/2).\n\n[reduce(arg1, arg2)](#reduce/2)\n\nSee [`REnum.reduce/2`](REnum.html#reduce/2).\n\n[reduce(arg1, arg2, arg3)](#reduce/3)\n\nSee [`REnum.reduce/3`](REnum.html#reduce/3).\n\n[reduce_while(arg1, arg2, arg3)](#reduce_while/3)\n\nSee [`REnum.reduce_while/3`](REnum.html#reduce_while/3).\n\n[reject(arg1, arg2)](#reject/2)\n\nSee [`RMap.Ruby.reject/2`](RMap.Ruby.html#reject/2).\n\n[replace(arg1, arg2, arg3)](#replace/3)\n\nSee [`Map.replace/3`](https://hexdocs.pm/elixir/Map.html#replace/3).\n\n[replace!(arg1, arg2, arg3)](#replace!/3)\n\nSee [`Map.replace!/3`](https://hexdocs.pm/elixir/Map.html#replace!/3).\n\n[reverse(arg1)](#reverse/1)\n\nSee [`REnum.reverse/1`](REnum.html#reverse/1).\n\n[reverse(arg1, arg2)](#reverse/2)\n\nSee [`REnum.reverse/2`](REnum.html#reverse/2).\n\n[reverse_each(arg1, arg2)](#reverse_each/2)\n\nSee [`REnum.reverse_each/2`](REnum.html#reverse_each/2).\n\n[reverse_slice(arg1, arg2, arg3)](#reverse_slice/3)\n\nSee [`REnum.reverse_slice/3`](REnum.html#reverse_slice/3).\n\n[scan(arg1, arg2)](#scan/2)\n\nSee [`REnum.scan/2`](REnum.html#scan/2).\n\n[scan(arg1, arg2, arg3)](#scan/3)\n\nSee [`REnum.scan/3`](REnum.html#scan/3).\n\n[select(arg1, arg2)](#select/2)\n\nSee [`RMap.Ruby.select/2`](RMap.Ruby.html#select/2).\n\n[shift(arg1)](#shift/1)\n\nSee [`RMap.Ruby.shift/1`](RMap.Ruby.html#shift/1).\n\n[shuffle(arg1)](#shuffle/1)\n\nSee [`REnum.shuffle/1`](REnum.html#shuffle/1).\n\n[size(arg1)](#size/1)\n\nSee [`RMap.Ruby.size/1`](RMap.Ruby.html#size/1).\n\n[slice(arg1, arg2)](#slice/2)\n\nSee [`REnum.slice/2`](REnum.html#slice/2).\n\n[slice(arg1, arg2, arg3)](#slice/3)\n\nSee [`REnum.slice/3`](REnum.html#slice/3).\n\n[slice_after(arg1, arg2)](#slice_after/2)\n\nSee [`REnum.slice_after/2`](REnum.html#slice_after/2).\n\n[slice_before(arg1, arg2)](#slice_before/2)\n\nSee [`REnum.slice_before/2`](REnum.html#slice_before/2).\n\n[slice_when(arg1, arg2)](#slice_when/2)\n\nSee [`REnum.slice_when/2`](REnum.html#slice_when/2).\n\n[slide(arg1, arg2, arg3)](#slide/3)\n\nSee [`REnum.slide/3`](REnum.html#slide/3).\n\n[sole(arg1)](#sole/1)\n\nSee [`REnum.sole/1`](REnum.html#sole/1).\n\n[sort(arg1)](#sort/1)\n\nSee [`REnum.sort/1`](REnum.html#sort/1).\n\n[sort(arg1, arg2)](#sort/2)\n\nSee [`REnum.sort/2`](REnum.html#sort/2).\n\n[sort_by(arg1, arg2)](#sort_by/2)\n\nSee [`REnum.sort_by/2`](REnum.html#sort_by/2).\n\n[sort_by(arg1, arg2, arg3)](#sort_by/3)\n\nSee [`REnum.sort_by/3`](REnum.html#sort_by/3).\n\n[split(arg1, arg2)](#split/2)\n\nSee [`Map.split/2`](https://hexdocs.pm/elixir/Map.html#split/2).\n\n[split_while(arg1, arg2)](#split_while/2)\n\nSee [`REnum.split_while/2`](REnum.html#split_while/2).\n\n[split_with(arg1, arg2)](#split_with/2)\n\nSee [`REnum.split_with/2`](REnum.html#split_with/2).\n\n[store(arg1, arg2, arg3)](#store/3)\n\nSee [`RMap.Ruby.store/3`](RMap.Ruby.html#store/3).\n\n[stringify_keys(arg1)](#stringify_keys/1)\n\nSee [`RMap.ActiveSupport.stringify_keys/1`](RMap.ActiveSupport.html#stringify_keys/1).\n\n[sum(arg1)](#sum/1)\n\nSee [`REnum.sum/1`](REnum.html#sum/1).\n\n[symbolize_keys(arg1)](#symbolize_keys/1)\n\nSee [`RMap.ActiveSupport.symbolize_keys/1`](RMap.ActiveSupport.html#symbolize_keys/1).\n\n[take(arg1, arg2)](#take/2)\n\nSee [`Map.take/2`](https://hexdocs.pm/elixir/Map.html#take/2).\n\n[take_every(arg1, arg2)](#take_every/2)\n\nSee [`REnum.take_every/2`](REnum.html#take_every/2).\n\n[take_random(arg1, arg2)](#take_random/2)\n\nSee [`REnum.take_random/2`](REnum.html#take_random/2).\n\n[take_while(arg1, arg2)](#take_while/2)\n\nSee [`REnum.take_while/2`](REnum.html#take_while/2).\n\n[tally(arg1)](#tally/1)\n\nSee [`REnum.tally/1`](REnum.html#tally/1).\n\n[to_a(arg1)](#to_a/1)\n\nSee [`REnum.to_a/1`](REnum.html#to_a/1).\n\n[to_h(arg1)](#to_h/1)\n\nSee [`REnum.to_h/1`](REnum.html#to_h/1).\n\n[to_h(arg1, arg2)](#to_h/2)\n\nSee [`REnum.to_h/2`](REnum.html#to_h/2).\n\n[to_hash(arg1)](#to_hash/1)\n\nSee [`RMap.Ruby.to_hash/1`](RMap.Ruby.html#to_hash/1).\n\n[to_l(arg1)](#to_l/1)\n\nSee [`REnum.to_l/1`](REnum.html#to_l/1).\n\n[to_list(arg1)](#to_list/1)\n\nSee [`Map.to_list/1`](https://hexdocs.pm/elixir/Map.html#to_list/1).\n\n[to_s(arg1)](#to_s/1)\n\nSee [`RMap.Ruby.to_s/1`](RMap.Ruby.html#to_s/1).\n\n[transform_keys(arg1, arg2)](#transform_keys/2)\n\nSee [`RMap.Ruby.transform_keys/2`](RMap.Ruby.html#transform_keys/2).\n\n[transform_values(arg1, arg2)](#transform_values/2)\n\nSee [`RMap.Ruby.transform_values/2`](RMap.Ruby.html#transform_values/2).\n\n[truthy_count(arg1)](#truthy_count/1)\n\nSee [`REnum.truthy_count/1`](REnum.html#truthy_count/1).\n\n[truthy_count(arg1, arg2)](#truthy_count/2)\n\nSee [`REnum.truthy_count/2`](REnum.html#truthy_count/2).\n\n[uniq_by(arg1, arg2)](#uniq_by/2)\n\nSee [`REnum.uniq_by/2`](REnum.html#uniq_by/2).\n\n[unzip(arg1)](#unzip/1)\n\nSee [`REnum.unzip/1`](REnum.html#unzip/1).\n\n[update(arg1, arg2, arg3, arg4)](#update/4)\n\nSee [`Map.update/4`](https://hexdocs.pm/elixir/Map.html#update/4).\n\n[update!(arg1, arg2, arg3)](#update!/3)\n\nSee [`Map.update!/3`](https://hexdocs.pm/elixir/Map.html#update!/3).\n\n[value?(arg1, arg2)](#value?/2)\n\nSee [`RMap.Ruby.value?/2`](RMap.Ruby.html#value?/2).\n\n[values(arg1)](#values/1)\n\nSee [`Map.values/1`](https://hexdocs.pm/elixir/Map.html#values/1).\n\n[values_at(arg1, arg2)](#values_at/2)\n\nSee [`RMap.Ruby.values_at/2`](RMap.Ruby.html#values_at/2).\n\n[with_index(arg1)](#with_index/1)\n\nSee [`REnum.with_index/1`](REnum.html#with_index/1).\n\n[with_index(arg1, arg2)](#with_index/2)\n\nSee [`REnum.with_index/2`](REnum.html#with_index/2).\n\n[without(arg1, arg2)](#without/2)\n\nSee [`REnum.without/2`](REnum.html#without/2).\n\n[zip(arg1)](#zip/1)\n\nSee [`REnum.zip/1`](REnum.html#zip/1).\n\n[zip(arg1, arg2)](#zip/2)\n\nSee [`REnum.zip/2`](REnum.html#zip/2).\n\n[zip_reduce(arg1, arg2, arg3)](#zip_reduce/3)\n\nSee [`REnum.zip_reduce/3`](REnum.html#zip_reduce/3).\n\n[zip_reduce(arg1, arg2, arg3, arg4)](#zip_reduce/4)\n\nSee [`REnum.zip_reduce/4`](REnum.html#zip_reduce/4).\n\n[zip_with(arg1, arg2)](#zip_with/2)\n\nSee [`REnum.zip_with/2`](REnum.html#zip_with/2).\n\n[zip_with(arg1, arg2, arg3)](#zip_with/3)\n\nSee [`REnum.zip_with/3`](REnum.html#zip_with/3).\n\n[Link to this section](#functions)\nFunctions\n===\n\nRMap.ActiveSupport\n===\n\nSummarized all of Hash functions in Rails.ActiveSupport.\nIf a function with the same name already exists in Elixir, that is not implemented.\nDefines all of here functions when `use RMap.ActiveSupport`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[assert_valid_keys(map, keys)](#assert_valid_keys/2)\n\nValidates all keys in a map match given keys, raising ArgumentError on a mismatch.\n\n[atomize_keys(map)](#atomize_keys/1)\n\nSee [`RMap.ActiveSupport.symbolize_keys/1`](#symbolize_keys/1).\n\n[deep_atomize_keys(map)](#deep_atomize_keys/1)\n\nSee [`RMap.ActiveSupport.deep_symbolize_keys/1`](#deep_symbolize_keys/1).\n\n[deep_stringify_keys(map)](#deep_stringify_keys/1)\n\nReturns a list with all keys converted to strings.\nThis includes the keys from the root map and from all nested maps and arrays.\n\n[deep_symbolize_keys(map)](#deep_symbolize_keys/1)\n\nReturns a list with all keys converted to atom.\nThis includes the keys from the root map and from all nested maps and arrays.\n\n[deep_transform_keys(map, func)](#deep_transform_keys/2)\n\nReturns a map with all keys converted by the function.\nThis includes the keys from the root map and from all nested maps and arrays.\n\n[deep_transform_values(map, func)](#deep_transform_values/2)\n\nReturns a map with all values converted by the function.\nThis includes the keys from the root map and from all nested maps and arrays.\n\n[stringify_keys(map)](#stringify_keys/1)\n\nReturns a map with all keys converted to strings.\n\n[symbolize_keys(map)](#symbolize_keys/1)\n\nReturns a map with all keys converted to atom.\n\n[Link to this section](#functions)\nFunctions\n===\n\nRMap.Native\n===\n\nA module defines all of native Map functions when `use RMap.Native`.\n[See also.](https://hexdocs.pm/elixir/Map.html)\n\nRMap.Ruby\n===\n\nSummarized all of Ruby's Hash functions.\nFunctions corresponding to the following patterns are not implemented\n\n* When a function with the same name already exists in Elixir.\n* When a method name includes `!`.\n* <, <=, ==, >, >=, [], []=, default_*\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[assoc(map, key)](#assoc/2)\n\nReturns a 2-element tuple containing a given key and its value.\n\n[clear(_)](#clear/1)\n\nReturns %{}.\n\n[delete_if(map, func)](#delete_if/2)\n\nSee [`RMap.Ruby.reject/2`](#reject/2).\n\n[dig(result, keys)](#dig/2)\n\nReturns the object in nested map that is specified by a given key and additional arguments.\n\n[each_key(map, func)](#each_key/2)\n\nCalls the function with each key; returns :ok.\n\n[each_pair(map, func)](#each_pair/2)\n\nSee [`Enum.each/2`](https://hexdocs.pm/elixir/Enum.html#each/2).\n\n[each_value(map, func)](#each_value/2)\n\nCalls the function with each value; returns :ok.\n\n[eql?(map1, map2)](#eql?/2)\n\nSee [`Map.equal?/2`](https://hexdocs.pm/elixir/Map.html#equal?/2).\n\n[except(map, keys)](#except/2)\n\nReturns a map excluding entries for the given keys.\n\n[fetch_values(map, keys)](#fetch_values/2)\n\nReturns a list containing the values associated with the given keys.\n\n[fetch_values(map, keys, func)](#fetch_values/3)\n\nWhen a function is given, calls the function with each missing key, treating the block's return value as the value for that key.\n\n[filter(map, func)](#filter/2)\n\nReturns a list whose entries are those for which the function returns a truthy value.\n\n[flatten(map)](#flatten/1)\n\nReturns a flatten list.\n\n[has_value?(map, value)](#has_value?/2)\n\nSee [`RMap.Ruby.value?/2`](#value?/2).\n\n[inspect(map)](#inspect/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[invert(map)](#invert/1)\n\nReturns a map object with the each key-value pair inverted.\n\n[keep_if(map, func)](#keep_if/2)\n\nSee [`RMap.Ruby.filter/2`](#filter/2).\n\n[key(map, key, default \\\\ nil)](#key/3)\n\nSee [`Map.get/3`](https://hexdocs.pm/elixir/Map.html#get/3).\n\n[key?(map, key)](#key?/2)\n\nSee [`Map.has_key?/2`](https://hexdocs.pm/elixir/Map.html#has_key?/2).\n\n[length(map)](#length/1)\n\nSee [`Enum.count/1`](https://hexdocs.pm/elixir/Enum.html#count/1).\n\n[rassoc(map, value)](#rassoc/2)\n\nReturns a 2-element tuple consisting of the key and value of the first-found entry having a given value.\n\n[reject(map, func)](#reject/2)\n\nReturns a list whose entries are all those from self for which the function returns false or nil.\n\n[select(map, func)](#select/2)\n\nSee [`RMap.Ruby.filter/2`](#filter/2).\n\n[shift(map)](#shift/1)\n\nRemoves the first map entry; returns a 2-element tuple.\nFirst element is {key, value}.\nSecond element is a map without first pair.\n\n[size(map)](#size/1)\n\nSee [`Enum.count/1`](https://hexdocs.pm/elixir/Enum.html#count/1).\n\n[store(map, key, value)](#store/3)\n\nSee [`Map.put/3`](https://hexdocs.pm/elixir/Map.html#put/3).\n\n[to_hash(map)](#to_hash/1)\n\nReturns given map.\n\n[to_s(map)](#to_s/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[transform_keys(map, func)](#transform_keys/2)\n\nReturns a map with modified keys.\n\n[transform_values(map, func)](#transform_values/2)\n\nReturns a map with modified values.\n\n[value?(map, value)](#value?/2)\n\nReturns true if value is a value in list, otherwise false.\n\n[values_at(map, keys)](#values_at/2)\n\nReturns a list containing values for the given keys.\n\n[Link to this section](#functions)\nFunctions\n===\n\nRMap.Support\n===\n\nSummarized other useful functions related to Lit.\nDefines all of here functions when `use RMap.Support`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[deep_to_list(map)](#deep_to_list/1)\n\nReturns list recursively converted  from given map to list.\n\n[Link to this section](#functions)\nFunctions\n===\n\nRRange\n===\n\nEntry point of Range extensions, and can use all of RRange.* and REnum functions.\nSee also.\n\n* [RRange.Native](https://hexdocs.pm/r_enum/RRange.Native.html#content)\n* [RRange.Ruby](https://hexdocs.pm/r_enum/RRange.Ruby.html#content)\n* [RRange.ActiveSupport](https://hexdocs.pm/r_enum/RRange.ActiveSupport.html#content)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html#content)\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[all?(arg1)](#all?/1)\n\nSee [`REnum.all?/1`](REnum.html#all?/1).\n\n[all?(arg1, arg2)](#all?/2)\n\nSee [`REnum.all?/2`](REnum.html#all?/2).\n\n[any?(arg1)](#any?/1)\n\nSee [`REnum.any?/1`](REnum.html#any?/1).\n\n[any?(arg1, arg2)](#any?/2)\n\nSee [`REnum.any?/2`](REnum.html#any?/2).\n\n[at(arg1, arg2)](#at/2)\n\nSee [`REnum.at/2`](REnum.html#at/2).\n\n[at(arg1, arg2, arg3)](#at/3)\n\nSee [`REnum.at/3`](REnum.html#at/3).\n\n[begin(arg1)](#begin/1)\n\nSee [`RRange.Ruby.begin/1`](RRange.Ruby.html#begin/1).\n\n[chain(arg1)](#chain/1)\n\nSee [`REnum.chain/1`](REnum.html#chain/1).\n\n[chain(arg1, arg2)](#chain/2)\n\nSee [`REnum.chain/2`](REnum.html#chain/2).\n\n[chunk_by(arg1, arg2)](#chunk_by/2)\n\nSee [`REnum.chunk_by/2`](REnum.html#chunk_by/2).\n\n[chunk_every(arg1, arg2)](#chunk_every/2)\n\nSee [`REnum.chunk_every/2`](REnum.html#chunk_every/2).\n\n[chunk_every(arg1, arg2, arg3)](#chunk_every/3)\n\nSee [`REnum.chunk_every/3`](REnum.html#chunk_every/3).\n\n[chunk_every(arg1, arg2, arg3, arg4)](#chunk_every/4)\n\nSee [`REnum.chunk_every/4`](REnum.html#chunk_every/4).\n\n[chunk_while(arg1, arg2, arg3, arg4)](#chunk_while/4)\n\nSee [`REnum.chunk_while/4`](REnum.html#chunk_while/4).\n\n[collect(arg1, arg2)](#collect/2)\n\nSee [`REnum.collect/2`](REnum.html#collect/2).\n\n[collect_concat(arg1, arg2)](#collect_concat/2)\n\nSee [`REnum.collect_concat/2`](REnum.html#collect_concat/2).\n\n[compact(arg1)](#compact/1)\n\nSee [`REnum.compact/1`](REnum.html#compact/1).\n\n[compact_blank(arg1)](#compact_blank/1)\n\nSee [`REnum.compact_blank/1`](REnum.html#compact_blank/1).\n\n[concat(arg1)](#concat/1)\n\nSee [`REnum.concat/1`](REnum.html#concat/1).\n\n[concat(arg1, arg2)](#concat/2)\n\nSee [`REnum.concat/2`](REnum.html#concat/2).\n\n[count(arg1)](#count/1)\n\nSee [`REnum.count/1`](REnum.html#count/1).\n\n[count(arg1, arg2)](#count/2)\n\nSee [`REnum.count/2`](REnum.html#count/2).\n\n[count_until(arg1, arg2)](#count_until/2)\n\nSee [`REnum.count_until/2`](REnum.html#count_until/2).\n\n[count_until(arg1, arg2, arg3)](#count_until/3)\n\nSee [`REnum.count_until/3`](REnum.html#count_until/3).\n\n[cover?(arg1, arg2)](#cover?/2)\n\nSee [`RRange.Ruby.cover?/2`](RRange.Ruby.html#cover?/2).\n\n[cycle(arg1, arg2, arg3)](#cycle/3)\n\nSee [`REnum.cycle/3`](REnum.html#cycle/3).\n\n[dedup(arg1)](#dedup/1)\n\nSee [`REnum.dedup/1`](REnum.html#dedup/1).\n\n[dedup_by(arg1, arg2)](#dedup_by/2)\n\nSee [`REnum.dedup_by/2`](REnum.html#dedup_by/2).\n\n[detect(arg1, arg2)](#detect/2)\n\nSee [`REnum.detect/2`](REnum.html#detect/2).\n\n[detect(arg1, arg2, arg3)](#detect/3)\n\nSee [`REnum.detect/3`](REnum.html#detect/3).\n\n[disjoint?(arg1, arg2)](#disjoint?/2)\n\nSee [`Range.disjoint?/2`](https://hexdocs.pm/elixir/Range.html#disjoint?/2).\n\n[drop(arg1, arg2)](#drop/2)\n\nSee [`REnum.drop/2`](REnum.html#drop/2).\n\n[drop_every(arg1, arg2)](#drop_every/2)\n\nSee [`REnum.drop_every/2`](REnum.html#drop_every/2).\n\n[drop_while(arg1, arg2)](#drop_while/2)\n\nSee [`REnum.drop_while/2`](REnum.html#drop_while/2).\n\n[each(arg1, arg2)](#each/2)\n\nSee [`REnum.each/2`](REnum.html#each/2).\n\n[each_cons(arg1, arg2, arg3)](#each_cons/3)\n\nSee [`REnum.each_cons/3`](REnum.html#each_cons/3).\n\n[each_entry(arg1, arg2)](#each_entry/2)\n\nSee [`REnum.each_entry/2`](REnum.html#each_entry/2).\n\n[each_slice(arg1, arg2)](#each_slice/2)\n\nSee [`REnum.each_slice/2`](REnum.html#each_slice/2).\n\n[each_slice(arg1, arg2, arg3)](#each_slice/3)\n\nSee [`REnum.each_slice/3`](REnum.html#each_slice/3).\n\n[each_with_index(arg1)](#each_with_index/1)\n\nSee [`REnum.each_with_index/1`](REnum.html#each_with_index/1).\n\n[each_with_index(arg1, arg2)](#each_with_index/2)\n\nSee [`REnum.each_with_index/2`](REnum.html#each_with_index/2).\n\n[each_with_object(arg1, arg2, arg3)](#each_with_object/3)\n\nSee [`REnum.each_with_object/3`](REnum.html#each_with_object/3).\n\n[empty?(arg1)](#empty?/1)\n\nSee [`REnum.empty?/1`](REnum.html#empty?/1).\n\n[end(arg1)](#end/1)\n\nSee `RRange.Ruby.end/1`.\n\n[entries(arg1)](#entries/1)\n\nSee [`REnum.entries/1`](REnum.html#entries/1).\n\n[eql?(arg1, arg2)](#eql?/2)\n\nSee [`RRange.Ruby.eql?/2`](RRange.Ruby.html#eql?/2).\n\n[exclude?(arg1, arg2)](#exclude?/2)\n\nSee [`REnum.exclude?/2`](REnum.html#exclude?/2).\n\n[excluding(arg1, arg2)](#excluding/2)\n\nSee [`REnum.excluding/2`](REnum.html#excluding/2).\n\n[fetch(arg1, arg2)](#fetch/2)\n\nSee [`REnum.fetch/2`](REnum.html#fetch/2).\n\n[fetch!(arg1, arg2)](#fetch!/2)\n\nSee [`REnum.fetch!/2`](REnum.html#fetch!/2).\n\n[filter(arg1, arg2)](#filter/2)\n\nSee [`REnum.filter/2`](REnum.html#filter/2).\n\n[find(arg1, arg2)](#find/2)\n\nSee [`REnum.find/2`](REnum.html#find/2).\n\n[find(arg1, arg2, arg3)](#find/3)\n\nSee [`REnum.find/3`](REnum.html#find/3).\n\n[find_all(arg1, arg2)](#find_all/2)\n\nSee [`REnum.find_all/2`](REnum.html#find_all/2).\n\n[find_index(arg1, arg2)](#find_index/2)\n\nSee [`REnum.find_index/2`](REnum.html#find_index/2).\n\n[find_index_with_index(arg1, arg2)](#find_index_with_index/2)\n\nSee [`REnum.find_index_with_index/2`](REnum.html#find_index_with_index/2).\n\n[find_value(arg1, arg2)](#find_value/2)\n\nSee [`REnum.find_value/2`](REnum.html#find_value/2).\n\n[find_value(arg1, arg2, arg3)](#find_value/3)\n\nSee [`REnum.find_value/3`](REnum.html#find_value/3).\n\n[first(arg1)](#first/1)\n\nSee [`REnum.first/1`](REnum.html#first/1).\n\n[first(arg1, arg2)](#first/2)\n\nSee [`REnum.first/2`](REnum.html#first/2).\n\n[flat_map(arg1, arg2)](#flat_map/2)\n\nSee [`REnum.flat_map/2`](REnum.html#flat_map/2).\n\n[flat_map_reduce(arg1, arg2, arg3)](#flat_map_reduce/3)\n\nSee [`REnum.flat_map_reduce/3`](REnum.html#flat_map_reduce/3).\n\n[frequencies(arg1)](#frequencies/1)\n\nSee [`REnum.frequencies/1`](REnum.html#frequencies/1).\n\n[frequencies_by(arg1, arg2)](#frequencies_by/2)\n\nSee [`REnum.frequencies_by/2`](REnum.html#frequencies_by/2).\n\n[grep(arg1, arg2)](#grep/2)\n\nSee [`REnum.grep/2`](REnum.html#grep/2).\n\n[grep(arg1, arg2, arg3)](#grep/3)\n\nSee [`REnum.grep/3`](REnum.html#grep/3).\n\n[grep_v(arg1, arg2)](#grep_v/2)\n\nSee [`REnum.grep_v/2`](REnum.html#grep_v/2).\n\n[grep_v(arg1, arg2, arg3)](#grep_v/3)\n\nSee [`REnum.grep_v/3`](REnum.html#grep_v/3).\n\n[group_by(arg1, arg2)](#group_by/2)\n\nSee [`REnum.group_by/2`](REnum.html#group_by/2).\n\n[group_by(arg1, arg2, arg3)](#group_by/3)\n\nSee [`REnum.group_by/3`](REnum.html#group_by/3).\n\n[in_order_of(arg1, arg2, arg3)](#in_order_of/3)\n\nSee [`REnum.in_order_of/3`](REnum.html#in_order_of/3).\n\n[include?(arg1, arg2)](#include?/2)\n\nSee [`REnum.include?/2`](REnum.html#include?/2).\n\n[including(arg1, arg2)](#including/2)\n\nSee [`REnum.including/2`](REnum.html#including/2).\n\n[index_by(arg1, arg2)](#index_by/2)\n\nSee [`REnum.index_by/2`](REnum.html#index_by/2).\n\n[index_with(arg1, arg2)](#index_with/2)\n\nSee [`REnum.index_with/2`](REnum.html#index_with/2).\n\n[inject(arg1, arg2)](#inject/2)\n\nSee [`REnum.inject/2`](REnum.html#inject/2).\n\n[inject(arg1, arg2, arg3)](#inject/3)\n\nSee [`REnum.inject/3`](REnum.html#inject/3).\n\n[inspect(arg1)](#inspect/1)\n\nSee [`RRange.Ruby.inspect/1`](RRange.Ruby.html#inspect/1).\n\n[intersperse(arg1, arg2)](#intersperse/2)\n\nSee [`REnum.intersperse/2`](REnum.html#intersperse/2).\n\n[into(arg1, arg2)](#into/2)\n\nSee [`REnum.into/2`](REnum.html#into/2).\n\n[into(arg1, arg2, arg3)](#into/3)\n\nSee [`REnum.into/3`](REnum.html#into/3).\n\n[join(arg1)](#join/1)\n\nSee [`REnum.join/1`](REnum.html#join/1).\n\n[join(arg1, arg2)](#join/2)\n\nSee [`REnum.join/2`](REnum.html#join/2).\n\n[last(arg1)](#last/1)\n\nSee [`RRange.Ruby.last/1`](RRange.Ruby.html#last/1).\n\n[lazy(arg1)](#lazy/1)\n\nSee [`REnum.lazy/1`](REnum.html#lazy/1).\n\n[list_and_not_keyword?(arg1)](#list_and_not_keyword?/1)\n\nSee [`REnum.list_and_not_keyword?/1`](REnum.html#list_and_not_keyword?/1).\n\n[many?(arg1)](#many?/1)\n\nSee [`REnum.many?/1`](REnum.html#many?/1).\n\n[many?(arg1, arg2)](#many?/2)\n\nSee [`REnum.many?/2`](REnum.html#many?/2).\n\n[map(arg1, arg2)](#map/2)\n\nSee [`REnum.map/2`](REnum.html#map/2).\n\n[map_and_not_range?(arg1)](#map_and_not_range?/1)\n\nSee [`REnum.map_and_not_range?/1`](REnum.html#map_and_not_range?/1).\n\n[map_every(arg1, arg2, arg3)](#map_every/3)\n\nSee [`REnum.map_every/3`](REnum.html#map_every/3).\n\n[map_intersperse(arg1, arg2, arg3)](#map_intersperse/3)\n\nSee [`REnum.map_intersperse/3`](REnum.html#map_intersperse/3).\n\n[map_join(arg1, arg2)](#map_join/2)\n\nSee [`REnum.map_join/2`](REnum.html#map_join/2).\n\n[map_join(arg1, arg2, arg3)](#map_join/3)\n\nSee [`REnum.map_join/3`](REnum.html#map_join/3).\n\n[map_reduce(arg1, arg2, arg3)](#map_reduce/3)\n\nSee [`REnum.map_reduce/3`](REnum.html#map_reduce/3).\n\n[match_function(arg1)](#match_function/1)\n\nSee [`REnum.match_function/1`](REnum.html#match_function/1).\n\n[max(arg1)](#max/1)\n\nSee [`REnum.max/1`](REnum.html#max/1).\n\n[max(arg1, arg2)](#max/2)\n\nSee [`REnum.max/2`](REnum.html#max/2).\n\n[max(arg1, arg2, arg3)](#max/3)\n\nSee [`REnum.max/3`](REnum.html#max/3).\n\n[max_by(arg1, arg2)](#max_by/2)\n\nSee [`REnum.max_by/2`](REnum.html#max_by/2).\n\n[max_by(arg1, arg2, arg3)](#max_by/3)\n\nSee [`REnum.max_by/3`](REnum.html#max_by/3).\n\n[max_by(arg1, arg2, arg3, arg4)](#max_by/4)\n\nSee [`REnum.max_by/4`](REnum.html#max_by/4).\n\n[maximum(arg1, arg2)](#maximum/2)\n\nSee [`REnum.maximum/2`](REnum.html#maximum/2).\n\n[member?(arg1, arg2)](#member?/2)\n\nSee [`REnum.member?/2`](REnum.html#member?/2).\n\n[min(arg1)](#min/1)\n\nSee [`REnum.min/1`](REnum.html#min/1).\n\n[min(arg1, arg2)](#min/2)\n\nSee [`REnum.min/2`](REnum.html#min/2).\n\n[min(arg1, arg2, arg3)](#min/3)\n\nSee [`REnum.min/3`](REnum.html#min/3).\n\n[min_by(arg1, arg2)](#min_by/2)\n\nSee [`REnum.min_by/2`](REnum.html#min_by/2).\n\n[min_by(arg1, arg2, arg3)](#min_by/3)\n\nSee [`REnum.min_by/3`](REnum.html#min_by/3).\n\n[min_by(arg1, arg2, arg3, arg4)](#min_by/4)\n\nSee [`REnum.min_by/4`](REnum.html#min_by/4).\n\n[min_max(arg1)](#min_max/1)\n\nSee [`REnum.min_max/1`](REnum.html#min_max/1).\n\n[min_max(arg1, arg2)](#min_max/2)\n\nSee [`REnum.min_max/2`](REnum.html#min_max/2).\n\n[min_max_by(arg1, arg2)](#min_max_by/2)\n\nSee [`REnum.min_max_by/2`](REnum.html#min_max_by/2).\n\n[min_max_by(arg1, arg2, arg3)](#min_max_by/3)\n\nSee [`REnum.min_max_by/3`](REnum.html#min_max_by/3).\n\n[min_max_by(arg1, arg2, arg3, arg4)](#min_max_by/4)\n\nSee [`REnum.min_max_by/4`](REnum.html#min_max_by/4).\n\n[minimum(arg1, arg2)](#minimum/2)\n\nSee [`REnum.minimum/2`](REnum.html#minimum/2).\n\n[minmax(arg1)](#minmax/1)\n\nSee [`REnum.minmax/1`](REnum.html#minmax/1).\n\n[minmax(arg1, arg2)](#minmax/2)\n\nSee [`REnum.minmax/2`](REnum.html#minmax/2).\n\n[minmax_by(arg1, arg2)](#minmax_by/2)\n\nSee [`REnum.minmax_by/2`](REnum.html#minmax_by/2).\n\n[minmax_by(arg1, arg2, arg3)](#minmax_by/3)\n\nSee [`REnum.minmax_by/3`](REnum.html#minmax_by/3).\n\n[minmax_by(arg1, arg2, arg3, arg4)](#minmax_by/4)\n\nSee [`REnum.minmax_by/4`](REnum.html#minmax_by/4).\n\n[new(arg1, arg2)](#new/2)\n\nSee [`Range.new/2`](https://hexdocs.pm/elixir/Range.html#new/2).\n\n[new(arg1, arg2, arg3)](#new/3)\n\nSee [`Range.new/3`](https://hexdocs.pm/elixir/Range.html#new/3).\n\n[none?(arg1)](#none?/1)\n\nSee [`REnum.none?/1`](REnum.html#none?/1).\n\n[none?(arg1, arg2)](#none?/2)\n\nSee [`REnum.none?/2`](REnum.html#none?/2).\n\n[one?(arg1)](#one?/1)\n\nSee [`REnum.one?/1`](REnum.html#one?/1).\n\n[one?(arg1, arg2)](#one?/2)\n\nSee [`REnum.one?/2`](REnum.html#one?/2).\n\n[overlaps?(arg1, arg2)](#overlaps?/2)\n\nSee [`RRange.ActiveSupport.overlaps?/2`](RRange.ActiveSupport.html#overlaps?/2).\n\n[pick(arg1, arg2)](#pick/2)\n\nSee [`REnum.pick/2`](REnum.html#pick/2).\n\n[pluck(arg1, arg2)](#pluck/2)\n\nSee [`REnum.pluck/2`](REnum.html#pluck/2).\n\n[product(arg1)](#product/1)\n\nSee [`REnum.product/1`](REnum.html#product/1).\n\n[random(arg1)](#random/1)\n\nSee [`REnum.random/1`](REnum.html#random/1).\n\n[reduce(arg1, arg2)](#reduce/2)\n\nSee [`REnum.reduce/2`](REnum.html#reduce/2).\n\n[reduce(arg1, arg2, arg3)](#reduce/3)\n\nSee [`REnum.reduce/3`](REnum.html#reduce/3).\n\n[reduce_while(arg1, arg2, arg3)](#reduce_while/3)\n\nSee [`REnum.reduce_while/3`](REnum.html#reduce_while/3).\n\n[reject(arg1, arg2)](#reject/2)\n\nSee [`REnum.reject/2`](REnum.html#reject/2).\n\n[reverse(arg1)](#reverse/1)\n\nSee [`REnum.reverse/1`](REnum.html#reverse/1).\n\n[reverse(arg1, arg2)](#reverse/2)\n\nSee [`REnum.reverse/2`](REnum.html#reverse/2).\n\n[reverse_each(arg1, arg2)](#reverse_each/2)\n\nSee [`REnum.reverse_each/2`](REnum.html#reverse_each/2).\n\n[reverse_slice(arg1, arg2, arg3)](#reverse_slice/3)\n\nSee [`REnum.reverse_slice/3`](REnum.html#reverse_slice/3).\n\n[scan(arg1, arg2)](#scan/2)\n\nSee [`REnum.scan/2`](REnum.html#scan/2).\n\n[scan(arg1, arg2, arg3)](#scan/3)\n\nSee [`REnum.scan/3`](REnum.html#scan/3).\n\n[select(arg1, arg2)](#select/2)\n\nSee [`REnum.select/2`](REnum.html#select/2).\n\n[shuffle(arg1)](#shuffle/1)\n\nSee [`REnum.shuffle/1`](REnum.html#shuffle/1).\n\n[size(arg1)](#size/1)\n\nSee [`Range.size/1`](https://hexdocs.pm/elixir/Range.html#size/1).\n\n[slice(arg1, arg2)](#slice/2)\n\nSee [`REnum.slice/2`](REnum.html#slice/2).\n\n[slice(arg1, arg2, arg3)](#slice/3)\n\nSee [`REnum.slice/3`](REnum.html#slice/3).\n\n[slice_after(arg1, arg2)](#slice_after/2)\n\nSee [`REnum.slice_after/2`](REnum.html#slice_after/2).\n\n[slice_before(arg1, arg2)](#slice_before/2)\n\nSee [`REnum.slice_before/2`](REnum.html#slice_before/2).\n\n[slice_when(arg1, arg2)](#slice_when/2)\n\nSee [`REnum.slice_when/2`](REnum.html#slice_when/2).\n\n[slide(arg1, arg2, arg3)](#slide/3)\n\nSee [`REnum.slide/3`](REnum.html#slide/3).\n\n[sole(arg1)](#sole/1)\n\nSee [`REnum.sole/1`](REnum.html#sole/1).\n\n[sort(arg1)](#sort/1)\n\nSee [`REnum.sort/1`](REnum.html#sort/1).\n\n[sort(arg1, arg2)](#sort/2)\n\nSee [`REnum.sort/2`](REnum.html#sort/2).\n\n[sort_by(arg1, arg2)](#sort_by/2)\n\nSee [`REnum.sort_by/2`](REnum.html#sort_by/2).\n\n[sort_by(arg1, arg2, arg3)](#sort_by/3)\n\nSee [`REnum.sort_by/3`](REnum.html#sort_by/3).\n\n[split(arg1, arg2)](#split/2)\n\nSee [`REnum.split/2`](REnum.html#split/2).\n\n[split_while(arg1, arg2)](#split_while/2)\n\nSee [`REnum.split_while/2`](REnum.html#split_while/2).\n\n[split_with(arg1, arg2)](#split_with/2)\n\nSee [`REnum.split_with/2`](REnum.html#split_with/2).\n\n[step(arg1, arg2)](#step/2)\n\nSee [`RRange.Ruby.step/2`](RRange.Ruby.html#step/2).\n\n[step(arg1, arg2, arg3)](#step/3)\n\nSee [`RRange.Ruby.step/3`](RRange.Ruby.html#step/3).\n\n[sum(arg1)](#sum/1)\n\nSee [`REnum.sum/1`](REnum.html#sum/1).\n\n[take(arg1, arg2)](#take/2)\n\nSee [`REnum.take/2`](REnum.html#take/2).\n\n[take_every(arg1, arg2)](#take_every/2)\n\nSee [`REnum.take_every/2`](REnum.html#take_every/2).\n\n[take_random(arg1, arg2)](#take_random/2)\n\nSee [`REnum.take_random/2`](REnum.html#take_random/2).\n\n[take_while(arg1, arg2)](#take_while/2)\n\nSee [`REnum.take_while/2`](REnum.html#take_while/2).\n\n[tally(arg1)](#tally/1)\n\nSee [`REnum.tally/1`](REnum.html#tally/1).\n\n[to_a(arg1)](#to_a/1)\n\nSee [`REnum.to_a/1`](REnum.html#to_a/1).\n\n[to_h(arg1)](#to_h/1)\n\nSee [`REnum.to_h/1`](REnum.html#to_h/1).\n\n[to_h(arg1, arg2)](#to_h/2)\n\nSee [`REnum.to_h/2`](REnum.html#to_h/2).\n\n[to_l(arg1)](#to_l/1)\n\nSee [`REnum.to_l/1`](REnum.html#to_l/1).\n\n[to_list(arg1)](#to_list/1)\n\nSee [`REnum.to_list/1`](REnum.html#to_list/1).\n\n[to_s(arg1)](#to_s/1)\n\nSee [`RRange.Ruby.to_s/1`](RRange.Ruby.html#to_s/1).\n\n[truthy_count(arg1)](#truthy_count/1)\n\nSee [`REnum.truthy_count/1`](REnum.html#truthy_count/1).\n\n[truthy_count(arg1, arg2)](#truthy_count/2)\n\nSee [`REnum.truthy_count/2`](REnum.html#truthy_count/2).\n\n[uniq_by(arg1, arg2)](#uniq_by/2)\n\nSee [`REnum.uniq_by/2`](REnum.html#uniq_by/2).\n\n[unzip(arg1)](#unzip/1)\n\nSee [`REnum.unzip/1`](REnum.html#unzip/1).\n\n[with_index(arg1)](#with_index/1)\n\nSee [`REnum.with_index/1`](REnum.html#with_index/1).\n\n[with_index(arg1, arg2)](#with_index/2)\n\nSee [`REnum.with_index/2`](REnum.html#with_index/2).\n\n[without(arg1, arg2)](#without/2)\n\nSee [`REnum.without/2`](REnum.html#without/2).\n\n[zip(arg1)](#zip/1)\n\nSee [`REnum.zip/1`](REnum.html#zip/1).\n\n[zip(arg1, arg2)](#zip/2)\n\nSee [`REnum.zip/2`](REnum.html#zip/2).\n\n[zip_reduce(arg1, arg2, arg3)](#zip_reduce/3)\n\nSee [`REnum.zip_reduce/3`](REnum.html#zip_reduce/3).\n\n[zip_reduce(arg1, arg2, arg3, arg4)](#zip_reduce/4)\n\nSee [`REnum.zip_reduce/4`](REnum.html#zip_reduce/4).\n\n[zip_with(arg1, arg2)](#zip_with/2)\n\nSee [`REnum.zip_with/2`](REnum.html#zip_with/2).\n\n[zip_with(arg1, arg2, arg3)](#zip_with/3)\n\nSee [`REnum.zip_with/3`](REnum.html#zip_with/3).\n\n[Link to this section](#functions)\nFunctions\n===\n\nRRange.ActiveSupport\n===\n\nSummarized all of List functions in Rails.ActiveSupport.\nIf a function with the same name already exists in Elixir, that is not implemented.\nDefines all of here functions when `use RRange.ActiveSupport`.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[overlaps?(range1, range2)](#overlaps?/2)\n\nCompare two ranges and see if they overlap each other.\n\n[Link to this section](#functions)\nFunctions\n===\n\nRRange.Native\n===\n\nA module defines all of native Range functions when `use RRange.Native`.\n[See also.](https://hexdocs.pm/elixir/Range.html)\n\nRRange.Ruby\n===\n\nSummarized all of Ruby's Range functions.\nFunctions corresponding to the following patterns are not implemented\n\n* When a function with the same name already exists in Elixir.\n* When a method name includes `!`.\n* %, ==, ===\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[begin(arg)](#begin/1)\n\nReturns the first element of range.\n\n[cover?(range, n)](#cover?/2)\n\nSee [`Enum.member?/2`](https://hexdocs.pm/elixir/Enum.html#member?/2).\n\n[end(range)](#end/1)\n\nSee [`RRange.Ruby.last/1`](#last/1).\n\n[eql?(range1, range2)](#eql?/2)\n\nReturns true if list1 == list2.\n\n[inspect(range)](#inspect/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[last(arg)](#last/1)\n\nReturns the last element of range.\n\n[step(arg, step)](#step/2)\n\nReturns Stream that from given range split into by given step.\n\n[step(arg, step, func)](#step/3)\n\nExecutes `Enum.each` to g given range split into by given step.\n\n[to_s(range)](#to_s/1)\n\nSee [`Kernel.inspect/1`](https://hexdocs.pm/elixir/Kernel.html#inspect/1).\n\n[Link to this section](#functions)\nFunctions\n===\n\nRRange.RubyEnd\n===\n\nRStream\n===\n\nEntry point of Stream extensions, and can use all of RStream.* and REnum functions.\nSee also.\n\n* [RStream.Native](https://hexdocs.pm/r_enum/RStream.Native.html#content)\n* [REnum](https://hexdocs.pm/r_enum/REnum.html#content)\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[all?(arg1)](#all?/1)\n\nSee [`REnum.all?/1`](REnum.html#all?/1).\n\n[all?(arg1, arg2)](#all?/2)\n\nSee [`REnum.all?/2`](REnum.html#all?/2).\n\n[any?(arg1)](#any?/1)\n\nSee [`REnum.any?/1`](REnum.html#any?/1).\n\n[any?(arg1, arg2)](#any?/2)\n\nSee [`REnum.any?/2`](REnum.html#any?/2).\n\n[at(arg1, arg2)](#at/2)\n\nSee [`REnum.at/2`](REnum.html#at/2).\n\n[at(arg1, arg2, arg3)](#at/3)\n\nSee [`REnum.at/3`](REnum.html#at/3).\n\n[chain(arg1)](#chain/1)\n\nSee [`REnum.chain/1`](REnum.html#chain/1).\n\n[chain(arg1, arg2)](#chain/2)\n\nSee [`REnum.chain/2`](REnum.html#chain/2).\n\n[chunk_by(arg1, arg2)](#chunk_by/2)\n\nSee [`Stream.chunk_by/2`](https://hexdocs.pm/elixir/Stream.html#chunk_by/2).\n\n[chunk_every(arg1, arg2)](#chunk_every/2)\n\nSee [`Stream.chunk_every/2`](https://hexdocs.pm/elixir/Stream.html#chunk_every/2).\n\n[chunk_every(arg1, arg2, arg3)](#chunk_every/3)\n\nSee [`Stream.chunk_every/3`](https://hexdocs.pm/elixir/Stream.html#chunk_every/3).\n\n[chunk_every(arg1, arg2, arg3, arg4)](#chunk_every/4)\n\nSee [`Stream.chunk_every/4`](https://hexdocs.pm/elixir/Stream.html#chunk_every/4).\n\n[chunk_while(arg1, arg2, arg3, arg4)](#chunk_while/4)\n\nSee [`Stream.chunk_while/4`](https://hexdocs.pm/elixir/Stream.html#chunk_while/4).\n\n[collect(arg1, arg2)](#collect/2)\n\nSee [`REnum.collect/2`](REnum.html#collect/2).\n\n[collect_concat(arg1, arg2)](#collect_concat/2)\n\nSee [`REnum.collect_concat/2`](REnum.html#collect_concat/2).\n\n[compact(arg1)](#compact/1)\n\nSee [`REnum.compact/1`](REnum.html#compact/1).\n\n[compact_blank(arg1)](#compact_blank/1)\n\nSee [`REnum.compact_blank/1`](REnum.html#compact_blank/1).\n\n[concat(arg1)](#concat/1)\n\nSee [`Stream.concat/1`](https://hexdocs.pm/elixir/Stream.html#concat/1).\n\n[concat(arg1, arg2)](#concat/2)\n\nSee [`Stream.concat/2`](https://hexdocs.pm/elixir/Stream.html#concat/2).\n\n[count(arg1)](#count/1)\n\nSee [`REnum.count/1`](REnum.html#count/1).\n\n[count(arg1, arg2)](#count/2)\n\nSee [`REnum.count/2`](REnum.html#count/2).\n\n[count_until(arg1, arg2)](#count_until/2)\n\nSee [`REnum.count_until/2`](REnum.html#count_until/2).\n\n[count_until(arg1, arg2, arg3)](#count_until/3)\n\nSee [`REnum.count_until/3`](REnum.html#count_until/3).\n\n[cycle(arg1)](#cycle/1)\n\nSee [`Stream.cycle/1`](https://hexdocs.pm/elixir/Stream.html#cycle/1).\n\n[dedup(arg1)](#dedup/1)\n\nSee [`Stream.dedup/1`](https://hexdocs.pm/elixir/Stream.html#dedup/1).\n\n[dedup_by(arg1, arg2)](#dedup_by/2)\n\nSee [`Stream.dedup_by/2`](https://hexdocs.pm/elixir/Stream.html#dedup_by/2).\n\n[detect(arg1, arg2)](#detect/2)\n\nSee [`REnum.detect/2`](REnum.html#detect/2).\n\n[detect(arg1, arg2, arg3)](#detect/3)\n\nSee [`REnum.detect/3`](REnum.html#detect/3).\n\n[drop(arg1, arg2)](#drop/2)\n\nSee [`Stream.drop/2`](https://hexdocs.pm/elixir/Stream.html#drop/2).\n\n[drop_every(arg1, arg2)](#drop_every/2)\n\nSee [`Stream.drop_every/2`](https://hexdocs.pm/elixir/Stream.html#drop_every/2).\n\n[drop_while(arg1, arg2)](#drop_while/2)\n\nSee [`Stream.drop_while/2`](https://hexdocs.pm/elixir/Stream.html#drop_while/2).\n\n[each(arg1, arg2)](#each/2)\n\nSee [`Stream.each/2`](https://hexdocs.pm/elixir/Stream.html#each/2).\n\n[each_cons(arg1, arg2, arg3)](#each_cons/3)\n\nSee [`REnum.each_cons/3`](REnum.html#each_cons/3).\n\n[each_entry(arg1, arg2)](#each_entry/2)\n\nSee [`REnum.each_entry/2`](REnum.html#each_entry/2).\n\n[each_slice(arg1, arg2)](#each_slice/2)\n\nSee [`REnum.each_slice/2`](REnum.html#each_slice/2).\n\n[each_slice(arg1, arg2, arg3)](#each_slice/3)\n\nSee [`REnum.each_slice/3`](REnum.html#each_slice/3).\n\n[each_with_index(arg1)](#each_with_index/1)\n\nSee [`REnum.each_with_index/1`](REnum.html#each_with_index/1).\n\n[each_with_index(arg1, arg2)](#each_with_index/2)\n\nSee [`REnum.each_with_index/2`](REnum.html#each_with_index/2).\n\n[each_with_object(arg1, arg2, arg3)](#each_with_object/3)\n\nSee [`REnum.each_with_object/3`](REnum.html#each_with_object/3).\n\n[empty?(arg1)](#empty?/1)\n\nSee [`REnum.empty?/1`](REnum.html#empty?/1).\n\n[entries(arg1)](#entries/1)\n\nSee [`REnum.entries/1`](REnum.html#entries/1).\n\n[exclude?(arg1, arg2)](#exclude?/2)\n\nSee [`REnum.exclude?/2`](REnum.html#exclude?/2).\n\n[excluding(arg1, arg2)](#excluding/2)\n\nSee [`REnum.excluding/2`](REnum.html#excluding/2).\n\n[fetch(arg1, arg2)](#fetch/2)\n\nSee [`REnum.fetch/2`](REnum.html#fetch/2).\n\n[fetch!(arg1, arg2)](#fetch!/2)\n\nSee [`REnum.fetch!/2`](REnum.html#fetch!/2).\n\n[filter(arg1, arg2)](#filter/2)\n\nSee [`Stream.filter/2`](https://hexdocs.pm/elixir/Stream.html#filter/2).\n\n[find(arg1, arg2)](#find/2)\n\nSee [`REnum.find/2`](REnum.html#find/2).\n\n[find(arg1, arg2, arg3)](#find/3)\n\nSee [`REnum.find/3`](REnum.html#find/3).\n\n[find_all(arg1, arg2)](#find_all/2)\n\nSee [`REnum.find_all/2`](REnum.html#find_all/2).\n\n[find_index(arg1, arg2)](#find_index/2)\n\nSee [`REnum.find_index/2`](REnum.html#find_index/2).\n\n[find_index_with_index(arg1, arg2)](#find_index_with_index/2)\n\nSee [`REnum.find_index_with_index/2`](REnum.html#find_index_with_index/2).\n\n[find_value(arg1, arg2)](#find_value/2)\n\nSee [`REnum.find_value/2`](REnum.html#find_value/2).\n\n[find_value(arg1, arg2, arg3)](#find_value/3)\n\nSee [`REnum.find_value/3`](REnum.html#find_value/3).\n\n[first(arg1)](#first/1)\n\nSee [`REnum.first/1`](REnum.html#first/1).\n\n[first(arg1, arg2)](#first/2)\n\nSee [`REnum.first/2`](REnum.html#first/2).\n\n[flat_map(arg1, arg2)](#flat_map/2)\n\nSee [`Stream.flat_map/2`](https://hexdocs.pm/elixir/Stream.html#flat_map/2).\n\n[flat_map_reduce(arg1, arg2, arg3)](#flat_map_reduce/3)\n\nSee [`REnum.flat_map_reduce/3`](REnum.html#flat_map_reduce/3).\n\n[frequencies(arg1)](#frequencies/1)\n\nSee [`REnum.frequencies/1`](REnum.html#frequencies/1).\n\n[frequencies_by(arg1, arg2)](#frequencies_by/2)\n\nSee [`REnum.frequencies_by/2`](REnum.html#frequencies_by/2).\n\n[grep(arg1, arg2)](#grep/2)\n\nSee [`REnum.grep/2`](REnum.html#grep/2).\n\n[grep(arg1, arg2, arg3)](#grep/3)\n\nSee [`REnum.grep/3`](REnum.html#grep/3).\n\n[grep_v(arg1, arg2)](#grep_v/2)\n\nSee [`REnum.grep_v/2`](REnum.html#grep_v/2).\n\n[grep_v(arg1, arg2, arg3)](#grep_v/3)\n\nSee [`REnum.grep_v/3`](REnum.html#grep_v/3).\n\n[group_by(arg1, arg2)](#group_by/2)\n\nSee [`REnum.group_by/2`](REnum.html#group_by/2).\n\n[group_by(arg1, arg2, arg3)](#group_by/3)\n\nSee [`REnum.group_by/3`](REnum.html#group_by/3).\n\n[in_order_of(arg1, arg2, arg3)](#in_order_of/3)\n\nSee [`REnum.in_order_of/3`](REnum.html#in_order_of/3).\n\n[include?(arg1, arg2)](#include?/2)\n\nSee [`REnum.include?/2`](REnum.html#include?/2).\n\n[including(arg1, arg2)](#including/2)\n\nSee [`REnum.including/2`](REnum.html#including/2).\n\n[index_by(arg1, arg2)](#index_by/2)\n\nSee [`REnum.index_by/2`](REnum.html#index_by/2).\n\n[index_with(arg1, arg2)](#index_with/2)\n\nSee [`REnum.index_with/2`](REnum.html#index_with/2).\n\n[inject(arg1, arg2)](#inject/2)\n\nSee [`REnum.inject/2`](REnum.html#inject/2).\n\n[inject(arg1, arg2, arg3)](#inject/3)\n\nSee [`REnum.inject/3`](REnum.html#inject/3).\n\n[intersperse(arg1, arg2)](#intersperse/2)\n\nSee [`Stream.intersperse/2`](https://hexdocs.pm/elixir/Stream.html#intersperse/2).\n\n[interval(arg1)](#interval/1)\n\nSee [`Stream.interval/1`](https://hexdocs.pm/elixir/Stream.html#interval/1).\n\n[into(arg1, arg2)](#into/2)\n\nSee [`Stream.into/2`](https://hexdocs.pm/elixir/Stream.html#into/2).\n\n[into(arg1, arg2, arg3)](#into/3)\n\nSee [`Stream.into/3`](https://hexdocs.pm/elixir/Stream.html#into/3).\n\n[iterate(arg1, arg2)](#iterate/2)\n\nSee [`Stream.iterate/2`](https://hexdocs.pm/elixir/Stream.html#iterate/2).\n\n[join(arg1)](#join/1)\n\nSee [`REnum.join/1`](REnum.html#join/1).\n\n[join(arg1, arg2)](#join/2)\n\nSee [`REnum.join/2`](REnum.html#join/2).\n\n[lazy(arg1)](#lazy/1)\n\nSee [`REnum.lazy/1`](REnum.html#lazy/1).\n\n[list_and_not_keyword?(arg1)](#list_and_not_keyword?/1)\n\nSee [`REnum.list_and_not_keyword?/1`](REnum.html#list_and_not_keyword?/1).\n\n[many?(arg1)](#many?/1)\n\nSee [`REnum.many?/1`](REnum.html#many?/1).\n\n[many?(arg1, arg2)](#many?/2)\n\nSee [`REnum.many?/2`](REnum.html#many?/2).\n\n[map(arg1, arg2)](#map/2)\n\nSee [`Stream.map/2`](https://hexdocs.pm/elixir/Stream.html#map/2).\n\n[map_and_not_range?(arg1)](#map_and_not_range?/1)\n\nSee [`REnum.map_and_not_range?/1`](REnum.html#map_and_not_range?/1).\n\n[map_every(arg1, arg2, arg3)](#map_every/3)\n\nSee [`Stream.map_every/3`](https://hexdocs.pm/elixir/Stream.html#map_every/3).\n\n[map_intersperse(arg1, arg2, arg3)](#map_intersperse/3)\n\nSee [`REnum.map_intersperse/3`](REnum.html#map_intersperse/3).\n\n[map_join(arg1, arg2)](#map_join/2)\n\nSee [`REnum.map_join/2`](REnum.html#map_join/2).\n\n[map_join(arg1, arg2, arg3)](#map_join/3)\n\nSee [`REnum.map_join/3`](REnum.html#map_join/3).\n\n[map_reduce(arg1, arg2, arg3)](#map_reduce/3)\n\nSee [`REnum.map_reduce/3`](REnum.html#map_reduce/3).\n\n[match_function(arg1)](#match_function/1)\n\nSee [`REnum.match_function/1`](REnum.html#match_function/1).\n\n[max(arg1)](#max/1)\n\nSee [`REnum.max/1`](REnum.html#max/1).\n\n[max(arg1, arg2)](#max/2)\n\nSee [`REnum.max/2`](REnum.html#max/2).\n\n[max(arg1, arg2, arg3)](#max/3)\n\nSee [`REnum.max/3`](REnum.html#max/3).\n\n[max_by(arg1, arg2)](#max_by/2)\n\nSee [`REnum.max_by/2`](REnum.html#max_by/2).\n\n[max_by(arg1, arg2, arg3)](#max_by/3)\n\nSee [`REnum.max_by/3`](REnum.html#max_by/3).\n\n[max_by(arg1, arg2, arg3, arg4)](#max_by/4)\n\nSee [`REnum.max_by/4`](REnum.html#max_by/4).\n\n[maximum(arg1, arg2)](#maximum/2)\n\nSee [`REnum.maximum/2`](REnum.html#maximum/2).\n\n[member?(arg1, arg2)](#member?/2)\n\nSee [`REnum.member?/2`](REnum.html#member?/2).\n\n[min(arg1)](#min/1)\n\nSee [`REnum.min/1`](REnum.html#min/1).\n\n[min(arg1, arg2)](#min/2)\n\nSee [`REnum.min/2`](REnum.html#min/2).\n\n[min(arg1, arg2, arg3)](#min/3)\n\nSee [`REnum.min/3`](REnum.html#min/3).\n\n[min_by(arg1, arg2)](#min_by/2)\n\nSee [`REnum.min_by/2`](REnum.html#min_by/2).\n\n[min_by(arg1, arg2, arg3)](#min_by/3)\n\nSee [`REnum.min_by/3`](REnum.html#min_by/3).\n\n[min_by(arg1, arg2, arg3, arg4)](#min_by/4)\n\nSee [`REnum.min_by/4`](REnum.html#min_by/4).\n\n[min_max(arg1)](#min_max/1)\n\nSee [`REnum.min_max/1`](REnum.html#min_max/1).\n\n[min_max(arg1, arg2)](#min_max/2)\n\nSee [`REnum.min_max/2`](REnum.html#min_max/2).\n\n[min_max_by(arg1, arg2)](#min_max_by/2)\n\nSee [`REnum.min_max_by/2`](REnum.html#min_max_by/2).\n\n[min_max_by(arg1, arg2, arg3)](#min_max_by/3)\n\nSee [`REnum.min_max_by/3`](REnum.html#min_max_by/3).\n\n[min_max_by(arg1, arg2, arg3, arg4)](#min_max_by/4)\n\nSee [`REnum.min_max_by/4`](REnum.html#min_max_by/4).\n\n[minimum(arg1, arg2)](#minimum/2)\n\nSee [`REnum.minimum/2`](REnum.html#minimum/2).\n\n[minmax(arg1)](#minmax/1)\n\nSee [`REnum.minmax/1`](REnum.html#minmax/1).\n\n[minmax(arg1, arg2)](#minmax/2)\n\nSee [`REnum.minmax/2`](REnum.html#minmax/2).\n\n[minmax_by(arg1, arg2)](#minmax_by/2)\n\nSee [`REnum.minmax_by/2`](REnum.html#minmax_by/2).\n\n[minmax_by(arg1, arg2, arg3)](#minmax_by/3)\n\nSee [`REnum.minmax_by/3`](REnum.html#minmax_by/3).\n\n[minmax_by(arg1, arg2, arg3, arg4)](#minmax_by/4)\n\nSee [`REnum.minmax_by/4`](REnum.html#minmax_by/4).\n\n[none?(arg1)](#none?/1)\n\nSee [`REnum.none?/1`](REnum.html#none?/1).\n\n[none?(arg1, arg2)](#none?/2)\n\nSee [`REnum.none?/2`](REnum.html#none?/2).\n\n[one?(arg1)](#one?/1)\n\nSee [`REnum.one?/1`](REnum.html#one?/1).\n\n[one?(arg1, arg2)](#one?/2)\n\nSee [`REnum.one?/2`](REnum.html#one?/2).\n\n[pick(arg1, arg2)](#pick/2)\n\nSee [`REnum.pick/2`](REnum.html#pick/2).\n\n[pluck(arg1, arg2)](#pluck/2)\n\nSee [`REnum.pluck/2`](REnum.html#pluck/2).\n\n[product(arg1)](#product/1)\n\nSee [`REnum.product/1`](REnum.html#product/1).\n\n[random(arg1)](#random/1)\n\nSee [`REnum.random/1`](REnum.html#random/1).\n\n[range?(arg1)](#range?/1)\n\nSee [`REnum.range?/1`](REnum.html#range?/1).\n\n[reduce(arg1, arg2)](#reduce/2)\n\nSee [`REnum.reduce/2`](REnum.html#reduce/2).\n\n[reduce(arg1, arg2, arg3)](#reduce/3)\n\nSee [`REnum.reduce/3`](REnum.html#reduce/3).\n\n[reduce_while(arg1, arg2, arg3)](#reduce_while/3)\n\nSee [`REnum.reduce_while/3`](REnum.html#reduce_while/3).\n\n[reject(arg1, arg2)](#reject/2)\n\nSee [`Stream.reject/2`](https://hexdocs.pm/elixir/Stream.html#reject/2).\n\n[repeatedly(arg1)](#repeatedly/1)\n\nSee [`Stream.repeatedly/1`](https://hexdocs.pm/elixir/Stream.html#repeatedly/1).\n\n[resource(arg1, arg2, arg3)](#resource/3)\n\nSee [`Stream.resource/3`](https://hexdocs.pm/elixir/Stream.html#resource/3).\n\n[reverse(arg1)](#reverse/1)\n\nSee [`REnum.reverse/1`](REnum.html#reverse/1).\n\n[reverse(arg1, arg2)](#reverse/2)\n\nSee [`REnum.reverse/2`](REnum.html#reverse/2).\n\n[reverse_each(arg1, arg2)](#reverse_each/2)\n\nSee [`REnum.reverse_each/2`](REnum.html#reverse_each/2).\n\n[reverse_slice(arg1, arg2, arg3)](#reverse_slice/3)\n\nSee [`REnum.reverse_slice/3`](REnum.html#reverse_slice/3).\n\n[run(arg1)](#run/1)\n\nSee [`Stream.run/1`](https://hexdocs.pm/elixir/Stream.html#run/1).\n\n[scan(arg1, arg2)](#scan/2)\n\nSee [`Stream.scan/2`](https://hexdocs.pm/elixir/Stream.html#scan/2).\n\n[scan(arg1, arg2, arg3)](#scan/3)\n\nSee [`Stream.scan/3`](https://hexdocs.pm/elixir/Stream.html#scan/3).\n\n[select(arg1, arg2)](#select/2)\n\nSee [`REnum.select/2`](REnum.html#select/2).\n\n[shuffle(arg1)](#shuffle/1)\n\nSee [`REnum.shuffle/1`](REnum.html#shuffle/1).\n\n[slice(arg1, arg2)](#slice/2)\n\nSee [`REnum.slice/2`](REnum.html#slice/2).\n\n[slice(arg1, arg2, arg3)](#slice/3)\n\nSee [`REnum.slice/3`](REnum.html#slice/3).\n\n[slice_after(arg1, arg2)](#slice_after/2)\n\nSee [`REnum.slice_after/2`](REnum.html#slice_after/2).\n\n[slice_before(arg1, arg2)](#slice_before/2)\n\nSee [`REnum.slice_before/2`](REnum.html#slice_before/2).\n\n[slice_when(arg1, arg2)](#slice_when/2)\n\nSee [`REnum.slice_when/2`](REnum.html#slice_when/2).\n\n[slide(arg1, arg2, arg3)](#slide/3)\n\nSee [`REnum.slide/3`](REnum.html#slide/3).\n\n[sole(arg1)](#sole/1)\n\nSee [`REnum.sole/1`](REnum.html#sole/1).\n\n[sort(arg1)](#sort/1)\n\nSee [`REnum.sort/1`](REnum.html#sort/1).\n\n[sort(arg1, arg2)](#sort/2)\n\nSee [`REnum.sort/2`](REnum.html#sort/2).\n\n[sort_by(arg1, arg2)](#sort_by/2)\n\nSee [`REnum.sort_by/2`](REnum.html#sort_by/2).\n\n[sort_by(arg1, arg2, arg3)](#sort_by/3)\n\nSee [`REnum.sort_by/3`](REnum.html#sort_by/3).\n\n[split(arg1, arg2)](#split/2)\n\nSee [`REnum.split/2`](REnum.html#split/2).\n\n[split_while(arg1, arg2)](#split_while/2)\n\nSee [`REnum.split_while/2`](REnum.html#split_while/2).\n\n[split_with(arg1, arg2)](#split_with/2)\n\nSee [`REnum.split_with/2`](REnum.html#split_with/2).\n\n[sum(arg1)](#sum/1)\n\nSee [`REnum.sum/1`](REnum.html#sum/1).\n\n[take(arg1, arg2)](#take/2)\n\nSee [`Stream.take/2`](https://hexdocs.pm/elixir/Stream.html#take/2).\n\n[take_every(arg1, arg2)](#take_every/2)\n\nSee [`Stream.take_every/2`](https://hexdocs.pm/elixir/Stream.html#take_every/2).\n\n[take_random(arg1, arg2)](#take_random/2)\n\nSee [`REnum.take_random/2`](REnum.html#take_random/2).\n\n[take_while(arg1, arg2)](#take_while/2)\n\nSee [`Stream.take_while/2`](https://hexdocs.pm/elixir/Stream.html#take_while/2).\n\n[tally(arg1)](#tally/1)\n\nSee [`REnum.tally/1`](REnum.html#tally/1).\n\n[timer(arg1)](#timer/1)\n\nSee [`Stream.timer/1`](https://hexdocs.pm/elixir/Stream.html#timer/1).\n\n[to_a(arg1)](#to_a/1)\n\nSee [`REnum.to_a/1`](REnum.html#to_a/1).\n\n[to_h(arg1)](#to_h/1)\n\nSee [`REnum.to_h/1`](REnum.html#to_h/1).\n\n[to_h(arg1, arg2)](#to_h/2)\n\nSee [`REnum.to_h/2`](REnum.html#to_h/2).\n\n[to_l(arg1)](#to_l/1)\n\nSee [`REnum.to_l/1`](REnum.html#to_l/1).\n\n[to_list(arg1)](#to_list/1)\n\nSee [`REnum.to_list/1`](REnum.html#to_list/1).\n\n[transform(arg1, arg2, arg3)](#transform/3)\n\nSee [`Stream.transform/3`](https://hexdocs.pm/elixir/Stream.html#transform/3).\n\n[transform(arg1, arg2, arg3, arg4)](#transform/4)\n\nSee [`Stream.transform/4`](https://hexdocs.pm/elixir/Stream.html#transform/4).\n\n[truthy_count(arg1)](#truthy_count/1)\n\nSee [`REnum.truthy_count/1`](REnum.html#truthy_count/1).\n\n[truthy_count(arg1, arg2)](#truthy_count/2)\n\nSee [`REnum.truthy_count/2`](REnum.html#truthy_count/2).\n\n[unfold(arg1, arg2)](#unfold/2)\n\nSee [`Stream.unfold/2`](https://hexdocs.pm/elixir/Stream.html#unfold/2).\n\n[uniq_by(arg1, arg2)](#uniq_by/2)\n\nSee [`Stream.uniq_by/2`](https://hexdocs.pm/elixir/Stream.html#uniq_by/2).\n\n[unzip(arg1)](#unzip/1)\n\nSee [`REnum.unzip/1`](REnum.html#unzip/1).\n\n[with_index(arg1)](#with_index/1)\n\nSee [`Stream.with_index/1`](https://hexdocs.pm/elixir/Stream.html#with_index/1).\n\n[with_index(arg1, arg2)](#with_index/2)\n\nSee [`Stream.with_index/2`](https://hexdocs.pm/elixir/Stream.html#with_index/2).\n\n[without(arg1, arg2)](#without/2)\n\nSee [`REnum.without/2`](REnum.html#without/2).\n\n[zip(arg1)](#zip/1)\n\nSee [`Stream.zip/1`](https://hexdocs.pm/elixir/Stream.html#zip/1).\n\n[zip(arg1, arg2)](#zip/2)\n\nSee [`Stream.zip/2`](https://hexdocs.pm/elixir/Stream.html#zip/2).\n\n[zip_reduce(arg1, arg2, arg3)](#zip_reduce/3)\n\nSee [`REnum.zip_reduce/3`](REnum.html#zip_reduce/3).\n\n[zip_reduce(arg1, arg2, arg3, arg4)](#zip_reduce/4)\n\nSee [`REnum.zip_reduce/4`](REnum.html#zip_reduce/4).\n\n[zip_with(arg1, arg2)](#zip_with/2)\n\nSee [`Stream.zip_with/2`](https://hexdocs.pm/elixir/Stream.html#zip_with/2).\n\n[zip_with(arg1, arg2, arg3)](#zip_with/3)\n\nSee [`Stream.zip_with/3`](https://hexdocs.pm/elixir/Stream.html#zip_with/3).\n\n[Link to this section](#functions)\nFunctions\n===\n\nRStream.ActiveSupport\n===\n\nUnimplemented.\n\nRStream.Native\n===\n\nA module defines all of native Stream functions when `use RStream.Native`.\n[See also.](https://hexdocs.pm/elixir/Stream.html)\n\nRStream.Ruby\n===\n\nUnimplemented.\n\nRUtils\n===\n\nUtils for REnum.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[blank?(map)](#blank?/1)\n\nReturn true if object is blank, false, empty, or a whitespace string.\nFor example, +nil+, '', ' ', [], {}, and +false+ are all blank.\n\n[define_all_functions!(mod, undelegate_functions \\\\ [])](#define_all_functions!/2)\n\nDefines in the module that called all the functions of the argument module.\n\n[make_args(n)](#make_args/1)\n\nCreates tuple for `unquote_splicing`.\n\n[present?(obj)](#present?/1)\n\nReturns true if not `RUtils.blank?`\n\n[Link to this section](#functions)\nFunctions\n===\n\nSoleItemExpectedError exception\n==="}}},{"rowIdx":453,"cells":{"project":{"kind":"string","value":"github.com/shurcool/vfsgen"},"source":{"kind":"string","value":"go"},"language":{"kind":"string","value":"Go"},"content":{"kind":"string","value":"README\n [¶](#section-readme)\n---\n\n### vfsgen\n\n[![Build Status](https://travis-ci.org/shurcooL/vfsgen.svg?branch=master)](https://travis-ci.org/shurcooL/vfsgen) [![GoDoc](https://godoc.org/github.com/shurcooL/vfsgen?status.svg)](https://godoc.org/github.com/shurcooL/vfsgen)\n\nPackage vfsgen takes an http.FileSystem (likely at `go generate` time) and generates Go code that statically implements the provided http.FileSystem.\n\nFeatures:\n\n* Efficient generated code without unneccessary overhead.\n* Uses gzip compression internally (selectively, only for files that compress well).\n* Enables direct access to internal gzip compressed bytes via an optional interface.\n* Outputs `gofmt`ed Go code.\n\n#### Installation\n```\ngo get -u github.com/shurcooL/vfsgen\n```\n#### Usage\n\nPackage `vfsgen` is a Go code generator library. It has a `Generate` function that takes an input filesystem (as a [`http.FileSystem`](https://godoc.org/net/http#FileSystem) type), and generates a Go code file that statically implements the contents of the input filesystem.\n\nFor example, we can use [`http.Dir`](https://godoc.org/net/http#Dir) as a `http.FileSystem` implementation that uses the contents of the `/path/to/assets` directory:\n```\nvar fs http.FileSystem = http.Dir(\"/path/to/assets\")\n```\nNow, when you execute the following code:\n```\nerr := vfsgen.Generate(fs, vfsgen.Options{})\nif err != nil {\n\tlog.Fatalln(err)\n}\n```\nAn assets_vfsdata.go file will be generated in the current directory:\n```\n// Code generated by vfsgen; DO NOT EDIT.\n\npackage main\n\nimport ...\n\n// assets statically implements the virtual filesystem provided to vfsgen.Generate.\nvar assets http.FileSystem = ...\n```\nThen, in your program, you can use `assets` as any other [`http.FileSystem`](https://godoc.org/net/http#FileSystem), for example:\n```\nfile, err := assets.Open(\"/some/file.txt\")\nif err != nil {\n\treturn err\n}\ndefer file.Close()\n```\n```\nhttp.Handle(\"/assets/\", http.FileServer(assets))\n```\n`vfsgen` can be more useful when combined with build tags and go generate directives. This is described below.\n\n##### `go generate` Usage\n\nvfsgen is great to use with go generate directives. The code invoking `vfsgen.Generate` can go in an assets_generate.go file, which can then be invoked via \"//go:generate go run assets_generate.go\". The input virtual filesystem can read directly from disk, or it can be more involved.\n\nBy using build tags, you can create a development mode where assets are loaded directly from disk via `http.Dir`, but then statically implemented for final releases.\n\nFor example, suppose your source filesystem is defined in a package with import path \"example.com/project/data\" as:\n```\n// +build dev\n\npackage data\n\nimport \"net/http\"\n\n// Assets contains project assets.\nvar Assets http.FileSystem = http.Dir(\"assets\")\n```\nWhen built with the \"dev\" build tag, accessing `data.Assets` will read from disk directly via `http.Dir`.\n\nA generate helper file assets_generate.go can be invoked via \"//go:generate go run -tags=dev assets_generate.go\" directive:\n```\n// +build ignore\n\npackage main\n\nimport (\n\t\"log\"\n\n\t\"example.com/project/data\"\n\t\"github.com/shurcooL/vfsgen\"\n)\n\nfunc main() {\n\terr := vfsgen.Generate(data.Assets, vfsgen.Options{\n\t\tPackageName:  \"data\",\n\t\tBuildTags:    \"!dev\",\n\t\tVariableName: \"Assets\",\n\t})\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n```\nNote that \"dev\" build tag is used to access the source filesystem, and the output file will contain \"!dev\" build tag. That way, the statically implemented version will be used during normal builds and `go get`, when custom builds tags are not specified.\n\n##### `vfsgendev` Usage\n\n`vfsgendev` is a binary that can be used to replace the need for the assets_generate.go file.\n\nMake sure it's installed and available in your PATH.\n```\ngo get -u github.com/shurcooL/vfsgen/cmd/vfsgendev\n```\nThen the \"//go:generate go run -tags=dev assets_generate.go\" directive can be replaced with:\n```\n//go:generate vfsgendev -source=\"example.com/project/data\".Assets\n```\nvfsgendev accesses the source variable using \"dev\" build tag, and generates an output file with \"!dev\" build tag.\n\n##### Additional Embedded Information\n\nAll compressed files implement [`httpgzip.GzipByter` interface](https://godoc.org/github.com/shurcooL/httpgzip#GzipByter) for efficient direct access to the internal compressed bytes:\n```\n// GzipByter is implemented by compressed files for\n// efficient direct access to the internal compressed bytes.\ntype GzipByter interface {\n\t// GzipBytes returns gzip compressed contents of the file.\n\tGzipBytes() []byte\n}\n```\nFiles that have been determined to not be worth gzip compressing (their compressed size is larger than original) implement [`httpgzip.NotWorthGzipCompressing` interface](https://godoc.org/github.com/shurcooL/httpgzip#NotWorthGzipCompressing):\n```\n// NotWorthGzipCompressing is implemented by files that were determined\n// not to be worth gzip compressing (the file size did not decrease as a result).\ntype NotWorthGzipCompressing interface {\n\t// NotWorthGzipCompressing is a noop. It's implemented in order to indicate\n\t// the file is not worth gzip compressing.\n\tNotWorthGzipCompressing()\n}\n```\n#### Comparison\n\nvfsgen aims to be conceptually simple to use. The [`http.FileSystem`](https://godoc.org/net/http#FileSystem) abstraction is central to vfsgen. It's used as both input for code generation, and as output in the generated code.\n\nThat enables great flexibility through orthogonality, since helpers and wrappers can operate on `http.FileSystem` without knowing about vfsgen. If you want, you can perform pre-processing, minifying assets, merging folders, filtering out files and otherwise modifying input via generic `http.FileSystem` middleware.\n\nIt avoids unneccessary overhead by merging what was previously done with two distinct packages into a single package.\n\nIt strives to be the best in its class in terms of code quality and efficiency of generated code. However, if your use goals are different, there are other similar packages that may fit your needs better.\n\n##### Alternatives\n\n* [`go-bindata`](https://github.com/jteeuwen/go-bindata) - Reads from disk, generates Go code that provides access to data via a [custom API](https://github.com/jteeuwen/go-bindata#accessing-an-asset).\n* [`go-bindata-assetfs`](https://github.com/elazarl/go-bindata-assetfs) - Takes output of go-bindata and provides a wrapper that implements `http.FileSystem` interface (the same as what vfsgen outputs directly).\n* [`becky`](https://github.com/tv42/becky) - Embeds assets as string literals in Go source.\n* [`statik`](https://github.com/rakyll/statik) - Embeds a directory of static files to be accessed via `http.FileSystem` interface (sounds very similar to vfsgen); implementation sourced from [camlistore](https://camlistore.org).\n* [`go.rice`](https://github.com/GeertJohan/go.rice) - Makes working with resources such as HTML, JS, CSS, images and templates very easy.\n* [`esc`](https://github.com/mjibson/esc) - Embeds files into Go programs and provides `http.FileSystem` interfaces to them.\n* [`staticfiles`](https://github.com/bouk/staticfiles) - Allows you to embed a directory of files into your Go binary.\n* [`togo`](https://github.com/flazz/togo) - Generates a Go source file with a `[]byte` var containing the given file's contents.\n* [`fileb0x`](https://github.com/UnnoTed/fileb0x) - Simple customizable tool to embed files in Go.\n* [`embedfiles`](https://github.com/leighmcculloch/embedfiles) - Simple tool for embedding files in Go code as a map.\n* [`packr`](https://github.com/gobuffalo/packr) - Simple solution for bundling static assets inside of Go binaries.\n* [`rsrc`](https://github.com/akavel/rsrc) - Tool for embedding .ico & manifest resources in Go programs for Windows.\n\n#### Attribution\n\nThis package was originally based on the excellent work by [@jteeuwen](https://github.com/jteeuwen) on [`go-bindata`](https://github.com/jteeuwen/go-bindata) and [@elazarl](https://github.com/elazarl) on [`go-bindata-assetfs`](https://github.com/elazarl/go-bindata-assetfs).\n\n#### License\n\n* [MIT License](https://github.com/shurcool/vfsgen/blob/0d455de96546/LICENSE)\n\nDocumentation\n [¶](#section-documentation)\n---\n\n \n### Overview [¶](#pkg-overview)\n\nPackage vfsgen takes an http.FileSystem (likely at `go generate` time) and generates Go code that statically implements the provided http.FileSystem.\n\nFeatures:\n\n- Efficient generated code without unneccessary overhead.\n\n- Uses gzip compression internally (selectively, only for files that compress well).\n\n- Enables direct access to internal gzip compressed bytes via an optional interface.\n\n- Outputs `gofmt`ed Go code.\n\nExample [¶](#example-package)\n\nThis code will generate an assets_vfsdata.go file with\n`var assets http.FileSystem = ...`\nthat statically implements the contents of \"assets\" directory.\n\nvfsgen is great to use with go generate directives. This code can go in an assets_gen.go file, which can then be invoked via \"//go:generate go run assets_gen.go\". The input virtual filesystem can read directly from disk, or it can be more involved.\n```\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/shurcooL/vfsgen\"\n)\n\nfunc main() {\n\tvar fs http.FileSystem = http.Dir(\"assets\")\n\n\terr := vfsgen.Generate(fs, vfsgen.Options{})\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n```\n```\nOutput:\n```\nShare Format\nRun\n\n### Index [¶](#pkg-index)\n\n* [func Generate(input http.FileSystem, opt Options) error](#Generate)\n* [type Options](#Options)\n\n#### Examples [¶](#pkg-examples)\n\n* [Package](#example-package)\n\n### Constants [¶](#pkg-constants)\n\nThis section is empty.\n\n### Variables [¶](#pkg-variables)\n\nThis section is empty.\n\n### Functions [¶](#pkg-functions)\n\n#### \nfunc [Generate](https://github.com/shurcool/vfsgen/blob/0d455de96546/generator.go#L22) [¶](#Generate)\n```\nfunc Generate(input [http](/net/http).[FileSystem](/net/http#FileSystem), opt [Options](#Options)) [error](/builtin#error)\n```\nGenerate Go code that statically implements input filesystem,\nwrite the output to a file specified in opt.\n\n### Types [¶](#pkg-types)\n\n#### \ntype [Options](https://github.com/shurcool/vfsgen/blob/0d455de96546/options.go#L9) [¶](#Options)\n```\ntype Options struct {\n // Filename of the generated Go code output (including extension).\n\t// If left empty, it defaults to \"{{toLower .VariableName}}_vfsdata.go\".\n\tFilename [string](/builtin#string)\n\n // PackageName is the name of the package in the generated code.\n\t// If left empty, it defaults to \"main\".\n\tPackageName [string](/builtin#string)\n\n // BuildTags are the optional build tags in the generated code.\n\t// The build tags syntax is specified by the go tool.\n\tBuildTags [string](/builtin#string)\n\n // VariableName is the name of the http.FileSystem variable in the generated code.\n\t// If left empty, it defaults to \"assets\".\n\tVariableName [string](/builtin#string)\n\n // VariableComment is the comment of the http.FileSystem variable in the generated code.\n\t// If left empty, it defaults to \"{{.VariableName}} statically implements the virtual filesystem provided to vfsgen.\".\n\tVariableComment [string](/builtin#string)\n}\n```\nOptions for vfsgen code generation."}}},{"rowIdx":454,"cells":{"project":{"kind":"string","value":"asynci-box"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"Python"},"content":{"kind":"string","value":"aiotools 2.1.0.dev15+g14aa2b4 documentation\n\n[aiotools](#)\n\n---\n\naiotools Documentation[](#aiotools-documentation)\n===\n\n**aiotools** is a set of idiomatic utilities to reduce asyncio boiler-plates.\n\nAsync Context Manager[](#module-aiotools.context)\n---\n\nProvides an implementation of asynchronous context manager and its applications.\n\nNote\n\nThe async context managers in this module are transparent aliases to\n`contextlib.asynccontextmanager` of the standard library in Python 3.7 and later.\n\n*class* AbstractAsyncContextManager[[source]](_modules/contextlib.html#AbstractAsyncContextManager)[](#aiotools.context.AbstractAsyncContextManager)\nAn abstract base class for asynchronous context managers.\n\nAsyncContextManager[](#aiotools.context.AsyncContextManager)\nalias of `contextlib._AsyncGeneratorContextManager`\n\nasync_ctx_manager(*func*)[](#aiotools.context.async_ctx_manager)\nA helper function to ease use of `AsyncContextManager`.\n\nactxmgr(*func*)[](#aiotools.context.actxmgr)\nAn alias of [`async_ctx_manager()`](#aiotools.context.async_ctx_manager).\n\n*class* aclosing(*thing*)[[source]](_modules/contextlib.html#aclosing)[](#aiotools.context.aclosing)\nAsync context manager for safely finalizing an asynchronously cleaned-up resource such as an async generator, calling its `aclose()` method.\n\nCode like this:\n\n> async with aclosing(.fetch()) as agen:\nis equivalent to this:\n\n> agen = .fetch()\n> try:\n> > > \n> > > > finally:await agen.aclose()\n*class* closing_async(*thing: aiotools.context.T_AsyncClosable*)[[source]](_modules/aiotools/context.html#closing_async)[](#aiotools.context.closing_async)\nAn analogy to [`contextlib.closing()`](https://docs.python.org/3/library/contextlib.html#contextlib.closing) for objects defining the `close()`\nmethod as an async function.\n\nNew in version 1.5.6.\n\n*class* AsyncContextGroup(*context_managers: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[[Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable)[[contextlib.AbstractAsyncContextManager](index.html#aiotools.context.AbstractAsyncContextManager)]] = None*)[[source]](_modules/aiotools/context.html#AsyncContextGroup)[](#aiotools.context.AsyncContextGroup)\nMerges a group of context managers into a single context manager.\nInternally it uses [`asyncio.gather()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.gather) to execute them with overlapping,\nto reduce the execution time via asynchrony.\n\nUpon entering, you can get values produced by the entering steps from the passed context managers (those `yield`-ed) using an `as` clause of the `async with`\nstatement.\n\nAfter exits, you can check if the context managers have finished successfully by ensuring that the return values of `exit_states()` method are `None`.\n\nNote\n\nYou cannot return values in context managers because they are generators.\n\nIf an exception is raised before the `yield` statement of an async context manager, it is stored at the corresponding manager index in the as-clause variable. Similarly, if an exception is raised after the\n`yield` statement of an async context manager, it is stored at the corresponding manager index in the `exit_states()` return value.\n\nAny exceptions in a specific context manager does not interrupt others;\nthis semantic is same to `asyncio.gather()`’s when\n`return_exceptions=True`. This means that, it is user’s responsibility to check if the returned context values are exceptions or the intended ones inside the context body after entering.\n\nParameters\n**context_managers** – An iterable of async context managers.\nIf this is `None`, you may add async context managers one by one using the [`add()`](#aiotools.context.AsyncContextGroup.add)\nmethod.\n\nExample:\n```\n@aiotools.actxmgr async def ctx(v):\n  yield v + 10\n\ng = aiotools.actxgroup([ctx(1), ctx(2)])\n\nasync with g as values:\n    assert values[0] == 11\n    assert values[1] == 12\n\nrets = g.exit_states()\nassert rets[0] is None  # successful shutdown assert rets[1] is None\n```\nadd(*cm*)[[source]](_modules/aiotools/context.html#AsyncContextGroup.add)[](#aiotools.context.AsyncContextGroup.add)\nTODO: fill description\n\nexit_states()[[source]](_modules/aiotools/context.html#AsyncContextGroup.exit_states)[](#aiotools.context.AsyncContextGroup.exit_states)\nTODO: fill description\n\n*class* actxgroup[](#aiotools.context.actxgroup)\nAn alias of [`AsyncContextGroup`](#aiotools.context.AsyncContextGroup).\n\nAsync Deferred Function Tools[](#module-aiotools.defer)\n---\n\nProvides a Golang-like `defer()` API using decorators, which allows grouping resource initialization and cleanup in one place without extra indentations.\n\nExample:\n```\nasync def init(x):\n    ...\n\nasync def cleanup(x):\n    ...\n\n@aiotools.adefer async def do(defer):  # <-- be aware of defer argument!\n    x = SomeResource()\n    await init(x)\n    defer(cleanup(x))\n    ...\n    ...\n```\nThis is equivalent to:\n```\nasync def do():\n    x = SomeResource()\n    await init(x)\n    try:\n        ...\n        ...\n    finally:\n        await cleanup(x)\n```\nNote that [`aiotools.context.AsyncContextGroup`](index.html#aiotools.context.AsyncContextGroup) or\n[`contextlib.AsyncExitStack`](https://docs.python.org/3/library/contextlib.html#contextlib.AsyncExitStack) serves well for the same purpose, but for simple cleanups, this defer API makes your codes simple because it steps aside the main execution context without extra indentations.\n\nWarning\n\nAny exception in the deferred functions is raised transparently, and may block execution of the remaining deferred functions.\nThis behavior may be changed in the future versions, though.\n\ndefer(*func*)[[source]](_modules/aiotools/defer.html#defer)[](#aiotools.defer.defer)\nA synchronous version of the defer API.\nIt can only defer normal functions.\n\nadefer(*func*)[[source]](_modules/aiotools/defer.html#adefer)[](#aiotools.defer.adefer)\nAn asynchronous version of the defer API.\nIt can defer coroutine functions, coroutines, and normal functions.\n\nAsync Fork[](#module-aiotools.fork)\n---\n\nThis module implements a simple [`os.fork()`](https://docs.python.org/3/library/os.html#os.fork)-like interface,\nbut in an asynchronous way with full support for PID file descriptors on Python 3.9 or higher and the Linux kernel 5.4 or higher.\n\nIt internally synchronizes the beginning and readiness status of child processes so that the users may assume that the child process is completely interruptible after\n[`afork()`](#aiotools.fork.afork) returns.\n\n*class* AbstractChildProcess[[source]](_modules/aiotools/fork.html#AbstractChildProcess)[](#aiotools.fork.AbstractChildProcess)\nThe abstract interface to control and monitor a forked child process.\n\n*abstract* send_signal(*signum: [int](https://docs.python.org/3/library/functions.html#int)*) → [None](https://docs.python.org/3/library/constants.html#None)[[source]](_modules/aiotools/fork.html#AbstractChildProcess.send_signal)[](#aiotools.fork.AbstractChildProcess.send_signal)\nSend a UNIX signal to the child process.\nIf the child process is already terminated, it will log a warning message and return.\n\n*abstract async* wait() → [int](https://docs.python.org/3/library/functions.html#int)[[source]](_modules/aiotools/fork.html#AbstractChildProcess.wait)[](#aiotools.fork.AbstractChildProcess.wait)\nWait until the child process terminates or reclaim the child process’ exit code if already terminated.\nIf there are other coroutines that has waited the same process, it may return 255 and log a warning message.\n\nPosixChildProcess(*pid: [int](https://docs.python.org/3/library/functions.html#int)*) → [None](https://docs.python.org/3/library/constants.html#None)[[source]](_modules/aiotools/fork.html#PosixChildProcess)[](#aiotools.fork.PosixChildProcess)\nA POSIX-compatible version of [`AbstractChildProcess`](#aiotools.fork.AbstractChildProcess).\n\nPidfdChildProcess(*pid: [int](https://docs.python.org/3/library/functions.html#int)*, *pidfd: [int](https://docs.python.org/3/library/functions.html#int)*) → [None](https://docs.python.org/3/library/constants.html#None)[[source]](_modules/aiotools/fork.html#PidfdChildProcess)[](#aiotools.fork.PidfdChildProcess)\nA PID file descriptor-based version of [`AbstractChildProcess`](#aiotools.fork.AbstractChildProcess).\n\n*async* afork(*child_func: [Callable](https://docs.python.org/3/library/typing.html#typing.Callable)[[], [int](https://docs.python.org/3/library/functions.html#int)]*) → [aiotools.fork.AbstractChildProcess](index.html#aiotools.fork.AbstractChildProcess)[[source]](_modules/aiotools/fork.html#afork)[](#aiotools.fork.afork)\nFork the current process and execute the given function in the child.\nThe return value of the function will become the exit code of the child process.\n\nParameters\n**child_func** – A function that represents the main function of the child and returns an integer as its exit code.\nNote that the function must set up a new event loop if it wants to run asyncio codes.\n\nAsync Function Tools[](#module-aiotools.func)\n---\n\napartial(*coro*, **args*, ***kwargs*)[[source]](_modules/aiotools/func.html#apartial)[](#aiotools.func.apartial)\nWraps a coroutine function with pre-defined arguments (including keyword arguments). It is an asynchronous version of [`functools.partial()`](https://docs.python.org/3/library/functools.html#functools.partial).\n\nlru_cache(*maxsize: [int](https://docs.python.org/3/library/functions.html#int) = 128*, *typed: [bool](https://docs.python.org/3/library/functions.html#bool) = False*, *expire_after: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[[float](https://docs.python.org/3/library/functions.html#float)] = None*)[[source]](_modules/aiotools/func.html#lru_cache)[](#aiotools.func.lru_cache)\nA simple LRU cache just like [`functools.lru_cache()`](https://docs.python.org/3/library/functools.html#functools.lru_cache), but it works for coroutines. This is not as heavily optimized as [`functools.lru_cache()`](https://docs.python.org/3/library/functools.html#functools.lru_cache)\nwhich uses an internal C implementation, as it targets async operations that take a long time.\n\nIt follows the same API that the standard functools provides. The wrapped function has `cache_clear()` method to flush the cache manually, but leaves `cache_info()` for statistics unimplemented.\n\nNote that calling the coroutine multiple times with the same arguments before the first call returns may incur duplicate executions.\n\nThis function is not thread-safe.\n\nParameters\n* **maxsize** – The maximum number of cached entries.\n* **typed** – Cache keys in different types separately (e.g., `3` and `3.0` will be different keys).\n* **expire_after** – Re-calculate the value if the configured time has passed even when the cache is hit. When re-calculation happens the expiration timer is also reset.\n\nAsync Itertools[](#module-aiotools.iter)\n---\n\n*async* aiter(*obj*, *sentinel=*)[[source]](_modules/aiotools/iter.html#aiter)[](#aiotools.iter.aiter)\nAnalogous to the builtin [`iter()`](https://docs.python.org/3/library/functions.html#iter).\n\nMulti-process Server[](#module-aiotools.server)\n---\n\nBased on [Async Context Manager](index.html#document-aiotools.context), this module provides an automated lifecycle management for multi-process servers with explicit initialization steps and graceful shutdown steps.\n\nserver(*func*)[](#aiotools.server.server)\nA decorator wrapper for [`AsyncServerContextManager`](#aiotools.server.AsyncServerContextManager).\n\nUsage example:\n```\n@aiotools.server async def myserver(loop, pidx, args):\n    await do_init(args)\n    stop_sig = yield\n    if stop_sig == signal.SIGINT:\n        await do_graceful_shutdown()\n    else:\n        await do_forced_shutdown()\n\naiotools.start_server(myserver, ...)\n```\n*class* AsyncServerContextManager(*func: [Callable](https://docs.python.org/3/library/typing.html#typing.Callable)[[...], [Any](https://docs.python.org/3/library/typing.html#typing.Any)]*, *args*, *kwargs*)[[source]](_modules/aiotools/server.html#AsyncServerContextManager)[](#aiotools.server.AsyncServerContextManager)\nA modified version of [`contextlib.asynccontextmanager()`](https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager).\n\nThe implementation detail is mostly taken from the `contextlib` standard library, with a minor change to inject `self.yield_return` into the wrapped async generator.\n\nyield_return*: Optional[[signal.Signals](https://docs.python.org/3/library/signal.html#signal.Signals)]*[](#aiotools.server.AsyncServerContextManager.yield_return)\n\n*exception* InterruptedBySignal[[source]](_modules/aiotools/server.html#InterruptedBySignal)[](#aiotools.server.InterruptedBySignal)\nA new [`BaseException`](https://docs.python.org/3/library/exceptions.html#BaseException) that represents interruption by an arbitrary UNIX signal.\n\nSince this is a [`BaseException`](https://docs.python.org/3/library/exceptions.html#BaseException) instead of [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception), it behaves like [`KeyboardInterrupt`](https://docs.python.org/3/library/exceptions.html#KeyboardInterrupt) and [`SystemExit`](https://docs.python.org/3/library/exceptions.html#SystemExit) exceptions (i.e.,\nbypassing except clauses catching the [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception) type only)\n\nThe first argument of this exception is the signal number received.\n\n*class* ServerMainContextManager(*func*, *args*, *kwargs*)[[source]](_modules/aiotools/server.html#ServerMainContextManager)[](#aiotools.server.ServerMainContextManager)\nA modified version of [`contextlib.contextmanager()`](https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager).\n\nThe implementation detail is mostly taken from the `contextlib` standard library, with a minor change to inject `self.yield_return` into the wrapped generator.\n\nyield_return*: Optional[[signal.Signals](https://docs.python.org/3/library/signal.html#signal.Signals)]*[](#aiotools.server.ServerMainContextManager.yield_return)\n\nmain(*func*)[](#aiotools.server.main)\nA decorator wrapper for [`ServerMainContextManager`](#aiotools.server.ServerMainContextManager)\n\nUsage example:\n```\n@aiotools.main def mymain():\n    server_args = do_init()\n    stop_sig = yield server_args\n    if stop_sig == signal.SIGINT:\n        do_graceful_shutdown()\n    else:\n        do_forced_shutdown()\n\naiotools.start_server(..., main_ctxmgr=mymain, ...)\n```\nstart_server(*worker_actxmgr: typing.Callable[[asyncio.events.AbstractEventLoop, int, typing.Sequence[typing.Any]], aiotools.server.AsyncServerContextManager], main_ctxmgr: typing.Optional[typing.Callable[[], aiotools.server.ServerMainContextManager]] = None, extra_procs: typing.Iterable[typing.Callable] = (), stop_signals: typing.Iterable[signal.Signals] = (, ), num_workers: int = 1, args: typing.Iterable[typing.Any] = (), wait_timeout: typing.Optional[float] = None*) → [None](https://docs.python.org/3/library/constants.html#None)[[source]](_modules/aiotools/server.html#start_server)[](#aiotools.server.start_server)\nStarts a multi-process server where each process has their own individual asyncio event loop. Their lifecycles are automantically managed – if the main program receives one of the signals specified in `stop_signals` it will initiate the shutdown routines on each worker that stops the event loop gracefully.\n\nParameters\n* **worker_actxmgr** – An asynchronous context manager that dicates the initialization and shutdown steps of each worker.\nIt should accept the following three arguments:\n\n\t+ **loop**: the asyncio event loop created and set\n\tby aiotools\n\t+ **pidx**: the 0-based index of the worker\n\t(use this for per-worker logging)\n\t+ **args**: a concatenated tuple of values yielded by\n\t**main_ctxmgr** and the user-defined arguments in\n\t**args**.\naiotools automatically installs an interruption handler that calls `loop.stop()` to the given event loop,\nregardless of using either threading or multiprocessing.\n* **main_ctxmgr** – An optional context manager that performs global initialization and shutdown steps of the whole program.\nIt may yield one or more values to be passed to worker processes along with **args** passed to this function.\nThere is no arguments passed to those functions since you can directly access `sys.argv` to parse command line arguments and/or read user configurations.\n* **extra_procs** – An iterable of functions that consist of extra processes whose lifecycles are synchronized with other workers.\nThey should set up their own signal handlers.\n\nIt should accept the following three arguments:\n\n\t+ **intr_event**: Always `None`, kept for legacy\n\t+ **pidx**: same to **worker_actxmgr** argument\n\t+ **args**: same to **worker_actxmgr** argument\n* **stop_signals** – A list of UNIX signals that the main program to recognize as termination signals.\n* **num_workers** – The number of children workers.\n* **args** – The user-defined arguments passed to workers and extra processes. If **main_ctxmgr** yields one or more values,\nthey are *prepended* to this user arguments when passed to workers and extra processes.\n* **wait_timeout** – The timeout in seconds before forcibly killing all remaining child processes after sending initial stop signals.\n\nReturns None\n\nChanged in version 0.3.2: The name of argument **num_proc** is changed to **num_workers**.\nEven if **num_workers** is 1, a child is created instead of doing everything at the main thread.\n\nNew in version 0.3.2: The argument `extra_procs` and `main_ctxmgr`.\n\nNew in version 0.4.0: Now supports use of threading instead of multiprocessing via\n**use_threading** option.\n\nChanged in version 0.8.0: Now **worker_actxmgr** must be an instance of\n[`AsyncServerContextManager`](#aiotools.server.AsyncServerContextManager) or async generators decorated by\n`@aiotools.server`.\n\nNow **main_ctxmgr** must be an instance of [`ServerMainContextManager`](#aiotools.server.ServerMainContextManager)\nor plain generators decorated by `@aiotools.main`.\n\nThe usage is same to asynchronous context managers, but optionally you can distinguish the received stop signal by retrieving the return value of the\n`yield` statement.\n\nIn **extra_procs** in non-threaded mode, stop signals are converted into either one of [`KeyboardInterrupt`](https://docs.python.org/3/library/exceptions.html#KeyboardInterrupt), [`SystemExit`](https://docs.python.org/3/library/exceptions.html#SystemExit), or\n[`InterruptedBySignal`](#aiotools.server.InterruptedBySignal) exception.\n\nNew in version 0.8.4: **start_method** argument can be set to change the subprocess spawning implementation.\n\nDeprecated since version 1.2.0: The **start_method** and **use_threading** arguments, in favor of our new\n`afork()` function which provides better synchronization and pid-fd support.\n\nChanged in version 1.2.0: The **extra_procs** will be always separate processes since **use_threading**\nis deprecated and thus **intr_event** arguments are now always `None`.\n\nNew in version 1.5.5: The **wait_timeout** argument.\n\nSupervisor[](#supervisor)\n---\n\nThis is a superseding replacement of [`PersistentTaskGroup`](index.html#PersistentTaskGroup) and recommend to use in new codes.\n\n*class* Supervisor[[source]](_modules/aiotools/supervisor.html#Supervisor)[](#aiotools.supervisor.Supervisor)\nSupervisor is a primitive structure to provide a long-lived context manager scope for an indefinite set of subtasks. During its lifetime, it is free to spawn new subtasks at any time. If the supervisor itself is cancelled from outside or\n`shutdown()` is called, it will cancel all running tasks immediately, wait for their completion, and then exit the context manager block.\n\nThe main difference to [`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup) is that it keeps running sibling subtasks even when there is an unhandled exception from one of the subtasks.\n\nTo prevent memory leaks, a supervisor does not store any result or exception from its subtasks. Instead, the callers must use additional task-done callbacks to process subtask results and exceptions.\n\nSupervisor provides the same analogy to Kotlin’s `SupervisorScope` and Javascript’s `Promise.allSettled()`, while [`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup) provides the same analogy to Kotlin’s `CoroutineScope` and Javascript’s\n`Promise.all()`.\n\nThe original implementation is based on DontPanicO’s pull request\n() and [`PersistentTaskGroup`](index.html#PersistentTaskGroup),\nbut it is modified *not* to store unhandled subtask exceptions.\n\nNew in version 2.0.\n\nTask Group[](#task-group)\n---\n\ncurrent_taskgroup[](#current_taskgroup)\nA [`contextvars.ContextVar`](https://docs.python.org/3/library/contextvars.html#contextvars.ContextVar) that has the reference to the current innermost\n[`TaskGroup`](#TaskGroup) instance. Available only in Python 3.7 or later.\n\ncurrent_ptaskgroup[](#current_ptaskgroup)\nA [`contextvars.ContextVar`](https://docs.python.org/3/library/contextvars.html#contextvars.ContextVar) that has the reference to the current innermost\n[`PersistentTaskGroup`](#PersistentTaskGroup) instance. Available only in Python 3.7 or later.\n\nWarning\n\nThis is set only when [`PersistentTaskGroup`](#PersistentTaskGroup) is used with the `async with` statement.\n\n*class* TaskGroup(***, *name=None*)[](#TaskGroup)\nProvides a guard against a group of tasks spawend via its [`create_task()`](#TaskGroup.create_task)\nmethod instead of the vanilla fire-and-forgetting [`asyncio.create_task()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task).\n\nSee the motivation and rationale in [the trio’s documentation](https://trio.readthedocs.io/en/stable/reference-core.html#nurseries-and-spawning).\n\nIn Python 3.11 or later, this wraps [`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup) with a small extension to set the current taskgroup in a context variable.\n\ncreate_task(*coro*, ***, *name=None*)[](#TaskGroup.create_task)\nSpawns a new task inside the taskgroup and returns the reference to the task. Setting the name of tasks is supported in Python 3.8 or later only and ignored in older versions.\n\nget_name()[](#TaskGroup.get_name)\nReturns the name set when creating the instance.\n\nNew in version 1.0.0.\n\nChanged in version 1.5.0: Fixed edge-case bugs by referring the Python 3.11 stdlib’s\n[`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup) implementation, including abrupt cancellation before all nested spawned tasks start without context switches and propagation of the source exception when the context manager (parent task) is getting cancelled but continued.\nAll existing codes should run without any issues, but it is recommended to test thoroughly.\n\n*class* PersistentTaskGroup(***, *name=None*, *exception_handler=None*)[](#PersistentTaskGroup)\nProvides an abstraction of long-running task groups for server applications.\nThe main use case is to implement a dispatcher of async event handlers, to group RPC/API request handlers, etc. with safe and graceful shutdown.\nHere “long-running” means that all tasks should keep going even when sibling tasks fail with unhandled errors and such errors must be reported immediately.\nHere “safety” means that all spawned tasks should be reclaimed before exit or shutdown.\n\nWhen used as an async context manager, it works similarly to\n[`asyncio.gather()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.gather) with `return_exceptions=True` option. It exits the context scope when all tasks finish, just like [`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup), but it does NOT abort when there are unhandled exceptions from child tasks; just keeps sibling tasks running and reporting errors as they occur (see below).\n\nWhen *not* used as an async context maanger (e.g., used as attributes of long-lived objects), it persists running until [`shutdown()`](#PersistentTaskGroup.shutdown) is called explicitly. Note that it is the user’s responsibility to call\n[`shutdown()`](#PersistentTaskGroup.shutdown) because [`PersistentTaskGroup`](#PersistentTaskGroup) does not provide the\n`__del__()` method.\n\nRegardless how it is executed, it lets all spawned tasks run to their completion and calls the exception handler to report any unhandled exceptions immediately.\nIf there are exceptions occurred again in the exception handlers, then it uses\n[`loop.call_exception_handler()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_exception_handler)\nas the last resort.\n\n*exception_handler* should be an asynchronous function that accepts the exception type, exception object, and the traceback, just like\n`__aexit__()` dunder method. The default handler just prints out the exception log using [`traceback.print_exc()`](https://docs.python.org/3/library/traceback.html#traceback.print_exc). Note that the handler is invoked within the exception handling context and thus\n[`sys.exc_info()`](https://docs.python.org/3/library/sys.html#sys.exc_info) is also available.\n\nSince the exception handling and reporting takes places immediately, it eliminates potential arbitrary report delay due to other tasks or the execution method. This resolves a critical debugging pain when only termination of the application displays accumulated errors, as sometimes we don’t want to terminate but just inspect what is happening.\n\ncreate_task(*coro*, ***, *name=None*)[](#PersistentTaskGroup.create_task)\nSpawns a new task inside the taskgroup and returns the reference to a [`future`](https://docs.python.org/3/library/asyncio-future.html#asyncio.Future) describing the task result.\nSetting the name of tasks is supported in Python 3.8 or later only and ignored in older versions.\n\nYou may `await` the retuned future to take the task’s return value or get notified with the exception from it, while the exception handler is still invoked. Since it is just a *secondary* future,\nyou cannot cancel the task explicitly using it. To cancel the task(s), use [`shutdown()`](#PersistentTaskGroup.shutdown) or exit the task group context.\n\nWarning\n\nIn Python 3.6, `await`-ing the returned future hangs indefinitely. We do not fix this issue because Python 3.6 is now EoL (end-of-life) as of December 2021.\n\nget_name()[](#PersistentTaskGroup.get_name)\nReturns the name set when creating the instance.\n\n*async* shutdown()[](#PersistentTaskGroup.shutdown)\nTriggers immediate shutdown of this taskgroup, cancelling all unfinished tasks and waiting for their completion.\n\n*classmethod* all_ptaskgroups()[](#PersistentTaskGroup.all_ptaskgroups)\nReturns a sequence of all currently existing non-exited persistent task groups.\n\nNew in version 1.5.0.\n\nNew in version 1.4.0.\n\nChanged in version 1.5.0: Rewrote the overall implementation referring the Python 3.11 stdlib’s\n[`asyncio.TaskGroup`](https://docs.python.org/3/library/asyncio-task.html#asyncio.TaskGroup) implementation and adapting it to the semantics for “persistency”.\nAll existing codes should run without any issues, but it is recommended to test thoroughly.\n\nChanged in version 1.6.1: It no longer raises [`BaseExceptionGroup`](https://docs.python.org/3/library/exceptions.html#BaseExceptionGroup) or [`ExceptionGroup`](https://docs.python.org/3/library/exceptions.html#ExceptionGroup)\nupon exit or [`shutdown()`](#PersistentTaskGroup.shutdown), because it no longer stores the history of unhnadled exceptions from subtasks to prevent memory leaks for long-running persistent task groups. The users must register explicit exception handlers or task done callbacks to report or process such unhandled exceptions.\n\n*exception* TaskGroupError[](#TaskGroupError)\nRepresents a collection of errors raised inside a task group.\nCallers may iterate over the errors using the `__errors__` attribute.\n\nIn Python 3.11 or later, this is a mere wrapper of underlying\n[`BaseExceptionGroup`](https://docs.python.org/3/library/exceptions.html#BaseExceptionGroup). This allows existing user codes to run without modification while users can take advantage of the new\n`except*` syntax and [`ExceptionGroup`](https://docs.python.org/3/library/exceptions.html#ExceptionGroup) methods if they use Python 3.11 or later. Note that if none of the passed exceptions passed is a\n[`BaseException`](https://docs.python.org/3/library/exceptions.html#BaseException), it automatically becomes [`ExceptionGroup`](https://docs.python.org/3/library/exceptions.html#ExceptionGroup).\n\nTimers[](#module-aiotools.timer)\n---\n\nProvides a simple implementation of timers run inside asyncio event loops.\n\n*class* TimerDelayPolicy(*value*, *names=None*, ***, *module=None*, *qualname=None*, *type=None*, *start=1*, *boundary=None*)[[source]](_modules/aiotools/timer.html#TimerDelayPolicy)[](#aiotools.timer.TimerDelayPolicy)\nAn enumeration of supported policies for when the timer function takes longer on each tick than the given timer interval.\n\nCANCEL *= 1*[](#aiotools.timer.TimerDelayPolicy.CANCEL)\n\nDEFAULT *= 0*[](#aiotools.timer.TimerDelayPolicy.DEFAULT)\n\n*class* VirtualClock[[source]](_modules/aiotools/timer.html#VirtualClock)[](#aiotools.timer.VirtualClock)\nProvide a virtual clock for an asyncio event loop which makes timing-based tests deterministic and instantly completed.\n\npatch_loop()[[source]](_modules/aiotools/timer.html#VirtualClock.patch_loop)[](#aiotools.timer.VirtualClock.patch_loop)\nOverride some methods of the current event loop so that sleep instantly returns while proceeding the virtual clock.\n\nvirtual_time() → [float](https://docs.python.org/3/library/functions.html#float)[[source]](_modules/aiotools/timer.html#VirtualClock.virtual_time)[](#aiotools.timer.VirtualClock.virtual_time)\nReturn the current virtual time.\n\ncreate_timer(*cb: [Callable](https://docs.python.org/3/library/typing.html#typing.Callable)[[[float](https://docs.python.org/3/library/functions.html#float)], [Union](https://docs.python.org/3/library/typing.html#typing.Union)[[Generator](https://docs.python.org/3/library/typing.html#typing.Generator)[[Any](https://docs.python.org/3/library/typing.html#typing.Any), [None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None)], [Coroutine](https://docs.python.org/3/library/typing.html#typing.Coroutine)[[Any](https://docs.python.org/3/library/typing.html#typing.Any), [Any](https://docs.python.org/3/library/typing.html#typing.Any), [None](https://docs.python.org/3/library/constants.html#None)]]]*, *interval: [float](https://docs.python.org/3/library/functions.html#float)*, *delay_policy: [aiotools.timer.TimerDelayPolicy](index.html#aiotools.timer.TimerDelayPolicy) = TimerDelayPolicy.DEFAULT*, *loop: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[asyncio.events.AbstractEventLoop] = None*) → _asyncio.Task[[source]](_modules/aiotools/timer.html#create_timer)[](#aiotools.timer.create_timer)\nSchedule a timer with the given callable and the interval in seconds.\nThe interval value is also passed to the callable.\nIf the callable takes longer than the timer interval, all accumulated callable’s tasks will be cancelled when the timer is cancelled.\n\nParameters\n**cb** – TODO - fill argument descriptions\n\nReturns You can stop the timer by cancelling the returned task.\n\nHigh-level Coroutine Utilities[](#module-aiotools.utils)\n---\n\nA set of higher-level coroutine aggregation utilities based on `Supervisor`.\n\n*async* as_completed_safe(*coros: [Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable)[[Awaitable](https://docs.python.org/3/library/typing.html#typing.Awaitable)[aiotools.utils.T]]*, ***, *context: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[_contextvars.Context] = None*) → [AsyncGenerator](https://docs.python.org/3/library/typing.html#typing.AsyncGenerator)[[Awaitable](https://docs.python.org/3/library/typing.html#typing.Awaitable)[aiotools.utils.T], [None](https://docs.python.org/3/library/constants.html#None)][[source]](_modules/aiotools/utils.html#as_completed_safe)[](#aiotools.utils.as_completed_safe)\nThis is a safer version of [`asyncio.as_completed()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.as_completed) which uses\n`aiotools.Supervisor` as an underlying coroutine lifecycle keeper.\n\nThis requires Python 3.11 or higher to work properly with timeouts.\n\nNew in version 1.6.\n\nChanged in version 2.0: It now uses `aiotools.Supervisor` internally and handles timeouts in a bettery way.\n\n*async* gather_safe(*coros: [Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable)[[Awaitable](https://docs.python.org/3/library/typing.html#typing.Awaitable)[aiotools.utils.T]]*, ***, *context: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[_contextvars.Context] = None*) → [List](https://docs.python.org/3/library/typing.html#typing.List)[[Union](https://docs.python.org/3/library/typing.html#typing.Union)[aiotools.utils.T, [Exception](https://docs.python.org/3/library/exceptions.html#Exception)]][[source]](_modules/aiotools/utils.html#gather_safe)[](#aiotools.utils.gather_safe)\nA safer version of [`asyncio.gather()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.gather). It wraps the passed coroutines with a `Supervisor` to ensure the termination of them when returned.\n\nAdditionally, it supports manually setting the context of each subtask.\n\nNote that if it is cancelled from an outer scope (e.g., timeout), there is no way to retrieve partially completed or failed results.\nIf you need to process them anyway, you must store the results in a separate place in the passed coroutines or use [`as_completed_safe()`](#aiotools.utils.as_completed_safe)\ninstead.\n\nNew in version 2.0.\n\n*async* race(*coros: [Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable)[[Awaitable](https://docs.python.org/3/library/typing.html#typing.Awaitable)[aiotools.utils.T]]*, ***, *continue_on_error: [bool](https://docs.python.org/3/library/functions.html#bool) = False*, *context: [Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[_contextvars.Context] = None*) → [Tuple](https://docs.python.org/3/library/typing.html#typing.Tuple)[aiotools.utils.T, [Sequence](https://docs.python.org/3/library/typing.html#typing.Sequence)[[Exception](https://docs.python.org/3/library/exceptions.html#Exception)]][[source]](_modules/aiotools/utils.html#race)[](#aiotools.utils.race)\nReturns the first result and cancelling all remaining coroutines safely.\nPassing an empty iterable of coroutines is not allowed.\n\nIf `continue_on_error` is set False (default), it will raise the first exception immediately, cancelling all remaining coroutines. This behavior is same to Javascript’s `Promise.race()`. The second item of the returned tuple is always empty.\n\nIf `continue_on_error` is set True, it will keep running until it encounters the first successful result. Then it returns the exceptions as a list in the second item of the returned tuple. If all coroutines fail, it will raise an\n[`ExceptionGroup`](https://docs.python.org/3/library/exceptions.html#ExceptionGroup) to indicate the explicit failure of the entire operation.\n\nYou may use this function to implement a “happy eyeball” algorithm.\n\nNew in version 2.0.\n\nIndices and tables[](#indices-and-tables)\n---\n\n* [Index](genindex.html)\n* [Search Page](search.html)"}}},{"rowIdx":455,"cells":{"project":{"kind":"string","value":"BClustLonG"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘BClustLonG’\n                                           October 12, 2022\nType Package\nTitle A Dirichlet Process Mixture Model for Clustering Longitudinal\n      Gene Expression Data\nVersion 0.1.3\nAuthor  [aut, cre], [aut], [aut],  [aut], and  [aut],\nMaintainer  <>\nDescription Many clustering methods have been proposed, but\n      most of them cannot work for longitudinal gene expression data.\n      'BClustLonG' is a package that allows us to perform clustering analysis for\n      longitudinal gene expression data. It adopts a linear-mixed effects framework\n      to model the trajectory of genes over time, while clustering is jointly\n      conducted based on the regression coefficients obtained from all genes.\n      To account for the correlations among genes and alleviate the\n      high dimensionality challenges, factor analysis models are adopted\n      for the regression coefficients. The Dirichlet process prior distribution\n      is utilized for the means of the regression coefficients to induce clustering.\n      This package allows users to specify which variables to use for clustering\n      (intercepts or slopes or both) and whether a factor analysis model is desired.\n      More de-\n      tails about this method can be found in Jiehuan Sun, et al. (2017) .\nLicense GPL-2\nEncoding UTF-8\nLazyData true\nDepends R (>= 3.4.0), MASS (>= 7.3-47), lme4 (>= 1.1-13), mcclust (>=\n      1.0)\nImports Rcpp (>= 0.12.7)\nSuggests knitr, lattice\nVignetteBuilder knitr\nLinkingTo Rcpp, RcppArmadillo\nRoxygenNote 7.1.0\nNeedsCompilation yes\nRepository CRAN\nDate/Publication 2020-05-07 04:10:02 UTC\nR topics documented:\nBClustLon... 2\ncalSi... 3\ndat... 4\n  BClustLonG                   A Dirichlet process mixture model for clustering longitudinal gene ex-\n                               pression data.\nDescription\n    A Dirichlet process mixture model for clustering longitudinal gene expression data.\nUsage\n    BClustLonG(\n       data = NULL,\n       iter = 20000,\n       thin = 2,\n       savePara = FALSE,\n       infoVar = c(\"both\", \"int\")[1],\n       factor = TRUE,\n      hyperPara = list(v1 = 0.1, v2 = 0.1, v = 1.5, c = 1, a = 0, b = 10, cd = 1, aa1 = 2,\n         aa2 = 1, alpha0 = -1, alpha1 = -1e-04, cutoff = 1e-04, h = 100)\n    )\nArguments\n    data               Data list with three elements: Y (gene expression data with each column being\n                       one gene), ID, and years. (The names of the elements have to be matached\n                       exactly. See the data in the example section more info)\n    iter               Number of iterations (excluding the thinning).\n    thin               Number of thinnings.\n    savePara           Logical variable indicating if all the parameters needed to be saved. Default\n                       value is FALSE, in which case only the membership indicators are saved.\n    infoVar            Either \"both\" (using both intercepts and slopes for clustering) or \"int\" (using\n                       only intercepts for clustering)\n    factor             Logical variable indicating whether factor analysis model is wanted.\n    hyperPara          A list of hyperparameters with default values.\nValue\n     returns a list with following objects.\n     e.mat                Membership indicators from all iterations.\n     All other parameters\n                          only returned when savePara=TRUE.\nReferences\n     , , , , and . \"A\n     Dirichlet process mixture model for clustering longitudinal gene expression data.\" Statistics in\n     Medicine 36, No. 22 (2017): 3495-3506.\nExamples\n     data(data)\n     ## increase the number of iterations\n     ## to ensure convergence of the algorithm\n     res = BClustLonG(data, iter=20, thin=2,savePara=FALSE,\n     infoVar=\"both\",factor=TRUE)\n     ## discard the first 10 burn-ins in the e.mat\n     ## and calculate similarity matrix\n     ## the number of burn-ins has be chosen s.t. the algorithm is converged.\n     mat = calSim(t(res$e.mat[,11:20]))\n     clust = maxpear(mat)$cl ## the clustering results.\n     ## Not run:\n     ## if only want to include intercepts for clustering\n     ## set infoVar=\"int\"\n     res = BClustLonG(data, iter=10, thin=2,savePara=FALSE,\n     infoVar=\"int\",factor=TRUE)\n     ## if no factor analysis model is wanted\n     ## set factor=FALSE\n     res = BClustLonG(data, iter=10, thin=2,savePara=FALSE,\n     infoVar=\"int\",factor=TRUE)\n     ## End(Not run)\n   calSim                        Function to calculate the similarity matrix based on the cluster mem-\n                                 bership indicator of each iteration.\nDescription\n     Function to calculate the similarity matrix based on the cluster membership indicator of each itera-\n     tion.\nUsage\n    calSim(mat)\nArguments\n    mat                 Matrix of cluster membership indicator from all iterations\nExamples\n    n = 90 ##number of subjects\n    iters = 200 ##number of iterations\n    ## matrix of cluster membership indicators\n    ## perfect clustering with three clusters\n    mat = matrix(rep(1:3,each=n/3),nrow=n,ncol=iters)\n    sim = calSim(t(mat))\n  data                         Simulated dataset for testing the algorithm\nDescription\n    Simulated dataset for testing the algorithm\nUsage\n    data(data)\nFormat\n    An object of class list of length 3.\nExamples\n    data(data)\n    ## this is the required data input format\n    head(data.frame(ID=data$ID,years=data$years,data$Y))"}}},{"rowIdx":456,"cells":{"project":{"kind":"string","value":"django-baton"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"Markdown"},"content":{"kind":"string","value":"django-baton 2.8.0 documentation\n\n[django-baton](index.html#document-index)\n\n---\n\ndjango-baton’s documentation[¶](#django-baton-s-documentation)\n===\n\nA cool, modern and responsive django admin application based on bootstrap 5\n\nBaton was developed with one concept in mind: **overwrite as few django templates as possible**.\nEverything is done with css (sass and bootstrap mixins), and when the markup needs some edit, then DOM manipulation through js is used.\n\nFeatures[¶](#features)\n---\n\n* Supports django >= 2.1\n* Based on bootstrap 5 and FontAwesome 6\n* Fully responsive\n* Custom and flexible sidebar menu\n* Text input filters facility\n* Configurable form tabs\n* Easy way to include templates in the change form page\n* Collapsable stacke inline entries\n* Lazy load of current uploaded images\n* Optional index page filled with google analytics widgets\n* Full customization available recompiling the provided js app\n* it translations\n\nGetting started[¶](#getting-started)\n---\n\n### Installation[¶](#installation)\n\n#### Using pip[¶](#using-pip)\n\n1. Install the last available version:\n```\npip install django-baton\n```\nNote\n\nIn order to use the Google Analytics index, install baton along the optional dependencies with `pip install django-baton[analytics]`\n\n2. Add `baton` and `baton.autodiscover` to your `INSTALLED_APPS`:\n```\nINSTALLED_APPS = (\n    # ...\n    'baton',\n    'django.contrib.admin',\n    # ... (place baton.autodiscover at the very end)\n    'baton.autodiscover',\n)\n```\nImportant\n\n`baton` must be placed before `django.contrib.admin` and `baton.autodiscover` as the last app.\n\n3. Replace django.contrib.admin in your project urls, and add baton urls:\n```\nfrom baton.autodiscover import admin from django.urls import path, include\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path('baton/', include('baton.urls')),\n\n]\n```\nImportant\n\nIf you get a “__No crypto library [available__](#system-message-1)” when using the google analytics index, then install this package:\n\n$ pip install PyOpenSSL\n\n##### Why two installed apps?[¶](#why-two-installed-apps)\n\nThe first baton has to be placed before the `django.contrib.admin` app, because it overrides 3 templates and resets all css. The `baton.autodiscover` entry is needed as the last installed app in order to register all applications for the admin. I decided to create a custom `AdminSite` class, in order to allow the customization of some variables the django way (`site_header`, `index_title`, …). I think this is a good approach, better than customizing this vars overwriting the orignal templates. The problem is that when creating a custom `AdminSite`, you should register manually all the apps. I didn’t like this, so I wrote this autodiscover module, which automatically registers all the apps already registered with the django default `AdminSite`. In order to do this, all the apps must be already registered, so it comes as the last installed app.\n\n### Configuration[¶](#configuration)\n\nYou can configure your baton installation defining a config dictionary in your `settings.py`\n\n#### Example[¶](#example)\n\nThis is an example of configuration:\n```\nBATON = {\n    'SITE_HEADER': 'Baton',\n    'SITE_TITLE': 'Baton',\n    'INDEX_TITLE': 'Site administration',\n    'SUPPORT_HREF': 'https://github.com/otto-torino/django-baton/issues',\n    'COPYRIGHT': 'copyright © 2017 Otto srl', # noqa\n    'POWERED_BY': 'Otto srl',\n    'CONFIRM_UNSAVED_CHANGES': True,\n    'SHOW_MULTIPART_UPLOADING': True,\n    'ENABLE_IMAGES_PREVIEW': True,\n    'CHANGELIST_FILTERS_IN_MODAL': True,\n    'CHANGELIST_FILTERS_ALWAYS_OPEN': False,\n    'CHANGELIST_FILTERS_FORM': True,\n    'COLLAPSABLE_USER_AREA': False,\n    'MENU_ALWAYS_COLLAPSED': False,\n    'MENU_TITLE': 'Menu',\n    'MESSAGES_TOASTS': False,\n    'GRAVATAR_DEFAULT_IMG': 'retro',\n    'GRAVATAR_ENABLED': True,\n    'FORCE_THEME': None\n    'LOGIN_SPLASH': '/static/core/img/login-splash.png',\n    'SEARCH_FIELD': {\n        'label': 'Search contents...',\n        'url': '/search/',\n    },\n    'MENU': (\n        { 'type': 'title', 'label': 'main', 'apps': ('auth', ) },\n        {\n            'type': 'app',\n            'name': 'auth',\n            'label': 'Authentication',\n            'icon': 'fa fa-lock',\n            'default_open': True,\n            'models': (\n                {\n                    'name': 'user',\n                    'label': 'Users'\n                },\n                {\n                    'name': 'group',\n                    'label': 'Groups'\n                },\n            )\n        },\n        { 'type': 'title', 'label': 'Contents', 'apps': ('flatpages', ) },\n        { 'type': 'model', 'label': 'Pages', 'name': 'flatpage', 'app': 'flatpages' },\n        { 'type': 'free', 'label': 'Custom Link', 'url': 'http://www.google.it', 'perms': ('flatpages.add_flatpage', 'auth.change_user') },\n        { 'type': 'free', 'label': 'My parent voice', 'children': [\n            { 'type': 'model', 'label': 'A Model', 'name': 'mymodelname', 'app': 'myapp', 'icon': 'fa fa-gavel' },\n            { 'type': 'free', 'label': 'Another custom link', 'url': 'http://www.google.it' },\n        ] },\n    ),\n    'ANALYTICS': {\n        'CREDENTIALS': os.path.join(BASE_DIR, 'credentials.json'),\n        'VIEW_ID': '12345678',\n    }\n}\n```\n#### Site header[¶](#site-header)\n\n**Default**: baton logo\n\nImportant\n\n`SITE_HEADER` is marked as safe, so you can include img tags or links\n\n#### Site title[¶](#site-title)\n\n**Default**: ‘Baton’\n\n#### Index title[¶](#index-title)\n\n**Default**: ‘Site administration’\n\n#### Support href[¶](#support-href)\n\nThis is the content of the href attribute of the support link rendered in the footer.\n\n**Default**: ‘’\n\n**Example**: ‘[mailto:](mailto:support%40company.org)’\n\n#### Copyright[¶](#copyright)\n\nA copyright string inserted centered in the footer\n\n**Default**: ‘copyright © 2017 ”>Otto srl’\n\nImportant\n\n`COPYRIGHT` is marked as safe, so you can include img tags or links\n\n#### Powered by[¶](#powered-by)\n\nA powered by information included in the right part of the footer, under the `SITE_TITLE` string\n\n**Default**: ‘”>Otto srl’\n\nImportant\n\n`POWERED_BY` is marked as safe, so you can include img tags or links\n\n#### Confirm unsaved changes[¶](#confirm-unsaved-changes)\n\nAlert the user when he’s leaving a change or add form page without saving changes\n\n**Default**: True\n\nImportant\n\nThe check for a dirty form relies on the jQuery serialize method, so it’s not 100% safe. Disabled inputs, particular widgets (ckeditor) can not be detected.\n\n#### Show multipart uploading[¶](#show-multipart-uploading)\n\nShow an overlay with a spinner when a `multipart/form-data` form is submitted\n\n**Default**: True\n\n#### Enable images preview[¶](#enable-images-preview)\n\nDisplays a preview above all input file fields which contain images. You can control how the preview is displayed overriding the class `.baton-image-preview`. By default previews are 100px height and with a box shadow on over event\n\n**Default**: True\n\n#### Changelist filters in modal[¶](#changelist-filters-in-modal)\n\nIf set to `True` the changelist filters are opened in a centered modal above the document, useful when you set many filters. By default, its value is `False` and the changelist filters appears from the right side of the changelist table.\n\n**Default**: False\n\n#### Changelist filters always open[¶](#changelist-filters-always-open)\n\nIf set to `True` the changelist filters are opened by default. By default, its value is `False` and the changelist filters can be expanded clicking a toggler button. This option is considered only if `CHANGELIST_FILTERS_IN_MODAL` is `False`\n\n**Default**: False\n\n#### Changelist filters form[¶](#changelist-filters-form)\n\nIf set to `True` the changelist filters are treated as in a form, you can set many of them at once and then press a filter button in order to actually perform the filtering. With such option all standard filters are displayed as dropdowns.\n\n**Default**: False\n\n#### Collapsable user area[¶](#collapsable-user-area)\n\nIf set to `True` the sidebar user area is collapsed and can be expanded to show links.\n\n**Default**: False\n\n#### Menu always collapsed[¶](#menu-always-collapsed)\n\nIf set to `True` the menu is hidden at page load, and the navbar toggler is always visible, just click it to show the sidebar menu.\n\n**Default**: False\n\n#### Menu title[¶](#menu-title)\n\nThe menu title shown in the sidebar. If an empty string, the menu title is hidden and takes no space on larger screens, the default menu voice will still be visible in the mobile menu.\n\n#### Messages toasts[¶](#messages-toasts)\n\nYou can decide to show all or specific level admin messages in toasts. Set it to `True` to show all message in toasts. set it to `['warning', 'error']` to show only warning and error messages in toasts.\n\n**Default**: False\n\n#### Gravatar default image[¶](#gravatar-default-image)\n\nThe default gravatar image displayed if the user email is not associated to any gravatar image. Possible values: 404, mp, identicon, monsterid, wavatar, retro, robohash, blank (see gravatar docs [http://en.gravatar.com/site/implement/images/]).\n\n**Default**: ‘retro’\n\n#### Gravatar enabled[¶](#gravatar-enabled)\n\nShould a gravatar image be shown for the user in the menu?\n\n**Default**: True\n\n#### Login splash image[¶](#login-splash-image)\n\nAn image used as body background in the login page. The image is centered and covers the whole viewport.\n\n**Default**: None\n\n#### Force theme[¶](#force-theme)\n\nYou can force the light or dark theme, and the theme toggle disappears from the user area.\n\n**Default**: None\n\n#### Menu[¶](#menu)\n\nThe sidebar menu is rendered through javascript.\n\nIf you don’t define a custom menu, the default menu is rendered, which includes all the apps and models registered in the admin that the user can view.\n\nWhen defining a custom menu you can use 4 different kinds of voices:\n\n* title\n* app\n* model\n* free\n\nTitle and free voices can have children. Children follow these rules:\n\n* children children are ignored (do not place an app voice as child)\n\nVoices with children can specify a `default_open` option, used to expand the submenu by default.\n\n##### Title[¶](#title)\n\nLike the voices MAIN and CONTENTS in the above image, it represents a menu section. You should set a `label` and optionally an `apps` or `perms` key, used for visualization purposes.\n\nIf the title voice should act as a section title for a group of apps, you’d want to specify these apps, because if the user can’t operate over them, then the voice is not shown. At the same time you can define some perms (OR condition), something like:\n```\n{ 'type': 'title', 'label': 'main', 'perms': ('auth.add_user', ) },\n```\nor\n```\n{ 'type': 'title', 'label': 'main', 'apps': ('auth', ) },\n```\nIt accepts children voices, though you can specify the `default_open` key.\n\n##### App[¶](#app)\n\nIn order to add an application with all its models to the menu, you need an app menu voice.\n\nYou must specify the `type` and `name` keys, optionally an `icon` key (you can use FontAwesome classes which are included by default), a `default_open` key and a `models` key.\n\nImportant\n\nIf you don’t define the models key then the default app models are listed under your app, otherwise only the specified models are listed (in the order you provide).\n\nThe `models` key must be a tuple, where every item represents a model in the form of a dictionary with keys `label` and `name`\n```\n{\n    'type': 'app',\n    'name': 'auth',\n    'label': 'Authentication',\n    'icon': 'fa fa-lock',\n    'models': (\n        {\n            'name': 'user',\n            'label': 'Users'\n        },\n        {\n            'name': 'group',\n            'label': 'Groups'\n        },\n    )\n},\n```\nImportant\n\nApp name should be lowercase.\n\n##### Model[¶](#model)\n\nIf you want to add only a link to the admin page of a single model, you can use this voice. For example, the flatpages app has only one model Flatpage, so I think it may be better to avoid a double selection.\n\nIn this case you must specify the `type`, `name` and `app` keys, optionally an `icon` key (you can use FontAwesome classes which are included by default). An example:\n```\n{ 'type': 'model', 'label': 'Pages', 'name': 'flatpage', 'app': 'flatpages', 'icon': 'fa fa-file-text-o' },\n```\nImportant\n\nModel name should be lowercase.\n\n##### Free[¶](#free)\n\nIf you want to link an external site, a documentation page, an add element page and in general every custom resource, you may use this voice.\n\nIn such case you must define an `url` and if you want some visibility permissions (OR clause)\n```\n{ 'type': 'free', 'label': 'Docs', 'url': 'http://www.mydocssite.com' },\n```\nor\n```\n{ 'type': 'free', 'label': 'Add page', 'url': '/admin/flatpages/flatpage/add/', 'perms': ('flatpages.add_flatpage', ) },\n```\nIt accepts children voices\n```\n{ 'type': 'free', 'label': 'My parent voice', 'children': [\n    { 'type': 'free', 'label': 'Docs', 'url': 'http://www.mydocssite.com' },\n    { 'type': 'free', 'label': 'Photos', 'url': 'http://www.myphotossite.com' },\n] },\n```\nSince free voices can have children you can specify the `default_open` key.\n\nFree voices also accept a _re_ property, which specifies a regular expression used to decide whether to highlight the voice or not (the regular expression is evaluated against the document location pathname):\n```\n{\n        'type': 'free',\n    'label': 'Categories',\n    'url': '/admin/news/category/',\n    're': '^/admin/news/category/(\\d*)?'\n}\n```\n#### Search Field[¶](#search-field)\n\nWith this functionality, you can configure a sidebar input search field with autocomplete functionality that can let you surf easily and quickly to any page you desire.\n```\n'SEARCH_FIELD': {\n    'label': 'Label shown as placeholder',\n    'url': '/api/path/',\n},\n```\nThe autocomplete field will call a custom api at every keyup event. Such api receives the `text` param in the querystring and should return a json response including the search results in the form:\n```\n{\n    length: 2,\n    data: [\n        { label: 'My result #1', icon: 'fa fa-edit', url: '/admin/myapp/mymodel/1/change' },\n        // ...\n    ]\n}\n```\nYou should provide the results length and the data as an array of objects which must contain the `label` and `url` keys. The `icon` key is optional and is treated as css class given to an `i` element.\n\nLet’s see an example:\n```\n@staff_member_required def admin_search(request):\n    text = request.GET.get('text', None)\n    res = []\n    news = News.objects.all()\n    if text:\n        news = news.filter(title__icontains=text)\n    for n in news:\n        res.append({\n            'label': str(n) + ' edit',\n            'url': '/admin/news/news/%d/change' % n.id,\n            'icon': 'fa fa-edit',\n        })\n    if text.lower() in 'Lucio Dalla Wikipedia'.lower():\n        res.append({\n            'label': ' Wikipedia',\n            'url': 'https://www.google.com',\n            'icon': 'fab fa-wikipedia-w'\n        })\n    return JsonResponse({\n        'length': len(res),\n        'data': res\n    })\n```\nYou can move between the results using the keyboard up and down arrows, and you can browse to the voice url pressing Enter.\n\n#### Analytics[¶](#analytics)\n\nNote\n\nIn order to use the Google Analytics index, install baton along the optional dependencies with `pip install django-baton[analytics]`\n\nBaton provides an index view which displays google analytics statistics charts for the last 15 days, 1 month, 3 month and 1 year.\n\nIn order to activate it you need to create a service account and link it to your google analytics view, then you must define the keys:\n\n* `CREDENTIALS`: path to the credentials json file\n* `VIEW_ID`: id of the analytics view which serves the data\n\nYou can add contents before and after the analytics dashboard by extending the `baton/analytics.html` template and filling the `baton_before_analytics` and `baton_after_analytics` blocks.\n\n##### How to generate a credentials json file[¶](#how-to-generate-a-credentials-json-file)\n\nFollow the steps in the Google Identity Platform documentation to [create a service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) from the [Google Developer Console](https://console.developers.google.com/).\n\nOnce the service account is created, you can click the Generate New JSON Key button to create and download the key and add it to your project.\n\nAdd the service account as a user in Google Analytics. The service account you created in the previous step has an email address that you can add to any of the Google Analytics views you’d like to request data from. It’s generally best to only grant the service account read-only access.\n\n### Page Detection[¶](#page-detection)\n\nBaton triggers some of its functionalities basing upon the current page. For example, it will trigger the tab functionality only when the current page is an add form or change form page.\n\nBaton understands which page is currently displayed performing some basic regular expressions against the location pathname.\nThere may be cases in which you’d like to serve such contents at different and custom urls, in such cases you need a way to tell Baton which kind of page is tied to that url.\n\nFor this reason you can inject your custom hook, a javascript function which should return the page type and that receives as first argument the Baton’s default function to use as fallback, i.e.\n```\n\n\n\n```\nIn this case we tell Baton that when the location pathname includes the string `newschange`, then the page should be considered a `change_form`, otherwise we let Baton guess the page type.\n\nSo, in order to hook into the Baton page detection system, just define a `Baton.detectPageHook` function which receives the default function as first argument and should return the page type.\n\nThe available page types are the following: `dashboard`, `admindocs`, `login`, `logout`, `passowrd_change`, `password_change_success`, `add_form`, `change_form`, `changelist`, `filer`, `default`.\n\n### Signals[¶](#signals)\n\nBaton provides a dispatcher that can be used to register function that will be called when some events occurr.\nAt this moment Baton emits four types of events:\n\n* `onNavbarReady`: dispatched when the navbar is fully rendered\n* `onMenuReady`: dispatched when the menu is fully rendered (probably the last event fired, since the menu contents are retrieves async)\n* `onTabsReady`: dispatched when the changeform tabs are fully\n* `onMenuError`: dispatched if the request sent to retrieve menu contents fails\n* `onReady`: dispatched when Baton js has finished its sync job\n\nIn order to use them just override the baton admin/base_site.html template and register your listeners **before** calling Baton.init, i.e.\n```\n\n\n\n\n```\n### Js Utilities[¶](#js-utilities)\n\nBaton comes with a number of exported js modules you can use to enhance your admin application.\n\n#### Dispatcher[¶](#dispatcher)\n\nBaton Dispatcher singleton module lets you subscribe to event and dispatch them, making use of the Mediator pattern.\n\nExample:\n```\n// register a callback tied to the event Baton.Dispatcher.register('myAppLoaded', function (evtName, s) { console.log('COOL ' + s) })\n\n// emit the event Baton.Dispatcher.emit('myAppLoaded', 'STUFF!')\n```\n#### Modal[¶](#modal)\n\nBaton Modal class lets you insert some content on a bootstrap modal without dealing with all the markup.\n\nUsage:\n```\n// modal configuration:\n//\n// let config = {\n//     title: 'My modal title',\n//     subtitle: 'My subtitle', // optional\n//     content: '

my html content

', // alternative to url\n// url: '/my/url', // url used to perform an ajax request, the response is put inside the modal body. Alternative to content.\n// hideFooter: false, // optional\n// showBackBtn: false, // show a back button near the close icon, optional\n// backBtnCb: function () {}, // back button click callback (useful to have a multi step modal), optional\n// actionBtnLabel: 'save', // action button label, default 'save', optional\n// actionBtnCb: null, // action button callback, optional\n// onUrlLoaded: function () {}, // callback called when the ajax request has completed, optional\n// size: 'lg', // modal size: sm, md, lg, xl, optional\n// onClose: function () {} // callback called when the modal is closed, optional\n// }\n//\n// constructs a new modal instance\n// let myModal = new Baton.Modal(config)\n\nlet myModal = new Baton.Modal({\n title: 'My modal title',\n content: '

my html content

',\n size: 'lg'\n})\n\nmyModal.open();\nmyModal.close();\n\nmyModal.update({\n title: 'Step 2',\n content: '

cool

'\n})\nmyModal.toggle();\n```\n```\n### Js Translations[¶](#js-translations)\n\nThere are some circustamces in which Baton will print to screen some js message. Baton detects the user locale and will localize such messages, but it comes with just `en` and `it` translations provided.\n\nImportant\n\nBaton retrieves the current user locale from the `lang` attribute of the `html` tag.\n\nHowever you can provide or add your own translations by attaching an object to the Baton namespace:\n```\n// these are the default translations, you can just edit the one you need, or add some locales. Baton engione will always\n// pick up your custom translation first, if it find them.\n// you can define thi object before Baton.init in the base_site template Baton.translations = {\n unsavedChangesAlert: 'You have some unsaved changes.',\n uploading: 'Uploading...',\n filter: 'Filter',\n close: 'Close',\n save: 'Save',\n search: 'Search',\n cannotCopyToClipboardMessage: 'Cannot copy to clipboard, please do it manually: Ctrl+C, Enter',\n retrieveDataError: 'There was an error retrieving the data',\n lightTheme: 'Light theme',\n darkTheme: 'Dark theme',\n}\n```\nImportant\n\nJust use the `trans` templatetag to deal with multilanguage web applications\n\nIf Baton can’t find the translations for the user locale, it will default to `en`. Keep in mind that Baton will use `en` translations for all `en-xx` locales, but of course you can specify your custom translations!\n\n### List Filters[¶](#list-filters)\n\n#### Input Text Filters[¶](#input-text-filters)\n\nIdea taken from this [medium article](https://medium.com/@hakibenita/how-to-add-a-text-filter-to-django-admin-5d1db93772d8).\n\nBaton defines a custom InputFilter class that you can use to create text input filters and use them as any other `list_filters`, for example\n```\n# your app admin\n\nfrom baton.admin import InputFilter\n\nclass IdFilter(InputFilter):\n parameter_name = 'id'\n title = 'id'\n\n def queryset(self, request, queryset):\n if self.value() is not None:\n search_term = self.value()\n return queryset.filter(\n id=search_term\n )\n\nclass MyModelAdmin(admin.ModelAdmin):\n list_filters = (\n 'my_field',\n IdFilter,\n 'my_other_field',\n )\n```\nJust define in the `queryset` method the logic used to retrieve the results.\n\n#### Dropdown Filters[¶](#dropdown-filters)\n\nTaken from the github app [django-admin-list-filter-dropdown](https://github.com/mrts/django-admin-list-filter-dropdown).\n\nBaton provides a dropdown form of the following list filters:\n\n| Django admin filter name | Baton name |\n| --- | --- |\n| SimpleListFilter | SimpleDropdownFilter |\n| AllValuesFieldListFilter | DropdownFilter |\n| ChoicesFieldListFilter | ChoicesDropdownFilter |\n| RelatedFieldListFilter | RelatedDropdownFilter |\n| RelatedOnlyFieldListFilter | RelatedOnlyDropdownFilter |\n\nThe dropdown is visible only if the filter contains at least three options, otherwise the default template is used.\n\nUsage:\n```\nfrom baton.admin import DropdownFilter, RelatedDropdownFilter, ChoicesDropdownFilter\n\nclass MyModelAdmin(admin.ModelAdmin):\n\n list_filter = (\n # for ordinary fields\n ('a_charfield', DropdownFilter),\n # for choice fields\n ('a_choicefield', ChoiceDropdownFilter),\n # for related fields\n ('a_foreignkey_field', RelatedDropdownFilter),\n )\n```\n#### Multiple Choice Filters[¶](#multiple-choice-filters)\n\nBaton defines a custom MultipleChoiceListFilter class that you can use to filter on multiple options, for example:\n```\n# your app admin\n\nfrom baton.admin import MultipleChoiceListFilter\n\nclass StatusListFilter(MultipleChoiceListFilter):\n title = 'Status'\n parameter_name = 'status__in'\n\n def lookups(self, request, model_admin):\n return News.Status.choices\n\nclass MyModelAdmin(admin.ModelAdmin):\n list_filters = (\n 'my_field',\n StatusListFilter,\n 'my_other_field',\n )\n```\n### Changelist includes[¶](#changelist-includes)\n\nImportant\n\nIn order for this feature to work, the user browser must support html template tags.\n\nBaton lets you include templates directly inside the change list page, in any position you desire. It’s as simple as specifying the template path and the position of the template:\n```\n@admin.register(News)\nclass NewsAdmin(admin.ModelAdmin):\n #...\n baton_cl_includes = [\n ('news/admin_include_top.html', 'top', ),\n ('news/admin_include_below.html', 'below', )\n ]\n```\nIn this case, Baton will place the content of the `admin_include_top.html` template at the top of the changelist section (above the search field), and the content of the `admin_include_below.html` below the changelist form.\n\nYou can specify the following positions:\n\n| Position | Description |\n| --- | --- |\n| top | the template is placed inside the changelist form, at the top |\n| bottom | the template is placed inside the changelist form, at the bottom |\n| above | the template is placed above the changelist form |\n| below | the template is placed below the changelist form |\n\nAnd, of course, you can access the all the changelist view context variables inside your template.\n\n### Changelist filters includes[¶](#changelist-filters-includes)\n\nImportant\n\nIn order for this feature to work, the user browser must support html template tags.\n\nBaton lets you include templates directly inside the change list filter container, at the top or the bottom. It’s as simple as specifying the template path and the position of the template:\n```\n@admin.register(News)\nclass NewsAdmin(admin.ModelAdmin):\n #...\n baton_cl_filters_includes = [\n ('news/admin_filters_include_top.html', 'top', ),\n ('news/admin_filters_include_below.html', 'bottom', )\n ]\n```\nYou can specify the following positions:\n\n| Position | Description |\n| --- | --- |\n| top | the template is placed inside the changelist filters container, at the top |\n| bottom | the template is placed inside the changelist filters container, at the bottom |\n\nAnd, of course, you can access the all the changelist view context variables inside your template.\n\n### Changelist Row Attributes[¶](#changelist-row-attributes)\n\nImportant\n\nIn order for this feature to work, the user browser must support html template tags.\n\nWith Baton you can add every kind of html attribute (including css classes) to any element in the changelist table (cell, rows, …)\n\nIt’s a bit tricky, let’s see how:\n\n1. Add a `baton_cl_rows_attributes` function to your `ModelAdmin` class, which takes `request` and `cl` (changelist view) as parameters.\n2. Return a json dictionary where the keys are used to match an element and the values specifies the attributes and other rules to select the element.\n\nBetter to see an example:\n```\nclass NewsModelAdmin(admin.ModelAdmin):\n # ...\n\n def get_category(self, instance):\n return mark_safe('%s' % (instance.id, str(instance.category)))\n get_category.short_description = 'category'\n\n def baton_cl_rows_attributes(self, request, cl):\n data = {}\n for news in cl.queryset.filter(category__id=2):\n data[news.id] = {\n 'class': 'table-info',\n }\n data[news.id] = {\n 'class': 'table-success',\n 'data-lol': 'lol',\n 'title': 'A fantasctic tooltip!',\n 'selector': '.span-category-id-%d' % 1,\n 'getParent': 'td',\n }\n return json.dumps(data)\n```\nIn such case we’re returning a dictionary with possibly many keys (each key is an id of a news instance).\n\nThe first kind of dictionary elements will add a `table-info` class to the `tr` (rows) containing the news respecting the rule `category__id=2`\n\nThe second kind of element instead uses some more options to customize the element selection: you can specify a css selector, and you can specify if Baton should then take one of its parents, and in such case you can give a parent selector also.\nIn the example provided Baton will add the class `table-success`, `data-attribute` and the `title` attribute to the cell which contains the element `.span-category-id-1`.\n\nSo these are the rules:\n\n* the default `selector` is `#result_list tr input[name=_selected_action][value=' + key + ']`, meaning that it can work only if the model is editable (you have the checkox inputs for selecting a row), and selects the row of the instance identified by `key`. If you use a custom selector the dictionary `key` is unuseful.\n* the default `getParent` is `tr`. You can change it at you will, or set it to False, in such case the element to which apply the given attributes will be the one specified by `selector`.\n* Every other key different from `selector` and `getParent` will be considered an attribute and added to the element.\n\n### Form tabs[¶](#form-tabs)\n\nBaton provides an easy way to define form tabs in yor change form templates. Everything is done through javascript and you only need to add some classes you your `ModelAdmin` fieldsets\n```\nfrom django.contrib import admin from .models import Item, Attribute, Feature\n\nclass AttributeInline(admin.StackedInline):\n model = Attribute\n extra = 1\n\nclass FeatureInline(admin.StackedInline):\n model = Feature\n extra = 1\n\nclass ItemAdmin(admin.ModelAdmin):\n list_display = ('label', 'description', 'main_feature', )\n inlines = [AttributeInline, FeatureInline, ]\n\n fieldsets = (\n ('Main', {\n 'fields': ('label', ),\n 'classes': ('baton-tabs-init', 'baton-tab-inline-attribute', 'baton-tab-fs-content', 'baton-tab-group-fs-tech--inline-feature', ),\n 'description': 'This is a description text'\n\n }),\n ('Content', {\n 'fields': ('text', ),\n 'classes': ('tab-fs-content', ),\n 'description': 'This is another description text'\n\n }),\n ('Tech', {\n 'fields': ('main_feature', ),\n 'classes': ('tab-fs-tech', ),\n 'description': 'This is another description text'\n\n }),\n )\n```\n#### Rules[¶](#rules)\n\n* Inline classes remain the same, no action needed\n* In the first fieldset define a `baton-tabs-init` class which enables tabs\n* On the first fieldset, you can add an `order-[NUMBER]` class, which will be used to determined in which position to place the first fieldset. The order starts from 0, and if omitted, the first fieldset has order 0. If you assign for example the class `order-2` to the first fieldset, then the first fieldset will be the third tab, while all other tabs will respect the order of declaration.\n* For every `InLine` you want to put in a separate tab, add a class `baton-tab-inline-MODELNAME` or `baton-tab-inline-RELATEDNAME` if you’ve specified a related_name to the foreign key\n* For every fieldset you want to put in a separate tab, add a class `baton-tab-fs-CUSTOMNAME`, and add a class `tab-fs-CUSTOMNAME` on the fieldset\n* For every group you want to put in a separate tab, add a class `baton-tab-group-ITEMS`, where items can be inlines (`inline-RELATEDNAME`) and/or fieldsets (`fs-CUSTOMNAME`) separated by a double hypen `--`. Also add a class `tab-fs-CUSTOMNAME` on the fieldset items.\n* Tabs order respects the defined classes order\n* Fieldsets without a specified tab will be added to the main tab. If you want the fieldset to instead display outside of any tabs, add a class `tab-fs-none` to the fieldset. The fieldset will then always be visible regardless of the current tab.\n\nOther features:\n\n* when some field has an error, the first tab containing errors is opened automatically\n* you can open a tab on page load just by adding an hash to the url, i.e. #inline-feature, #fs-content, #group-fs-tech–inline-feature\n\n### Form includes[¶](#form-includes)\n\nImportant\n\nIn order for this feature to work, the user browser must support html template tags.\n\nBaton lets you include templates directly inside the change form page, in any position you desire. It’s as simple as specifying the template path, the field name used as anchor and the position of the template:\n```\n@admin.register(News)\nclass NewsAdmin(admin.ModelAdmin):\n #...\n baton_form_includes = [\n ('news/admin_datetime_include.html', 'datetime', 'top', ),\n ('news/admin_content_include.html', 'content', 'above', )\n ]\n```\nIn this case, Baton will place the content of the `admin_datetime_include.html` template at the top of the datetime field row, and the content of the `admin_content_include.html` above the content field row.\n\nYou can specify the following positions:\n\n| Position | Description |\n| --- | --- |\n| top | the template is placed inside the form row, at the top |\n| bottom | the template is placed inside the form row, at the bottom |\n| above | the template is placed above the form row |\n| below | the template is placed below the form row |\n| right | the template is placed inline at the field right side |\n\nAnd, of course, you can access the {{ original }} object variable inside your template.\n\nIt works seamlessly with the tab facility, if you include content related to a field inside one tab, then the content will be placed in the same tab.\n\n### Collapsable StackedInline entries[¶](#collapsable-stackedinline-entries)\n\nBaton lets you collapse single stacked inline entries, just add a collapse-entry class to the inline, with or without the entire collapse class\n```\nclass VideosInline(admin.StackedInline):\n model = Video\n extra = 1\n classes = ('collapse-entry', ) # or ('collapse', 'collapse-entry', )\n```\nAnd if you want the first entry to be initially expanded, add also the expand-first class\n```\nclass VideosInline(admin.StackedInline):\n model = Video\n extra = 1\n classes = ('collapse-entry', 'expand-first', )\n```\nAdvanced customization[¶](#advanced-customization)\n---\n\n### Customization[¶](#customization)\n\nIt’s easy to heavily customize the appeareance of baton. All the stuff is compiled from a modern js app which resides in baton/static/baton/app.\n\n#### The Baton js app[¶](#the-baton-js-app)\n\nThe js app which **baton** provides is a modern js app, written using es2015 and stage-0 code features, which are then transpiled to a code browsers can understand using [babel](https://babeljs.io/) and [webpack](https://webpack.github.io/).\n\nAll css are written using sass on top of bootstrap 4.5.0, and transpiled with babel so that the final output is a single js file ready to be included in the html template.\n\nThe app entry point is [index.js](https://github.com/otto-torino/django-baton/blob/master/baton/static/baton/app/src/index.js), where the only variable attached to the window object `Baton` is defined.\n\nAll the js modules used are inside the [core](https://github.com/otto-torino/django-baton/tree/master/baton/static/baton/app/src/core) directory.\n\n#### Change the baton appearance[¶](#change-the-baton-appearance)\n\nIt’s quite easy to change completely the appearance of baton, just overwrite the [sass variables](https://github.com/otto-torino/django-baton/blob/master/baton/static/baton/app/src/styles/_variables.scss) as you like and recompile the app. Then make sure to serve your recompiled app in place of the baton one.\n\nHere comes what you have to do:\n\n* place one of your django apps before baton in the INSTALLED_APPS settings, I’ll call this app ROOTAPP\n* clone the repository (or copy the static/baton/app dir from your virtualenv)\n```\n$ git clone https://github.com/otto-torino/django-baton.git\n```\n* install the app requirements\n```\n$ cd django-baton/baton/static/baton/app/\n$ npm install\n```\n* edit the `src/styles/_variables.scss` file as you like\n* recompile the app\n```\n$ npm run compile\n```\n* copy the generated bundle `dist/baton.min.js` in `ROOTAPP/static/baton/app/dist/`\n\nYou can also perform live development, in this case:\n\n* place one of your django apps before baton in the INSTALLED_APPS settings, I’ll call this app ROOTAPP\n* create an admin base_site template `ROOTAPP/templates/admin/base_site.html` with the following content:\n```\n{% baton_config as conf %}\n{{ conf | json_script:\"baton-config\" }}\n\n\n\n\n\n\n```\n* or you can edit directly the baton template and switch the comment of the two lines:\n```\n\n\n```\n* start the webpack development server\n```\n$ npm run dev\n```\nNow while you make your changes to the js app (css included), webpack will update the bundle automatically, so just refresh the page and you’ll see your changes.\n\nScreenshots[¶](#screenshots)\n---"}}},{"rowIdx":457,"cells":{"project":{"kind":"string","value":"Java%20-%20Mattone%20dopo%20mattone.pdf"},"source":{"kind":"string","value":"free_programming_book"},"language":{"kind":"string","value":"Unknown"},"content":{"kind":"string","value":"Versione 0.1.5 Rilascio del 09/03/2001\nTitolo Originale Java Enterprise Computing Copyrigth per la prima edizione\n Copyrigth per ledizione corrente\n Coordinamento Editoriale Progetto Editoriale PRIMA EDIZIONE http://www.java-net.tv 2\nSe in un primo momento l'idea non assurda, allora non c' nessuna speranza che si realizzi.\n http://www.java-net.tv 3\nGli sponsor di Java Mattone Dopo Mattone Questo spazio libero Questo spazio libero http://www.java-net.tv 4\nQuesto spazio libero Questo spazio libero Questo spazio libero Questo spazio libero http://www.java-net.tv 5\nIndice Analitico GLI SPONSOR DI JAVA MATTONE DOPO MATTONE ... 4 INDICE ANALITICO ... 6 JAVA MATTONE DOPO MATTONE ... 14 INTRODUZIONE ... 14 PREMESSE... 14 CAPITOLO 1 ... 17 INTRODUZIONE ALLA PROGRAMMAZIONE OBJECT ORIENTED ... 17 INTRODUZIONE ... 17 UNA EVOLUZIONE NECESSARIA... 18 IL PARADIGMA PROCEDURALE ... 18 CORREGGERE GLI ERRORI PROCEDURALI ... 19 IL PARADIGMA OBJECT ORIENTED ... 21 CLASSI DI OGGETTI ... 21 EREDITARIET ... 21 IL CONCETTO DI EREDITARIET NELLA PROGRAMMAZIONE ... 22 VANTAGGI NELLUSO DELLEREDITARIET ... 23 PROGRAMMAZIONE OBJECT ORIENTED ED INCAPSULAMENTO... 23 I VANTAGGI DELLINCAPSULAMENTO ... 24 ALCUNE BUONE REGOLE PER CREARE OGGETTI ... 25 CAPITOLO 2 ... 26 INTRODUZIONE AL LINGUAGGIO JAVA ... 26 INTRODUZIONE ... 26 LA STORIA DI JAVA ... 26 LE CARATTERISTICHE PRINCIPALI DI JAVA INDIPENDENZA DALLA PIATTAFORMA......26 LE CARATTERISTICHE PRINCIPALI DI JAVA USO DELLA MEMORIA E MULTI-THREADING\n... 28 MECCANISMO DI CARICAMENTO DELLE CLASSI DA PARTE DELLA JVM... 29 IL JAVA DEVELOPMENT KIT (JDK) ... 29 SCARICARE ED INSTALLARE IL JDK ... 30 IL COMPILATORE JAVA (JAVAC)... 31 IL DEBUGGER JAVA (JDB)... 31 LINTERPRETE JAVA ... 31 CAPITOLO 3 ... 33 INTRODUZIONE ALLA SINTASSI DI JAVA... 33 INTRODUZIONE ... 33 VARIABILI ... 33 Massimiliano Tarquini http://www.java-net.tv 6\nINIZIALIZZAZIONE DI UNA VARIABILE ... 34 VARIABILI FINAL ... 34 OPERATORI ... 34 OPERATORI ARITMETICI ... 36 OPERATORI RELAZIONALI ... 37 OPERATORI CONDIZIONALI ... 38 OPERATORI LOGICI E DI SHIFT BIT A BIT ... 38 OPERATORI DI ASSEGNAMENTO ... 40 ESPRESSIONI ... 41 ISTRUZIONI ... 41 REGOLE SINTATTICHE DI JAVA ... 41 BLOCCHI DI ISTRUZIONI ... 42 METODI ... 42 DEFINIRE UNA CLASSE... 43 VARIABILI REFERENCE ... 44 VISIBILIT DI UNA VARIABILE JAVA ... 46 LOGGETTO NULL ... 47 CREARE ISTANZE ... 47 LOPERATORE PUNTO .... 48 AUTO REFERENZA ED AUTO REFERENZA ESPLICITA ... 49 AUTO REFERENZA IMPLICITA ... 49 STRINGHE ... 51 STATO DI UN OGGETTO JAVA ... 51 COMPARAZIONE DI OGGETTI ... 51 METODI STATICI ... 52 IL METODO MAIN... 53 LOGGETTO SYSTEM ... 53 LABORATORIO 3 ... 55 INTRODUZIONE ALLA SINTASSI DI JAVA... 55 DESCRIZIONE ... 55 ESERCIZIO 1... 55 SOLUZIONE AL PRIMO ESERCIZIO ... 57 CAPITOLO 4 ... 59 CONTROLLO DI FLUSSO E DISTRIBUZIONE DI OGGETTI ... 59 INTRODUZIONE ... 59 ISTRUZIONI PER IL CONTROLLO DI FLUSSO ... 59 LISTRUZIONE IF ... 60 LISTRUZIONE IF-ELSE ... 60 ISTRUZIONI IF, IF-ELSE ANNIDATE ... 61 CATENE IF-ELSE-IF ... 61 LISTRUZIONE SWITCH ... 62 LISTRUZIONE WHILE ... 64 LISTRUZIONE DO-WHILE ... 65 LISTRUZIONE FOR ... 65 ISTRUZIONE FOR NEI DETTAGLI ... 66 http://www.java-net.tv 7\nISTRUZIONI DI RAMIFICAZIONE ... 66 LISTRUZIONE BREAK ... 67 LISTRUZIONE CONTINUE... 67 LISTRUZIONE RETURN ... 68 PACKAGE JAVA ... 68 ASSEGNAMENTO DI NOMI A PACKAGE ... 68 CREAZIONE DEI PACKAGE SU DISCO ... 69 IL MODIFICATORE PUBLIC ... 70 LISTRUZIONE IMPORT ... 71 LABORATORIO 4 ... 72 CONTROLLO DI FLUSSO E DISTRIBUZIONE DI OGGETTI ... 72 ESERCIZIO 1... 72 ESERCIZIO 2... 72 SOLUZIONE AL PRIMO ESERCIZIO ... 73 SOLUZIONE AL SECONDO ESERCIZIO... 73 CAPITOLO 5 ... 74 INCAPSULAMENTO ... 74 INTRODUZIONE ... 74 MODIFICATORI PUBLIC E PRIVATE ... 75 PRIVATE ... 75 PUBLIC ... 75 IL MODIFICATORE PROTECTED ... 76 UN ESEMPIO DI INCAPSULAMENTO ... 77 LOPERATORE NEW ... 77 COSTRUTTORI ... 78 UN ESEMPIO DI COSTRUTTORI ... 79 OVERLOADING DEI COSTRUTTORI ... 80 RESTRIZIONE SULLA CHIAMATA AI COSTRUTTORI ... 81 CROSS CALLING TRA COSTRUTTORI ... 82 LABORATORIO 5 ... 84 INCAPSULAMENTO DI OGGETTI... 84 ESERCIZIO 1... 84 SOLUZIONE DEL PRIMO ESERCIZIO... 85 CAPITOLO 6 ... 86 EREDITARIET ... 86 INTRODUZIONE ... 86 DISEGNARE UNA CLASSE BASE... 86 OVERLOAD DI METODI... 87 ESTENDERE UNA CLASSE BASE... 89 EREDITARIET ED INCAPSULAMENTO... 89 http://www.java-net.tv 8\nEREDITARIET E COSTRUTTORI... 90 AGGIUNGERE NUOVI METODI ... 92 OVERRIDING DI METODI ... 92 CHIAMARE METODI DELLA CLASSE BASE ... 93 FLESSIBILIT DELLE VARIABILI REFERENCE ... 94 RUN-TIME E COMPILE-TIME ... 94 ACCESSO A METODI ATTRAVERSO VARIABILI REFERENCE ... 95 CAST DEI TIPI ... 95 LOPERATORE INSTANCEOF ... 96 LOGGETTO OBJECT ... 96 IL METODO EQUALS() ... 97 RILASCIARE RISORSE ESTERNE... 97 RENDERE GLI OGGETTI IN FORMA DI STRINGA... 98 LABORATORIO 6 ... 99 INTRODUZIONE ALLA EREDITARIET ... 99 ESERCIZIO 1... 99 ESERCIZIO 2... 100 SOLUZIONE AL PRIMO ESERCIZIO ... 101 SOLUZIONE AL SECONDO ESERCIZIO... 102 CAPITOLO 7 ... 104 ECCEZIONI... 104 INTRODUZIONE ... 104 ECCEZIONI : PROPAGAZIONE DI OGGETTI ... 104 OGGETTI THROWABLE ... 105 LISTRUZIONE THROW ... 106 ISTRUZIONI TRY / CATCH ... 106 SINGOLI CATCH PER ECCEZIONI MULTIPLE ... 107 LA CLAUSOLA THROWS ... 108 LE ALTRE ISTRUZIONI GUARDIANE. FINALLY... 109 DEFINIRE ECCEZIONI PERSONALIZZATE ... 109 UN ESEMPIO COMPLETO... 110 CAPITOLO 8 ... 113 POLIMORFISMO ED EREDITARIET AVANZATA ... 113 INTRODUZIONE ... 113 POLIMORFISMO : UNINTERFACCIA, MOLTI METODI... 113 INTERFACCE ... 114 DEFINIZIONE DI UNA INTERFACCIA... 114 IMPLEMENTARE UNA INTERFACCIA ... 114 EREDITARIET MULTIPLA IN JAVA ... 115 CLASSI ASTRATTE ... 116 CAPITOLO 9 ... 118 http://www.java-net.tv 9\nJAVA THREADS ... 118 INTRODUZIONE ... 118 THREAD DI SISTEMA ... 118 LA CLASSE JAVA.LANG.THREAD ... 119 INTERFACCIA RUNNABLE... 120 SINCRONIZZARE THREAD ... 121 LOCK ... 122 SINCRONIZZAZIONE DI METODI STATICI... 123 BLOCCHI SINCRONIZZATI ... 124 LABORATORIO 9 ... 125 JAVA THREAD ... 125 ESERCIZIO 1... 125 ESERCIZIO 2... 125 SOLUZIONE AL PRIMO ESERCIZIO ... 126 SOLUZIONE AL SECONDO ESERCIZIO... 126 CAPITOLO 11 ... 129 JAVA NETWORKING... 129 INTRODUZIONE ... 129 I PROTOCOLLI DI RETE (INTERNET) ... 129 INDIRIZZI IP... 130 COMUNICAZIONE CONNECTION ORIENTED O CONNECTIONLESS ... 132 DOMAIN NAME SYSTEM : RISOLUZIONE DEI NOMI DI UN HOST ... 133 URL... 135 TRASMISSION CONTROL PROTOCOL : TRASMISSIONE CONNECTION ORIENTED ..........135 USER DATAGRAM PROTOCOL : TRASMISSIONE CONNECTIONLESS ... 137 IDENTIFICAZIONE DI UN PROCESSO : PORTE E SOCKET ... 137 IL PACKAGE JAVA.NET ... 139 UN ESEMPIO COMPLETO DI APPLICAZIONE CLIENT/SERVER... 140 LA CLASSE SERVERSOCKET ... 142 LA CLASSE SOCKET ... 142 UN SEMPLICE THREAD DI SERVIZIO ... 143 TCP SERVER ... 143 IL CLIENT ... 145 CAPITOLO 12 ... 147 JAVA ENTERPRISE COMPUTING... 147 INTRODUZIONE ... 147 ARCHITETTURA DI J2EE... 148 J2EE APPLICATION MODEL... 150 CLIENT TIER ... 151 WEB TIER ... 152 BUSINESS TIER... 153 EIS-TIER ... 155 http://www.java-net.tv 10\nLE API DI J2EE ... 156 JDBC : JAVA DATABASE CONNECTIVITY ... 156 RMI : REMOTE METHOD INVOCATION... 158 JAVA IDL ... 159 JNDI ... 159 JMS ... 160 CAPITOLO 13 ... 162 ARCHITETTURA DEL WEB TIER... 162 INTRODUZIONE ... 162 LARCHITETTURA DEL WEB TIER... 162 INVIARE DATI ... 164 SVILUPPARE APPLICAZIONI WEB ... 165 COMMON GATEWAY INTERFACE ... 165 ISAPI ED NSAPI... 166 ASP ACTIVE SERVER PAGES ... 166 JAVA SERVLET E JAVASERVER PAGES ... 167 CAPITOLO 14 ... 168 JAVA SERVLET API ... 168 INTRODUZIONE ... 168 IL PACKAGE JAVAX.SERVLET ... 168 IL PACKAGE JAVAX.SERVLET.HTTP... 169 CICLO DI VITA DI UNA SERVLET ... 170 SERVLET E MULTITHREADING ... 171 LINTERFACCIA SINGLETHREADMODEL ... 172 UN PRIMO ESEMPIO DI CLASSE SERVLET ... 172 IL METODO SERVICE()... 173 CAPITOLO 15 ... 175 SERVLET HTTP... 175 INTRODUZIONE ... 175 IL PROTOCOLLO HTTP 1.1 ... 175 RICHIESTA HTTP... 176 RISPOSTA HTTP ... 178 ENTIT ... 179 I METODI DI REQUEST ... 180 INIZIALIZZAZIONE DI UNA SERVLET ... 180 LOGGETTO HTTPSERVLETRESPONSE ... 181 I METODI SPECIALIZZATI DI HTTPSERVLETRESPONSE ... 183 NOTIFICARE ERRORI UTILIZZANDO JAVA SERVLET ... 184 LOGGETTO HTTPSERVLETREQUEST ... 184 INVIARE DATI MEDIANTE LA QUERY STRING ... 186 QUERY STRING E FORM HTML ... 187 I LIMITI DEL PROTOCOLLO HTTP : COOKIES ... 189 http://www.java-net.tv 11\nMANIPOLARE COOKIES CON LE SERVLET ... 189 UN ESEMPIO COMPLETO... 190 SESSIONI UTENTE ... 191 SESSIONI DAL PUNTO DI VISTA DI UNA SERVLET... 191 LA CLASSE HTTPSESSION ... 192 UN ESEMPIO DI GESTIONE DI UNA SESSIONE UTENTE ... 193 DURATA DI UNA SESSIONE UTENTE ... 194 URL REWRITING ... 194 CAPITOLO 16 ... 196 JAVASERVER PAGES ... 196 INTRODUZIONE ... 196 JAVASERVER PAGES ... 196 COMPILAZIONE DI UNA PAGINA JSP... 198 SCRIVERE PAGINE JSP... 198 INVOCARE UNA PAGINA JSP DA UNA SERVLET ... 199 CAPITOLO 17 ... 201 JAVASERVER PAGES NOZIONI AVANZATE... 201 INTRODUZIONE ... 201 DIRETTIVE ... 201 DICHIARAZIONI... 202 SCRIPTLETS ... 202 OGGETTI IMPLICITI : REQUEST ... 203 OGGETTI IMPLICITI : RESPONSE... 203 OGGETTI IMPLICITI : SESSION... 204 CAPITOLO 18 ... 205 JDBC ... 205 INTRODUZIONE ... 205 ARCHITETTURA DI JDBC ... 205 DRIVER DI TIPO 1 ... 206 DRIVER DI TIPO 2 ... 207 DRIVER DI TIPO 3 ... 207 DRIVER DI TIPO 4 ... 209 UNA PRIMA APPLICAZIONE DI ESEMPIO... 209 RICHIEDERE UNA CONNESSIONE AD UN DATABASE ... 211 ESEGUIRE QUERY SUL DATABASE... 212 LOGGETTO RESULTSET ... 212 APPENDICE A ... 216 JAVA TIME-LINE ... 216 1995-1996... 216 1997... 216 http://www.java-net.tv 12\n1998... 217 1999... 218 2000... 219 APPENDICE B... 220 GLOSSARIO DEI TERMINI ... 220 BIBLIOGRAFIA... 224 http://www.java-net.tv 13\nJava Mattone dopo Mattone Introduzione\nPremesse La guerra dei desktop ormai persa, ma con Java 2 Enterprise Edition la Sun Microsystem ha trasformato un linguaggio in una piattaforma di sviluppo integrata diventata ormai standard nel mondo del Server Side Computing.\nPer anni, il mondo della IT ha continuato a spendere soldi ed energie in soluzioni proprietarie tra loro disomogenee dovendo spesso reinvestire in infrastrutture tecnologiche per adattarsi alle necessit emergenti di mercato.\nNella ultima decade di questo secolo con la introduzione di tecnologie legate ad Internet e pi in generale alle reti, lindustria del software ha immesso sul mercato circa 30 application server, ognuno con un modello di programmazione specifico.\nCon la nascita di nuovi modelli di business legati al fenomeno della neweconomy, la divergenza di tali tecnologie diventata in breve tempo un fattore destabilizzante ed il maggior ostacolo alla innovazione tecnologica. Capacit di risposta in tempi brevi e produttivit con lunghi margini temporali sono diventate oggi le chiavi del successo di applicazioni enterprise.\nCon la introduzione della piattaforma J2EE, la Sun ha proposto non pi una soluzione proprietaria, ma una architettura basata su tecnologie aperte e portabili proponendo un modello in grado di accelerare il processo di implementazione di soluzioni server-sideattraverso lo sviluppo di funzionalit nella forma di Enterprise Java Beans in grado di girare su qualsiasi application server compatibile con lo standard.\nOltre a garantire tutte le caratteristiche di portabilit (Write Once Run Everywhere) del linguaggio Java, J2EE fornisce:\nUn modello di sviluppo semplificato per l enterprise computing - La piattaforma offre ai vendors di sistemi la capacit di fornire una soluzione che lega insieme molti tipi di middleware in un unico ambiente, riducendo tempi di sviluppo e costi necessari alla integrazioni di componenti software di varia natura. J2EE permette di creare ambienti server side contenenti tutti i middletiers di tipo server come connettivit verso database, ambienti transazionale, servizi di naming ecc.;\nUna architettura altamente scalabile - La piattaforma fornisce la scalabilit necessaria allo sviluppo di soluzione in ambienti dove le applicazioni scalano da prototipo di lavoro ad architetture 24x7 enterprise wide;\nLegacy Connectivity La piattaforma consente lintegrabilit di soluzioni pre esistenti in ambienti legacy consentendo di non reinvestire in nuove soluzioni;\nPiattaforme Aperte J2EE uno standard aperto. La Sun in collaborazione con partner tecnologici garantisce ambienti aperti per specifiche e portabilit;\nSicurezza La piattaforma fornisce un modello di sicurezza in grado di proteggere dati in applicazioni Internet;\nAlla luce di queste considerazioni si pu affermare che la soluzione offerta da Sun abbia traghettato lenterprise computingin una nuova era in cui le applicazioni usufruiranno sempre pi di tutti i vantaggi offerti da uno standard aperto.\n http://www.java-net.tv 14\n http://www.java-net.tv 15\nParte Prima La programmazione Object Oriented http://www.java-net.tv 16\nCapitolo 1 Introduzione alla programmazione Object Oriented Introduzione\nQuesto capitolo dedicato al paradigma Object Orientede cerca di fornire ai neofiti della programmazione in Java i concetti base necessari allo sviluppo di applicazioni Object Oriented.\nIn realt le problematiche che andremo ad affrontare nei prossimi paragrafi sono estremamente complesse e trattate un gran numero di testi che non fanno alcuna menzione a linguaggi di programmazione, quindi limiter la discussione soltanto ai concetti pi importanti. Procedendo nella comprensione del nuovo modello di programmazione risulter chiara levoluzione che, a partire dallapproccio orientato a procedure e funzioni e quindi alla programmazione dal punto di vista del calcolatore,\nporta oggi ad un modello di analisi che, partendo dal punto di vista dellutente suddivide lapplicazione in concetti rendendo il codice pi comprensibile e semplice da mantenere.\nIl modello classico conosciuto come paradigma procedurale, pu essere riassunto in due parole: Divide et Impera ossia dividi e conquista. Difatti secondo il paradigma procedurale, un problema complesso viene suddiviso in problemi pi semplici in modo che siano facilmente risolvibili mediante programmi procedurali.\nE chiaro che in questo caso, lattenzione del programmatore accentrata al problema.\nA differenza del primo, il paradigma Object Oriented accentra lattenzione verso dati. Lapplicazione viene suddivisa in un insieme di oggetti in grado di interagire tra di loro e codificati in modo tale che la macchina sia in gradi di comprenderli.\nIl primo cambiamento evidente quindi a livello di disegno della applicazione. Di fatto lapproccio Object Oriented non limitato a linguaggi come Java o C++ . Molte applicazione basate su questo modello sono state scritte con linguaggi tipo C o Assembler. Un linguaggio Object Oriented semplifica il meccanismo di creazione degli Oggetti allo stesso modo con cui un linguaggio procedurale semplifica la decomposizione in funzioni.\nFigura 1-1 : Evoluzione del modello di programmazione http://www.java-net.tv 17\nUna evoluzione necessaria Quando i programmi erano scritti in assembler, ogni dato era globale e le funzioni andavano disegnate a basso livello. Con lavvento dei linguaggi procedurali come il linguaggio C, i programmi sono diventati pi robusti e semplici da mantenere inquanto il linguaggio forniva regole sintattiche e semantiche che supportate da un compilatore consentivano un maggior livello di astrazione rispetto a quello fornito dallassembler fornendo un ottimo supporto alla decomposizione procedurale della applicazione.\nCon laumento delle prestazione dei calcolatori e di conseguenza con laumento della complessit delle applicazioni, lapproccio procedurale ha iniziato a mostrare i propri limiti rendendo necessario definire un nuovo modello e nuovi linguaggi di programmazione. Questa evoluzione stata schematizzata nella figura 1-1.\nI linguaggi come Java e C++ forniscono il supporto ideale al disegno ad oggetti di applicazioni fornendo un insieme di regole sintattiche e semantiche che aiutano nello sviluppo di oggetti.\nIl paradigma procedurale Secondo il paradigma procedurale il programmatore analizza il problema ponendosi dal punto di vista del computer che solamente istruzioni semplici e, di conseguenza adotta un approccio di tipo divide et impera1. Il programmatore sa perfettamente che una applicazione per quanto complessa pu essere suddivisa in step di piccola entit. Questo approccio stato formalizzato in molti modi ed ben supportato da molti linguaggi che forniscono al programmatore un ambiente in cui siano facilmente definibili procedure e funzioni.\nLe procedure sono blocchi di codice riutilizzabile che possiedono un proprio insieme di dati e realizzano specifiche funzioni. Le funzioni una volta scritte possono essere richiamate ripetutamente in un programma, possono ricevere parametri che modificano il loro stato e possono tornare valori al codice chiamante. Una volta scritte, le procedure possono essere legate assieme a formare un applicazione.\nAllinterno della applicazione quindi necessario che i dati vengano condivisi tra loro. Questo meccanismo si risolve mediante luso di variabili globali, passaggio di parametri e ritorno di valori.\nUna applicazione procedurale tipica ed il suo diagramma di flusso riassunta nella Figura 1-2. Luso di variabili globali genera per problemi di protezione dei dati quando le procedure si richiamano tra di loro. Per esempio nella applicazione mostrata nella Figura 1-2, la procedura outputesegue una chiamata a basso livello verso il terminale e pu essere chiamata soltanto dalla procedura print la quale a sua volta modifica dati globali.\nDal momento che le procedure non sono auto-documentanti(self-documenting)\nossia non rappresentano entit ben definite, un programmatore dovendo modificare la applicazione e non conoscendone a fondo il codice, potrebbe utilizzare la routine Output senza chiamare la procedura Print dimenticando quindi laggiornamento dei dati globali a carico di Print e producendo di conseguenza effetti indesiderati\n(side-effects) difficilmente gestibili.\n1 Divide et Impera ossia dividi e conquista era la tecnica utilizzata dagli antichi romani che sul campo di battaglia dividevano le truppe avversarie per poi batterle con pochi sforzi.\n http://www.java-net.tv 18\nFigura 1-2 : Diagramma di una applicazione procedurale Per questo motivo, le applicazioni basate sul modello procedurale sono difficili da aggiornare e controllare con meccanismi di debug. I bug derivanti da side-effects possono presentarsi in qualunque punto del codice causando una propagazione incontrollata dellerrore. Ad esempio riprendendo ancora la nostra applicazione, una gestione errata dei dati globali dovuta ad una mancata chiamata a Print potrebbe avere effetto su f4()che a sua volta propagherebbe lerrore ad f2()ed f3()fino al maindel programma causando la terminazione anomala del processo.\nCorreggere gli errori procedurali Per risolvere i problemi presentati nel paragrafo precedente i programmatori hanno fatto sempre pi uso di tecniche mirate a proteggere dati globali o funzioni nascondendone il codice. Un modo sicuramente spartano, ma spesso utilizzato,\nconsisteva nel nascondere il codice di routine sensibili (Outputnel nostro esempio)\nallinterno di librerie contando sul fatto che la mancanza di documentazione scoraggiasse un nuovo programmatore ad utilizzare impropriamente queste funzioni.\nIl linguaggio C fornisce strumenti mirati alla circoscrizione del problema come il modificatore static con il fine di delimitare sezioni di codice di una applicazione in grado di accedere a dati globali, eseguire funzioni di basso livello o, evitare direttamente luso di variabili globali.\nQuando si applica il modificatore static ad una variabile locale, viene allocata per la variabile della memoria permanente in modo molto simile a quanto avviene per le variabili globali. Questo meccanismo consente alla variabile dichiarata static di mantenere il proprio valore tra due chiamate successive ad una funzione. A differenza di una variabile locale non statica il cui ciclo di vita (di conseguenza il valore) limitato al tempo necessario per la esecuzione della funzione, il valore di una variabile dichiarata static non andr perduto tra chiamate successive.\nLa differenza sostanziale tra una variabile globale ed una variabile locale static\nche la seconda nota solamente al blocco in cui dichiarata ossia una variabile globale con scopo limitato, vengono inizializzate solo una volta allavvio del Massimiliano Tarquini http://www.java-net.tv 19\nprogramma e non ogni volta che si effettui una chiamata alla funzione in cui sono definite.\nSupponiamo ad esempio di voler scrivere che calcoli la somma di numeri interi passati ad uno ad uno per parametro. Grazie alluso di variabili static sar possibile risolvere il problema nel modo seguente :\nint _sum (int i)\n{\nstatic int sum=0;\nsum=sum+I;\nreturn sum;\n}\nUsando una variabile static, la funzione in grado di mantenere il valore della variabile tra chiamate successive evitando luso di variabili globali.\nIl modificatore static pu essere utilizzato anche con variabili globali. Difatti, se applicato ad un dato globale indica al compilatore che la variabile creata dovr essere nota solamente alle funzioni dichiarate nello stesso file contenente la dichiarazione della variabile. Stesso risultato lo otterremmo applicando il modificatore ad una funzione o procedura.\nQuesto meccanismo consente di suddividere applicazioni procedurali in moduli.\nUn modulo un insieme di dati e procedure logicamente correlate tra di loro in cui le parti sensibili possono essere isolate in modo da poter essere chiamate solo da determinati blocchi di codice. Il processo di limitazione dellaccesso a dati o funzioni\n conosciuto come incapsulamento.\nUn esempio tipico di applicazione suddivisa in moduli schematizzato nella figura 1-3 nella quale rappresentata una nuova versione del modello precedentemente proposto. Il modulo di I/O mette a disposizione degli altri moduli la funzione Printincapsulando la routine Outputed i dati sensibili.\nFigura 1-3 : Diagramma di una applicazione procedurale suddiviso per moduli Questa evoluzione del modello fornisce numerosi vantaggi; i dati ora non sono completamente globali e risultano quindi pi protetti che nel modello precedente,\nlimitando di conseguenza i danni causati da propagazioni anomale dei bug. Inoltre il http://www.java-net.tv 20\nnumero limitato di procedure pubbliche viene in aiuto ad un programmatore che inizi a studiare il codice della applicazione. Questo nuovo modello si avvicina molto al modello proposto dallapproccio Object Oriented.\nIl paradigma Object Oriented Il paradigma Object Oriented formalizza la tecnica vista in precedenza di incapsulare e raggruppare parti di un programma. In generale, il programmatore divide le applicazioni in gruppi logici che rappresentano concetti sia a livello di utente che a livello applicativo. I pezzi che vengono poi riuniti a formare una applicazione.\nScendendo nei dettagli, il programmatore ora inizia con lanalizzare tutti i singoli aspetti concettuali che compongono un programma. Questi concetti sono chiamati oggetti ed hanno nomi legati a ci che rappresentano. Una volta che gli oggetti sono identificati, il programmatore decide di quali attributi (dati) e funzionalit (metodi)\ndotare le entit. Lanalisi infine dovr includere le modalit di interazione tra gli oggetti. Proprio grazie a queste interazioni sar possibile riunire gli oggetti a formare un applicazione.\nA differenza di procedure e funzioni, gli oggetti sono auto-documentanti (selfdocumenting). Una applicazione pu essere scritta a partire da poche informazioni ed in particolar modo il funzionamento interno delle funzionalit di ogni oggetto\ncompletamente nascosto al programmatore (Incapsulamento Object Oriented).\nClassi di Oggetti Concentriamoci per qualche istante su alcuni concetti tralasciando laspetto tecnico del paradigma object oriented e proviamo per un istante a pensare ad un libro. Quando pensiamo ad un libro pensiamo subito ad una classe di oggetti aventi caratteristiche comuni: tutti i libri contengono delle pagine, ogni pagina contiene del testo e le note sono scritte a fondo pagina. Altra cosa che ci viene subito in mente riguarda le azioni che tipicamente compiamo quando utilizziamo un libro: voltare pagina, leggere il testo, guardare le figure etc.\nE interessante notare che utilizziamo il termine libro per generalizzare un concetto relativo a qualcosa che contiene pagine da sfogliare, da leggere o da strappare ossia ci riferiamo ad un insieme di oggetti con attributi comuni, ma comunque composto da entit aventi ognuna caratteristiche proprie che rendono ognuna differente rispetto allaltra.\nPensiamo ora ad un libro scritto in francese. Ovviamente sar comprensibile soltanto a persone in grado di comprendere questa lingua; daltro canto possiamo comunque guardarne i contenuti (anche se privi di senso), sfogliarne le pagine o scriverci dentro. Questo insieme generico di propriet rende un libro utilizzabile da chiunque a prescindere dalle caratteristiche specifiche (nel nostro caso la lingua).\nPossiamo quindi affermare che un libro un oggetto che contiene pagine e contenuti da guardare e viceversa ogni oggetto contenente pagine e contenuti da guardare pu essere classificato come un libro.\nAbbiamo quindi definito una categoria di oggetti che chiameremo classe e che,\nnel nostro caso, fornisce la descrizione generale del concetto di libro. Ogni nuovo libro con caratteristiche proprie apparterr comunque a questa classe base.\nEreditariet Con la definizione di una classe, nel paragrafo precedente abbiamo stabilito che un libro contiene pagine che possono essere girate, scarabocchiate, strappate etc.\n http://www.java-net.tv 21\nFigura 1-4 : Diagramma di una applicazione procedurale suddiviso per moduli Stabilita la classe base, possiamo creare tanti libri purch aderiscano alle regole definite (Figura 1-4). Il vantaggio maggiore nellaver stabilito questa classificazione\nche ogni persona deve conoscere solo le regole base per essere in grado di poter utilizzare qualsiasi libro. Una volta assimilato il concetto di pagina che pu essere sfogliata, si in grado di utilizzare qualsiasi entit classificabile come libro.\nIl concetto di ereditariet nella programmazione Se estendiamo i concetti illustrati alla programmazione iniziamo ad intravederne i reali vantaggi. Una volta stabilite le categorie di base, possiamo utilizzarle per creare tipi specifici di oggetti ereditando e specializzando le regole base.\nFigura 1-5 : Diagramma di ereditariet http://www.java-net.tv 22\nPer definire questo tipo di relazioni viene utilizzata una forma a diagramma in cui la classe generica riportata come nodo sorgente di un grafo orientato i cui sotto nodi rappresentano categorie pi specifiche e gli archi che uniscono i nodi sono orientati da specifico a generale (Figura 1-5).\nUn linguaggio orientato ad oggetti fornisce al programmatore strumenti per rappresentare queste relazioni. Una volta definite classi e relazioni, sar possibile mediante il linguaggio implementare applicazioni in termini di classi generiche;\nquesto significa che una applicazione sar in grado di utilizzare ogni oggetto specifico senza essere necessariamente riscritta, ma limitando le modifiche alle funzionalit fornite dalloggetto per manipolare le sue propriet.\nVantaggi nelluso dellereditariet Come facile intravedere, lorganizzazione degli oggetti fornita dal meccanismo di ereditariet rende semplici le operazioni di manutenzione di una applicazione.\nOgni volta che si renda necessaria una modifica, in genere sufficiente creare un nuovo oggetto allinterno di una classe di oggetti ed utilizzarlo per rimpiazzare uno vecchio ed obsoleto.\nUn altro vantaggio della ereditariet la re-utilizzabilit del codice. Creare una classe di oggetti per definire entit molto di pi che crearne una semplice rappresentazione: per la maggior parte delle classi limplementazione spesso scritta allinterno della descrizione.\nIn Java ad esempio ogni volta che definiamo un concetto, esso viene definito come una classe allinterno della quale viene scritto il codice necessario ad implementare le funzionalit delloggetto per quanto generico esso sia. Se viene creato un nuovo oggetto (e quindi una nuova classe) a partire da un oggetto (classe)\nesistente si dice che la nuova classe deriva dalla originale.\nQuando questo accade, tutte le caratteristiche delloggetto principale diventano parte della nuova classe. Dal momento che la classe derivata eredita le funzionalit della classe predecessore, lammontare del codice da necessario per la nuova classe pesantemente ridotto: il codice della classe di origine stato riutilizzato.\nA questo punto necessario iniziare a definire formalmente alcuni termini. La relazione di ereditariet tra classi espressa in termini di superclasse e sottoclasse. Una superclasse la classe pi generica utilizzata come punto di partenza per derivare nuove classi. Una sottoclasse rappresenta invece una specializzazione di una superclasse.\nEuso comune chiamare una superclasse classe basee una sottoclasse classe derivata. Questi termini sono comunque relativi in quanto una classe derivata pu a sua volta essere una classe base per una classe pi specifica.\nProgrammazione object oriented ed incapsulamento Come gi ampiamente discusso, nella programmazione orientata ad oggetti definiamo oggetti creando rappresentazioni di entit o nozioni da utilizzare come parte di unapplicazione. Per assicurarci che il programma lavori correttamente ogni oggetto deve rappresentare in modo corretto il concetto di cui modello senza che lutente possa disgregarne lintegrit.\nPer fare questo importante che loggetto esponga solo la porzione di codice e dati che il programma deve utilizzare. Ogni altro dato e codice deve essere nascosto affinch sia possibile mantenere loggetto in uno stato consistente. Ad esempio se un http://www.java-net.tv 23\noggetto rappresenta uno stack2 di dati (figura 1-6), lapplicazione dovr poter accedere solo al primo dato dello stack ossia alle funzioni di Push e Pop.\nIl contenitore ed ogni altra funzionalit necessaria alla sua gestione dovr essere protetta rispetto alla applicazione garantendo cos che lunico errore in cui si pu incorrere quello di inserire un oggetto sbagliato in testa allo stack o estrapolare pi dati del necessario. In qualunque caso lapplicazione non sar mai in grado di creare inconsistenze nello stato del contenitore.\nLincapsulamento inoltre localizza tutti i possibili problemi in porzioni ristrette di codice. Una applicazione potrebbe inserire dati sbagliati nello Stack, ma saremo comunque sicuri che lerrore localizzato allesterno delloggetto.\nFigura 1-6 : Stack di dati I vantaggi dellincapsulamento Una volta che un oggetto stato incapsulato e testato, tutto il codice ed i dati associati sono protetti. Modifiche successive al programma non potranno causare rotture nelle le dipendenze tra gli oggetti inquanto non saranno in grado di vedere i legami tra dati ed entit. Leffetto principale sulla applicazione sar quindi quello di localizzare i bugs evitando la propagazione di errori, dotando la applicazione di grande stabilit.\nIn un programma decomposto per funzioni, le procedure tendono ad essere interdipendenti. Ogni modifica al programma richiede spesso la modifica di funzioni condivise cosa che pu propagare un errore alle componenti del programma che le utilizzano.\nIn un programma object oriented, le dipendenze sono sempre strettamente sotto controllo e sono mascherate allinterno delle entit concettuali. Modifiche a programmi di questo tipo riguardano tipicamente la aggiunta di nuovi oggetti, ed il meccanismo di ereditariet ha leffetto di preservare lintegrit referenziale delle entit componenti la applicazione.\nSe invece fosse necessario modificare internamente un oggetto, le modifiche sarebbero comunque limitate al corpo dellentit e quindi confinate allinterno delloggetto che impedir la propagazione di errori allesterno del codice.\n2 Uno Stack di dati una struttura a pila allinterno della quale possibile inserire dati solo sulla cima ed estrarre solo lultimo dato inserito.\n http://www.java-net.tv 24\nAnche le operazioni di ottimizzazione risultano semplificate. Quando un oggetto risulta avere performance molto basse, si pu cambiare facilmente la sua struttura interna senza dovere riscrivere il resto del programma, purch le modifiche non tocchino le propriet gi definite delloggetto.\nAlcune buone regole per creare oggetti Un oggetto deve rappresentare un singolo concetto ben definito.\nRappresentare piccoli concetti con oggetti ben definiti aiuta ad evitare confusione inutile allinterno della applicazione. Il meccanismo dellereditariet rappresenta uno strumento potente per creare concetti pi complessi a partire da concetti semplici.\nUn oggetto deve rimanere in uno stato consistente per tutto il tempo che viene utilizzato, dalla sua creazione alla sua distruzione.\nQualunque linguaggio di programmazione venga utilizzato, bisogna sempre mascherare limplementazione di un oggetto al resto della applicazione.\nLincapsulamento una ottima tecnica per evitare effetti indesiderati e spesso incontrollabili.\nFare attenzione nellutilizzo della ereditariet.\nEsistono delle circostanze in cui la convenienza sintattica della ereditariet porta ad un uso inappropriato della tecnica. Per esempio una lampadina pu essere accesa o spenta. Usando il meccanismo della ereditariet sarebbe possibile estendere queste sue propriet ad un gran numero di concetti come un televisore, un fon etc.. Il modello che ne deriverebbe sarebbe inconsistente e confuso.\n http://www.java-net.tv 25\nCapitolo 2 Introduzione al linguaggio Java Introduzione\nJava un linguaggio di programmazione object oriented indipendente dalla piattaforma, modellato a partire dai linguaggi C e C++ di cui mantiene caratteristiche.\nLindipendenza dalla piattaforma ottenuta grazie alluso di uno strato software chiamato Java Virtual Machine che traduce le istruzioni dei codici binari indipendenti dalla piattaforma generati dal compilatore java, in istruzioni eseguibili dalla macchina locale (Figura 2-1).\nLa natura di linguaggio a oggetti di Java consente di sviluppare applicazioni utilizzando oggetti concettuali piuttosto che procedure e funzioni. La sintassi object oriented di Java supporta la creazione di oggetti concettuali, il che consente al programmatore di scrivere codice stabile e riutilizzabile utilizzando il paradigma object oriented secondo il quale il programma viene scomposto in concetti piuttosto che funzioni o procedure.\nLa sua stretta parentela con il linguaggio C a livello sintattico fa si che un programmatore che abbia gi fatto esperienza con linguaggi come C, C++, Perl sia facilitato nellapprendimento del linguaggio.\nIn fase di sviluppo, lo strato che rappresenta la virtual machine pu essere creato mediante il comando java anche se molti ambienti sono in grado di fornire questo tipo di supporto. Esistono inoltre compilatori specializzati o jit (Just In Time) in grado di generare codice eseguibile dipendente dalla piattaforma.\nInfine Java contiene alcune caratteristiche che lo rendono particolarmente adatto alla programmazione di applicazioni web (client-side e server-side).\nLa storia di Java Durante laprile del 1991, un gruppo di impiegati della SUN Microsystem,\nconosciuti come Green Group iniziarono a studiare la possibilit di creare una tecnologia in grado di integrare le allora attuali conoscenze nel campo del software con lelettronica di consumo.\nAvendo subito focalizzato il problema sulla necessit di avere un linguaggio indipendente dalla piattaforma (il software non doveva essere legato ad un particolare processore) il gruppo inizi i lavori nel tentativo di creare un linguaggio che estendesse il C++. La prima versione del linguaggio fu chiamata Oak e,\nsuccessivamente per motivi di royalty Java.\nAttraverso una serie di eventi, quella che era la direzione originale del progetto sub vari cambiamenti ed il target fu spostato dallelettronica di consumo al world wide web. Il 23 Maggio del 1995 la SUN ha annunciato formalmente Java. Da quel momento in poi il linguaggio stato adottato da tutti i maggiori vendorsdi software incluse IBM, Hewlett Packard e Microsoft.\nIn appendice riportata la Time line della storia del linguaggio a partire dal maggio 1995. I dati sono stati recuperati dal sito della SUN Microsystem allindirizzo http://java.sun.com/features/2000/06/time-line.html.\nLe caratteristiche principali di Java Indipendenza dalla piattaforma Le istruzioni binarie di Java indipendenti dalla piattaforma sono pi comunemente conosciuto come Bytecodes. Il Bytecodes di java prodotto dal compilatore e http://www.java-net.tv 26\nnecessita di uno strato di software, la Java Virtual Machine (che per semplicit indicheremo con JVM), per essere eseguito (Figura 2-1).\nLa JVM un programma scritto mediante un qualunque linguaggio di programmazione dipendente dalla piattaforma, e traduce le istruzioni Java, nella forma di Bytecodes, in istruzioni native del processore locale.\nFigura 2-1: architettura di una applicazione Java Non essendo il Bytecodes legato ad una particolare architettura Hardware,\nquesto fa si che per trasferire una applicazione Java da una piattaforma ad unaltra\nnecessario solamente che la nuova piattaforma sia dotata di una apposita JVM. In presenza di un interprete una applicazione Java potr essere eseguita su qualunque piattaforma senza necessit di essere ricompilata.\nIn alternativa, si possono utilizzare strumenti come i Just In Time Compilers,\ncompilatori in grado di tradurre il Bytecodes in un formato eseguibile su una specifica piattaforma al momento della esecuzione del programma Java. I vantaggi nelluso dei compilatori JIT sono molteplici. La tecnologia JIT traduce il bytecodes in un formato eseguibile al momento del caricamento della applicazione.\nCi consente di migliorare le performance della applicazione che non dovr pi passare per la virtual machine, e allo stesso tempo preserva la caratteristica di portabilit del codice. Lunico svantaggio nelluso di un JIT sta nella perdita di prestazioni al momento del lancio della applicazione che deve essere prima compilata e poi eseguita.\nUn ultimo aspetto interessante della tecnologia Java quello legato agli sviluppi che la tecnologia sta avendo. Negli ultimi anni molti produttori di hardware anno iniziato a rilasciare processori in grado di eseguire direttamente il Bytecode di Java a livello di istruzioni macchina senza luso di una virtual machine.\n http://www.java-net.tv 27\nLe caratteristiche principali di Java Uso della memoria e multi-threading Un problema scottante quando si parla di programmazione la gestione luso della memoria. Uno dei problemi pi complessi da affrontare quando si progetta una applicazione di fatto proprio quello legato al mantenimento degli spazi di indirizzamento del programma, con il risultato che spesso necessario sviluppare complesse routine specializzate nella gestione e tracciamento della memoria assegnata alla applicazione.\nJava risolve il problema alla radice sollevando direttamente il programmatore dallonere della gestione della memoria grazie ad un meccanismo detto Garbage Collector. Il Garbage Collector, tiene traccia degli oggetti utilizzati da una applicazione Java, nonch delle referenze a tali oggetti. Ogni volta che un oggetto non pi referenziato per tutta la durata di una specifica slide di tempo, viene rimosso dalla memoria e la risorsa liberata viene di nuovo messa a disposizione della applicazione che potr continuare a farne uso. Questo meccanismo in grado di funzionare correttamente in quasi tutti i casi anche se molto complessi, ma non si pu dire che completamente esente da problemi.\nEsistono infatti dei casi documentati di fronte ai quali il Garbage Collector non\nin grado di intervenire. Un caso tipico quello della referenza circolare in cui un oggetto A referenzia un oggetto B e viceversa, ma la applicazione non sta utilizzando nessuno dei due come schematizzato nella figura 2-2.\nFigura 2-2: riferimento circolare Java un linguaggio multi-threaded. Il multi-threading consente ad applicazioni Java di sfruttare il meccanismo di concorrenza logica. Parti separate di un programma possono essere eseguite come se fossero (dal punto di vista del programmatore) processate parallelamente. Luso di thread rappresenta un modo semplice di gestire la concorrenza tra processi inquanto gli spazi di indirizzamento della memoria della applicazione sono condivisi con i thread eliminando cos la necessit di sviluppare complesse procedure di comunicazione tra processi.\nInfine Java supporta il metodo detto di Dynamic Loading and Linking. Secondo questo modello, ogni modulo del programma (classe) memorizzato in un determinato file. Quando un programma Java viene eseguito, le classi vengono caricate e stanziate solo al momento del loro effettivo utilizzo. Una applicazione composta da molte classi caricher solamente quelle porzioni di codice che debbono essere eseguite in un determinato istante.\nJava prevede un gran numero di classi pre-compilate che forniscono molte funzionalit come strumenti di i/o o di networking.\n http://www.java-net.tv 28\nMeccanismo di caricamento delle classi da parte della JVM Quando la JVM viene avviata, il primo passo che deve compiere quello di caricare le classi necessarie allavvio della applicazione. Questa fase avviene secondo uno schema temporale ben preciso e schematizzato nella figura 2-3, ed a carico di un modulo interno chiamato launcher.\nFigura 2-3: schema temporale del caricamento delle classi della JVM Le prime ad essere caricate sono le classi di base necessarie alla piattaforma Java per fornire lo strato di supporto alla applicazione a cui fornir lambiente di runtime. Il secondo passo caricare le classi Java appartenenti alle librerie di oggetti messi a disposizione dalla SUN ed utilizzate allinterno della applicazione. Infine vengono caricate le classi componenti lapplicazione e definite dal programmatore.\nPer consentire al launcher di trovare le librerie e le classi utente, necessario specificare esplicitamente la loro locazione su disco. Per far questo necessario definire una variabile di ambiente chiamata CLASSPATH che viene letta sia in fase di compilazione, sia in fase di esecuzione della applicazione.\nLa variabile di ambiente CLASSPATH contiene una serie di stringhe suddivise dal carattere ; e rappresentanti ognuna il nome completo di una archivio3 di classi\n(files con estensione .jar e .zip) o di una directory contenete file con estensione\n.class . Ad esempio, se la classe MiaClasse.java memorizzata su disco nella directory c:\\java\\mieclassi , la variabile classpath dovr contenere una stringa del tipo:\nCLASSPATH=.;.\\;c:\\java\\mieclassi\\; .\nI valori . E .\\ indicano alla JVM che le classi definite dallutente si trovano allinterno della directory corrente o in un package definito a partire dalla directory corrente.\nIl Java Development Kit (JDK)\nJava Development Kit un insieme di strumenti ed utilit ed messo a disposizione gratuitamente da tanti produttori di software. Linsieme base o standard delle funzionalit supportato direttamente da SUN Microsystem ed include un compilatore (javac), una Java Virtual Machine (java), un debugger e tanti altri strumenti necessari allo sviluppo di applicazioni Java. Inoltre il JDK comprende, oltre alle utilit a linea di comando, un completo insieme di classi pre-compilate ed il relativo codice sorgente.\nLa documentazione generalmente distribuita separatamente, rilasciata in formato HTML (Figura2-4) e copre tutto linsieme delle classi rilasciate con il JDK a cui da ora in poi ci riferiremo come alle Java API (Application Program Interface).\n3 Gli archivi di classi verranno trattati esaustivamente nei capitoli successivi.\n http://www.java-net.tv 29\nFigura 2-4: Java Doc Scaricare ed installare il JDK Questo testo fa riferimento alla ultima versione del Java Development Kit rilasciata da SUN nel corso del 2000: il JDK 1.3 . JDK pu essere scaricato gratuitamente insieme a tutta la documentazione dal sito della SUN\n(http://www.javasoft.com), facendo ovviamente attenzione che il prodotto che si sta scaricando sia quello relativo alla piattaforma da utilizzare. Linstallazione del prodotto semplice e, nel caso di piattaforme Microsoft richiede solo la esecuzione di un file auto-installante. Per semplicit da questo momento in poi faremo riferimento a questi ambienti.\nAl momento della istallazione, a meno di specifiche differenti, il JDK crea allinterno del disco principale la directory jdk1.3allinterno della quale istaller tutto il necessario al programmatore. Sotto questa directory verranno create le seguenti sottodirettori:\nc:\\jdk1.3\\bin contenente tutti i comandi java per compilare, le utility di servizio,\noltre che ad una quantit di librerie dll di utilit varie.\nc:\\jdk1.3\\demo contenente molti esempi comprensivi di eseguibili e codici sorgenti;\nc:\\jdk1.3\\include contenente alcune librerie per poter utilizzare chiamate a funzioni scritte in C o C++;\nc:\\jdk1.3\\lib contenente alcune file di libreria tra cui tools.jar contenete le API rilasciate da SUN ;\n http://www.java-net.tv 30\nc:\\jdk1.3\\src contenente il codice sorgente delle classi contenute nellarchivio tools.jar.\nIl compilatore Java (javac)\nIl compilatore java (javac) accetta come argomento da linea di comando il nome di un file che deve terminare con la estensione .java. Il file passato come argomento deve essere un normale file ASCII contenente del codice Java valido.\nIl compilatore processer il contenuto del file e produrr come risultato un file con estensione .class e con nome uguale a quello datogli in pasto contenente il Bytecodes generato dal codice sorgente ed eseguibile tramite virtual machine. I parametri pi comuni che possono essere passati tramite linea di comando al compilatore sono generalmente :\n-O : questa opzione attiva lottimizzazione del codice\n-g : questa opzione attiva il supporto per il debug del codice\n-classpath path : specifica lesatto percorso su disco per trovare le librerie o gli oggetti da utilizzare.\nLultima opzione pu essere omessa purch sia definita la variabile di ambiente CLASSPATH. Ad esempio questi sono i passi da compiere per compilare una applicazione Java utilizzando il command promptdi windows:\nC:\\> set CLASSPATH=c:\\java\\lib\\classes.zip C:\\> c:\\jdk1.3\\bin\\javac O pippo.java C:\\>\nIl debugger Java (JDB)\nIl debugger (jdb) uno strumento utilizzato per effettuare le operazioni di debug di applicazioni Java ed molto simile al debugger standard su sistemi Unix\n(dbx). Per utilizzare il debugger, necessario che le applicazioni siano compilate utilizzando lopzione g C:\\> c:\\jdk1.3\\bin\\javac g pippo.java Dopo che il codice stato compilato, il debugger pu essere utilizzato direttamente chiamando attraverso linea di comando.\nC:\\> c:\\jdk1.3\\bin\\jdb pippo Linterprete Java Linterprete Java (java) utilizzato per eseguire applicazioni Java stand-alone ed accetta argomenti tramite linea di comando da trasmettere al metodo main() della applicazione (nei paragrafi successivi spiegheremo nei dettagli il meccanismo di passaggio di parametri ad una applicazione Java).\nLa linea di comando per attivare linterprete prende la forma seguente:\nC:\\> c:\\jdk1.3\\bin\\java ClassName arg1 arg2 ..\n http://www.java-net.tv tar 31\nLinterprete va utilizzato solamente con file contenenti Bytecodes (ovvero con estensione .class) in particolare in grado di eseguire solo file che rappresentano una applicazione ovvero contengono il metodo statico main() (anche questo aspetto verr approfondito nei capitoli successivi).\nLe informazioni di cui necessita il traduttore sono le stesse del compilatore. E infatti necessario utilizzare la variabile di ambiente CLASSPATH o il parametro a linea di comando classpath per indicare al programma la locazione su disco dei file da caricare.\n http://www.java-net.tv 32\nCapitolo 3 Introduzione alla sintassi di Java Introduzione\nIn questo capitolo verranno trattati gli aspetti specifici del linguaggio Java: le regole sintattiche base per la definizione di classi, linstanziamento di oggetti e la definizione dellentry point di una applicazione.\nPer tutta la durata del capitolo sar importante ricordare i concetti base discussi nei capitoli precedenti , in particolar modo quelli relativi alla definizione di una classe.\nLe definizioni di classe rappresentano il punto centrale dei programmi Java. Le classi hanno la funzione di contenitori logici per dati e codice e facilitano la creazione di oggetti che compongono la applicazione.\nPer completezza il capitolo tratter le caratteristiche del linguaggio necessarie per scrivere piccoli programmi includendo la manipolazione di stringhe e la generazione di output a video.\nVariabili Per scrivere applicazioni Java un programmatore deve poter creare oggetti, e per creare oggetti necessario poter rappresentarne i dati. Il linguaggio mette a disposizione del programmatore una serie di primitive utili alla definizione di oggetti pi complessi.\nPer garantire la portabilit del Bytecodes da una piattaforma ad unaltra Java fissa le dimensioni di ogni dato primitivo . Queste dimensioni sono quindi definite e non variano se passiamo da un ambiente ad un altro, cosa che non succede con gli altri linguaggi di programmazione. I tipi numerici sono da considerarsi tutti con segno.\nLa tabella a seguire schematizza i dati primitivi messi a disposizione da Java.\nPrimitiva boolean\nchar byte\nshort int\nlong float\ndouble void\nDimensione 1-bit 16-bit 8-bit 16-bit 32-bit 64-bit 32-bit 64 -bit\n-\nVal. minimo Unicode 0\n-128\n-2 15\n-2 31\n-2 63 IEEE754\nIEEE754\n-\nVal.Massimo Unicode 2 16 - 1\n+127\n+2 15 - 1\n+2 31 - 1\n+2 63 - 1 IEEE754\nIEEE754\n-\nLa dichiarazione di un dato primitivo in Java ha la seguente forma:\nidentificatore var_name;\ndove lidentificatore uno tra i tipi descritti nella prima colonna della tabella e var_name rappresenta il nome della variabile, pu contenere caratteri alfanumerici ma deve iniziare necessariamente con una lettera. E possibile creare pi di una variabile dello stesso tipo utilizzando una virgola per separare tra di loro i nomi delle variabili:\nidentificatore var_name, var_name, . ;\n http://www.java-net.tv 33\nPer convenzione lidentificatore di una variabile deve iniziare con una lettera minuscola.\nInizializzazione di una variabile Ogni variabile in Java richiede che al momento della dichiarazione le venga assegnato un valore iniziale. Come per il linguaggio c e C++ linizializzazione di una variabile in Java pu essere effettuata direttamente al moneto della sua dichiarazione con la sintassi seguente:\nidentificatore var_name = var_value;\ndove var_value rappresenta un valore legale per il tipo di variabile dichiarata, ed\n= rappresenta loperatore di assegnamento. Ad esempio possibile dichiarare ed inizializzare una variale intera con la riga di codice:\nint mioPrimoIntero = 100;\nIn alternativa, Java assegna ad ogni variabile un valore di default al momento della dichiarazione. La tabella riassume il valore iniziale assegnato dalla JVM nel caso in cui una variabile non venga inizializzata dal programmatore:\nTipo primitivo boolean\nchar byte\nshort int\nlong float\ndouble Valore assegnato dalla JVM false\n\\u0000 0\n0 0\n0L 0.0f 0.0 Variabili final A differenza di molti altri linguaggi, Java non consente di definire costanti. Per far fronte alla mancanza possibile utilizzare il modificatore final. Una variabile dichiarata final si comporta come una costante, pertanto le deve essere assegnato il valore iniziale al momento della sua dichiarazione utilizzando loperatore = di assegnamento.\nfinal identificatore var_name = var_value;\nLe variabili di questo tipo vengono inizializzate solo una volta al momento della dichiarazione. Qualsiasi altro tentativo di assegnamento si risolver in un errore di compilazione.\nOperatori Una volta definito, un oggetto deve poter manipolare i dati. Java mette a disposizione del programmatore una serie di operatori utili allo scopo. Nella tabella a seguire sono stati elencati la maggior parte degli operatori Java ordinati secondo lordine di precedenza; dal pi alto al pi basso. Gran parte degli operatori Java sono stati importati dal set degli operatori del linguaggio C, a cui ne sono stati aggiunti http://www.java-net.tv 34\nnuovi allo scopo di supportare le nuove funzionalit messe a disposizione da questo linguaggio.\nTutti gli operatori funzionano solamente con dati primitivi a parte gli operatori !=,\n== e = che hanno effetto anche se gli operandi sono rappresentati da oggetti. Inoltre la classe String utilizza gli operatori + e += per operazioni di concatenazione.\nCome in C, gli operatori di uguaglianza e disuguaglianza sono == (uguale a) e !=\n(non uguale a). Si nota subito la disuguaglianza con gli stessi operatori come definiti dallalgebra: = e <>. Luso delloperatore digrafo4 == necessario dal momento che =\n utilizzato esclusivamente come operatore di assegnamento. Loperatore !=\ncompare in questa forma per consistenza con la definizione delloperatore logico !\n(NOT).\nOperatori\n++ -- + - ?\nFunzioni Aritmetiche unarie e booleane\n*\nAritmetiche\n+\n/\n%\n-\nAddizione, sottrazione e concatenazione\n<< >> >>>\nShift di bit\n< <= > >= instanceof Comparazione\n== !=\nUguaglianza e disuguaglianza\n&\n(bit a bit) AND\n^\n(bit a bit) XOR\n|\n(bit a bit) OR\n&&\nAND Logico\n||\nOR Logico\n!\nNOT Logico expr ? expr :expr Condizione a tre\n= *= /+ %= += -= <<=\n>>>= n &= ^= |=\nAssegnamento e di combinazione Anche gli operatori bit a bite logici derivano dal C sono completamente separati tra di loro. Ad esempio loperatore & utilizzato per combinare due interi bit per bit e loperatore && utilizzato per eseguire loperazione di AND logico tra due espressioni booleane.\nQuindi mentre (1011 & 1001) restituir 1001 (a == a && b != b) restituir false.\nLa differenza con C, sta nel fatto che gli operatori logici in Java sono di tipo shortcircuitossia, se il lato sinistro di una espressione fornisce informazioni sufficienti a completare lintera operazione, il lato destro della espressione non verr valutato.\nPer esempio, si consideri lespressione booleana 4\nGli operatori digrafi sono operatori formati dalla combinazione di due simboli. I due simboli debbono essere adiacenti ed ordinati.\n http://www.java-net.tv 35\n( a == a ) || ( b == c )\nLa valutazione del lato sinistro dellespressione fornisce valore true. Dal momento che si tratta di una operazione di OR logico, non c motivo a proseguire nella valutazione del lato sinistro della espressione, cos che b non sar mai comparato con c. Questo meccanismo allapparenza poco utile, si rivela invece estremamente valido nei casi di chiamate a funzioni complesse per controllare la complessit della applicazione. Se infatti scriviamo una chiamata a funzione nel modo seguente :\n( A == B ) && ( f() == 2 )\ndove f() una funzione arbitrariamente complessa, f() non sar eseguita se A non uguale a B.\nSempre dal C Java eredita gli operatori unari di incremento e decremento ++ e --:\ni++ equivale a i=i+1 e i-- equivale a i=i-1.\nInfine gli operatori di combinazione, combinano un assegnamento con una operazione aritmetica: i*=2 equivale a i=i*2. Questi operatori anche se semplificano la scrittura del codice lo rendono di difficile comprensione al nuovo programmatore che avesse la necessit di apportare modifiche. Per questo motivo non sono comunemente utilizzati.\nOperatori aritmetici Java supporta tutti i pi comuni operatori aritmetici (somma, sottrazione,\nmoltiplicazione, divisione e modulo), in aggiunta fornisce una serie di operatori che semplificano la vita al programmatore consentendogli, in alcuni casi, di ridurre la quantit di codice da scrivere. Gli operatori aritmetici sono suddivisi in due classi:\noperatori binari ed operatori unari.\nGli operatori binari (ovvero operatori che necessitano di due operandi) sono cinque e sono schematizzati nella tabella seguente:\nOperatore\n+\n*\n/\n%\nOperatori Aritmetici Binari Utilizzo\nDescrizione res=sx + dx res = somma algebrica di dx ed sx res= sx - dx res = sottrazione algebrica di dx da sx res= sx * dx res = moltiplicazione algebrica tra sx e dx res= sx / dx res = divisione algebrica di sx con dx res= sx % dx res = resto della divisione tra sx e dx Consideriamo ora le seguenti poche righe di codice:\nint sx = 1500;\nlong dx = 1.000.000.000\n??? res;\nres = sx * dx;\nNasce il problema di rappresentare correttamente la variabile res affinch le si assegnare il risultato della operazione. Essendo tale risultato 1.500.000.000.000 troppo grande per essere assegnato ad una variabile di tipo int, sar necessario utilizzare una variabile in grado di contenere correttamente il valore prodotto. Il nostro codice funzioner perfettamente se riscritto nel modo seguente:\n http://www.java-net.tv 36\nint sx = 1500;\nlong dx = 1.000.000.000 long res;\nres = sx * dx;\nQuello che notiamo che se i due operandi non rappresentano uno stesso tipo,\nnel nostro caso un tipo int ed un tipo long, Java prima di valutare lespressione trasforma implicitamente il tipo int in long e produce un valore di tipo long. Questo processo di conversione implicita dei tipi viene effettuato da Java secondo alcune regole ben precise. Queste regole possono essere riassunte come segue:\nIl risultato di una espressione aritmetica di tipo long se almeno un operando\ndi tipo long e, nessun operando di tipo float o double;\nIl risultato di una espressione aritmetica di tipo int se entrambi gli operandi sono di tipo int;\nIl risultato di una espressione aritmetica di tipo float se almeno un operando\ndi tipo float e, nessun operando di tipo double;\nIl risultato di una espressione aritmetica di tipo double se almeno un operando\n di tipo double;\nGli operatori + e -, oltre ad avere una forma binaria hanno una forma unaria il cui significato definito dalle seguenti regole:\n+op : trasforma loperando op in un tipo int se dichiarato di tipo char, byte o short;\n-op : restituisce la negazione aritmetica di op;\nNon resta che parlare degli operatori aritmetici di tipo shortcut . Questo tipo di operatori consente lincremento od il decremento di uno come riassunto nella tabella:\nForma shortcut int i=0;\nint j;\nj=i++;\nint i=1;\nint j;\nj=i--;\nint i=0;\nint j;\nj=++i;\nint i=1;\nint j;\nj=--i;\nForma estesa corrispondente int i=0;\nint j;\nj=i;\ni=i+1;\nint i=1;\nint j;\nj=i;\ni=i-1;\nint i=0;\nint j;\ni=i+1;\nj=i;\nint i=1;\nint j;\ni=i-1;\nj=i;\nRisultato dopo lesecuzione i=1 j=0 i=0 j=1 i=1 j=1 i=0 j=0 Operatori relazionali Gli operatori relazionali servono ad effettuare un confronto tra valori producendo come risultato di ritorno un valore booleano (true o false) come prodotto del confronto. Nella tabella sono riassunti gli operatori ed il loro significato.\n http://www.java-net.tv 37\nOperatori Relazionali Descrizione\nres = true se e solo se sx maggiore di dx Operatore\n>\nUtilizzo res=sx > dx\n>=\nres= sx >= dx\n<\nres= sx < dx res = true se e solo se sx maggiore o uguale di dx\nres = true se e solo se sx minore di dx\n<=\nres= sx <= dx res = true se e solo se sx minore o uguale di dx\n!=\nres= sx != dx res = true se e solo se sx diverso da dx Operatori condizionali Gli operatori condizionali consentono di effettuare operazioni logiche su operandi di tipo booleano, ossia operandi che prendono solo valori true o false. Questi operatori sono quattro e sono riassunti nella tabella:\nOperatore\n&&\nUtilizzo res=sx && dx\n||\nres= sx || dx\n!\nres= ! sx\n^\nres= sx ^ dx Operatori Condizionali Descrizione\nAND : res = true se e solo se sx vale true e dx vale true, false altrimenti.\nOR : res = true se e solo se almeno uno tra sx e dx vale true, false altrimenti.\nNOT : res = true se e solo se sx vale false, false altrimenti.\nXOR : res = true se e solo se uno solo dei due operandi vale true, false altrimenti.\nNelle tabelle successive vengono specificati tutti i possibili valori booleani prodotti dagli operatori descritti.\nsx true\ntrue false\nfalse sx\ntrue false\nAND ( && )\ndx res\ntrue true\nfalse false\ntrue false\nfalse false\nNOT ( ! )\nres false\ntrue sx\ntrue true\nfalse false\nOR ( || )\ndx true\nfalse true\nfalse res\ntrue true\ntrue false\nsx true\ntrue false\nfalse XOR ( ^ )\ndx true\nfalse true\nfalse res\nfalse true\ntrue false\nOperatori logici e di shift bit a bit Gli operatori di shift bit a bit consentono di manipolare tipi primitivi spostandone i bit verso sinistra o verso destra secondo le regole definite nella tabella seguente http://www.java-net.tv 38\nOperatore\n>>\nUtilizzo sx >> dx\n<<\nsx << dx\n>>>\nsx >>> dx Operatori di shift bit a bit Descrizione\nSposta i bit di sx verso destra di un numero di posizioni come stabilito da dx.\nSposta i bit di sx verso sinistra di un numero di posizioni come stabilito da dx.\nSposta i bit di sx verso sinistra di un numero di posizioni come stabilito da dx, ove dx da considerarsi un intero senza segno.\nConsideriamo ad esempio:\nbyte i = 100;\ni >> 1;\ndal momento che la rappresentazione binaria del numero decimale 100\n01100100, lo shift verso destra di una posizione dei bit, produrr come risultato il numero binario 00110010 che corrisponde al valore 50 decimale.\nOltre ad operatori di shift, Java consente di eseguire operazioni logiche su tipi primitivi operando come nel caso precedente sulla loro rappresentazione binaria.\nOperatore\n&\n|\n^\n~\nUtilizzo res = sx & dx res = sx | dx res = sx ^ dx res = ~sx Operatori logici bit a bit Descrizione\nAND bit a bit OR bit a bit XOR bit a bit COMPLEMENTO A UNO bit a bit Nelle tabelle seguenti sono riportati tutti i possibili risultati prodotti dalla applicazione degli operatori nella tabella precedente. Tutte le combinazioni sono state effettuate considerando un singolo bit degli operandi.\nsx (bit)\n1 1\n0 0\nAND ( & )\ndx (bit)\n1 0\n1 0\nres (bit)\n1 0\n0 0\nCOMPLEMENTO ( ~ )\nsx (bit)\nres (bit)\n1 0\n0 1\nsx (bit)\n1 1\n0 0\nOR ( | )\ndx (bit)\n1 0\n1 0\nres (bit)\n1 1\n1 0\nsx (bit)\n1 1\n0 0\nXOR ( ^ )\ndx (bit)\n1 0\n1 0\nres (bit)\n0 1\n1 0\nIl prossimo un esempio di applicazione di operatori logici bit a bit tra variabili di tipo byte:\nbyte sx = 100;\nbyte dx = 125;\nbyte res1 = sx & dx;\nbyte res2 = sx | dx;\nbyte res3 = sx ^ dx;\n http://www.java-net.tv 39\nbyte res4 = ~sx;\nDal momento che la rappresentazione binaria di sx e dx rispettivamente:\nvariabile sx\ndx decimale\n100 125\nbinario 01100100\n01111101 Lesecuzione del codice produrr i risultati seguenti:\noperatore\n&\n|\n^\n~\nsx 01100100\n01100100 01100100\n01100100 dx\n01111101 01111101\n01111101\n-------------\nrisultato 01100100\n01111101 00011001\n10011011 decimale\n100 125\n25 155\nOperatori di assegnamento Loperatore di assegnamento = consente al programmatore, una volta definita una variabile, di assegnarle un valore. La sintassi da utilizzare la seguente:\nresult_type res_var = espressione;\nEspressione rappresenta una qualsiasi espressione che produce un valore del tipo compatibile con il tipo definito da result_type, e res_var rappresenta lidentificatore della variabile che conterr il risultato. Se torniamo alla tabella definita nel paragrafo Operatori, vediamo che loperatore di assegnamento ha la priorit pi bassa rispetto a tutti gli altri. La riga di codice Java produrr quindi la valutazione della espressione ed infine lassegnamento del risultato alla variabile res_var. Ad esempio:\nint res1 = 5+10;\nEsegue lespressione alla destra delloperatore e ne assegna il risultato (15) a res1.\nint res1 = 5;\nAssegna il valore 5 alla destra delloperatore alla variabile res1. Oltre alloperatore = Java mette a disposizione del programmatore una serie di operatori di assegnamento di tipo shortcut (in italiano scorciatoia), definiti nella prossima tabella. Questi operatori combinano un operatore aritmetico o logico con loperatore di assegnamento.\n http://www.java-net.tv 40\nOperatore\n+=\n-=\n*=\n/=\n%=\n&=\n|=\n^=\n<<=\n>>=\n>>>=\nOperatori di assegnamento shortcut Utilizzo\nEquivalente a sx +=dx sx = sx + dx;\nsx -=dx sx = sx - dx;\nsx *=dx sx = sx * dx;\nsx /=dx sx = sx / dx;\nsx %=dx sx = sx % dx;\nsx &=dx sx = sx & dx;\nsx |=dx sx = sx | dx;\nsx ^=dx sx = sx ^ dx;\nsx <<=dx sx = sx << dx;\nsx >>=dx sx = sx >> dx;\nsx >>>=dx sx = sx >>> dx;\nEspressioni Le espressioni rappresentano il meccanismo per effettuare calcoli allinterno della nostra applicazione, e combinano variabili e operatori producendo un singolo valore di ritorno. Le espressioni vengono utilizzate per assegnare valori a variabili o modificare, come vedremo nel prossimo capitolo, il flusso della esecuzione di una applicazione Java.\nUna espressione non rappresenta una unit di calcolo completa inquanto non produce assegnamenti o modifiche alle variabili della applicazione.\nIstruzioni A differenza delle espressioni, le istruzioni sono unit eseguibili complete terminate dal carattere ; e combinano operazioni di assegnamento, valutazione di espressioni o chiamate ad oggetti (questultimo concetto risulter pi chiaro alla fine del capitolo) combinate tra loro a partire dalle regole sintattiche del linguaggio.\nRegole sintattiche di Java Una istruzione rappresenta il mattone per la costruzione di oggetti. Difatti la sintassi del linguaggio Java pu essere descritta da tre sole regole di espansione:\nistruzione --> expression OR\nistruzione --> {\nistruzione\n[istruzione]\n}\nOR istruzione --> flow_control istruzione\nQueste tre regole hanno natura ricorsiva e, la freccia deve essere letta come diventa. Sostituendo una qualunque di queste tre definizioni allinterno del lato destro di ogni espansione possono essere generati una infinit di istruzioni. Di seguito un esempio.\nPrendiamo in considerazione la terza regola.\n http://www.java-net.tv 41\nistruzione --> flow_control Statement\nE sostituiamo il lato destro utilizzando la seconda espansione ottenendo istruzione --> flow_control --> flow_control istruzione 2 {\nistruzione\n}\nApplicando ora la terza regola di espansione otteniamo :\nistruzione --> flow_control --> flow_control --> flow_control istruzione 2 {\n3 {\nistruzione flow_control\n}\nistruzione\n}\nPrendiamo per buona che listruzione if sia uno statement per il controllo del flusso della applicazione (flow_control), e facciamo un ulteriore sforzo accettando che la sua sintassi sia:\nif(boolean_expression)\nEcco che la nostra espansione diventer quindi :\nistruzione --> --> --> flow_control\n-->\n2 3 {\nflow_control istruzione\n}\nif(i>10)\n{\nif(I==5)\nprint(Il valore di I 5);\ni++;\n}\nBlocchi di istruzioni La seconda regola di espansione:\nistruzione --> {\nistruzione\n[istruzione]\n}\ndefinisce la struttura di un blocco di istruzioni, ovvero una sequenza di una o pi istruzioni racchiuse allinterno di parentesi graffe.\nMetodi Una istruzione rappresenta il mattone per creare le funzionalit di un oggetto.\nNasce spontaneo chiedersi: come vengono organizzate le istruzioni allinterno di oggetti?\nI metodi rappresentano il cemento che tiene assieme tutti i mattoni. I metodi sono gruppi di istruzioni riuniti a fornire una singola funzionalit. Essi hanno una sintassi http://www.java-net.tv 42\nmolto simile a quella della definizione di funzioni ANSI C e possono essere descritti con la seguente forma:\nreturn_type method_name(arg_type name [,arg_type name] )\n{\nistruzioni\n}\nreturn_type e arg_type rappresentano ogni tipo di dato (primitivo o oggetto),\nname e method_name sono identificatori alfanumerici ed iniziano con una lettera\n(discuteremo in seguito come avviene il passaggio di parametri).\nSe il metodo non ritorna valori, dovr essere utilizzata la chiave speciale void al posto di return_type.\nSe il corpo di un metodo contiene dichiarazioni di variabili, queste saranno visibili solo allinterno del metodo stesso, ed il loro ciclo di vita sar limitato alla esecuzione del metodo. Non manterranno il loro valore tra chiamate differenti e, non saranno accessibili da altri metodi.\nPer evitare la allocazione di variabili inutilizzate, il compilatore java prevede una forma di controllo secondo la quale un metodo non pu essere compilato se esistono variabili a cui non stato assegnato alcun valore. In questi casi la compilazione verr interrotta con la restituzione di un messaggio di errore. Ad esempio consideriamo il metodo seguente:\nint moltiplica_per_tre (int number)\n{\nint risultato = 0;\nrisultato = number*3;\nreturn risultato;\n}\nIn questo caso la compilazione andr a buon fine ed il compilatore Java produrr come risultato un file contenente Bytecodes. Se invece il metodo avesse la forma:\nint moltiplica_per_tre (int number)\n{\nint risultato;\nreturn number*3;\n}\nil compilatore produrrebbe un messaggio di errore dal momento che esiste una variabile dichiarata e mai utilizzata.\nDefinire una classe Le istruzioni sono organizzate utilizzando metodi, e i metodi forniscono funzionalit. Daltro canto, Java un linguaggio object oriented, e come tale richiede che le funzionalit (metodi) siano organizzati in classi.\nNel primo capitolo, una classe stata paragonata al concetto di categoria. Se trasportato nel contesto del linguaggio di programmazione la definizione non cambia,\nma importante chiarire le implicazioni che la cosa comporta. Una classe Java deve rappresentare un oggetto concettuale. Per poterlo fare deve raggruppare dati e metodi assegnando un nome comune. La sintassi la seguente:\n http://www.java-net.tv 43\nclass ObjectName\n{\ndata_declarations method_declarations\n}\nI dati ed I metodi contenuti allinterno della classe vengono chiamati membri della classe. Eimportante notare che dati e metodi devono essere rigorosamente definiti allinterno della classe. Non possibile in nessun modo dichiarare variabili globali, funzioni o procedure. Questa restrizione del linguaggio Java, scoraggia il programmatore ad effettuare una decomposizione procedurale, incoraggiando di conseguenza ad utilizzare lapproccio object oriented.\nRiprendendo la classe libro descritta nel primo capitolo, ricordiamo che avevamo stabilito che un libro tale solo se contiene pagine, le pagine si possono sfogliare, strappare etc.. Utilizzando la sintassi di Java potremmo fornire una grossolana definizione della nostra classe nel modo seguente:\nclass Libro\n{\n// dichiarazione dei dati int numero_di_pagine;\nint pagina_attuale;\n// dichiarazione dei metodi void strappaUnaPagina(int numero_della_pagina) {}\nint paginaCorrente(){}\nvoid giraLaPagina(){}\n}\nVariabili reference Java fa una netta distinzione tra Classi e tipi primitivi. Una delle maggiori differenze che un oggetto non allocato dal linguaggio al momento della dichiarazione. Per chiarire questo punto, consideriamo la seguente dichiarazione:\nint counter;\nQuesta dichiarazione crea una variabile intera chiamata counter ed alloca subito quattro byte per lo storage del dato. Con le classi lo scenario cambia e la dichiarazione\nStack s;\ncrea una variabile che referenzia loggetto, ma non crea loggetto Stack. Una variabile di referenza, quindi una variabile speciale che tiene traccia di istanze di tipi non primitivi. Questo tipo di variabili hanno lunica capacit di tracciare oggetti del tipo compatibile: ad esempio una referenza ad un oggetto di tipo Stack non pu tracciare oggetti di diverso tipo.\nOltre che per gli oggetti, Java utilizza lo stesso meccanismo per gli array, che non sono allocati al momento della dichiarazione, ma viene semplicemente creata una variabile per referenziare lentit. Un array pu essere dichiarato utilizzando la sintassi:\n http://www.java-net.tv 44\nint numbers[];\nUna dichiarazione cos fatta crea una variabile che tiene traccia di un array di interi di dimensione arbitraria.\nLe variabili reference sono molto simili concettualmente ai puntatori di C e C++,\nma non consentono la conversione intero/indirizzo o le operazioni aritmetiche;\ntuttavia queste variabili sono uno strumento potente per la creazione di strutture dati dinamiche come liste, alberi binari e array multidimensionali. In questo modo eliminano gli svantaggi derivanti dalluso di puntatori, mentre ne mantengono tutti i vantaggi. Nella Figura 3-1 sono riportati alcuni esempi relativi alla modalit utilizzata da Java per allocare primitive od oggetti.\nUnultima considerazione da fare riguardo la gestione delle variabili in Java che a differenza di C e C++ in cui un dato rappresenta il corrispondente dato-macchina ossia una variabile intera in C++ occupa 32 bit ed una variabile byte ne occupa 8, ora le variabili si comportano come se.\nLa virtual machine Java difatti alloca per ogni dato primitivo il massimo disponibile in fatto di rappresentazione macchina dei dati. La virtual machine riserver, su una macchina a 32 bit, 32 bit sia per variabili intere che variabili byte,\nquello che cambia che il programmatore vedr una variabile byte comportarsi come tale ed altrettanto per le altre primitive.\nQuesto, a discapito di un maggior consumo di risorse, fornisce per molti vantaggi: primo consente la portabilit del Bytecodes su ogni piattaforma garantendo che una variabile si comporter sempre allo stesso modo, secondo sfrutta al massimo le capacit della piattaforma che utilizzer le FPU (Floating Point Unit)\nanche per calcoli su variabili intere di piccole dimensioni.\nFigura 3-1 : Variabili primitive e variabili reference http://www.java-net.tv 45\nVisibilit di una variabile Java Come C e C++ Java consente di dichiarare variabili in qualunque punto del codice della applicazione a differenza di linguaggi come il Pascal che richiedevano che le variabili venissero dichiarate allinterno di un apposito blocco dedicato.\nDal momento che secondo questa regola potrebbe risultare possibile dichiarare pi variabili con lo stesso nome in punti differenti del codice, necessario stabilire le regole di visibilit delle variabili. I blocchi di istruzioni ci forniscono il meccanismo necessario per delimitare quello che chiameremo scope di una variabile Java. In generale diremo che una variabile ha scopelimitato al blocco allinterno del quale\nstata dichiarata.\nAnalizziamo quindi caso per caso lo scope di variabili. Quando definiamo una classe, racchiudiamo allinterno del suo blocco di istruzioni sia dichiarazioni di variabili membro che dichiarazioni di metodi membro. Secondo la regola definita, e come schematizzato nella Figura 3-2, i dati membro di una classe sono visibili a da tutti i metodi dichiarati allinterno della definizione delloggetto.\nFigura 3-2 : scope dei dati membro di una classe Nel caso di metodi membro vale a sua volta lo schema degli scope come definito nella Figura 3-3.\nFigura 3-3 : scope delle variabili in una dichiarazione di metodo http://www.java-net.tv 46\nLoggetto null Il linguaggio Java prevede un valore speciale per le variabili reference che non referenzia nessuna istanza di un oggetto. Il valore speciale null rappresenta un oggetto inesistente, e viene assegnato di default ad ogni variabile reference.\nSe la applicazione esegue una chiamata ad un oggetto tramite una variabile reference non inizializzato, il compilatore Java produrr un messaggio di errore di tipo NullPointerException5.\nQuando ad una variabile reference viene assegnato il valore null, loggetto referenziato verr rilasciato e, se non utilizzato verr dato in pasto alla garbage collection che si occuper di rilasciare la memoria allocata per la entit.\nAltro uso che pu essere fatto delloggetto null riguarda le operazioni di comparazione come visibile nellesempio seguente. Le poche righe di codice dichiarano un array di interi chiamato numbers. Mediante listruzione per il controllo di flusso if6 controlla se loggetto array sia stato creato o no.\nStack s = null;\nint numbers[];\nif (numbers == null)\n{\n ..\n}\nFacciano attenzione I programmatori C, C++. Il valore null nel nostro caso non equivale al valore 0, ma rappresenta un oggetto nullo.\nCreare istanze Creata la variabile refence, siamo pronti a creare una istanza di un nuovo oggetto o di un array. Loperatore new fa questo per noi, allocando la memoria necessaria per il nostro oggetto e tornando la locazione in memoria della entit creata. Questa locazione pu quindi essere memorizzata nella variabile reference di tipo appropriato ed utilizzata per accedere alloggetto quando necessario.\nQuando utilizziamo loperatore new con una classe, la sintassi la seguente:\nnew class_type() ;\nLe parentesi sono necessarie ed hanno un significato particolare che sveleremo presto. Class_type una classe appartenente alle API di Java oppure definita dal programmatore. Per creare un oggetto Stack utilizzeremo quindi listruzione:\nStack s = new Stack();\nChe dichiara una variabile s di tipo Stack(), istanzia loggetto utilizzando la definizione di classe e memorizza la locazione della nuova istanza nella variabile. Un risultato analogo pu essere ottenuto anche nel modo seguente:\nStack s = null;\ns = new Stack();\nGli array sono allocati allo stesso modo:\n5 6\nLe eccezioni verranno discusse in un capitolo a se Le istruzioni per il controllo di flusso verranno trattate nel capitolo successivo http://www.java-net.tv 47\nint my_array[] = new int[20];\no, analogamente al caso precedente int my_array[] = null;\nmy_array = new int[20];\nIn questo caso Java dichiarer una variabile reference intera, allocher memoria per 20 interi e memorizzer la locazione di memoria a my_array. Il nuovo array sar indicizzato a partire da 07.\nLoperatore punto .\nQuesto operatore utilizzato per accedere ai membri di un oggetto tramite la variabile reference. Le due definizioni di classe a seguire, rappresentano una definizione per la classe Stack ed una per la classe StackElement che rappresentano vicendevolmente il concetto di stack e quello di elemento dello stack.\nclass StackElement\n{\nint val;\n}\nclass Stack\n{\nStackElement pop()\n{\n ..\n}\nvoid push(StackElement stack_ele)\n{\n ..\n}\n}\nLa classe StackElement contiene un dato membro chiamato val che rappresenta un numero intero da inserire allinterno dello Stack. Le due classi possono essere legate assieme a formare un breve blocco di codice che realizza una operazione di pop() ed una di push() sullo Stack utilizzando loperatore punto:\n//Creiamo un oggetto StackElement ed inizializziamo il dato membro StackElement stack_el = new StackElement();\nint value = 10;\nStack_el.val = value ;\n//Creiamo un oggetto Stack Stack s = new Stack();\n//inseriamo il valore in testa allo stack s.push(Stack_el);\n7 In java come in C e C++ gli array di dimensione n indicizzano gli elementi con valori compresi tra 0 e\n(n-1). Ad esempio my_array[0] torner lindice relativo al primo elemento dellarray.\n http://www.java-net.tv 48\n//Rilasciamo il vecchio valore per StackElement e eseguiamo una operazione di\n//pop sullo stack Stack_el = null;\nStack_el = s.pop();\nAuto referenza ed auto referenza esplicita Loperatore punto, oltre a fornire il meccanismo per accedere a dati i metodi di un oggetto attraverso la relativa variabile reference, consente ai metodi di una classe di accedere ai dati membro della classe di appartenenza. Proviamo a fare qualche modifica alla classe StackElement del paragrafo precedente:\nclass StackElement\n{\nint val;\n// questo metodo inizializza il dato membro della classe void setVal(int valore)\n{\n???.val = valore;\n}\n}\nIl metodo setVal prende come parametro un intero ed utilizza loperatore punto per memorizzare il dato allinterno della variabile membro val. Il problema che rimane da risolvere (evidenziato nellesempio dai punti interrogativi ???), riguarda la modalit con cui un oggetto possa referenziare se stesso.\nJava prevede una modalit di referenziazione speciale identificata da this. Difatti il valore di this viene modificato automaticamente da Java in modo che ad ogni istante sia sempre referenziato alloggetto attivo, intendendo per oggetto attivo listanza delloggetto in esecuzione durante la chiamata al metodo corrente. La nostra classe diventa ora:\nclass StackElement\n{\nint val;\n// questo metodo inizializza il dato membro della classe void setVal(int valore)\n{\nthis.val = valore;\n}\n}\nQuesta modalit di accesso viene detta auto referenza esplicita ed applicabile ad ogni tipo di dato e metodo membro di una classe.\nAuto referenza implicita Dal momento che, come abbiamo detto, ogni metodo deve essere definito allinterno di una classe, i meccanismo di auto referenza molto comune in applicazioni Java.\n http://www.java-net.tv 49\nSe una referenza non risulta ambigua, Java consente di utilizzare un ulteriore meccanismo detto di auto referenza implicita, mediante il quale possibile accede a dati o metodi membro di una classe senza necessariamente utilizzare this.\nclass StackElement\n{\nint val;\nvoid setVal(int valore)\n{\nval = valore;\n}\n}\nDal momento che la visibilit di una variabile in Java limitata al blocco ai sottoblocchi di codice in cui stata effettuata la dichiarazione, Java basa su questo meccanismo la auto referenza implicita. Formalmente java ricerca una variabile non qualificata risalendo a ritroso tra i diversi livelli dei blocchi di codice.\nPrima di tutto Java ricerca la dichiarazione di variabile allinterno del blocco di istruzioni correntemente in esecuzione. Se la variabile non un parametro appartenente al blocco risale tra i vari livelli del codice fino ad arrivare alla lista dei parametri del metodo corrente. Se la lista dei parametri del metodo non soddisfa la ricerca, Java legge il blocco di dichiarazione delloggetto corrente utilizzando quindi implicitamente this. Nel caso in cui la variabile non neanche un dato membro delloggetto viene generato un codice di errore dal compilatore.\nAnche se luso implicito di variabili facilita la scrittura di codice riducendo la quantit di caratteri da digitare, un abuso della tecnica rischia di provocare ambiguit allinterno del codice. Tipicamente la situazione a cui si va incontro la seguente:\nclass StackElement\n{\nint val;\nvoid setVal(int valore)\n{\nint val ;\n ..\n ..\nval = valore;\n}\n}\nUna assegnazione di questo tipo in assenza di this provocher la perdita del dato passato come parametro al metodo setVal(int), dato che verr memorizzato in una variabile visibile solo allinterno del blocco di istruzioni del metodo e di conseguenza con ciclo di vita limitato al tempo necessario alla esecuzione del metodo. Il codice per funzionare correttamente dovr essere modificato nel modo seguente:\nclass StackElement\n{\nint val;\nvoid setVal(int valore)\n{\nint val ;\n ..\n ..\nthis.val = valore;\n http://www.java-net.tv 50\n}\n}\nMeno ambiguo invece luso della auto referenza implicita se utilizzata per la chiamata a metodi della classe. In questo caso infatti Java applicher soltanto il terzo passo dellalgoritmo descritto per la determinazione delle variabili. Un metodo infatti non pu essere definito allinterno di un altro, e non pu essere passato come argomento ad unaltro metodo.\nStringhe Come abbiamo anticipato, Java ha a disposizione molti tipi gi definiti. String\nuno di questi, ed dotato di molte caratteristiche particolari. Le stringhe sono oggetti che possono essere inizializzato usando semplicemente una notazione con doppi apici senza lutilizzo delloperatore new:\nString prima = Hello;\nString seconda = world;\nPossono essere concatenate usando loperatore di addizione:\nString terza = prima + seconda;\nHanno un membro che ritorna la lunghezza della stringa rappresentata:\nint lunghezza = prima.lenght();\nStato di un oggetto Java Gli oggetti Java rappresentano dati molto complessi il cui stato, a differenza di un tipo primitivo, non pu essere definito semplicemente dal valore della variabile reference. In particolare, definiamo stato di un oggetto il valore in un certo istante di tutti i dati membro della classe. Ad esempio lo stato delloggetto StackElement\nrappresentato dal valore del dato membro val di tipo intero.\nComparazione di oggetti In Java la comparazione di oggetti leggermente differente rispetto ad altri linguaggi e ci dipende dal modo in cui Java utilizza gli oggetti. Una applicazione Java non usa oggetti, ma usa variabili reference come oggetti. Una normale comparazione effettuata utilizzando loperatore == comparerebbe il riferimento e non lo stato degli oggetti. Ci significa che == produrr risultato true solo se le due variabili reference puntano allo stesso oggetto e non se i due oggetti distinti di tipo uguale sono nello stesso stato.\nStack a = new Stack();\nStack b = new Stack();\n(a == b) -> false Molte volte per ad una applicazione Java potrebbe tornare utile sapere se due istanze separate di una stessa classe sono nello stesso stato ovvero, ricordando la definizione data nel paragrafo precedente potremmo formulare la regola secondo la quale due oggetti java dello stesso tipo sono uguali se si trovano nello stesso stato al momento del confronto.\n http://www.java-net.tv 51\nJava prevede un metodo speciale chiamato equals() che confronta lo stato di due oggetti. Di fatto, tutti gli oggetti in Java, anche quelli definiti dal programmatore,\npossiedono questo metodo inquanto ereditato per default da una classe particolare che analizzeremo in seguito parlando di ereditariet.\nStack a = new Stack();\nStack b = new Stack();\na.push(1);\nb.push(1);\na.equals(b) -> true Metodi statici Finora abbiamo mostrato segmenti di codice dando per scontato che siano parte di un processo attivo: in tutto questo c una falla. Per tapparla dobbiamo fare alcune considerazioni: primo, ogni metodo deve essere definito allinterno di una classe\n(questo incoraggia ad utilizzare il paradigma object oriented). Secondo, i metodi devono essere invocati utilizzando una variabile reference inizializzata in modo che tenga traccia della istanza di un oggetto.\nQuesto meccanismo rende possibile lauto referenziazione inquanto se un metodo viene chiamato senza che loggetto di cui membro sia attivo, this non sarebbe inizializzato. Il problema quindi che in questo scenario un metodo per essere eseguito richiede un oggetto attivo, ma fino a che non c qualcosa in esecuzione un oggetto non pu essere istanziato.\nLunica possibile soluzione quindi quella di creare metodi speciali che non richiedano lattivit da parte delloggetto di cui sono membro cos che possano essere utilizzati in qualsiasi momento.\nLa risposta nei metodi statici, ossia metodi che appartengono a classi, ma non richiedono oggetti attivi. Questi metodi possono essere creati utilizzando la parola chiave static a sinistra della dichiarazione di un metodo come mostrato nella dichiarazione di static_method() nellesempio che segue:\n1 class esempio 2 {\n3 static int static_method()\n4\n{\n5\n .\n6\n}\n7 int non_static_method()\n8\n{\n9 return static_method();\n10\n}\n11 }\n12 class altra_classe 13 {\n14 void un_metodo_qualunque()\n15\n{\n16 int i = esempio. static_method();\n17\n}\n18 }\nUn metodo statico esiste sempre a prescindere dallo stato delloggetto; tuttavia la locazione o classe incapsulante del metodo deve sempre essere ben qualificata.\nQuesta tecnica chiamata scope resolution e pu essere realizzata in svariati Massimiliano Tarquini http://www.java-net.tv 52\nmodi. Uno di questi consiste nellutilizzare il nome della classe come se fosse una variabile reference:\nesempio.static_metod();\nOppure si pu utilizzare una variabile reference nel modo che conosciamo:\nesempio _ese = new esempio();\n_ese.static_metod();\nSe il metodo statico viene chiamato da un altro membro della stessa classe non\n necessario alcun accorgimento. Eimportante tener bene a mente che un metodo statico non inizializza loggetto this; di conseguenza un oggetto statico non pu utilizzare membri non statici della classe di appartenenza.\nIl metodo main Affinch la Java Virtual Machine possa eseguire una applicazione, necessario che abbia ben chiaro quale debba essere il primo metodo da eseguire. Questo metodo viene detto entry point della applicazione. Come per il linguaggio C, Java riserva allo scopo lidentificatore di membro main.\nOgni classe pu avere il suo metodo main(), ma solo il metodo main della classe specificata verr eseguito allavvio del processo. Questo significa che ogni classe di una applicazione pu rappresentare un potenziale entry point che pu quindi essere scelto allavvio del processo scegliendo semplicemente la classe desiderata.\nCome pi avanti vedremo, una classe pu contenere pi metodi membro aventi lo stesso nome, purch abbiano differenti parametri in input. Affinch il metodo main() possa essere trovato dalla virtual machine, necessario che abbia una lista di argomenti che accetti un array di stringhe. Eproprio grazie a questo array la virtual machine in grado di passare alla applicazioni dei valori da riga di comando.\nInfine, per il metodo main() necessario utilizzare il modificatore public8 che accorda alla virtual machine il permesso per eseguire il metodo.\nclass prima_applicazione\n{\npublic static void main(String args[])\n{\n ..\n}\n}\nTutto questo ci porta ad una importante considerazione finale : tutto un oggetto, anche un applicazione.\nLoggetto System Unaltra delle classi predefinite in Java la classe System. Questa classe ha una serie di metodi statici e rappresenta il sistema su cui la applicazione Java sta girando.\nDue dati membro statici di questa classe sono System.out e System.err che rappresentano rispettivamente lo standard output e lo standard error dellinterprete java. Usando il loro metodo statico println(), una applicazione Java in grado di inviare un output sullo standard output o sullo standard error.\n8 Capiremo meglio il suo significato successivamente http://www.java-net.tv tarquini@all-one-mail.net 53\nSystem.out.println(Scrivo sullo standard output);\nSystem.err.println(Scrivo sullo standard error);\nIl metodo statico System.exit(int number) causa la terminazione della applicazione Java.\n http://www.java-net.tv 54\nLaboratorio 3 Introduzione alla sintassi di Java Descrizione\nIn questa sezione inizieremo a comprendere la tecnica delluso degli oggetti Java. Prima di proseguire per necessario capire la sintassi di una semplice istruzione if9 La sintassi base di if la seguente:\nif (expression)\n{\nistruzione\n}\nAd esempio:\nif(x > y)\n{\nSystem.out.println(\"x is greater than y);\n}\nEsercizio 1 Uno Stack o Pila una struttura dati gestita secondo la filosofia LIFO (Last In First Out) ovvero lultimo elemento ad essere inserito il primo ad essere recuperato.\nDisegnare e realizzare un oggetto Stack. Loggetto Stack deve contenere al massimo 20 numeri interi e deve avere i due metodi:\nvoid push(int)\nint pop()\n9 I controlli di flusso verranno descritti in dettaglio nel capitolo successivo.\n http://www.java-net.tv tarqu 55\nIl metodo push che ritorna un tipo void e prende come parametro di input un numero intero inserisce lelemento in cima alla pila.\nLarray deve essere inizializzato allinterno del metodo push(int). Si pu controllare lo stato dello stack ricordando che una variabile reference non inizializzata punta alloggetto null.\n http://www.java-net.tv @all-one-mail.net 56\nSoluzione al primo esercizio La classe Stack dovrebbe essere qualcosa tipo:\nc:\\esercizi\\cap3\\Stack.java 1\n2 3\n4 5\n6 7\n8 9\n10 11\n12 13\n14 15\n16 17\n18 19\n20 21\n22 23\n24 25\n26 27\nclass Stack\n{\nint data[];\nint first;\nvoid push(int i)\n{\nif(data == null)\n{\nfirst = 0;\ndata = new int[20];\n}\nif(first < 20)\n{\ndata[first] = i;\nfirst ++;\n}\n}\nint pop()\n{\nif(first > 0)\n{\nfirst --;\nreturn data[first];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\n}\nLe righe 3 e 4 contengono la dichiarazione dei dati membro della classe. In particolare utilizziamo un array di numeri interi per contenere i dati ed una variabile intera che mantiene traccia della prima posizione libera allinterno dellarray.\nDalla riga 5 alla riga 17 viene dichiarato il metodo void push(int i) allinterno del quale per prima cosa viene controllato se larray stato inizializzato (righe 7-11) ed eventualmente viene allocato come array di 20 numeri interi.\nif(data == null)\n{\nfirst = 0;\ndata = new int[20];\n}\nQuindi viene effettuato il controllo per verificare se possibile inserire elementi allinterno dellarray. In particolare essendo 20 il numero massimo di interi contenuti,\nmediante listruzione if il metodo verifica che la posizione puntata dalla variabile first sia minore di 20 (ricordiamo che in un array le posizioni sono identificate a partire da 0). Se lespressione first < 20 produce il valore true, il numero intero passato come parametro di input viene inserito nellarray nella posizione first. La variabile first viene quindi aggiornata in modo che punto alla prima posizione libera nellarray.\n http://www.java-net.tv 57\nif(first < 20)\n{\ndata[first] = i;\nfirst ++;\n}\nLe righe da 18 a 26 rappresentano la dichiarazione del metodo int pop() che recupera il primo elemento della pila e lo ritorna allutente. Per prima cosa il metodo controlla allinterno di una istruzione if se first sia maggiore di 0 ovvero che esista almeno un elemento allinterno dello Stack. Se la condizione si verifica first viene modificata in modo da puntare allultimo elemento inserito il cui valore viene restituito mediante il comando return. In caso contrario il metodo ritorna il valore 0.\nint pop()\n{\nif(first > 0)\n{\nfirst --;\nreturn data[first];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\nA questo punto possibile salvare il file contenente il codice sorgente e compilarlo. Alla fine del processo di compilazione avremo a disposizione un file contenente il bytecode della definizione di classe. Salviamo il file nella directory c:\\esercizi\\cap3\\ con nome Stack.java. A questo punto possiamo quindi compilare il file:\nC:\\> set CLASSPATH=.;.\\;c:\\jdk1.3\\lib\\tools.jar;\nC:\\> set PATH=%PATH%;c:\\jdk1.3\\bin;\nC:\\> javac Stack.java C:\\>\n http://www.java-net.tv 58\nCapitolo 4 Controllo di flusso e distribuzione di oggetti Introduzione\nJava eredita da C e C++ lintero insieme di istruzioni per il controllo di flusso apportando solo alcune modifiche. In aggiunta Java introduce alcune nuove istruzioni necessarie alla manipolazione di oggetti.\nQuesto capitolo tratta le istruzioni condizionali, le istruzioni di loop, le istruzioni relative alla gestione dei package per lorganizzazione di classi e, listruzione import per risolvere la posizionedelle definizioni di classi in altri file o package.\nI package Java sono strumenti simili a librerie e servono come meccanismo per raggruppare classi o distribuire oggetti. Listruzione import una istruzione speciale utilizzata dal compilatore per determinare la posizione su disco delle definizioni di classi da utilizzare nella applicazione corrente .\nCome C e C++ Java indipendente dagli spazi ovvero lindentazione del codice di un programma ed eventualmente luso di pi di una riga di testo sono opzionali.\nIstruzioni per il controllo di flusso Espressioni ed istruzioni per il controllo di flusso forniscono al programmatore il meccanismo per decidere se e come eseguire blocchi di istruzioni condizionatamente a meccanismo decisionali definiti allinterno della applicazione.\nIstruzione if\nif-else switch\nfor while\ndo-while Istruzioni per il controllo di flusso Descrizione\nEsegue o no un blocco di codice a seconda del valore restituito da una espressione booleana.\nEsegue permette di selezionare tra due blocchi di codice quello da eseguire a seconda del valore restituito da una espressione booleana.\nUtile in tutti quei casi in cui sia necessario decidere tra opzioni multiple prese in base al controllo di una sola variabile.\nEsegue ripetutamente un blocco di codice.\nEsegue ripetutamente un blocco di codice controllando il valore di una espressione booleana.\nEsegue ripetutamente un blocco di codice controllando il valore di una espressione booleana.\nLe istruzioni per il controllo di flusso sono riassunte nella tabella precedente ed hanno sintassi definita dalle regole di espansione definite nel terzo capitolo e riassunte qui di seguito..\nistruzione --> {\nistruzione\n[istruzione]\n}\nOR istruzione --> flow_control istruzione\n http://www.java-net.tv 59\nListruzione if Listruzione per il controllo di flusso if consente alla applicazione di decidere, in base ad una espressione booleana, se eseguire o no un blocco di codice.\nApplicando le regole di espansione definite, la sintassi di questa istruzione la seguente:\nif (boolean_expr)\nistruzione1\n-->\nif (boolean_expr)\n{\nistruzione;\n[istruzione]\n}\ndove boolean_expr rappresenta una istruzione booleana valida. Di fatto, se boolean_expr restituisce il valore true, verr eseguito il blocco di istruzioni successivo, in caso contrario il controllo passer alla prima istruzione successiva al blocco if. Un esempio di istruzione if il seguente:\n1 2\n3 4\n5 6\n7 8\n9 int x;\n .\nif(x>10)\n{\n .\nx=0;\n ..\n}\nx=1;\nIn questo caso, se il valore di x strettamente maggiore di 10, verr eseguito il blocco di istruzioni di if (righe 4-8), in caso contrario il flusso delle istruzioni salter direttamente dalla riga 3 alla riga 9 del codice.\nListruzione if-else Una istruzione if pu essere opzionalmente affiancata da una istruzione else.\nQuesta forma particolare dellistruzione if, la cui sintassi descritta qui di seguito,\nconsente di decidere quale blocco di codice eseguire tra due blocchi di codice.\nif (boolean_expr)\nistruzione1 else istruzione2\n-->\nif (boolean_expr)\n{\nistruzione;\n[istruzione]\n}\nelse\n{\nistruzione;\n[istruzione]\n}\nSe boolean_expr restituisce il valore true verr eseguito il blocco di istruzioni di if, altrimenti il controllo verr passato ad else e verr eseguito il secondo blocco di istruzioni. Di seguito un esempio:\n http://www.java-net.tv 60\n1 2\n3 4\n5 6\n7 8\nif(y==3)\n{\ny=12;\n}\nelse\n{\ny=0;\n}\nIn questo caso, se lespressione booleana sulla riga 3 del codice ritorna valore true, allora verranno eseguite le istruzioni contenute nelle righe 2-4, altrimenti verranno eseguite le istruzioni contenute nelle righe 6-8.\nIstruzioni if, if-else annidate Una istruzione if annidata rappresenta una forma particolare di controllo di flusso in cui una istruzione if o if-else controllata da unaltra istruzione if o if-else.\nUtilizzando le regole di espansione, in particolare concatenando ricorsivamente la terza con le definizioni di if e if-else:\nflow_control ->if(espressione)\nistruzione istruzione -> flow_control flow_control\nistruzione flow_control ->if(espressione)\nistruzione else\nistruzione otteniamo la regola sintattica per costruire blocchi if annidati:\nif(espressione)\n{\nistruzione if (espressione2)\n{\nistruzione if (espressione3)\n{\nistruzione\n .\n}\n}\n}\nCatene if-else-if La forma pi comune di if annidati rappresentata dalla sequenza o catena ifelse-if. Questo tipo di concatenazione valuta una serie arbitraria di istruzioni booleane precedendo dallalto verso il basso. Se almeno una delle condizioni restituisce il valore true verr eseguito il blocco di istruzioni relativo. Se nessuna delle condizioni si dovesse verificare allora verrebbe eseguito il blocco else finale.\n http://www.java-net.tv 61\nif(espressione)\n{\nistruzione\n}\nelse if (espressione2)\n{\nistruzione\n}\nelse if (espressione3)\n{\nistruzione\n .\n}\nelse\n{\nistruzione\n .\n}\nNellesempio viene utilizzato un tipico caso in cui utilizzare questa forma di annidamento:\n ..\nint i = getUserSelection();\nif(i==1)\n{\nfaiQualcosa();\n}\nelse if(i==2)\n{\nfaiQualcosAltro();\n}\nelse\n{\nnonFareNulla ();\n}\n .\nNellesempio, la variabile di tipo int i prende il valore restituito come parametro di ritorno dal metodo getUserSelection(). La catena controlla quindi il valore di i ed esegue il metodo faiQualcosa() nel caso in cui i valga 1, faiQualcosAltro() nel caso in cui valga 2, nonFareNulla() in tutti gli altri casi.\nListruzione switch Java mette a disposizione una istruzione di controllo di flusso che, specializzando la catena if-else-if, semplifica la vita al programmatore.\nListruzione switch utile in tutti quei casi in cui sia necessario decidere tra opzioni multiple prese in base al controllo di una sola variabile. Questa istruzione pu sembrare sicuramente ridondante rispetto alla forma precedente, ma sicuramente rende la vita del programmatore pi semplice in fase di lettura del codice. La sintassi della istruzione la seguente:\n http://www.java-net.tv tar 62\nswitch (espressione)\n{\ncase espr_costante:\nistruzione1 break_opzionale\ncase espr_costante:\nistruzione2 break_opzionale\ncase espr_costante:\nistruzione3 break_opzionale\n ..\ndefault:\nistruzione4\n}\nespressione rappresenta ogni espressione valida che produca un intero e espr_costante una espressione che pu essere valutata completamente al momento della compilazione. Questultima per funzionamento pu essere paragonata ad una costante. Istruzione ogni istruzione Java come specificato dalle regole di espansione e break_opzionale rappresenta la inclusione opzionale della parala chiave break seguita da ;.\nUn esempio pu aiutarci a comprendere il significato di questo costrutto.\nConsideriamo lesempio del paragrafo precedente:\n ..\nint i = getUserSelection();\nif(i==1)\n{\nfaiQualcosa();\n}\nelse if(i==2)\n{\nfaiQualcosAltro();\n}\nelse\n{\nnonFareNulla ();\n}\n .\nUtilizzando listruzione switch possiamo riscrivere il blocco di codice nel modo seguente:\n ..\nint i = getUserSelection();\nswitch (i)\n{\ncase 1:\nfaiQualcosa();\nbreak;\ncase 2:\nfaiQualcosAltro();\nbreak;\ndefault:\n http://www.java-net.tv 63\nnonFareNulla();\n}\n .\nSe la variabile intera i valesse 1, il programma eseguirebbe il blocco di codice relativo alla prima istruzione case chiamando il metodo faiQualcosa(), troverrebbe listruzione break ed uscirebbe quindi dal blocco switch passando alla prossima istruzione del bytecode. Se invece i valesse 2, verrebbe eseguito il blocco contente la chiamata al metodo faiQualcosAltro() ed essendoci una istruzione break uscirebbe anche in questo caso dal blocco switch. Infine, per qualunque altro valore di i, lapplicazione eseguirebbe il blocco identificato dalla label default.\nIn generale, dopo che viene valutata lespressione di switch, il controllo della applicazione salta al primo case tale che espressione == espr_costante ed esegue il relativo blocco di codice. Nel caso in cui il blocco sia terminato con una istruzione break, lapplicazione abbandona lesecuzione del blocco switch saltando alla prima istruzione successiva al blocco, altrimenti il controllo viene eseguito sui blocchi case a seguire. Se nessun blocco case soddisfa la condizione ossia\nespressione != espr_costante la virtual machine controlla lesistenza della label default ed esegue, se presente, solo il blocco di codice relativo ed esce da switch.\nListruzione while Una istruzione while permette la esecuzione ripetitiva di una istruzione utilizzando una espressione booleana per determinare se eseguire il blocco di istruzioni, eseguendolo quindi fino a che lespressione booleana non restituisce il valore false. La sintassi per questa istruzione la seguente:\nwhile (espressione_booleana){\nistruzione\n}\ndove espressione_booleana una espressione valida che restituisce un valore booleano. Per prima cosa, una istruzione while controlla il valore della espressione booleana. Se restituisce true verr eseguito il blocco di codice di while. Alla fine della esecuzione viene nuovamente controllato il valore della espressione booleana per decidere se ripetere lesecuzione del blocco di codice o passare il controllo della esecuzione alla prima istruzione successiva al blocco while.\nApplicando le regole di espansione, anche in questo caso otteniamo la forma annidata:\nwhile (espressione_booleana)\nwhile (espressione_booleana)\nistruzione Il codice di esempio utilizza la forma annidata del ciclo while:\n http://www.java-net.tv 64\n1 2\n3 4\n5 6\n7 8\n9 10\n11 int i=0;\nwhile(i<10)\n{\nj=10;\nwhile(j>0)\n{\nSystem.out.println(i=+i+e j=+j);\nj--;\n}\ni++;\n}\nListruzione do-while Una alternativa alla istruzione while rappresentata dallistruzione do-while a differenza della precedente, controlla il valore della espressione booleana alla fine del blocco di istruzioni. In questo caso quindi il blocco di istruzioni verr eseguito sicuramente almeno una volta.\nLa sintassi di do-while la seguente:\ndo {\nistruzione;\n} while (espressione_booleana);\nListruzione for Quando scriviamo un ciclo, accade spesso la situazione in cui tre task distinti concorrono alla esecuzione del blocco di istruzioni. Consideriamo il ciclo di 10 iterazioni:\ni=0;\nwhile(i<10)\n{\nfaiQualcosa();\ni++;\n}\nNel codice come prima cosa viene inizializzata una variabile per il controllo del ciclo, quindi viene eseguita una espressione condizionale per decidere sullo stato del ciclo, infine la variabile viene aggiornata in modo tale che possa determinare la fine del ciclo. Per semplificare la vita al programmatore, Java mette a disposizione listruzione for che include tutte queste operazioni nella stessa istruzione condizionale:\nfor(init_statement ; conditional_expr ; iteration_stmt){\nistruzione\n}\nche ha forma annidata:\nfor(init_statement ; conditional_expr ; iteration_stmt){\nfor(init_statement ; conditional_expr ; iteration_stmt){\nistruzione\n}\n}\n http://www.java-net.tv 65\ninit_statement rappresenta linizializzazione della variabile per il controllo del ciclo, conditional_expr lespressione condizionale, iteration_stmt laggiornamento della variabile di controllo. In una istruzione for lespressione condizionale viene sempre controllata allinizio del ciclo. Nel caso in cui restituisca un valore false, il blocco di istruzioni non verr mai eseguito. Per esempio, il ciclo realizzato nel primo esempio utilizzando il comando while pu essere riscritto utilizzando il comando for :\nfor (int i=0 ; i<10 ; i++)\nfaiQualcosa();\nIstruzione for nei dettagli Listruzione for in Java come in C e C++ una istruzione estremamente versatile inquanto consente di scrivere cicli di esecuzione utilizzando molte varianti alla forma descritta nel paragrafo precedente.\nIn pratica, il ciclo for consente di utilizzare zero o pi variabili di controllo, zero o pi istruzioni di assegnamento ed altrettanto vale per le espressioni booleane. Nella sua forma pi semplice il ciclo for pu essere scritto nella forma:\nfor( ; ; ){\nistruzione\n}\nQuesta forma non utilizza ne variabili di controllo, ne istruzioni di assegnamento ne tanto meno espressioni booleane. In un contesto applicativo realizza un ciclo infinito. Consideriamo ora il seguente esempio:\nfor (int i=0, j=10 ; (i<10 && j>0) ; i++, j--) {\nfaiQualcosa();\n}\nIl ciclo descritto utilizza due variabili di controllo con due operazioni di assegnamento distinte. Sia la dichiarazione ed inizializzazione delle variabili di controllo che le operazioni di assegnamento utilizzando il carattere , come separatore. Per concludere, la sintassi di questa istruzione pu essere quindi descritta della regola generale:\nfor([init_stmt][,init_stmt] ; conditional_expr ; [iteration_stmt] [,iteration_stmt] ) {\nistruzione\n}\nIstruzioni di ramificazione Il linguaggio Java consente luso di tre parole chiave che consentono di modificare in qualunque punto del codice il normale flusso della esecuzione della applicazione con effetto sul blocco di codice in esecuzione o sul metodo corrente.\nQueste parole chiave sono tre (come schematizzato nella tabella seguente) e sono dette istruzioni di branchingo ramificazione.\n http://www.java-net.tv 66\nIstruzione break\ncontinue return\nIstruzioni di ramificazione Descrizione\nInterrompe lesecuzione di un ciclo evitando ulteriori controlli sulla espressione condizionale e ritorna il controllo alla istruzione successiva al blocco attuale.\nSalta un blocco di istruzioni allinterno di un ciclo e ritorna il controllo alla espressione booleana che ne governa lesecuzione.\nInterrompe lesecuzione del metodo attuale e ritorna il controllo al metodo chiamante.\nListruzione break Questa istruzione consente di forzare luscita da un ciclo aggirando il controllo sulla espressione booleana e provocandone luscita immediata in modo del tutto simile a quanto gi visto parlando della istruzione switch. Per comprenderne meglio il funzionamento torniamo per un attimo al ciclo for gi visto nei paragrafi precedenti:\nfor (int i=0; i<10 ; i++) {\nfaiQualcosa();\n}\nUtilizzando listruzione break, possiamo riscrivere il codice evitando di inserire controlli allinterno del ciclo for come segue:\nfor (int i=0; ; i++) {\nif(i==10) break;\nfaiQualcosa();\n}\nLesecuzione del codice produrr esattamente gli stessi risultati del caso precedente.\nLuso di questa istruzione tipicamente legata a casi in cui sia necessario poter terminare lesecuzione di un ciclo a prescindere dai valori delle variabili di controllo utilizzate. Queste situazioni si verificano in quei casi in cui sia impossibile utilizzare un parametro di ritorno come operando allinterno della espressione booleana che controlla lesecuzione del ciclo, ed pertanto necessario implementare allinterno del blocco meccanismi specializzati per la gestione di questi casi.\nUn esempio tipico quello di chiamate a metodi che possono generare eccezioni10 ovvero notificare errori di esecuzione in forma di oggetti. In questi casi utilizzando il comando break possibile interrompere lesecuzione del ciclo non appena venga catturato lerrore.\nListruzione continue A differenza del caso precedente questa istruzione non interrompe lesecuzione del ciclo di istruzioni, ma al momento della chiamata produce un salto alla parentesi graffa che chiude il blocco restituendo il controllo alla espressione booleana che ne determina lesecuzione. Un esempio pu aiutarci a chiarire le idee:\n10 Le eccezioni verranno trattate in dettaglio a breve.\n http://www.java-net.tv 67\n1 2\n3 4\n5 6\n7 8\nint i=-1;\nint pairs=0;\nwhile(I<20)\n{\ni++;\nif((i%2)!=0) continue;\npairs ++;\n}\nLe righe di codice descritte calcolano quante occorrenze di interi pari ci sono in una sequenza di interi compresa tra 1 e 20 e memorizzano il valore in una variabile di tipo int chiamata pairs. Il ciclo while controllato dal valore della variabile i inizializzata a 1. La riga 6 effettua una controllo sul valore di i: nel caso in cui i rappresenti un numero intero dispari viene eseguito il comando continue ed il flusso ritorna alla riga 3. In caso contrario viene aggiornato il valore di pairs.\nListruzione return Questa istruzione rappresenta lultima istruzione di ramificazione e pu essere utilizzata per terminare lesecuzione del metodo corrente tornando il controllo al metodo chiamante. Return pu essere utilizzata in due forme:\nreturn valore;\nreturn;\nLa prima forma viene utilizzata per consentire ad un metodo di ritornare valori al metodo chiamante e pertanto deve ritornare un valore compatibile con quello dichiarato nella definizione del metodo. La seconda pu essere utilizzata per interrompere lesecuzione di un metodo qualora il metodo ritorni un tipo void.\nPackage Java I package sono meccanismi per raggruppare definizioni di classe in librerie,\nsimilmente ad altri linguaggi di programmazione. Il meccanismo provvisto di una struttura gerarchica per lassegnamento di nomi alle classi in modo da evitare eventuali collisioni in caso in cui alcuni programmatori usino lo stesso nome per differenti definizioni di classe.\nOltre a questo, sono molti i benefici nelluso di questo meccanismo: primo, le classi possono essere mascherate allinterno dei package implementando lincapsulamento anche a livello di file. Secondo, le classi di un package possono condividere dati e metodi con classi di altri package. Terzo, i package forniscono un meccanismo efficace per distribuire oggetti.\nIn questo capitolo verr mostrato in dettaglio solamente il meccanismo di raggruppamento. Gli altri aspetti verranno trattati nei capitoli successivi.\nAssegnamento di nomi a package I package combinano definizioni di classi in un unico archivio la cui struttura gerarchica rispetta quella del file system. I nomi dei package sono separati tra loro da punto. La classe Vector ad esempio fa parte del package java.util archiviato nel file tools.jar .\nSecondo le specifiche, il linguaggio riserva tutti i package che iniziano con java per le classi che sono parte del linguaggio. Questo significa che nuove classi definite da un utente devono essere raggruppate in package con nomi differenti da questo.\n http://www.java-net.tv 68\nLe specifiche suggeriscono inoltre che package generati con classi di uso generale debbano iniziare con il nome della azienda proprietaria del codice. Ad esempio se la pippo corporation avesse generato un insieme di classi dedicate al calcolo statistico, le classi dovrebbero essere contenute in un package chiamato ad esempio pippo.stat .\nUna volta definito il nome di un package, affinch una classe possa essere archiviata al suo interno, necessario aggiungere una istruzione package allinizio del codice sorgente che definisce la classe. Per esempio allinizio di ogni file contenente i sorgenti del package pippo.stat necessario aggiungere la riga:\npackage pippo.stat;\nQuesta istruzione non deve assolutamente essere preceduta da nessuna linea di codice. In generale, se una classe non viene definita come appartenente ad un package, il linguaggio per definizione assegna la classe ad un particolare package senza nome.\nCreazione dei package su disco Una volta definito il nome di un package, deve essere creata su disco la struttura a directory che rappresenti la gerarchia definita dai nomi. Ad esempio, le classi appartenenti al package java.util devono essere memorizzate in una gerarchia di directory che termina con java/util localizzata in qualunque punto del disco (ex.\nC:/classes/java/util/ schematizzato nella Figura 4-1).\nPer trovare le classi contenute in un package, Java utilizza la variabile di ambiente CLASSPATH che contiene le informazioni per puntare alla root del nome del package e non direttamente alle classi allinterno del package. Per esempio se il nome del package java.util e le classi sono memorizzate nella directory C:/classes/java/util/*, allora CLASSPATH dovr includere la directory C:/classes/.\nSotto sistemi microsoft, una variabile CLASSPATH ha tipicamente una forma del tipo:\nCLASSPATH = c:\\java\\lib\\tools.jar;d:\\java\\import;.;.\\;\nFigura 4-1 : Struttura di un package Java Massimiliano Tarquini http://www.java-net.tv 69\nIl modificatore public Di default, la definizione di una classe Java pu essere utilizzata solo dalle classi allinterno del suo stesso package. Per esempio, assumiamo di aver scritto una applicazione in un file Appo.java non appartenente a nessun package e, supponiamo che esista una classe Stack appartenente al package app.stack . Per definizione,\nAppo.java non potr accedere alla definizione di classe di Stack.\npackage app.stack;\nclass Stack\n{\nint data[];\nint ndata;\nvoid push(int i)\n{\n}\nint pop()\n{\n ..\n}\n}\nJava richiede al programmatore di esplicitare quali classi e quali membri possano essere utilizzati allesterno del package. A questo scopo Java riserva il modificatore public da utilizzare prima della dichiarazione della classe o di un membro come mostrato nella nuova versione della classe Stack detta ora classe pubblica.\npackage app.stack;\npublic class Stack\n{\nint data[];\nint ndata;\npublic void push(int i)\n{\n}\npublic int pop()\n{\n ..\n}\n}\nLe specifiche del linguaggio richiedono che il codice sorgente di classe pubblica sia memorizzata in un file avente lo stesso nome della classe (incluse maiuscole e minuscole), ma con estensione .java. Come conseguenza alla regola, pu esistere solo una classe pubblica per ogni file di sorgente. Questa regola rinforzata dal compilatore che scrive il bytecode di ogni classe in un file avente lo stesso nome della classe (incluse maiuscole e minuscole), ma con estensione .class.\nLo scopo di questa regola quello di semplificare la ricerca di sorgenti e bytecode da parte del programmatore. Per esempio supponiamo di avere tre classi A, B e C in un file unico. Se A fosse la classe pubblica (solo una lo pu essere), il codice sorgente di tutte e tre le classi dovrebbe trovarsi allinterno di un file A.java .\n http://www.java-net.tv 70\nQuando A.java verr compilato, il compilatore creer una classe per ogni classe nel file: A.class, B.class e C.class .\nQuesta organizzazione per quanto contorta, ha un senso logico. Se come detto la classe pubblica lunica a poter essere eseguita da altre classi allesterno del package, le altre classi rappresentano solo limplementazione di dettagli non necessarie al di fuori del package.\nPer concludere non mi resta che ricordare che, anche se una classe non pubblica pu essere definita nello stesso file di una classe pubblica, questo non\nstrettamente necessario e sar compito del programmatore scegliere in che modo memorizzare le definizioni delle classi allinterno di un package.\nListruzione import Il runtime di Java fornisce un ambiente completamente dinamico. Le classi non vengono caricate fino a che non sono referenziate per la prima volta durante lesecuzione della applicazione. Questo consente di ricompilare singole classi senza dover ricaricare grandi applicazioni.\nDal momento che ogni classe Java memorizzata in un suo file, la virtual machine pu trovare i file binari .class appropriati cercando nelle directory specificate nelle directory definite nella variabile dambiente CLASSPATH. Inoltre, dal momento che le classi possono essere organizzate in package, necessario specificare a quale package una classe appartenga pena lincapacit della virtual machine di trovarla.\nUn modo per indicare il package a cui una classe appartiene quello di specificare il package ad ogni chiamata alla classe ossia utilizzando nomi qualificati11. Riprendendo la nostra classe Stack appartenente al package app.stack,\nil suo nome qualificato sar app.stack.Stack .\nLuso di nomi qualificati non sempre comodo soprattutto per package organizzati con gerarchie a molti livelli. Per venire in contro al programmatore,Java consente di specificare una volta per tutte il nome qualificato di una classe allinizio del file utilizzando la parola chiave import.\nListruzione import ha come unico effetto quello di identificare univocamente una classe e quindi di consentire al compilatore di risolvere nomi di classe senza ricorrere ogni volta a nomi qualificati. Grazie allistruzione import app.stack.Stack;\nuna applicazione sar in grado di risolvere il nome di Stack ogni volta che sia necessario semplicemente utilizzando il nome di classe Stack. Capita spesso di dover per utilizzare un gran numero di classi appartenenti ad un unico package. Per questi casi listruzione import supporta luso di un carattere fantasma :\nimport app.stack.*;\nche risolve il nome di tutte le classi pubbliche di un package (app.stack nellesempio). Questa sintassi non consente altre forme e non pu essere utilizzata per caricare solo porzioni di package. Per esempio la forma import app.stack.S* non\n consentita.\n11 Tecnicamente, in Java un nome qualificato un nome formato da una serie di identificatori separati da punto per identificare univocamente una classe.\n http://www.java-net.tv 71\nLaboratorio 4 Controllo di flusso e distribuzione di oggetti Esercizio 1 Utilizzando le API Java, scrivere un semplice programma che utilizzando la classe Date stampi a video una stringa del tipo:\nOggi : giorno_della_settimana e sono le ore hh:mm Esercizio 2 Utilizzando la classe stack definita in precedenza, scrivere un ciclo while che stampi tutti gli interi pari da 1 a 13 inserendoli nello stack. La definizione di classe di stack dovr essere memorizzato nel package esempi.lab4.\n http://www.java-net.tv 72\nSoluzione al primo esercizio import java.util.Date;\nclass esercizio1\n{\npublic static void main(String args[])\n{\nDate d = new Date() ;\nString giorni[] = new String[7];\ngiorni [0] = Luned;\ngiorni [1] = Marted;\ngiorni [2] = Mercoled;\ngiorni [3] = Gioved;\ngiorni [4] = Venerd;\ngiorni [5] = Sabato;\ngiorni [6] = Domenica;\nSystem.out.println(Oggi : + giorni[d.getDay()]\n+ e sono le ore + d.getHours()\n+ : + d.getMinutes());\n}\n}\nSoluzione al secondo esercizio import esempi.lab4.*;\nclass esercizio2\n{\npublic static void main(String args[])\n{\nStack a = new Stack();\nint i;\ni=1;\nwhile(i<=13)\n{\nif(i % 2 !=0)\n{\nSystem.out.println(i);\na.push(i);\n}\ni++;\n}\n}\n}\n http://www.java-net.tv 73\nCapitolo 5 Incapsulamento\nIntroduzione Lincapsulamento di oggetti il processo di mascheramento dei dettagli dellimplementazione ad altri oggetti per evitare riferimenti incrociati. I programmi scritti con questa tecnica risultano molto pi leggibili e limitano i danni dovuto alla propagazione di un bug.\nUna analogia con il mondo reale rappresentata dalle carte di credito. Chiunque sia dotato di carta di credito pu eseguire una serie di operazioni bancarie attraverso lo sportello elettronico. Una carta di credito, non mostra allutente le modalit con cui si messa in comunicazione con lente bancario o ha effettuato transazioni sul conto corrente, semplicemente si limita a farci prelevare la somma richiesta tramite una interfaccia utente semplice e ben definita. In altre parole, una carta di credito maschera il sistema allutente che potr prelevare denaro semplicemente conoscendo luso di pochi strumenti come la tastiera numerica ed il codice pin.\nLimitando luso della carta di credito ad un insieme limitato di operazioni si pu:\nprimo, proteggere il nostro conto corrente. Secondo, impedire allutente di modificare in modo irreparabile dati o stati interni della carta di credito.\nUno degli scopi primari di un disegno object oriented, dovrebbe essere proprio quello di fornire allutente un insieme di dati e metodi che danno il senso delloggetto in questione. Questo possibile farlo senza esporre le modalit con cui loggetto tiene traccia dei dati ed implementa il corpo (metodi) delloggetto.\nNascondendo i dettagli, possiamo assicurare a chi utilizza loggetto che ci che sta utilizzando sempre in uno stato consistente a meno di bug delloggetto stesso.\nUno stato consistente uno stato permesso dal disegno di un oggetto. E per importante notare che uno stato consistente non corrisponde sempre allo stato spettato dallutente delloggetto. Se infatti lutente trasmette alloggetto parametri errati, loggetto si trover in uno stato consistente, ma non nello stato desiderato.\nFigura 5-1 : Modificatori public e private Massimiliano Tarquini http://www.java-net.tv 74\nModificatori public e private Java fornisce supporto per lincapsulamento a livello di linguaggio mediante i modificatori public e private da utilizzare al momento della dichiarazione di variabili e metodi. I membri di una classe o lintera classe, definiti public, sono liberamente accessibili da ogni classe utilizzata nella applicazione.\nI membri di una classe definiti private possono essere utilizzati sono dai membri della stessa classe. I membri privati mascherano i dettagli della implementazione di una classe.\nMembri di una classe non dichiarati n public, n private saranno per definizione accessibili a tutte le classi dello stesso package. Questi membri o classi sono comunemente detti package friendly. La regola stata schematizzata nella Figura 5-1.\nPrivate Il modificatore private realizza incapsulamento a livello di definizione di classe e serve a definire membri che devono essere utilizzati solo da altri membri della stessa classe di definizione. Lintento di fatto quello di nascondere porzioni di codice della classe che non devono essere utilizzati da altre classi.\nUn membro privato pu essere utilizzato da di qualsiasi membro statico, e non,\ndella stessa classe di definizione con laccorgimento che i membri statici possono solo utilizzare membri (dati od oggetti) statici o entit di qualunque tipo purch esplicitamente passate per parametro.\nPer dichiarare un membro privato si utilizza la parola chiave private anteposta alla dichiarazione di un metodo o di un dato:\nprivate identificatore var_name;\noppure nel caso di metodi:\nprivate return_type method_name(arg_type name [,arg_type name] )\n{\nistruzioni\n}\nPublic Il modificatore public consente di definire classi o membri di una classe visibili da qualsiasi classe allinterno dello stesso package e non. Public deve essere utilizzato per definire linterfaccia che loggetto mette a disposizione dellutente. Tipicamente metodi membro public utilizzano membri private per implementare le funzionalit delloggetto.\nPer dichiarare una classe od un membro pubblico si utilizza la parola chiave public anteposta alla dichiarazione :\npublic identificatore var_name;\nnel caso di metodi:\npublic return_type method_name(arg_type name [,arg_type name] )\n{\nistruzioni\n}\n http://www.java-net.tv tar-one-mail.net 75\ninfine nel caso di classi:\npublic class ObjectName\n{\ndata_declarations method_declarations\n}\nIl modificatore protected Un altro modificatore messo a disposizione dal linguaggio Java protected.\nMembri di una classe dichiarati protected possono essere utilizzati sia dai membri della stessa classe che da altre classi purch appartenenti allo stesso package\n(Figura 5-2).\nFigura 5-2 : Modificatore protected Per dichiarare un membro protected si utilizza la parola chiave protected anteposta alla dichiarazione :\nprotected identificatore var_name;\nnel caso di metodi:\nprotected return_type method_name(arg_type name [,arg_type name] )\n{\nistruzioni\n}\nDi questo modificatore torneremo a parlarne nei dettagli nel prossimo capitolo dove affronteremo il problema della ereditariet.\n http://www.java-net.tv 76\nUn esempio di incapsulamento Nellesempio mostrato di seguito, i dati della classe Impiegato (nome, e affamato) sono tutti dichiarati privati. Questo previene la lettura o peggio la modifica del valore dei dati da parte di DatoreDiLavoro.\nDaltra parte, la classe dotata di metodi pubblici (haiFame() e nome()), che consentono ad altre classi di accedere al valore dei dati privati. Nel codice sorgente,\nluso dei modificatori crea una simulazione ancora pi realistica limitando lazione di DatoreDiLavoro nella interazione DatoreDiLavoro / Impiegato. Ad esempio,\nDatoreDiLavoro non pu cambiare il nome di Impiegato.\n../javanet/mattone/cap5/Impiegato.java package javanet.mattone.cap5;\npublic class Impiegato\n{\nprivate String nome;\nprivate boolean affamato=true;\npublic boolean haiFame()\n{\nreturn affamato;\n}\npublic String nome()\n{\nreturn nome;\n}\npublic void vaiAPranzo(String luogo)\n{\n// mangia affamato = false;\n}\n}\n../javanet/mattone/cap5/DatoreDiLavoro.java package javanet.mattone.cap5;\npublic class DatoreDiLavoro\n{\npublic void siiCorrettoConImpiegato(Impiegato impiegato)\n{\n// if (person.Hungry) una chiamata illegale perch Hungry private\n// person.Hyngry = true un assegnamento illegale if (impiegato.haiFame())\n{\nimpiegato.vaiAPranzo(\"Ristorante sotto l''ufficio\");\n}\n}\n}\nLoperatore new Per creare un oggetto attivo dalla sua definizione di classe, Java mette a disposizione loperatore new. Questo operatore paragonabile alla malloc in C, ed\n identico allo stesso operatore in C++.\n http://www.java-net.tv 77\nNew oltre a generare un oggetto, consente di assegnargli lo stato iniziale ritornando un riferimento (indirizzo di memoria) al nuovo oggetto che pu essere memorizzata in una variabile reference di tipo compatibile mediante loperatore di assegnamento =.\nLa responsabilit della gestione della liberazione della memoria allocata per loggetto non pi in uso del il garbage collector. Per questo motivo, a differenza di C++ Java non prevede nessun meccanismo esplicito per distruggere un oggetto creato.\nLa sintassi delloperatore new prevede un tipo seguito da un insieme di parentesi. Le parentesi indicano che per creare loggetto verr chiamata un metodo chiamato costruttore, responsabile della inizializzazione dello stato delloggetto\n(Figura 5-3).\nFigura 5-3 : Loperatore new Costruttori\nTutti i programmatori, esperti e non, conoscono il pericolo che costituisce una variabile non inizializzata. Fare un calcolo matematico con una variabile intera non inizializzata pu generare risultati errati.\nIn una applicazione object oriented, un oggetto una entit molto pi complessa di un tipo primitivo come int e, lerrata inizializzazione dello stato delloggetto pu essere causa della terminazione prematura della applicazione o della generazione di bug intermittenti difficilmente controllabili.\nIn molti altri linguaggi di programmazione, il responsabile della inizializzazione delle variabili il programmatore. In Java questo impossibile dal momento che potrebbero essere dati membro privati delloggetto e quindi inaccessibili alloggetto utente.\nI costruttori sono metodi speciali chiamati quando viene creata una nuova istanza di classe e servono ad inizializzare lo stato iniziale delloggetto. Questi metodi hanno lo stesso nome della classe di cui sono membro e non restituiscono nessun tipo. Se una classe non provvista di costruttore, Java ne utilizza uno speciale di default che http://www.java-net.tv tarquini@all-one-mail.net 78\nnon fa nulla. Dal momento che il linguaggio garantisce la chiamata al costruttore ad ogni instanziamento di un oggetto, un costruttore scritto intelligentemente garantisce che tutti i dati membro vengano inizializzati. Nella nuova versione della classe Impiegato, il costruttore viene dichiarato esplicitamente dal programmatore e si occupa di impostare lo stato iniziale dei dati membro privati:\n../javanet/mattone/cap5/second/Impiegato.java package javanet.mattone.cap5.second;\npublic class Impiegato\n{\nprivate String nome;\nprivate boolean affamato;\npublic Impiegato haiFame()\n{\naffamato=true;\nnome=Massimiliano;\n}\npublic boolean haiFame()\n{\nreturn affamato;\n}\npublic String nome()\n{\nreturn nome;\n}\npublic void vaiAPranzo(String luogo)\n{\n// mangia affamato = false;\n}\n}\nJava supporta molte caratteristiche per i costruttori, ed esistono molte regole per la loro creazione.\nUn esempio di costruttori In questo esempio, la definizione delloggetto Stack contiene un solo costruttore che non prende argomenti ed imposta la dimensione massima dello stack a 10 elementi.\n../javanet/mattone/cap5/Stack.java package javanet.mattone.cap5;\npublic class Stack\n{\nprivate int maxsize;\nprivate int data[];\nprivate int first;\n http://www.java-net.tv 79\npublic Stack)\n{\nmaxsize = 10;\ndata = new int[10];\nfirst=0;\n}\nint pop()\n{\nif (first > 0)\n{\nfirst--;\nreturn data[first];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\nvoid push(int i)\n{\nif (first < maxsize)\n{\ndata[first] = i;\nfirst++;\n}\n}\n}\nLuso dei costruttori ci consente di inizializzare, al momento della creazione delloggetto tutti i dati membro (ora dichiarati privati), compreso larray che conterr i dati dello stack. Rispetto alla prima definizione della classe Stack fatta nel laboratorio 3, non sar pi necessario creare lo stack al momento della chiamata al metodo push(int) rendendo di conseguenza inutile il controllo sullo stato dellarray ad ogni sua chiamata:\nif (data == null)\n{\nfirst = 0;\ndata = new int[20];\n}\nDi fatto, utilizzando il costruttore saremo sempre sicuri che lo stato iniziale della classe correttamente impostato.\nOverloading dei costruttori Al programmatore consentito scrivere pi di un costruttore per una data classe a seconda delle necessit di disegno delloggetto, permettendogli di passare diversi insiemi di dati di inizializzazione. Ad esempio, un oggetto Stack potrebbe di default contenere al massimo 10 elementi. Un modo per generalizzare loggetto quello di scrivere un costruttore che prendendo come parametro di input un intero, inizializza la dimensione massima dello Stack a seconda delle necessit della applicazione.\n../javanet/mattone/cap5/Stack.java package javanet.mattone.cap5;\npublic class Stack\n{\n http://www.java-net.tv 80\nprivate int maxsize;\nprivate int data[];\nprivate int first;\npublic Stack)\n{\nmaxsize = 10;\ndata = new int[10];\nfirst=0;\n}\npublic Stack (int size)\n{\nmaxsize=size;\ndata = new int[size];\nfirst= 0;\n}\nint pop()\n{\nif (first > 0)\n{\nfirst--;\nreturn data[first];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\nvoid push(int i)\n{\nif (first < maxsize)\n{\ndata[first] = i;\nfirst++;\n}\n}\n}\nLutilizzo dei due costruttori della classe Stack ci consente di creare oggetti Stack di dimensioni variabili chiamando il costruttore che prende come parametro di input un intero che rappresenta le dimensioni dello stack:\npublic Stack (int size)\n{\nmaxsize=size;\ndata = new int[size];\nfirst= 0;\n}\nPer creare una istanza della classe Stack invocando il costruttore Stack(int)\nbaster utilizzare loperatore new come segue:\nint dimensioni=10;\nStack s = new Stack(dimensioni);\nRestrizione sulla chiamata ai costruttori Java permette una sola chiamata a costruttore al momento della referenziazione delloggetto. Questo significa che nessun costruttore pu essere eseguito Massimiliano Tarquini http://www.java-net.tv 81\nnuovamente dopo la creazione delloggetto. Di fatto, il codice Java descritto di seguito produrr un errore di compilazione sulla riga 3:\n1 2\n3 int dimensioni=10;\nStack s = new Stack(dimensioni);\ns.Stack(20);\nCross Calling tra costruttori Java consente ad un costruttore di chiamare altri costruttori appartenenti alla stessa defnizione di classe. Questo meccanismo utile inquanto i costruttori generalmente hanno funzionalit simili e, un costruttore che assume uno stato di default, potrebbe chiamarne uno che prevede che lo stato sia passato come parametro, chiamandolo e passando i dati di default.\nGuardando la definizione di Stack, notiamo che i due costruttori fanno esattamente la stessa cosa. Per ridurre la quantit di codice, possiamo chiamare un costruttore da un altro. Per chiamare un costruttore da un altro, necessario utilizzare una sintassi speciale:\nthis(parameter_list);\nNella chiamata, parameter_list rappresenta la lista di parametri del costruttore che si intende chiamare.\nUna chiamata cross-call tra costruttori, deve essere la prima riga di codice del costruttore chiamante. Qualsiasi altra cosa venga fatta prima, compresa la definizione di variabili, Java non consente di effettuare tale chiamata. Il costruttore corretto viene determinato in base alla lista dei parametri paragonando parameter_list con la lista dei parametri di tutti i costruttori della classe.\n../javanet/mattone/cap5/Stack.java package javanet.mattone.cap5;\nclass Stack\n{\nprivate int data[];\nprivate int max; //Dimensione massima private int size; //Dimensione Corrente public Stack ()\n{\nthis(10);\n}\npublic Stack (int max_size)\n{\ndata = new int[max_size];\nsize = 0;\nmax = max_size;\n}\nvoid push(int n)\n{\nif(size http://www.java-net.tv 82\nreturn;\n}\nint pop()\n{\nif(size > 0)\n{\nsize--;\nreturn data[size];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\n}\n http://www.java-net.tv 83\nLaboratorio 5 Incapsulamento di oggetti Esercizio 1 Definire un oggetto chiamato Set che rappresenta un insieme di interi. Linsieme deve avere al massimo tre metodi:\nboolean isMember(int); //Ritorna true se il numero nellinsieme void addMember(int); //Aggiunge un numero allinsieme void showSet(); //stampa a video il contenuto dellinsieme nel formato:\n// {1, 4, 5, 12}\nAssicurarsi di incapsulare loggetto utilizzando i modificatori public/private appropriati.\n http://www.java-net.tv 84\nSoluzione del primo esercizio class Set\n{\nprivate int numbers[];\nprivate int cur_size;\npublic Set()\n{\ncur_size=0;\nnumbers = new int[100];\n}\npublic boolean isMember(int n)\n{\nint i;\ni=0;\nwhile(i < cur_size)\n{\nif(numbers[i]==n) return true;\ni++;\n}\nreturn false;\n}\npublic void addMember(int n)\n{\nif(isMember(n)) return;\nif(cur_size == numbers.length) return;\nnumbers[cur_size++] = n;\n}\npublic void showSet()\n{\nint i;\ni=0;\nSystem.out.println({);\nwhile(i < cur_size)\n{\nSystem.out.println(numbers[i] + , );\ni++;\n}\nSystem.out.println(});\n}\n}\n http://www.java-net.tv 85\nCapitolo 6 Ereditariet\nIntroduzione Lereditariet la caratteristica dei linguaggi object oriented che consente di utilizzare classi come base per la definizione di nuove entit che specializzano il concetto. Lereditariet fornisce inoltre un ottimo meccanismo per aggiungere funzionalit ad un programma con rischi minimi per le funzionalit esistenti, nonch un modello concettuale che rende un programma object oriented auto-documentante rispetto ad un analogo scritto con linguaggi procedurali.\nPer utilizzare correttamente lereditariet, il programmatore deve conoscere a fondo gli strumenti forniti dal linguaggio in supporto.\nQuesto capitolo introduce al concetto di ereditariet in Java, alla sintassi per estendere classi, alloverloading e overriding di metodi e ad una caratteristica molto importante di Java che include per default la classe Object nella gerarchia delle classi.\nDisegnare una classe base Quando disegniamo una classe, dobbiamo sempre tenere a mente che con molta probabilit ci sar qualcuno che in seguito potrebbe aver bisogno di utilizzarla tramite il meccanismo di ereditariet.\nOgni colta che si utilizza una classe per ereditariet ci si riferisce a questa come alla classe baseo superclasse. Il termine ha come significato che la classe stata utilizzata come fondamenta per una nuova definizione.\nUtilizzando lereditariet, tutte le funzionalit della classe base sono trasferite alla nuova classe comunemente detta classe derivatao sottoclasse. Quando si fa uso della ereditariet, bisogna sempre tener ben presente alcuni concetti.\nLereditariet consente di utilizzare una classe come punto di partenza per la scrittura di nuove classi. Questa caratteristica pu essere vista come una forma di riutilizzazione del codice: i membri della classe base sono concettualmente copiati nella nuova classe.\nCome conseguenza diretta, lereditariet consente alla classe base di modificare la superclasse. In altre parole, ogni aggiunta o modifica ai metodi della superclasse sar applicata solo alle classe derivata. La classe base risulter quindi protetta dalla generazione di nuovi eventuali bug, che rimarranno circoscritti alla classe derivata.\nLa classe derivata per ereditariet, supporter tutte le caratteristiche della classe base.\nIn definitiva, tramite questa metodologia sar possibile creare nuove variet di entit gi definite mantenendone tutte le caratteristiche e le funzionalit. Questo significa che se una applicazione in grado di utilizzare una classe base, sar in grado di utilizzarne la derivata allo stesso modo.\nPer questi motivi, importante che una classe base rappresenti le funzionalit generiche delle varie specializzazioni che andremo a definire.\nProviamo a pensare ad un veicolo generico: questo potr muoversi, svoltare a sinistra o a destra o fermarsi. Di seguito la definizione della classe della classe contenete lentry point della applicazione.\n http://www.java-net.tv 86\npublic class Driver\n{\npublic static void main(String args[])\n{\nVeicolo v = new Veicolo();\nv.go();\nv.left();\nv.diritto();\nv.stop();\n}\n}\npublic class Veicolo\n{\nString nome;\nint velocita; //in Km/h int direzione;\nfinal static int STRAIGHT=0;\nfinal static int LEFT = -1;\nfinal static int RIGHT = 1;\npublic Veicolo()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Veicolo;\n}\npublic void go()\n{\nvelocita=1;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void stop()\n{\nvelocita=0;\nSystem.out.println(nome + si fermato);\n}\npublic void left()\n{\ndirezione =LEFT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\npublic void right()\n{\ndirezione =RIGHT;\nSystem.out.println(nome + ha sterzato a destra);\n}\npublic void diritto()\n{\ndirezione = STRAIGHT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\n}\nOverload di metodi Per utilizzare a fondo lereditariet, introdurre unaltra importante caratteristica di Java: quella di consentire loverloading di metodi. Fare loverloading di un metodo significa dotare una classe di metodi aventi stesso nome ma con parametri differenti.\n http://www.java-net.tv -one-mail.net 87\nConsideriamo ad esempio il metodo go() della classe Veicolo nellesempio precedente: il metodo simula la messa in moto del veicolo e la mette in moto alla velocit di 1 Km/h. Apportiamo quindi qualche modifica alla definizione di classe:\npublic class Veicolo\n{\nString nome;\nint velocita; //in Km/h int direzione;\nfinal static int STRAIGHT=0;\nfinal static int LEFT = -1;\nfinal static int RIGHT = 1;\npublic Veicolo()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Veicolo;\n}\npublic void go()\n{\nvelocita=1;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void go(int quale_velocita)\n{\nvelocita= quale_velocita;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void stop()\n{\nvelocita=0;\nSystem.out.println(nome + si fermato);\n}\npublic void left()\n{\ndirezione =LEFT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\npublic void right()\n{\ndirezione =RIGHT;\nSystem.out.println(nome + ha sterzato a destra);\n}\npublic void diritto()\n{\ndirezione = STRAIGHT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\n}\nAvendo a disposizione anche il metodo go(int quale_velocita) potremo migliorare la nostra simulazione facendo in modo che il veicolo possa accelerare o decelerare ad una determinata velocit.\nPrima di terminare il paragrafo, ecco alcune linee guida per utilizzare loverloading di metodi. Primo, non possono esistere due metodi aventi nomi e lista dei parametri contemporaneamente uguali. Secondo, i metodi di cui si fatto loverloading devono implementare vari aspetti di una medesima funzionalit.\n http://www.java-net.tv 88\nNellesempio, aggiungere un metodo go() che provochi la svolta della macchina non avrebbe senso.\nEstendere una classe base Definita la classe Veicolo, sar possibile definire nuovi veicoli estendendo la classe base. La nuova classe, manterr tutti i dati ed i metodi membro della superclasse con la possibilit di aggiungerne di nuovi o modificare quelli esistenti.\nLa sintassi per estendere una classe a partire dalla classe base la seguente:\nclass nome_classe extends nome_super_classe Lesempio seguente mostra come creare un oggetto Macchina a partire dalla classe base Veicolo.\npublic class Macchina extends Veicolo\n{\npublic Macchina()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Macchina;\n}\n}\npublic class Driver\n{\npublic static void main(String args[])\n{\nMacchina fiat = new Macchina ();\nfiat.go();\nfiat.left();\nfiat.diritto();\nfiat.stop();\n}\n}\nEstendendo la classe Veicolo, ne ereditiamo tutti i dati membro ed I metodi.\nLunico cambiamento che abbiamo dovuto apportare quello di creare un costruttore ad hoc. Il nuovo costruttore semplicemente modifca il contenuto della variabile nome affinch lapplicazione stampi I messaggi corretti.\nCome mostrato nel nuovo codice della classe Driver, utilizzare il nuovo veicolo equivale ad utilizzare il Veicolo generico.\nEreditariet ed incapsulamento Nellesempi precedente si nota facilmente che il codice del metodo costruttore della classe Veicolo molto simile a quello del costruttore della classe Macchina di conseguenza potrebbe tornare utile utilizzare il costruttore della classe base per effettuare almeno una parte delle operazioni di inizializzazione. Facciamo qualche considerazione:\nCosa potrebbe succedere se sbagliassimo nella definizione del costruttore della classe derivata?\nNella classe base potrebbero esserci dei dati privati che il costruttore della classe derivata non potrebbe aggiornare. Cosa fare?\n http://www.java-net.tv 89\nclass A\n{\nprivate int stato;\npublic A()\n{\nstato=10;\n}\npublic int f()\n{\n//ritorna valori basati sullo stato impostato a 10\n}\n}\nclass B extends A\n{\nprivate int var;\npublic B()\n{\nvar=20;\n// stato = 20; ISTRUZIONE ILLEGALE\n}\npublic int g()\n{\nreturn f(); // Problemi di runtime dal momento che A.stato\n// non stato inizializzato correttamente\n}\n}\nPer assicurare che un oggetto venga inizializzato ad uno stato corretto, i dati della classe devono essere inizializzati con i valori corretti, ma questo esattamente il compito di un costruttore. In altre parole, Java applica lincapsulamento anche a livello di ereditariet e ci significa che non solo Java deve consentire luso del costruttore della classe derivata, ma anzi deve forzare il programmatore affinch lo utilizzi.\nTornando al nostro esempio con Macchina e Veicolo, la seconda condivide tutti i dati membro con la prima, ed quindi possibile modificarne lo stato dei dati membro mediante accesso diretto ai dati. Se la classe Veicolo avesse per avuto dei dati privati, lunico modo per modificarne lo state sarebbe stato attraverso i metodi pubblici della classe. In questo modo la classe base gode di tutti i benefici dellincapsulamento (isolamento dei bug, facilit di tuning ecc.).\nEreditariet e costruttori Il meccanismo utilizzato da Java per assicurare la chiamata di un costruttore per ogni classe di una gerarchia il seguente.\nPrimo, ogni classe deve avere un costruttore. Se il programmatore non ne implementa alcuno, Java assegner alla classe un costruttore di default con blocco del codice vuoto e senza lista di parametri:\npublic Some_Costructor()\n{\n}\n http://www.java-net.tv tarquini@all-one-mail.net 90\nIl costruttore di default viene utilizzato solamente in questo caso. Se il programmatore implementa un costruttore specializzato con lista di parametri di input non vuota, Java elimina completamente il costruttore di default.\nSecondo, se una classe derivata da unaltra lutente pu chiamare il costruttore della classe base immediatamente precedente nella gerarchia utilizzando la sintassi:\nsuper(argument_list)\ndove argument_list la lista dei parametri del costruttore da chiamare. Una chiamata esplicita al costruttore della classe base deve essere effettuata prima di ogni altra operazione incluso la dichiarazione di variabili.\nPublic user_defined_costructor()\n{\nsuper(23); //Chiama il costruttore della classe base che accetta un intero\n//come parametro int i;\n}\nInfine, se lutente non effettua una chiamata esplicita al costruttore della classe base, Java esegue implicitamente la chiamata. In questo caso, Java non passa argomenti al costruttore della classe base cosa che generer un errore in fase di compilazione se non esiste un costruttore senza argomenti.\nSe avessimo compilato il codice dellesempio precedente class A\n{\nprivate int stato;\npublic A()\n{\nstato=10;\n}\npublic int f()\n{\n//ritorna valori basati sullo stato impostato a 10\n}\n}\nclass B extends A\n{\nprivate int var;\npublic B()\n{\n//Chiamata implicita a super();\nvar=20;\n}\npublic int g()\n{\nreturn f(); //Lavora correttamente\n}\n}\nAvremmo notato subito che il codice funziona correttamente ed i due oggetti sarebbero stati sempre in uno stato consistente proprio grazie alla chiamata implicita che Java effettua nel costruttore di B sul costruttore della super classe A.\n http://www.java-net.tv 91\nAggiungere nuovi metodi Quando estendiamo una classe, possiamo aggiungere nuovi metodi alla classe derivata. Per esempio, una Macchina generalmente possiede un clacson.\nAggiungendo il metodo honk(), continueremo a mantenere tutte le vecchie funzionalit, ma ora la macchina in grado di suonare il clacson.\npublic class Macchina extends Veicolo\n{\npublic Macchina()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Macchina;\n}\npublic void honk()\n{\nSystem.out.println(nome + ha attivato il clacson);\n}\n}\npublic class Driver\n{\npublic static void main(String args[])\n{\nMacchina fiat = new Macchina ();\nfiat.go();\nfiat.left();\nfiat.diritto();\nfiat.stop();\nfiat.honk();\n}\n}\nOverriding di metodi Se un metodo ereditato non lavorasse come ci aspettiamo, possiamo sovrascrivere il metodo originale. Questo semplicemente significa riscrivere il metodo coinvolto allinterno della classe derivata.\nAnche in questo caso, riscrivendo nuovamente il metodo solo nella nuova classe,\nnon c pericolo che la vecchia venga rovinata.\nIl nuovo metodo verr quindi chiamato al posto del vecchio anche se la chiamata venisse effettuata da un metodo ereditato dalla classe base.\npublic class Macchina extends Veicolo\n{\npublic Macchina()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Macchina;\n}\npublic void go(int quale_velocita)\n{\nif(quale_velocita<120)\nvelocita= quale_velocita;\nelse http://www.java-net.tv 92\nspeed = 120;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void honk()\n{\nSystem.out.println(nome + ha attivato il clacson);\n}\n}\npublic class Driver\n{\npublic static void main(String args[])\n{\nMacchina fiat = new Macchina ();\nfiat.go(300);\nfiat.left();\nfiat.diritto();\nfiat.stop();\nfiat.honk();\n}\n}\nChiamare metodi della classe base La parola chiave super() pu essere utilizzata anche nel caso in cui sia necessario richiamare un metodo della super classe ridefinito nella classe derivata con il meccanismo di overriding.\nRitorniamo ancore sul codice della classe Macchina:\npublic class Macchina extends Veicolo\n{\npublic void go(int quale_velocita)\n{\nif(quale_velocita<120)\nvelocita= quale_velocita;\nelse speed = 120;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\n .\n}\nil metodo go() della classe effettua un check della variabile di input per limitare la velocit massima della macchina, quindi effettua un assegnamento identico a quello effettuato nel metodo ridefinito della superclasse:\npublic void go(int quale_velocita)\n{\nvelocita= quale_velocita;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\nIl metodo go() della classe macchina pu quindi essere riscritto nel modo seguente:\n http://www.java-net.tv 93\npublic class Macchina extends Veicolo\n{\npublic void go(int quale_velocita)\n{\nif(quale_velocita<120)\nvelocita= quale_velocita;\nelse super.go(quale_velocita);\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\n .\n}\nEimportante notare che a differenza della chiamata a costruttori che richiedeva solo luso della parola chiave super ed eventualmente la lista dei parametri, ora\nnecessario utilizzare loperatore .specificando il nome del metodo da chiamare.\nFlessibilit delle variabili reference Una volta che una classe Java stata derivata, Java consente alle variabili reference che rappresentano il tipo della classe base di referenziare ogni istanza di un oggetto derivato da essa nella gerarchia definita dalla ereditariet.\nVeicolo v = new Macchina();\nv.go(10); //Chiama il metodo go()dichiarato in Macchina Il motivo alla base di questa funzionalit che tutti gli oggetti derivati hanno sicuramente almeno tutti i metodi della classe base (li hanno ereditati), e quindi non ci dovrebbero essere problemi nellutilizzarli.\nNel caso in cui un metodo sia stato ridefinito mediante overriding, queste tipo di referenziamento comunque effettuer una chiamata al nuovo metodo.\nRun-time e compile-time Questo paragrafo introduce i due concetti di run-time e compile-time. Il tipo rappresentato a compile-time di una espressione, il tipo dellespressione come dichiarato formalmente nel codice sorgente. Il tipo rappresentato a run-time invece quello determinato quando il programma in esecuzione. Il tipo a compile-time\nsempre costante, mentre quello a run-time pu variare.\nNel nostro esempio del Veicolo e della Macchina, una variabile reference di tipo Veicolo rappresenta il tipo Veicolo a compile-time uguale, e il tipo Macchina a runtime.\nVeicolo v = new Macchina();\nVolendo fornire una regola generale, diremo che il tipo rappresentato al compiletime da una variabile specificato nella sua dichiarazione, mentre quello a run-time\n il tipo attualmente rappresentato. I tipi primitivi a run-time (int, float, double etc. )\ninvece rappresentano lo stesso tipo del compile-time.\n// v ha tipo a compile-time di Veicolo ed al run-time di Macchina Veicolo v = new Macchina();\n http://www.java-net.tv 94\n//Il tipo a run-time di v cambia in Veicolo v = new Veicolo();\n//b rappresenta al compile-time il tipo Libro, al run-time il tipo LibroDiMatematica Libro b = new LibroDiMatematica()\n// i rappresenta un tipo int sia a run-time che a compile-time int i;\n// i sempre un intero (4.0 viene convertito in intero)\ni = 4.0;\nE comunque importante sottolineare che, una variabile reference potr referenziare solo qualcosa il cui tipo sia in qualche modo compatibile con il tipo rappresentato al compile-time. Questa compatibilit rappresentata dalla relazione di ereditariet: tipi derivati sono sempre compatibili con le variabili reference dei predecessori.\nAccesso a metodi attraverso variabili reference Consideriamo ora le linee di codice:\nMacchina c = new Macchina ();\nVeicolo v = c;\nc.honk();\nv.honk();\nSe proviamo a compilare il codice, il compilatore ci ritorner un errore sulla quarta riga del sorgente. Questo perch, dal momento che il tipo rappresentato da una variabile al run-time pu cambiare, il compilatore assumer per definizione che la variabile reference sta referenziando loggetto del tipo rappresentato al compiletime. In altre parole, anche se una classe Macchina possiede un metodo honk(),\nquesto non sar utilizzabile tramite una variabile reference di tipo veicolo.\nCast dei tipi Java fornisce un modo per girare intorno a questa limitazione. Il cast di un tipo consente di dichiarare che una variabile reference temporaneamente rappresenter un tipo differente da quello rappresentato al compile-time. La sintassi di una cast di tipo la seguente:\n(new_type) variable Dove new_type il tipo desiderato, e variable la variabile che vogliamo convertire temporaneamente.\nRiscrivendo lesempio precedente come segue:\nMacchina c = new Macchina ();\nVeicolo v = c;\nc.honk();\n((Macchina) v).honk();\n http://www.java-net.tv 95\nIl codice verr compilato ed eseguito correttamente.\nLoperazione di cast possibile su tutti i tipi purch la variabile reference ed il nuovo tipo siano compatibili. Il cast di tipo di una variabile reference, cambia realmente il tipo rappresentato al compile-time della espressione, ma non loggetto in se stesso. Il cast su un tipo provocher la terminazione della applicazione se, il tipo rappresentato al run-time dalloggetto non rappresenta il tipo desiderato al momento della esecuzione.\nLoperatore instanceof Dal momento che in una applicazione Java esistono variabili reference in gran numero, a volte utile determinare al run-time, che tipo di oggetto la variabile sta referenziando. A tal fine Java supporta loperatore booleano instanceof che controlla il tipo di oggetto referenziato al run-time da una variabile reference.\nLa sintassi formale la seguente:\nA instanceof B Dove A rappresenta una variabile reference, e B un tipo referenziabile. Il tipo rappresentato al run-time dalla variabile reference A verr confrontato con il tipo definito da B. Loperatore torner uno tra i due possibili valori true o false. Nel primo caso (true) saremo sicuri che il tipo rappresentato da A al run-time consente di rappresentare il tipo rappresentato da B. False, indica che A referenzia loggetto null oppure che non rappresenta il tipo definito da B.\nIn poche parole, se possibile effettuare il cast di A in B, instanceof ritorner true.\nVeicolo v = new Macchina();\nv.honk(); //errore di compilazione\n-------------------------if(v instanceof Macchina)\n((Macchina)v).honk(); //Compila ed esegue correttamente\n-------------------------v = new Veicolo;\nif(v instanceof Macchina)\n((Macchina)v).honk(); //Compila ed esegue correttamente inquanto if\n//previene lesecuzione Loggetto Object Quando in Java viene creato un nuovo oggetto che non estende nessuna classe base, Java ne causer lestensione automatica delloggetto Object.\nQuesto meccanismo implementato per garantire alcune funzionalit base comuni a tutte le classi. Queste funzionalit includono la possibilit di esprimere lo stato di un oggetto in forma di String (tramite il metodo ereditato toString()), la possibilit di comparare due oggetti tramite il metodo equals() e terminare loggetto tramite il metodo finalize(). Questultimo metodo utilizzato dal garbage collector nel momento in cui elimina loggetto rilasciando la memoria, e pu essere modificato per poter gestire situazioni non gestibili dal garbage collector quali referenze circolari.\n http://www.java-net.tv 96\nIl metodo equals()\nIl metodo equals() ereditato dalla classe Object, necessario dal momento che le classi istanziate vengono referenziate ossia le variabili reference si comportano come se.\nQuesto significa che loperatore di comparazione == insufficiente inquanto opererebbe a livello di reference e non a livello di stato delloggetto.\nPer capire meglio il funzionamento di questo metodo, definiamo una classe Punto che rappresenta un punto in uno spazio a due dimensioni ed effettua loverriding di equals(Object)\npublic class Punto\n{\npublic int x,y;\npublic Punto(int xc, int yc)\n{\nx=xc;\ny=yc;\n}\npublic boolean equals(Object o)\n{\nif (o instanceof Punto)\n{\nPunto p = (Punto)o;\nif (p.x == x && p.y==y) return true;\n}\nreturn false;\n}\n}\n .\npublic static void main(String args[])\n{\nPoint a,b;\na= new Point(1,2);\nb= new Point(1,2);\nif (a==b) . //restituisce false if (a.equals(b)) . //restituisce false\nRilasciare risorse esterne Il metodo finalize() di una classe Java viene chiamato dal garbage collector prima di rilasciare loggetto e liberare la memoria allocata. Tipicamente questo metodo\nutilizzato in quei casi in cui sia necessario gestire situazioni di referenza circolare,\noppure situazione in cui loggetto utilizzi metodi nativi (metodi esterni a Java e nativi rispetto alla macchina locale) che utilizzano funzioni scritte in altri linguaggi. Dal momento che situazioni di questo tipo coinvolgono risorse al di fuori del controllo del garbage collector12, finalize() viene chiamato per consentire al programmatore di implementare meccanismi di gestione esplicita della memoria.\nDi default questo metodo non fa nulla.\n12 Ad esempio nel caso in cui si utilizzi una funzione C che fa uso della malloc() per allocare memoria http://www.java-net.tv 97\nRendere gli oggetti in forma di stringa Il metodi toString() utilizzato per implementare la conversione in String di una classe. Tutti gli oggetti definiti dal programmatore, dovrebbero contenere questo metodo che ritorna una stringa rappresentante loggetto.\nTipicamente questo metodo viene riscritto in modo che ritorni informazioni relative alla versione delloggetto ed al programmatore che lo ha disegnato.\n http://www.java-net.tv 98\nLaboratorio 6 Introduzione alla ereditariet d\nEsercizio 1 Creare, a partire dalla classe Veicolo, nuovi tipi di veicolo mediante il meccanismo della ereditariet: Cavallo, Nave, Aeroplano.\npublic class Veicolo\n{\nString nome;\nint velocita; //in Km/h int direzione;\nfinal static int STRAIGHT=0;\nfinal static int LEFT = -1;\nfinal static int RIGHT = 1;\npublic Veicolo()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Veicolo;\n}\npublic void go()\n{\nvelocita=1;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void go(int quale_velocita)\n{\nvelocita= quale_velocita;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void stop()\n{\nvelocita=0;\nSystem.out.println(nome + si fermato);\n}\npublic void left()\n{\ndirezione =LEFT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\npublic void right()\n{\ndirezione =RIGHT;\nSystem.out.println(nome + ha sterzato a destra);\n}\npublic void diritto()\n{\ndirezione = STRAIGHT;\nSystem.out.println(nome + ha sterzato a sinistra);\n}\n}\n http://www.java-net.tv 99\nEsercizio 2 Trasformare la classe Driver in una definizione di classe completa (non pi contenente solo il metodo main). La nuova definizione deve contenere un costruttore che richiede un Veicolo come parametro di input e sia in grado di riconoscere le limitazioni in fatto di velocit massima del veicolo preso in input. Aggiungere alla classe Driver il metodo sorpassa(Veicolo) e spostare il metodo main in una nuova classe. Creare alcuni autisti e veicoli ed effettuate la simulazione.\n http://www.java-net.tv 100\nSoluzione al primo esercizio public class Macchina extends Veicolo\n{\npublic Macchina()\n{\nvelocita=0;\ndirezione = STRAIGHT;\nnome = Macchina;\n}\npublic void go(int quale_velocita)\n{\nif(quale_velocita<120)\nvelocita= quale_velocita;\nelse speed = 120;\nSystem.out.println(nome + si sta movendo a: + velocita+ Kmh);\n}\npublic void honk()\n{\nSystem.out.println(nome + ha attivato il clacson);\n}\n}\npublic class Cavallo extends Veicolo\n{\nint stanchezza; // range da 0 a 10 public Cavallo (String n)\n{\nname = n + il cavallo;\nvelocita=0;\ndirezione = STRAIGHT;\nstanchezza = 0;\n}\npublic void go(int velocita)\n{\nint velocita_massima = 20 stanchezza;\nif(velocita > velocita_massima)\nvelocita= velocita_massima super.go(velocita);\nif(velocita > 10 && stanchezza <10) stanchezza++;\n}\npublic void stop()\n{\nstanchezza = stanchezza /2;\nsuper.stop();\n}\n}\npublic class Driver\n{\npublic static void main(String args[])\n{\nMacchina fiat = new Macchina ();\n http://www.java-net.tv 101\nfiat.go();\nfiat.left();\nfiat.diritto();\nfiat.stop();\nCavallo furia = new Cavallo(Furia);\nfuria.go(30);\nfuria.left();\nfuria.right();\nfuria.go(15);\nfuria.go(9);\nfuria.go(12);\nfuria.go(20);\n}\n}\nSoluzione al secondo esercizio class Driver\n{\nString nome;\nVeicolo trasporto;\npublic Driver(String nome, Veicolo v)\n{\nthis.nome=nome;\ntrasporto = v;\n}\npublic void sorpassa(Driver altro_autista)\n{\nint velocita_sorpasso = altro_autista.trasporto.velocita+1;\nSystem.out.println(nome + sta sorpassando un +\naltro_autista.trasporto.nome + con + trasporto.nome);\ntrasporto.go(velocita_sorpasso);\nif(trasporto.velocita < velocita_sorpasso)\nSystem.out.println(Questo trasporto troppo lento per superare);\nelse System.out.println(Lautista +altro_autista.nome+ha mangiato la mia polvere);\n}\npublic void viaggia(int velocita_di_marcia)\n{\ntrasporto.diritto();\ntrasporto.go(velocita_di_marcia);\n}\n}\nclass Simulazione\n{\npublic static void main(String args[])\n{\nDriver max = new Driver(Max, new Cavallo(Furia));\nDriver catia = new Driver(Catia, new Macchina());\nDriver franco = new Driver(Franco, new Macchina());\n http://www.java-net.tv 102\nmax.viaggia(15);\nfranco.viaggia(30);\ncatia.viaggia(40);\nmax.sorpassa(franco);\nfranco.sorpassa(catia);\ncatia.sorpassa(max);\n}\n}\n http://www.java-net.tv 103\nCapitolo 7 Eccezioni\nIntroduzione Le eccezioni sono utilizzate in Java in quelle situazioni in cui sia necessario gestire condizioni di errore, ma i normali meccanismi sono insufficienti ad indicare lerrore. Queste situazioni sono molte frequenti; molto frequentemente sono legate ai costruttori di classe.\nI costruttori sono chiamati dalloperatore new dopo aver allocato lo spazio di memoria appropriato alloggetto da istanziare. I costruttori non hanno valori di ritorno\n(dal momento che non c nessuno che possa catturarli) e quindi risulta molto difficile controllare casi in cui siano occorsi errori al momento della inizializzazione dei dati membro della classe (ricordiamo che non esistono variabili globali).\nConsideriamo ancora una volta la classe Stack definita nel capitolo 3. Dal momento che il metodo push() non prevede parametri di ritorno, necessario un meccanismo alternativo per gestire un eventuale errore causato da un overflow dellarray che pu contenere solo 20 elementi.\nIl metodo pop() a sua volta costretto a utilizzare il valore 0 come parametro di ritorno nel caso in cui lo stack non contenga pi elementi. Questo ovviamente costringere ad escludere il numero intero 0 dai valori che potr contenere lo Stack e dovr essere riservato alla gestione della eccezione.\nclass Stack\n{\nint data[];\nint ndata;\nvoid push(int i)\n{\nif(data == null)\n{\nndata = 0;\ndata = new int[20];\n}\nif(ndata < 20)\n{\ndata[ndata] = i;\nndata++;\n}\n}\nint pop()\n{\nif(ndata > 0)\n{\nndata--;\nreturn data[ndata];\n}\nreturn 0; // Bisogna tornare qualcosa\n}\n}\nEccezioni : propagazione di oggetti Il punto di forza delle Eccezioni consiste nel consentire la propagazione di un oggetto a ritroso attraverso la sequenza corrente di chiamate tra metodi.\nOpzionalmente, ogni metodo pu fermare la propagazione, gestire la condizione di Massimiliano Tarquini http://www.java-net.tv 104\nerrore utilizzando le informazioni trasportate, oppure continuare la propagazione ai metodi subito adiacenti nella sequenza di chiamate. Ogni metodo che non sia in grado di gestire leccezione viene interrotto nel punto in cui aveva chiamato il metodo che sta propagando lerrore (es. vedi codice sottostante).\nSe la propagazione raggiunge lentry point della applicazione e non viene arrestata, lapplicazione viene terminata.\nclass Example\n{\ndouble metodo1()\n{\ndouble d;\nd=4.0 / metodo2();\nSystem.out.println(d) ;\n}\nfloat metodo2()\n{\nfloat f ;\nf = metodo3();\n//Le prossime righe di codice non vengono eseguite\n//se il metodo 3 fallisce f = f*f;\nreturn f;\n}\nint metodo3()\n{\nif(condizione)\nreturn espressione ;\nelse\n// genera una eccezione e propaga loggetto a ritroso\n// al metodo2()\n}\n}\nPropagare un oggetto detto exception throwinge fermarne la propagazione exception catching.\nGli oggetti da propagare devono derivare dalla classe base java.lang.Exception.\nA partire da questa possibile creare nuovi tipi di eccezioni specializzando il codice a seconda del caso da gestire.\nOggetti throwable Come abbiamo detto, Java consente di propagare solo alcuni tipi di oggetti. Di fatto, tecnicamente Java richiede che tutti gli oggetti da propagare siano derivati da java.lang.Throwable, e questo sembra smentire quanto affermato nel paragrafo precedente in cui affermavamo che devono derivare dalla classe base java.lang.Exception. In realt entrambe le affermazioni sono vere: vediamo perch.\nLa classe Throwable contiene dei metodi necessari a gestire lo stack tracing13 per la propagazione delloggetto a ritroso, ed ha due costruttori:\nThrowable();\nThrowable(String);\n13 Al fine garantire la propagazione a ritroso, java utilizza uno stack (LIFO) per determinare la catena dei metodi chiamanti e risalire nella gerarchia.\n http://www.java-net.tv -one- 105\nEntrambi i costruttori di Throwable avviano lo stack tracing, il secondo in pi inizializza un dato membro String con un messaggio di stato dettagliato e,\naccessibile attraverso il metodo toString() ereditato da Object.\nPer convenzione invece, ogni eccezione definita dal programmatore deve derivare da java.lang.Exception che a sua volta deriva da Throwable (Figura 5-1).\nAnche questa classe ha due costruttori che coincidono con i costruttori della superclasse.\nFigura 5-0-1 Listruzione throw Le eccezioni vengono propagate a ritroso attraverso la sequenza dei metodi chiamanti tramite listruzione throw che ha sintassi:\nthrow Object_Instance ;\nDove Object_Instance una istanza delloggetto Throwable. Eimportante tener presente che Object_Instance una istanza creata mediante loperatore new e non semplicemente un tipo di dato.\nQuesto metodo causa la terminazione del metodo corrente (come se fosse stata utilizzata listruzione return), ed invia loggetto specificato al chiamante. Non c modo da parte del chiamante di riesumare il metodo senza richiamarlo.\nIstruzioni try / catch Una volta generata una eccezione, una applicazione destinata alla terminazione a meno che loggetto propagato non venga catturato prima di raggiungere lentry-point del programma o direttamente al suo interno.\nQuesto compito spetta alla istruzione catch. Questa istruzione fa parte di un insieme di istruzioni dette istruzioni guardiane deputate alla gestione delle eccezioni ed utilizzate per racchiudere e gestire le chiamate a metodi che le generano.\n http://www.java-net.tv 106\nListruzione catch non pu gestire da sola una eccezione, ma deve essere sempre accompagnata da un blocco try. Il blocco try utilizzato come guardiano per il controllo di un blocco di istruzioni, potenziali sorgenti di eccezioni. Try ha la sintassi seguente:\ntry {\nistruzioni\n}\ncatch (Exception var1) {\nistruzioni\n}\ncatch (Exception var2) {\nistruzioni\n}\n ..\nListruzione catch cattura solamente le eccezioni di tipo compatibile con il suo argomento e solamente quelle generate dalle chiamate a metodi racchiuse allinterno del blocco try. Se una istruzione nel blocco try genera una eccezione, le rimanenti istruzioni nel blocco vengono saltate (es. vedi codice a seguire).\ntry\n{\nf1(); //Una eccezione in questo punto fa saltare f2() e f3()\nf2(); //Una eccezione in questo punto fa saltare f3()\nf3();\n}\ncatch (IOException _e) {\nSystem.out.println(_e.toString())\n}\ncatch (NullPointerException _npe) {\nSystem.out.println(_npe.toString())\n}\nLesecuzione di un blocco catch esclude automaticamente tutti gli altri.\nSingoli catch per eccezioni multiple Ogni istruzione catch, cattura solo le eccezioni compatibili con il tipo definito dal suo argomento. Ricordando quanto abbiamo detto parlando di oggetti compatibili,\ntutto questo significa che una istruzione catch cattura ogni eccezione dello stesso tipo definito dal suo argomento o derivata dal tipo dichiarato.\nNellesempio a seguire, la classe base Exception catturer ogni tipo di eccezione rendendo inutile ogni altro blocco catch a seguire.\ntry\n{\nf1(); //Una eccezione in questo punto fa saltare f2() e f3()\nf2(); //Una eccezione in questo punto fa saltare f3()\nf3();\n}\ncatch (java.lang.Exception _e) {\nSystem.out.println(_e.toString())\n}\ncatch (NullPointerException _npe) {\n http://www.java-net.tv 107\n//Questo codice non verr mai eseguito\n}\nUtilizzare un tipo base con un istruzione catch, pu essere utilizzato per implementare un meccanismo di catch di default.\ntry\n{\nf1(); //Una eccezione in questo punto fa saltare f2() e f3()\nf2(); //Una eccezione in questo punto fa saltare f3()\nf3();\n}\ncatch (NullPointerException _npe) {\n//Questo blocco cattura NullPointerException\n}\ncatch (java.lang.Exception _e) {\n//Questo blocco cattura tutte le altre eccezioni System.out.println(_e.toString())\n}\nQuesto meccanismo ricorda molto listruzione per il controllo di flusso switch, ed in particola modo il funzionamento del blocco identificato dalla label default.\nNellesempio, una eccezione di tipo NullPointerException verr catturata da una apposita istruzione catch. Tutte le altre eccezioni saranno catturate dal blocco successivo.\nQuesta forma utile in quei casi in cui esista un insieme di eccezioni che richiedono ognuna un trattamento specifico, ed altre che possono invece essere trattate allo stesso modo.\nLa clausola throws Le eccezioni possono essere propagate solo dai metodi che ne dichiarano la possibilit. Tentare di generare una eccezione allinterno un metodo che non ha precedentemente dichiarato di avere la capacit di propagare tali oggetti, causer un errore in fase di compilazione.\nPer far questo, necessario utilizzare la clausola throws che indica al metodo chiamante che un oggetto eccezione potrebbe essere generato o propagato dal metodo chiamato.\nLa clausola throws ha sintassi:\nreturn_type method_name (param_list) throws Throwable_type\n{\nMethod Body\n}\nUn metodo con una clausola throws pu generare un oggetto di tipo Throwable_type oppure ogni tipo derivato esso.\nSe un metodo contenente una clausola throws viene ridefinito (overrided)\nattraverso lereditariet, il nuovo metodo pu scegliere se avere o no la clausola throws. Nel caso in cui scelga di avere una clausola throws, sar costretto a dichiarare lo stesso tipo del metodo originale, o al massimo un tipo derivato.\n http://www.java-net.tv 108\nLe altre istruzioni guardiane. Finally Di seguito ad ogni blocco catch, pu essere utilizzato opzionalmente un blocco finally, che sar sempre eseguito prima di uscire dal blocco try/catch. Questo blocco vuole fornire ad un metodo la possibilit di eseguire sempre un certo insieme di istruzioni a prescindere da come il metodo manipola le eccezioni.\nI blocchi finally non possono essere evitati dal controllo di flusso della applicazione. Le istruzioni break, continue o return allinterno del blocco try o allinterno di un qualunque blocco catch verranno eseguito solo dopo lesecuzione del codice nel blocco finally.\ntry\n{\nf1(); //Una eccezione in questo punto fa saltare f2() e f3()\nf2(); //Una eccezione in questo punto fa saltare f3()\nf3();\n}\ncatch (java.lang.Exception _e) {\n//Questo blocco cattura tutte le eccezioni System.out.println(_e.toString())\nreturn;\n}\nfinally {\n//Questo blocco cattura tutte le altre eccezioni System.out.println(Questo blocco viene comunque eseguito)\n}\nSolo una chiamata del tipo System.exit() ha la capacit di evitare lesecuzione del blocco di istruzioni in questione. La sintassi completa per il blocco guardiano diventa quindi:\ntry {\nistruzioni\n}\ncatch (Exception var1) {\nistruzioni\n}\ncatch (Exception var2) {\nistruzioni\n}\nfinally {\nistruzioni\n}\nDefinire eccezioni personalizzate Quando definiamo nuovi tipi di oggetti, spesso desiderabile disegnare nuovi tipi di eccezioni che li accompagnino. Un nuovo tipo di eccezione deve essere derivata da java.lang.Exception. Il funzionamento interno della nuova eccezione non\nristretto da nessuna limitazione.\n http://www.java-net.tv 109\nclass OutOfDataException extends Exception\n{\nString errormessage;\npublic OutOfDataException(String s)\n{\nsuper(s);\nerrormessage = s;\n}\npublic OutOfDataException(s)\n{\nsuper();\nerrormessage = OutOfDataException;\n}\npublic String toString()\n{\nreturn errormessage;\n}\n}\nUn esempio completo In questo paragrafo mostrato un esempio completo di uso di eccezioni a partire dalla definizione di un oggetto Set gi definito nel laboratorio del capitolo 5.\nLesempio mostra come definire una nuova eccezione (Duplicate-exception)\ngenerata dal metodo addMember() quando si cerca di inserire un elemento gi esistente allinterno dellinsieme.\nIl programma di test infine, utilizza blocchi try/catch per la gestione della eccezione generata.\nDuplicateException.java import java.lang.Exception;\npublic class DuplicateException extends Exception\n{\nString errormessage;\npublic DuplicateException (String s)\n{\nsuper(s);\nerrormessage = s;\n}\npublic DuplicateException ()\n{\nsuper();\nerrormessage = DuplicateException;\n}\npublic String toString()\n{\nreturn errormessage;\n}\n}\n http://www.java-net.tv tarquini 110\nSet.java class Set\n{\nprivate int numbers[];\nprivate int cur_size;\npublic Set()\n{\ncur_size=0;\nnumbers = new int[100];\n}\npublic boolean isMember(int n)\n{\nint i;\ni=0;\nwhile(i < cur_size)\n{\nif(numbers[i]==n) return true;\ni++;\n}\nreturn false;\n}\npublic void addMember(int n) throws DuplicateException\n{\nif(isMember(n)) throw new DuplicateException(Loggetto non pu essere duplicato);\nif(cur_size == numbers.length) return;\nnumbers[cur_size++] = n;\n}\npublic void showSet()\n{\nint i;\ni=0;\nSystem.out.println({);\nwhile(i < cur_size)\n{\nSystem.out.println(numbers[i] + , );\ni++;\n}\nSystem.out.println(});\n}\n}\n http://www.java-net.tv tarquini 111\nSetTest.java class SetTest\n{\npublic static void main(String args[])\n{\nSet s = new Set();\ntry\n{\ns.addMemeber(10);\n//duplico lelemento s.addMemeber(10);\n}\ncatch(DuplicateException _de)\n{\nSystem.err.println(_de.toString());\n}\n}\n}\n http://www.java-net.tv 112\nCapitolo 8 Polimorfismo ed ereditariet avanzata Introduzione\nLereditariet rappresenta uno strumento di programmazione molto potente;\ndaltra parte il semplice modello di ereditariet presentato nel capitolo 6 non risolve alcuni problemi di ereditariet molto comuni e, se non bastasse, crea alcuni problemi potenziali che possono essere risolti solo scrivendo codice aggiuntivo.\nUno dei limiti pi comuni della ereditariet singola che non prevede lutilizzo di una classe base come modello puramente concettuale, ossia priva della implementazione delle funzioni base. Se facciamo un passo indietro, ricordiamo che abbiamo definito uno Stack (pila) come un contenitore allinterno del quale inserire dati da recuperare secondo il criterio primo ad entrare, ultimo ad uscire. Potrebbe esserci per una applicazione che richiede vari tipi differenti di Stack: uno utilizzato per contenere valori interi ed un altro utilizzato per contenere valori reali a virgola mobile. In questo caso, le modalit utilizzate per manipolare lo Stack sono le stesse,\nquello che cambia sono i tipi di dato contenuti.\nAnche se utilizzassimo la classe Stack definita nel codice seguente come classe base, sarebbe impossibile per mezzo della semplice ereditariet creare specializzazioni dellentit rappresentata a meno di riscrivere una parte sostanziale del codice del nostro modello in grado di contenere solo valori interi.\nclass Stack\n{\nint data[];\nint ndata;\nvoid push(int i) {\n}\nint pop() {\n ..\n}\n}\nUn altro problema che non viene risolto dal nostro modello di ereditariet quello di non consentire ereditariet multipla, ossia la possibilit di derivare una classe da due o pi classi base; la parola chiave extends prevede solamente un singolo argomento.\nJava risolve tutti questi problemi con due variazioni al modello di ereditariet definito in precedenza: interfacce e classi astratte. Le interfacce sono entit simili a classi, ma non contengono implementazioni delle funzionalit descritte. Le classi astratte, anchesse del tutto simili a classi normali, consentono di non implementare tutte le caratteristiche delloggetto rappresentato.\nInterfacce e classi astratte, assieme, permettono di definire un concetto senza dover conoscere i dettagli di una classe posponendone limplementazione attraverso il meccanismo della ereditariet.\nPolimorfismo : uninterfaccia, molti metodi Polimorfismo la terza parola chiave del paradigma ad oggetti. Derivato dal greco, significa pluralit di forme ed la caratteristica che ci consente di utilizzare ununica interfaccia per una moltitudine di azioni. Quale sia la particolare azione eseguita dipende solamente dalla situazione in cui ci si trova.\n http://www.java-net.tv 113\nPer questo motivo, parlando di programmazione, il polimorfismo viene riassunto nellespressione uninterfaccia, molti metodi. Ci significa che possiamo definire una interfaccia unica da utilizzare in molti casi collegati logicamente tra di loro.\nOltre a risolvere i limiti del modello di ereditariet proposto, Java per mezzo delle interfacce fornisce al programmatore lo strumento per implementare il polimorfismo.\nInterfacce Formalmente, una interfaccia Java rappresenta un prototipo e consente al programmatore di definire lo scheletro di una classe: nomi dei metodi, tipi ritornati,\nlista dei parametri. Al suo interno il programmatore pu definire dati membro purch di tipo primitivo con ununica restrizione: Java considerer implicitamente questi dati come static e final (costanti). Quello che una interfaccia non consente, la implementazione del corpo dei metodi.\nUna interfaccia stabilisce il protocollo di una classe senza preoccuparsi dei dettagli di implementazione.\nDefinizione di una interfaccia La sintassi per implementare una interfaccia la seguente:\ninterface identificatore {\ncorpo_dell_interfaccia\n}\nInterface la parola chiave riservata da Java per lo scopo, identificatore il nome interfaccia e corpo_dell_interfaccia una lista di definizioni di metodi e dati membro separati da ;. Ad esempio, linterfaccia per la nostra classe Stack sar:\ninterface Stack {\npublic void push( int i );\npublic int pop();\n}\nImplementare una interfaccia Dal momento che una interfaccia rappresenta solo il prototipo di una classe,\naffinch possa essere utilizzata necessario che ne esista una implementazione che rappresenti una classe istanziabile.\nPer implementare una interfaccia, Java mette a disposizione la parola chiave implements con sintassi:\nclass nome_classe implements interface {\ncorpo_dell_interfaccia\n}\nLa nostra classe Stack potr quindi essere definita a partire da un modello nel modo seguente:\n http://www.java-net.tv 114\nStackDef.java public interface StackDef {\npublic void push( int i );\npublic int pop();\n}\nStack.java class Stack implements Stack {\npublic void push( int i )\n{\n ..\n}\npublic int pop()\n{\n ..\n}\n}\nQuando una classe implementa una interfaccia obbligata ad implementarne i prototipi dei metodi definiti nel corpo. In caso contrario il compilatore generer un messaggio di errore. Di fatto, possiamo pensare ad una interfaccia come ad una specie di contratto che il run-time di Java stipula con una classe. Implementando una interfaccia la classe non solo definir un concetto a partire da un modello logico\n(molto utile al momento del disegno della applicazione), ma assicurer limplementazione di almeno i metodi definiti nellinterfaccia.\nConseguenza diretta sar la possibilit di utilizzare le interfacce come tipi per definire variabili reference in grado di referenziare oggetti costruiti mediante implementazione di una interfaccia.\nStackDef s = new Stack();\nVarranno in questo caso tutte le regole gi discusse nel capitolo sesto parlando di variabili reference ed ereditariet.\nEreditariet multipla in Java Se loperatore extends limitava la derivazione di una classe a partire da una sola classe base, loperatore implements ci consente di implementare una classe a partire da quante interfacce desideriamo semplicemente esplicitando lelenco delle interfacce implementate separate tra loro con una virgola.\nclass nome_classe implements interface1, interface2, .interfacen {\ncorpo_dell_interfaccia\n}\nQuesta caratteristica permette al programmatore di creare gerarchie di classi molto complesse in cui una classe eredit la natura concettuale di molte entit.\nSe una classe implementa interfacce multiple, la classe dovr fornire tutte le funzionalit per i metodi definiti in tutte le interfacce.\n http://www.java-net.tv 115\nClassi astratte Capitano casi in cui questa astrazione deve essere implementata solo parzialmente allinterno della classe base. In questi casi le interfacce sono restrittive\n(non si possono implementare funzionalit alcune).\nPer risolvere questo problema, Java fornisce un metodo per creare classi base astratte ossia classi solo parzialmente implementate.\nLe classi astratte possono essere utilizzate come classi base tramite il meccanismo della ereditariet e per creare variabili reference; tuttavia queste classi non sono complete e, come le interfacce, non possono essere istanziate.\nPer estendere le classi astratte si utilizza come nel caso di classi normali listruzione extends e di conseguenza solo una classe astratta pu essere utilizzata per creare nuove definizioni di classe.\nQuesto meccanismo fornisce una alternativa alla costrizione di dover implementare tutte le funzionalit di una interfaccia allinterno di una nuova classe aumentando la flessibilit nella creazione delle gerarchie di derivazione.\nPer definire una classe astratta Java mette a disposizione la parola chiave abstract. Questa clausola informa il compilatore che alcuni metodi della classe potrebbero essere semplicemente prototipi o astratti.\nabstract class nome_classe\n{\ndata_members abstract_methods\nnon_abstract_methods\n}\nOgni metodo che rappresenta semplicemente un prototipo deve essere dichiarato abstract. Quando una nuova classe viene derivata a partire dalla classe astratta, il compilatore richiede che tutti i metodi astratti vengano definiti. Se la necessit del momento costringe a non definire questi metodi, la nuova classe dovr a sua volta essere definita abstract .\nUn esempio semplice potrebbe essere rappresentato da un oggetto Terminale.\nQuesto oggetto avr dei metodi per muovere il cursore, per inserire testo, ecc. Inoltre Terminale dovr utilizzare dei dati per rappresentare la posizione del cursore e le dimensioni dello schermo (in caratteri).\npublic abstract class Terminal\n{\nprivate int cur_row, cur_col, nrows, ncols;\npublic Terminal(int rows, int cols)\n{\nnrows = rows;\nncols = cols;\ncur_row=0;\ncur_col=0;\n}\npublic abstract void move_cursor(int rows, int col);\npublic abstract void insert_string(int rows, int col);\n .\npublic void clear()\n{\nint r,c;\nfor(r=0 ; r http://www.java-net.tv 116\ninsert_string( );\n}\n}\n}\nIl metodo che pulisce lo schermo (clear()) potrebbe essere scritto in termini di altri metodi prima che siano implementati. Quando viene implementato un terminale reale i metodi astratti saranno tutti implementati, ma non sar necessario implementare nuovamente il metodo clear().\n http://www.java-net.tv 117\nCapitolo 9 Java Threads Introduzione\nJava un linguaggio multi-thread, cosa che sta a significare che un programma pu essere eseguito logicamente in molti luoghi nello stesso momento. Ovvero, il multithreading consente di creare applicazioni in grado di utilizzare la concorrenza logica tra i processi, continuando a condividere tra i thread lo spazio in memoria riservato ai dati.\nFigura 8-1 Nel diagramma nella Figura 8-1, viene schematizzato lipotetico funzionamento della concorrenza logica. Dal punto di vista dellutente, i thread logici appaiono come una serie di processi che eseguono parallelamente le loro funzioni. Dal punto di vista della applicazione rappresentano una serie di processi logici che, da una parte condividono la stessa memoria della applicazione che li ha creati, dallaltra concorrono con il processo principale al meccanismo di assegnazione della CPU del computer su cui lapplicazione sta girando.\nThread di sistema In Java, esistono un certo numero di thread che vengono avviati dalla virtual machine in modo del tutto trasparente allutente.\nEsiste un thread per la gestione delle interfacce grafiche responsabile della cattura di eventi da passare alle componenti o dellaggiornamento dei contenuti dellinterfaccia grafica.\nIl garbage collection un thread responsabile di trovare gli oggetti non pi referenziati e quindi da eliminare dallo spazio di memoria della applicazione.\nLo stesso metodo main() di una applicazione viene avviato come un thread sotto il controllo della java virtual machine.\n http://www.java-net.tv 118\nFigura 8-2 Nella figura 8-2 viene schematizzata la struttura dei principali thread di sistema della virtual machine Java.\nLa classe java.lang.Thread In Java, un modo per definire un oggetto thread quello di utilizzare lereditariet derivando il nuovo oggetto dalla classe base java.lang.Thread mediante listruzione extends (questo meccanismo schematizzato nella figura 8-3).\nFigura 8-3 La classe java.lang.Thread fornita dei metodi necessari alla esecuzione,\ngestione e interruzione di un thread. I tre principali:\n http://www.java-net.tv 119\nrun() : il metodo utilizzato per implementare le funzionalit eseguite thread. In genere lunico metodo su cui effettuare overriding. Nel caso in cui il metodo non venga soprascritto, al momento della esecuzione eseguir una funzione nulla;\nstart() : causa lesecuzione del thread. La Java Virtual Machine chiama il metodo run() avviando il processo concorrente;\ndestroy() : distrugge il thread e rilascia le risorse allocate.\nUn esempio di thread definito per ereditariet dalla classe Thread il seguente:\nclass MioPrimoThread extends Thread {\nint secondi ;\nMioPrimoThread (int secondi) {\nthis. secondi = secondi;\n}\npublic void run() {\n// ogni slice di tempo definito da secondi\n//stampa a video una frase\n}\nInterfaccia Runnable Ricordando i capitoli sulla ereditariet in Java, eravamo arrivati alla conclusione che lereditariet singola insufficiente a rappresentare casi in cui necessario creare gerarchie di derivazione pi complesse, e che grazie alle interfacce\npossibile implementare lereditariet multipla a livello di prototipi di classe.\nSupponiamo ora che la nostra classe MioPrimoThread sia stata definita a partire da una classe generale diversa da java.lang.Thread. A causa dei limiti stabiliti dalla ereditariet singola, sar impossibile creare un thread utilizzando lo stesso meccanismo definito nel paragrafo precedente.\nSappiamo per che mediante listruzione implements possiamo implementare pi di una interfaccia. Lalternativa al caso precedente quindi quella di definire un oggetto thread utilizzando linterfaccia Runnable di java.lang (Figura 8-4).\nLinterfaccia Runnable contiene il prototipo di un solo metodo:\npublic interface Runnable\n{\npublic void run();\n}\nnecessario ad indicare lentry-point del nuovo thread (esattamente come definito nel paragrafo precedente). La nuova versione di MioPrimoThread sar quindi:\nclass MiaClasseBase{\nMiaClasseBase () {\n .\n}\npublic void faiQualcosa() {\n .\n}\n}\n http://www.java-net.tv 120\nclass MioPrimoThread extends MiaClasseBase implements Runnable{\nint secondi ;\nMioPrimoThread (int secondi) {\nthis. secondi = secondi;\n}\npublic void run() {\n// ogni slice di tempo definito da secondi\n//stampa a video una frase\n}\n}\nIn questo caso, affinch il threads sia attivato, sar necessario creare esplicitamente una istanza della classe Thread utilizzando il costruttore Thread(Runnable r).\nMioPrimoThread miothread = new MioPrimoThread(5);\nThread nthread = new Thread(miothread);\nnthread.start() //provoca la chiamata al metodi run di MioPrimoThread ;\nFigura 8-4 Sincronizzare thread Quando due o pi thread possono accedere ad un oggetto contemporaneamente per modificarlo, il rischio a cui si va incontro quello della corruzione dei dati rappresentati dalloggetto utilizzato tra i thread in regime di concorrenza.\nImmaginiamo ad esempio che una classe rappresenti il conto in banca della famiglia Tizioecaio e che il conto sia intestato ad entrambi i signori Tizioecaio. Supponiamo ora che loggetto utilizzi un dato membro intero per il saldo del conto pari a lire 1.200.000.\nSe i due intestatari del conto (thread) accedessero contemporaneamente per ritirare dei soldi, si rischierebbe una situazione simile alla seguente:\n http://www.java-net.tv tarquini@all- 121\nIl signor Tizioecaio accede al conto chiedendo di ritirare 600.000 lire.\nUn metodo membro delloggetto conto controlla il saldo trovando 1.200.000 lire.\nLa signora Tizioecaio accede al conto chiedendo di ritirare 800.000 lire.\nUn metodo membro delloggetto conto controlla il saldo trovando 1.200.000 lire.\nIl metodo membro delloggetto conto controlla il saldo trovando 1.200.000 lire.\nVengono addebitate 600.000 del signor Tizioecaio.\nVengono addebitate 800.000 della signora Tizioecaio.\nIl conto va in scoperto di 200.000 ed i due non lo sanno.\nIn questi casi quindi necessario che i due thread vengano sincronizzati ovvero che mentre uno esegue loperazione, laltro deve rimanere in attesa. Java fornisce un metodo per gestire la sincronizzazione tra thread mediante la parola chiave synchronized.\nQuesto modificatore deve essere aggiunto alla dichiarazione del metodo per assicurare che solo un thread alla volta sia in grado di utilizzare dati sensibili. Di fatto, indipendentemente dal numero di thread che tenteranno di accedere la metodo, solo uno alla volta potr eseguirlo. Gli altri rimarranno in coda in attesa di ricevere il controllo. Metodi di questo tipo sono detti Thread Safe.\nNellesempio successivo riportiamo due versioni della classe Set di cui, la prima non utilizza il modificatore, la seconda invece thread safe.\nclass Set // Versione non thread safe\n{\nprivate int data[];\n ..\nboolean isMember(int n)\n{\n//controlla se lintero appartiene allinsieme\n}\nvoid add(int n)\n{\n//aggiunge n allinsieme\n}\n}\nclass Set // Versione thread safe\n{\nprivate int data[];\n ..\nsynchronized boolean isMember(int n)\n{\n//controlla se lintero appartiene allinsieme\n}\nvoid add(int n)\n{\n//aggiunge n allinsieme\n}\n}\nLock Il meccanismo descritto nel paragrafo precedente non ha come solo effetto quello di impedire che due thread accedano ad uno stesso metodo contemporaneamente,\nma impedisce il verificarsi di situazioni anomale tipiche della programmazione concorrente. Consideriamo lesempio seguente:\n http://www.java-net.tv 122\nclass A\n{\n ..\nsynchronized int a()\n{\nreturn b()\n}\nsynchronized b(int n)\n{\n ..\nreturn a();\n}\n}\nSupponiamo ora che un thread T1 chiami il metodo b() della classe A contemporaneamente ad un secondo thread T2 che effettua una chiamata al metodo a() della stessa istanza di classe. Ovviamente, essendo i due metodi sincronizzati, il primo thread avrebbe il controllo sul metodo b() ed il secondo su a(). Lo scenario che si verrebbe a delineare disastroso inquanto T1 rimarrebbe in attesa sulla chiamata al metodo a() sotto il controllo di T2 e, viceversa T2 rimarrebbe bloccato sulla chiamata al metodo b() sotto il controllo di T1. Questa situazione si definisce deadlock e necessit di algoritmi molto complessi e poco efficienti per essere gestita o prevenuta.\nJava fornisce il programmatore la certezza che casi di questo tipo non avverranno mai. Di fatto, quando un thread entra allinterno di un metodo sincronizzato ottiene il lock sulla istanza dell oggetto (non solo sul controllo del metodo). Il thread che ha ottenuto il lock sulla istanza potr quindi richiamare altri metodi sincronizzati senza entrare in deadlock.\nOgni altro thread che prover ad utilizzare listanza in lock delloggetto si metter in coda in attesa di essere risvegliato al momento del rilascio della istanza da parte del thread proprietario.\nQuando il primo thread avr terminato le sue operazioni, il secondo otterr il lock e di conseguenza luso privato delloggetto.\nSincronizzazione di metodi statici Metodi statici accedono a dati membro statici. Dal momento che ogni classe pu accedere a dati membro statici i quali non richiedono che la classe di cui sono membri sia attiva, allora un thread che effettui una chiamata ad un metodo statico sincronizzato non pu ottenere il lock sulla istanza delloggetto. Daltra parte\nnecessaria una forma di prevenzione del deadlock anche in questo caso.\nJava prevede luso di una seconda forma di lock. Quando un thread accede ad un metodo statico sincronizzato, ottiene un lock su classe, ovvero su tutte le istanza della stessa classe di cui sta chiamando il metodo. In questo scenario, nessun thread pu accedere a metodi statici sincronizzati di ogni istanza di una stessa classe fino a che un thread detiene il lock sulla classe.\nQuesta seconda forma di lock nonostante riguardi tutte le istanze di un oggetto,\ncomunque meno restrittiva della precedente inquanto metodi sincronizzati non statici della classe in lock possono essere eseguiti durante lesecuzione del metodo statico sincronizzato.\n http://www.java-net.tv 123\nBlocchi sincronizzati Alcune volte pu essere comodo ottenere il lock su una istanza direttamente allinterno di un metodo e ristretto al tempo necessario per eseguire solo alcune istruzioni di codice. Java gestisce queste situazioni utilizzando blocchi di codice sincronizzati.\nNellesempio a seguire, il blocco sincronizzato ottiene il controllo sulloggetto QualcheOggetto e modifica il dato membro pubblico v.\nclass UnaClasseACaso\n{\npublic void a(QualcheOggetto unaistanza)\n{\n ..\nsynchronized (unaistanza); //ottiene il lock su una istanza\n{\nunaistanza.v=23;\n}\n}\n}\nQuesta tecnica pu essere utilizzata anche utilizzando la parola chiave this come parametro della dichiarazione del blocco sincronizzato. Nel nuovo esempio,\ndurante tutta la esecuzione del blocco sincronizzato, nessun altro thread potr accedere alla classe attiva.\nclass UnaClasseACaso\n{\npublic void a(QualcheOggetto unaistanza)\n{\n ..\nsynchronized (this); //ottiene il lock su se stessa\n{\nunaistanza.v=23;\n}\n}\n}\n http://www.java-net.tv 124\nLaboratorio 9 Java Thread d\nEsercizio 1 Creare una applicazione che genera tre thread. Utilizzando il metodo sleep() di java.lang.Thread, il primo deve stampare I am thread one una volta al secondo, il secondo I am thread twouna volta ogni due secondi, ed il terzo I am thread three una volta ogni tre secondi.\nEsercizio 2 Creare una applicazione che testi il funzionamento della sincronizzazione.\nUsando i tre thread dellesercizio precedente, fare in modo che rimangano in attesa un tempo random da 1 a 3 secondi (non pi un tempo prefissato) ed utilizzino un metodo sincronizzato statico e uno sincronizzato non statico stampando un messaggio di avviso ogni volta.\n http://www.java-net.tv 125\nSoluzione al primo esercizio import java.lang.*;\npublic class three_threads implements Runnable\n{\nString message;\nint how_long;\nThread me;\npublic three_threads (String msg, int sleep_time) {\nmessage = msg;\nhow_long= sleep_time * 1000;\nme = new Thread(this);\nme.start();\n}\npublic void run ()\n{\nwhile (true) {\ntry {\nme. Sleep (how_long);\nSystem.out.println(message);\n} catch(Exception e) {}\n}\n}\npublic static void main (String g[])\n{\nthree_threads tmp;\ntmp= new three_threads(I am thread one,1);\ntmp= new three_threads(I am thread two,2);\ntmp= new three_threads(I am thread three,3);\n}\n}\nSoluzione al secondo esercizio Import java.lang.*;\nclass shared_thing\n{\npublic static synchronized void stat_f(locks who)\n{\nSystem.out.println(who.name + Locked static);\ntry {\nWho.me.sleep (who.how_long);\n} catch(Exception e) {}\nSystem.out.println(who.name + Unlocked static);\n}\npublic synchronized void a (locks who)\n{\nSystem.out.println(who.name + Locked a);\ntry {\nwho.me.sleep (who.how_long);\n} catch(Exception e) {}\nSystem.out.println(who.name + Unlocked a);\n http://www.java-net.tv 126\n}\npublic synchronized void b (locks who)\n{\nSystem.out.println(who.name + Locked b);\ntry {\nWho.me.sleep (who.how_long);\n} catch(Exception e) {}\nSystem.out.println(who.name + Unlocked b);\n}\n}\npublic class locks implements Runnable\n{\nString name;\nint how_long;\nShared_thing thing;\nThread me;\npublic locks(String n, shared_thing st)\n{\nName = n ;\nThing = st;\n}\npublic static void main (String a[a])\n{\nlocks lk;\nshared_thing t = new shared_thing();\n1k=new locks (Thread one: ,t );\n1k.me =new Thread(1k);\n1k.me.start();\n1k=new locks (Thread two: ,t );\n1k.me =new Thread(1k);\n1k.me.start();\n1k=new locks (Thread three: ,t );\n1k.me =new Thread(1k);\n1k.me.start();\n}\npublic void run ()\n{\nint which_func;\nwhile(true) {\nwhich_func;\nwhile(true) {\nwhich_func =(int) (Math.random() * 2.5 + 1);\nhow_long = (int) (Mayh.random() * 2000.0 + 1000.0);\nswitch (which_func) {\ncase 1:\nSystem.out.println(name + Trying a());\nThing.a(this);\nBreak;\ncase 2:\nSystem.out.println(name + Trying b());\nThing.b(this);\nBreak;\ncase 3:\nSystem.out.println(name + Trying static());\nThing.stat_f(this);\nBreak;\n http://www.java-net.tv 127\n}\n}\n}\n}\n http://www.java-net.tv tar 128\nCapitolo 11 Java Networking Introduzione\nLa programmazione di rete un tema di primaria importanza inquanto spesso utile creare applicazioni che forniscano di servizi di rete. Per ogni piattaforma supportata, Java supporta sia il protocollo TCP che il protocollo UDP.\nIn questo capitolo introdurremo alla programmazione client/server utilizzando Java non prima per di aver introdotto le nozioni basilari su reti e TCP/IP.\nI protocolli di rete (Internet)\nDescrivere i protocolli di rete e pi in generale il funzionamento di una rete\nprobabilmente cosa impossibile se fatto, come in questo caso, in poche pagine.\nCercher quindi di limitare i danni facendo solo una breve introduzione a tutto ci che utilizziamo e non vediamo quando parliamo di strutture di rete, ai protocolli che pi comunemente vengono utilizzati ed alle modalit di connessione che ognuno di essi utilizza per realizzare la trasmissione dei dati tra client e server o viceversa.\nDue applicazioni client/server in rete comunicano tra di loro scambiandosi pacchetti di dati costruiti secondo un comune protocollo di comunicazione che definisce quella serie di regole sintattiche e semantiche utili alla comprensione dei dati contenuti nel pacchetto.\nI dati trasportati allinterno di questi flussi di informazioni possono essere suddivisi in due categorie principali : i dati necessari alla comunicazione tra le applicazioni ovvero i dati che non sono a carico dellapplicativo che invia il messaggio (esempio: lindirizzo della macchina che invia il messaggio e quello della macchina destinataria) ed i dati contenenti informazioni strettamente legate alla comunicazione tra le applicazioni ovvero tutti i dati a carico della applicazione che trasmette il messaggio. Risulta chiaro che possiamo identificare, parlando di protocolli, due macro insiemi : Protocolli di rete e Protocolli applicativi.\nAppartengono ai protocolli di rete i protocolli dipendenti dalla implementazione della rete necessari alla trasmissione di dati tra una applicazione ed un'altra.\nAppartengono invece ai protocolli applicativitutti i protocolli che contengono dati dipendenti dalla applicazione e utilizzano i protocolli di rete come supporto per la trasmissione. Nelle tabelle 1 e 2 vengono riportati i pi comuni protocolli appartenenti ai due insiemi.\nDescrizione TCP\nTrasmission Control Protocol / Internet Protocol UDP\nUser Datagram Protocol IP\nInternet Protocol ICMP\nInternet Control Message Protocol Tabella 1 I pi comuni protocolli di rete Protocollo\n http://www.java-net.tv 129\nDescrizione http\nHyper Text Trasfer Protocol Telnet\nProtocollo per la gestione remota via terminale TP\nTime Protocol Smtp\nSimple message trasfer protocollo Ftp\nFile trasfer protocol Tabella 2 I pi comuni protocolli applicativi in Internet Protocollo\nIl primo insieme, pu essere a sua volta suddiviso in due sottoinsiemi: Protocolli di trasmissione e Protocolli di instradamento. Per semplicit faremo comunque sempre riferimento a questi come protocolli di rete. Lunione dei due insiemi suddetti viene comunemente chiamata TCP/IP essendo TCP ed IP i due protocolli pi noti ed utilizzati. Nella Figura 10-1 viene riportato lo schema architetturale del TCP/IP dal quale risulter pi comprensibile la suddivisione nei due insiemi suddetti.\nIn pratica, possiamo ridurre internet ad un gestore di indirizzi il cui compito\nquello di far comunicare tra di loro due o pi sistemi appartenenti o no alla stessa rete.\nFigura 10-1 TCP/IP Indirizzi IP Per inviare pacchetti da una applicazione allaltra necessario specificare lindirizzo della macchina mittente e quello della macchina destinataria. Tutti i Mass http://www.java-net.tv tarquini@all-one-mail.net 130\ncomputer collegati ad internet sono identificati da uno o pi indirizzi numerici detti IP.\nTali indirizzi sono rappresentati da numeri di 32 bit e possono essere scritti informato decimale, esadecimale o in altri formati.\nIl formato di uso comune quello che usa la notazione decimale separata da punti mediante il quale lindirizzo numerico a 32 bit viene suddiviso in quattro sequenze di 1 byte ognuna separate da punto ed ogni byte viene scritto mediante numero intero senza segno. Ad esempio consideriamo lindirizzo IP 0xCCD499C1\n(in notazione esadecimale). Dal momento che:\n0xCC 0xD4\n0x99 0xC1\n204 212\n153 193\nLindirizzo IP secondo la notazione decimale separata da punti sar 204.212.153.193.\nGli indirizzi IP contengono due informazioni utilizzate dal protocollo IP per linstradamento di un pacchetto dal mittente al destinatario, informazioni che rappresentano lindirizzo della rete del destinatario e lindirizzo del computer destinatario allinterno della rete e sono suddivisi in quattro classi differenti : A, B, C,\nD.\nINDIRIZZO IP = INDIRIZZO RETE | INDIRIZZO HOST Gli indirizzi di Classe Asono tutti gli indirizzi il cui primo byte compreso tra 0 e 127 (ad esempio, appartiene alla classe A lindirizzo IP 10.10.2.11) ed hanno la seguente struttura:\nBit: 0 Id. Rete 0-127 7,8 Identificativo di Host 0-255 0-255 0-255 15,16 23,24 31\nDal momento che gli indirizzi di rete 0 e 127 sono indirizzi riservati, un IP di classe A fornisce 126 possibili indirizzi di rete e 224 = 16.777.219 indirizzi di host per ogni rete. Appartengono alla Classe B gli indirizzi IP in cui il primo numero\ncompreso tra 128 e 191 (esempio : 129.100.1.32) ed utilizzano i primi due byte per identificare lindirizzo di rete. In questo caso, lindirizzo IP assume quindi la seguente struttura :\nId. Rete 128-191 Bit:\n0 0-255 7,8 Identificativo di Host 0-255 0-255 15,16 23,24 31\nNotiamo che lindirizzo IP fornisce 214 = 16.384 reti ognuna delle quali con 216 =\n65.536 possibili host. Gli indirizzi di Classe C hanno il primo numero compreso tra 192 e 223 (esempio: 192.243.233.4) ed hanno la seguente struttura :\nId. Rete 192-223 Bit:\n0 0-255 7,8 0-255 15,16 http://www.java-net.tv Id. di Host 0-255 23,24 31\n 131\nQuesti indirizzi forniscono identificatori per 222 = 4.194.304 reti e 28 = 256 computer che, si riducono a 254 dal momento che gli indirizzi 0 e 255 sono indirizzi riservati. Gli indirizzi di Classe D, sono invece indirizzi riservati per attivit di multicasting.\nIndirizzo Multicast 1110 .\nBit: 0 7,8 15,16 23,24 31\nIn una trasmissione Multicast, un indirizzo non fa riferimento ad un singolo host allinterno di una rete bens a pi host in attesa di ricevere i dati trasmessi. Esistono infatti applicazioni in cui necessario inviare uno stesso pacchetto IP a pi host destinatari in simultanea. Ad esempio, applicazioni che forniscono servizi di streaming video privilegiano comunicazioni multicast a unicast potendo in questo caso inviare pacchetti a gruppi di host contemporaneamente, utilizzando un solo indirizzo IP di destinazione.\nQuanto descritto in questo paragrafo schematizzato nella prossima figura\n(Figura 10-2) da cui appare chiaro che possibile effettuare la suddivisione degli indirizzi IP nelle quattro classi suddette applicando al primo byte in formato binario la seguente regola :\n1) un indirizzo IP appartiene alla Classe Ase il primo bit uguale a 0;\n2) un indirizzo IP appartiene alla Classe Bse i primi due bit sono uguali a 10;\n3) un indirizzo IP appartiene alla Classe Cse i primi tre bit sono uguali a 110;\n4) un indirizzo IP appartiene alla Classe Dse i primi 4 bit sono uguali a 1110.\nClasse A 0 Indirizzo di rete Indirizzo di host Classe B 1 0 Indirizzo di rete Indirizzo di host Classe C 1 1 0\nIndirizzo di rete Indirizzo di host Classe D 1 1 1\n0 Bit:\n2 3\n0 1\nIndirizzo multicast 31\nFigura 10-2 : Le quattro forme di un indirizzo IP Comunicazione Connection Orientedo Connectionless I protocolli di trasporto appartenenti al primo insieme descritto nei paragrafi precedenti si occupano della trasmissione delle informazioni tra server e client (o viceversa). Per far questo utilizzano due modalit di trasmissione dei dati rispettivamente con connessione (Connection Oriented) o senza (Connectionless).\nIn modalit con connessioneil TCP/IP stabilisce un canale logico tra il computer server ed il computer client, canale che rimane attivo sino alla fine della trasmissione dei dati o sino alla chiusura da parte del server o del client. Questo tipo di Massimiliano Tarquini http://www.java-net.tv 132\ncomunicazione necessaria in tutti i casi in cui la rete debba garantire la avvenuta trasmissione dei dati e la loro integrit. Con una serie di messaggi detti di Acknowledge server e client verificano lo stato della trasmissione ripetendola se necessario. Un esempio di comunicazione con connessione la posta elettronica in cui il client di posta elettronica stabilisce un canale logico di comunicazione con il server tramite il quale effettua tutte lo operazione di scarico od invio di messaggi di posta. Solo alla fine delle operazione il client si occuper di notificare al server la fine della trasmissione e quindi la chiusura della comunicazione.\nNel secondo caso (Connectionless) il TCP/IP non si preoccupa della integrit dei dati inviati ne della avvenuta ricezione da parte del client. Per fare un paragone con situazioni reali, un esempio di protocollo connectionless ci fornito dalla trasmissione del normale segnale televisivo via etere. In questo caso infatti il trasmettitore (o ripetitore) trasmette il suo messaggio senza preoccuparsi se il destinatario lo abbia ricevuto.\nDomain Name System : risoluzione dei nomi di un host Ricordarsi a memoria un indirizzo IP non cosa semplicissima, proviamo infatti ad immaginare quanto potrebbe essere complicato navigare in Internet dovendo utilizzare la rappresentazione in notazione decimale separata da punto dellindirizzo del sito internet che vogliamo visitare. Lo standard prevede che oltre ad un indirizzo IP un host abbia associato uno o pi nomi Host Name che ci consentono di referenziare un computer in rete utilizzando una forma pi semplice e mnemonica della precedente. Ecco perch generalmente utilizziamo nomi piuttosto che indirizzi per collegarci ad un computer sulla rete.\nPer poter fornire questa forma di indirizzamento esistono delle applicazioni che traducono i nomi in indirizzi (o viceversa) comunemente chiamate Server DNS o nameserver. Analizziamo in breve come funziona la risoluzione di un nome mediante nameserver, ossia la determinazione dellindirizzo IP a partire dall Host Name.\nFigura 10-3: Gerarchia dei server DNS Tipicamente un nome di host ha la seguente forma :\nmyhost.mynet.net http://www.java-net.tv tarquini@all-one-mail.net 133\nDal punto di vista dellutente il nome va letto da sinistra verso destra ossia dal nome locale (myhost) al nome globale (net) ed ha diversi significati :\nmyhost.mynet.net si riferisce ad un singolo host allinterno di una rete ed per questo motivo detto fully qualified; mynet.net si riferisce al dominio degli host collegati alla rete dellorganizzazione mynet. Net si riferisce ai sistemi amministrativi nella rete mondiale Internet ed detto nome di alto livello Un nome quindi definisce una struttura gerarchica, e proprio su questa gerarchia si basa il funzionamento della risoluzione di un nome. Nella Figura 10-3 illustrata la struttura gerarchica utilizzata dai server DNS per risolvere i nomi. Dal punto di vista di un server DNS il nome non viene letto da sinistra verso destra, ma al contrario da destra verso sinistra ed il processo di risoluzione pu essere schematizzato nel modo seguente:\n1. Il nostro browser richiede al proprio server DNS lindirizzo IP corrispondente al nome myhost.mynet.net;\n2. Il DNS interroga il proprio database dei nomi per verificare se in grado di risolvere da solo il nome richiesto. Nel caso in cui il nome esista allinterno della propria base dati ritorna lindirizzo IP corrispondente,\naltrimenti deve tentare unaltra strada per ottenere quanto richiesto.\n3. Ogni nameserver deve sapere come contattare un almeno un server radice, ossia un server DNS che conosca i nomi di alto livello e sappia quale DNS in grado di risolverli. Il nostro DNS contatter quindi il server radice a lui conosciuto e chieder quale DNS server in grado di risolvere i nomi di tipo net;\n4. Il DNS server interrogher quindi il nuovo sistema chiedendogli quale DNS Server a lui conosciuto in grado di risolvere i nomi appartenenti al dominio mynet.net il quale verr a sua volta interrogato per risolvere infine il nome completo myhost.mynet.net Nella Figura 10-4\nschematizzato il percorso descritto affinch il nostro DNS ci restituisca la corretta risposta.\nFigura 10-4: flusso di ricerca allinterno della gerarchia dei server DNS http://www.java-net.tv tarquini@all-one-mail.net 134\nURL Parlando di referenziazione di un computer sulla rete, il nome di un Host non rappresenta ancora il nostro punto di arrivo. Con le nostre conoscenze siamo ora in grado di reperire e referenziare un computer host sulla rete, ma non siamo ancora in grado di accedere ad una risorsa di qualunque tipo essa sia.\nNavigando in Internet avrete sentito spesso nominare il termine URL. URL\nacronimo di Uniform Resource Locator e rappresenta lindirizzo di una risorsa sulla rete e fornisce informazioni relative al protocollo necessario alla gestione della risorsa indirizzata. Un esempio di URL il seguente:\nhttp://www.java-net.tv/index.html Http indica il protocollo (in questo caso Hyper Text Trasfer Protocol) e\n//www.java-net.tv/index.html il nome completo della risorsa richiesta. In definitiva un URL ha la seguente struttura :\nURL = Identificatore del Protocollo : Nome della Risorsa Il Nome della risorsapu contenere una o pi componenti tra le seguenti :\n1) Host Name : Nome del computer host su cui la risorsa risiede;\n2) File Name : Il path completo alla risorsa sul computer puntato da Host Name;\n3) Port Number : Il numero della porta a cui connettersi (vedremo in seguito il significato di porta);\n4) Reference : un puntatore ad una locazione specifica allinterno di una risorsa.\nTrasmission Control Protocol : trasmissione Connection Oriented Il protocollo TCP appartenente allo strato di trasporto del TCP/IP (Figura 10-1)\ntrasmette dati da server a client suddividendo un messaggio di dimensioni arbitrarie in frammenti o datagrammi da spedire separatamente e non necessariamente sequenzialmente, per poi ricomporli nellordine corretto. Una eventuale nuova trasmissione pu essere richiesta per leventuale pacchetto non arrivato a destinazione o contenenti dati affetti da errori. Tutto questo in maniera del tutto trasparente rispetto alle applicazioni che trasmettono e ricevono il dato.\nA tal fine, TCP stabilisce un collegamento logico o connessione tra il computer mittente ed il computer destinatario, creando una sorta di canale attraverso il quale le due applicazioni possono inviarsi dati in forma di pacchetti di lunghezza arbitraria.\nPer questo motivo TCP fornisce un servizio di trasporto affidabile garantendo una corretta trasmissione dei dati tra applicazioni. Nella Figura 10-5 riportato in maniera schematica il flusso di attivit che il TCP/IP deve eseguire in caso di trasmissioni di questo tipo. Queste operazioni, soprattutto su reti di grandi dimensioni, risultano essere molto complicate ed estremamente gravose in quanto comportano che per assolvere al suo compito il TCP debba tener traccia di tutti i possibili percorsi tra mittente e destinatario.\nUnaltra capacit del TCP garantita dalla trasmissione in presenza di una connessione quella di poter bilanciare la velocit di trasmissione tra mittente e destinatario, capacit che risulta molto utile soprattutto nel caso in cui la trasmissione avvenga in presenza di reti eterogenee.\nIn generale quando due sistemi comunicano tra di loro, necessario stabilire le dimensioni massime che un datagramma pu raggiungere affinch possa esservi Massimiliano Tarquini http://www.java-net.tv 135\ntrasferimento di dati. Tali dimensioni sono dipendenti dalla infrastruttura di rete, dal sistema operativo della macchina host e, possono quindi variare anche per macchine appartenenti alla stessa rete.\nFigura 10-5: Time-Line di una trasmissione Connection Oriented Quando viene stabilita una connessione tra due host, il TCP/IP negozia le dimensioni massime per la trasmissione in ogni direzione dei dati. Mediante il meccanismo di accettazione di un datagramma (acknowledge) viene trasmesso di volta in volta un nuovo valore di dimensione detto finestra che il mittente potr utilizzare nellinvio del datagramma successivo. Questo valore pu variare in maniera crescente o decrescente a seconda dello stato della infrastruttura di rete.\nFigura 10-6 : I primi 16 ottetti di un segmento TCP Massimiliano Tarquini http://www.java-net.tv 136\nNonostante le sue caratteristiche, il TCP/IP non risulta sempre essere la scelta migliore relativamente al metodo di trasmissione di dati. Dovendo fornire tanti servizi,\nil protocollo in questione oltre ai dati relativi al messaggio da trasmettere deve trasportare una quantit informazioni a volte non necessarie e, che spesso possono diventare causa di sovraccarico sulla rete. In questi casi a discapito della qualit della trasmissione necessario favorirne la velocit adottando trasmissioni di tipo Connectionless.\nUser Datagram Protocol : trasmissione Connectionless User Datagram Protocol si limita ad eseguire operazioni di trasmissione di un pacchetto di dati tra macchina mittente e macchina destinataria con il minimo sovraccarico di rete senza garanzia di consegna: il protocollo in assenza di connessione non invia pacchetti di controllo della trasmissione perdendo di conseguenza la capacit di rilevare perdite o duplicazioni di dati.\nFigura 10-7 : Datagramma User Datagram Protocol Nella Figura 10-8 viene mostrato il formato del datagramma UDP. Dal confronto con limmagine 7, appare chiaro quanto siano ridotte le dimensioni dell header del datagramma UDP rispetto al datagramma TCP.\nAltro limite di UDP rispetto al precedente sta nella mancata capacit di calcolare la finestraper la trasmissione dei dati, calcolo che sar completamente a carico del programmatore. Una applicazione che utilizza questo protocollo ha generalmente a disposizione un buffer di scrittura di dimensioni prefissate su cui scrivere i dati da inviare. Nel caso di messaggi che superino queste dimensioni sar necessario spezzare il messaggio gestendo manualmente la trasmissione dei vari segmenti che lo compongono. Sempre a carico del programmatore sar quindi la definizione delle politiche di gestione per la ricostruzione dei vari segmenti nel pacchetto originario e per il recupero di dati eventualmente persi nella trasmissione.\nIdentificazione di un processo : Porte e Socket Sino ad ora abbiamo sottointeso il fatto che parlando di rete, esistano allinterno di ogni computer host uno o pi processi che devono comunicare tra di loro tramite il TCP/IP con processi esistenti su altri computer host. Viene spontaneo domandarsi come un processo possa usufruire dei servizi messi a disposizione dal TCP/IP.\nIl primo passo che un processo deve compiere per poter trasmettere o ricevere dati quello di identificarsi rispetto al TCP/IP affinch possa essere riconosciuto dallo strato di gestione della rete. Tale identificazione viene effettuata tramite un numero detto Port o Port Address. Questo numero non per in grado di descrivere in maniera univoca una connessione (n processi su n host differenti potrebbero avere medesima Port). Le specifiche del protocollo definiscono una Massimiliano Tarquini http://www.java-net.tv 137\nstruttura chiamata Association, nientaltro che una quintupla di informazioni necessarie a descrivere univocamente una connessione :\nAssociation = (Protocollo,\nIndirizzo Locale,\nProcesso Locale,\nIndirizzo Remoto,\nProcesso Remoto)\nAd esempio una Associationla seguente quintupla :\n(TCP, 195.233.121.14, 1500, 194.243.233.4, 21)\nin cui TCP il protocollo da utilizzare, 195.233.121.14 lindirizzo locale ovvero lindirizzo IP del computer mittente, 1500 lidentificativo o Port Address del processo locale, 194.243.233.4 lindirizzo remoto ovvero lindirizzo IP del computer destinatario ed infine 21 lidentificativo o Port Address del processo remoto.Come fanno quindi due applicazioni che debbano comunicare tra di loro a creare una Association? Proviamo a pensare ad una Association come ad un insieme contenente solamente i 5 elementi della quintupla. Come si vede dalla Immagine 9, tale insieme pi essere costruito mediante unione a partire da due sottoinsiemi che chiameremo rispettivamente Local Half Association e Remote Half Association:\nFigura 10-8 : Association = Local Half Association U Remote Half Association Due processi (mittente o locale e destinatario o remoto) definiscono una Association, stabilendo in modo univoco una trasmissione mediante la creazione di due Half Association. Le Half Associationsono chiamate Socket.\nUn Socket rappresenta quindi il meccanismo attraverso il quale una applicazione invia e riceve dati tramite rete con unaltra. Consideriamo ad esempio la precedente Half Association (TCP, 195.233.121.14, 1500, 194.243.233.4, 21). La quintupla rappresenta in modo univoco una trasmissione TCP tra due applicazioni che comunicano tramite i due Socket :\n1 : (TCP, 195.233.121.14, 1500)\n2 : (TCP, 194.243.233.4, 21)\n http://www.java-net.tv 138\nIl package java.net E il package Java che mette a disposizione del programmatore le API necessarie per lo sviluppo di applicazioni Client/Server basata su socket. Vedremo ora come le classi appartenenti a questo package implementino quanto finora descritto solo concettualmente e come utilizzare gli oggetti messi a disposizione dal package per realizzare trasmissione di dati via rete tra applicazioni. La Figura 10.9 rappresenta la gerarchia delle classi ed interfacce appartenenti a questo package.\nScorrendo velocemente i loro nomi notiamo subito le loro analogie con la nomenclatura utilizzata nei paragrafi precedenti. Analizziamole brevemente.\nGerarchia delle classi o class java.lang.Object o class java.net.Authenticator o class java.lang.ClassLoader o class java.security.SecureClassLoader o class java.net.URLClassLoader o class java.net.ContentHandler o class java.net.DatagramPacket o class java.net.DatagramSocket o class java.net.MulticastSocket o class java.net.DatagramSocketImpl (implements java.net.SocketOptions)\no class java.net.InetAddress (implements java.io.Serializable)\no class java.net.PasswordAuthentication o class java.security.Permission (implements java.security.Guard, java.io.Serializable)\no class java.security.BasicPermission (implements java.io.Serializable)\no class java.net.NetPermission o class java.net.SocketPermission (implements java.io.Serializable)\no class java.net.ServerSocket o class java.net.Socket o class java.net.SocketImpl (implements java.net.SocketOptions)\no class java.lang.Throwable (implements java.io.Serializable)\no class java.lang.Exception o class java.io.IOException o class java.net.MalformedURLException o class java.net.ProtocolException o class java.net.SocketException o class java.net.BindException o class java.net.ConnectException o class java.net.NoRouteToHostException o class java.net.UnknownHostException o class java.net.UnknownServiceException o class java.net.URL (implements java.io.Serializable)\no class java.net.URLConnection o class java.net.HttpURLConnection o class java.net.JarURLConnection o class java.net.URLDecoder o class java.net.URLEncoder o class java.net.URLStreamHandler o\no o\no o\no Gerarchia delle Interfacce interface java.net.ContentHandlerFactory interface java.net.DatagramSocketImplFactory interface java.net.FileNameMap interface java.net.SocketImplFactory interface java.net.SocketOptions interface java.net.URLStreamHandlerFactory Figura 10-9 : Gerarchie tra le classi di Java.net Un indirizzo IP rappresentato dalla classe InetAddress che fornisce tutti i metodi necessari a manipolare un indirizzo internet necessario allinstradamento dei dati sulla rete e consente la trasformazione di un indirizzo nelle sue varie forme :\n http://www.java-net.tv tarquini@all-one-mail.net 139\ngetAllByName(String host) ritorna tutti gli indirizzi internet di un host dato il suo nome in forma estesa (esempio: getAllByName(www.javasoft.com));\ngetByName(String host) ritorna lindirizzo internet di un host dato il suo nome in forma estesa;\ngetHostAddress() ritorna una stringa rappresentante lindirizzo IP dellhost nella forma decimale separata da punto \"%d.%d.%d.%d\";\ngetHostName() ritorna una stringa rappresentante il nome dellhost.\nLe classi Socket e ServerSocket implementano rispettivamente un socket client e server per la comunicazione orientata alla connessione, la classe DatagramSocket implementa i socket per la trasmissione senza connessione ed infine la classe MulticastSocket fornisce supporto per i socket di tipo multicast.\nRimangono da menzionare le classi URL, URLConnection, HttpURLConnection e URLEencoder che implementano i meccanismi di connessione tra un browser ed un Web Server.\nUn esempio completo di applicazione client/server Nei prossimi paragrafi analizzeremo in dettaglio una applicazione client/server basata su modello di trasmissione con connessione. Prima di entrare nei dettagli della applicazione necessario per porci una domanda: cosa accade tra due applicazioni che comunichino con trasmissione orientata a connessione?\nIl server ospitato su un computer host in ascolto tramite socket su una determinata porta in attesa di richiesta di connessione da parte di un client (Figura 10-10). Il client invia la sua richiesta al server tentando la connessione tramite la porta su cui il server in ascolto.\nFigura 10-11: Richiesta di connessione Client/Server http://www.java-net.tv tarquini@all-one-mail.net 140\nDobbiamo a questo punto distinguere due casi: nel primo caso il server comunica con un solo client alla volta accettando una richiesta di connessione solo se nessunaltro client gi connesso (trasmissione unicast); nel secondo caso il server\n in grado di comunicare con pi client contemporaneamente (trasmissione multicast).\nNel caso di trasmissione unicast, se la richiesta di connessione tra client e server va a buon fine, il server accetta la connessione stabilendo il canale di comunicazione con il client che, a sua volta, ricevuta la conferma alloca un socket su una porta locale tramite il quale trasmettere e ricevere pacchetti (Figura 10-12).\nFigura 10-12: Connessione Unicast Nel caso di trasmissione multicast, se la richiesta di connessione tra client e server va a buon fine, il server prima di creare il canale di connessione alloca un nuovo socket associato ad una nuova porta (tipicamente avvia un nuovo thread per ogni connessione) a cui cede in gestione la gestione del canale di trasmissione con il client. Il socket principale torna quindi ad essere libero di rimanere in ascolto per una nuova richiesta di connessione (Figura 10-13).\nUn buon esempio di applicazione client/server che implementano trasmissioni multicast dono browser e Web Server. A fronte di n client (browser) connessi, il server deve essere in grado di fornire servizi a tutti gli utenti continuando ad ascoltare sulla porta 80 (porta standard per il servizio) in attesa di nuove connessioni.\nFigura 10-13 : Connessione Multicast Massimiliano Tarquini http://www.java-net.tv 141\nLa classe ServerSocket La classe ServerSocket rappresenta quella porzione del server che pu accettare richieste di connessioni da parte del client. Questa classe deve essere istanziata passando come parametro il numero della porta su cui il server sar in ascolto. Il codice di seguito rappresenta un prototipo semplificato della classe ServerSocket.\npublic final class ServerSocket\n{\npublic ServerSocket(int port) throws IOException ..\npublic ServerSocket(int port, int count) throws IOException ..\npublic Socket accept() throws IOException\npublic void close()throws IOException\npublic String toString()\n}\nLunico metodo realmente necessario alla classe il metodo accept(). Questo metodo mette il thread in attesa di richiesta di connessioni da parte di un client sulla porta specificata nel costruttore. Quando una richiesta di connessione va a buon fine, viene creato il canale di collegamento e il metodo ritorna un oggetto Socket connesso con il client.\nNel caso di comunicazione multicast, sar necessario creare un nuovo thread a cui passare il socket connesso al client.\nLa classe Socket La classe Socket rappresenta una connessione client/server via TCP su entrambi i lati: client e server. La differenza tra server e client sta nella modalit di creazione di un oggetto di questo tipo. A differenza del server in cui un oggetto Socket viene creato dal metodo accept() della classe ServerSocket, il client dovr provvedere a creare una istanza di Socket manualmente.\npublic final class Socket\n{\npublic Socket (String host, int port)\npublic int getPort()\npublic int getLocalPort()\npublic InputStream getInputStream() throws IOException\npublic OutputStream getOutputStream() throws IOException\npublic synchronized void close () throws IOException\npublic String toString();\n}\nQuando si crea una istanza manuale della classe Socket, il costruttore messo a disposizione dalla classe accetta due parametri: il primo, rappresenta il nome dell host a cui ci si vuole connettere; il secondo, la porta su cui il server in ascolto. Il costruttore una volta chiamato tenter di effettuare la connessione generando una eccezione nel caso in cui il tentativo non sia andato a buon fine.\nNotiamo inoltre che questa classe ha un metodo getInputStream() e un metodo getOutputStream(). Questo perch un Socket accetta la modalit di trasmissione in entrambi i sensi (entrata ed uscita).\nI metodi getPort() e getLocalPort() possono essere utilizzati per ottenere informazioni relative alla connessione, mentre il metodo close() chiude la connessione rilasciando la porta libera di essere utilizzata per altre connessioni.\n http://www.java-net.tv 142\nUn semplice thread di servizio Abbiamo detto che quando implementiamo un server di rete che gestisce pi client simultaneamente, importante creare dei thread separati per comunicare con ogni client. Questi thread sono detti thread di servizio. Nel nostro esempio,\nutilizzeremo una classe chiamata Xfer per definire i servizi erogati dalla nostra applicazione client/server .\n1. import java.net.* ;\n2. import java.lang.* ;\n3. import java.io.* ;\n4.\n5. class Xfer implements Runnable 6. {\n7.\nprivate Socket connection;\n8.\nprivate PrintStream o;\n9.\nprivate Thread me;\n10.\n11.\npublic Xfer(socket s)\n12.\n{\n13.\nconnection = s;\n14.\nme = new Thread(this);\n15.\nme.start();\n16.\n}\n17.\n18.\npublic void run()\n19.\n{\n20.\ntry 21.\n{\n22.\n//converte loutput del socket in un printstream 23.\no = new PrintStream(connection.getOutPutStream());\n24.\n} catch(Exception e) {}\n25.\nwhile (true)\n26.\n{\n27.\no.println(Questo un messaggio dal server);\n28.\ntry 29.\n{\n30.\nma.sleep(1000);\n31.\n} catch(Exception e) {}\n32.\n}\n33.\n}\n34. }\nXfer pu essere creata solo passandogli un oggetto Socket che deve essere gi connesso ad un client. Una volta istanziato, Xfer crea ed avvia un thread associato a se stesso (linee 11-16).\nIl metodo run() di Xfer converte lOutputStream del Socket in un PrintStream che utilizza per inviare un semplice messaggio al client ogni secondo.\nTCP Server La classe NetServ rappresenta il thread primario del server. Equesto il thread che accetter connessioni e creer tutti gli alti thread del server.\n http://www.java-net.tv 143\n1. import java.io.* ;\n2. import java.net.* ;\n3. import java.lang.* ;\n4.\n5. public class NetServ implements Runnable 6. {\n7.\nprivate ServerSocket server;\n8.\npublic NetServ () throws Exception 9.\n{\n10.\nserver = new ServerSocket(2000);\n11.\n}\n12.\npublic void run()\n13.\n{\n14.\nSocket s = null;\n15.\nXfer x;\n16.\n17.\nwhile (true)\n18.\n{\n19.\ntry {\n20.\n//aspetta la richiesta da parte del client 21.\ns = server.accept();\n22.\n} catch (IOException e) {\n23.\nSystem.out.println(e.toString());\n24.\nSystem.exit(1);\n25.\n}\n26.\n//crea un nuovo thread per servire la richiesta 27.\nx = new xfer(s);\n28.\n}\n29.\n}\n30. }\n31.\n32. public class ServerProgram 33. {\n34.\npublic static void main(String args[])\n35.\n{\n36.\nNetServ n = new NetServ();\n37.\n(new Thread(n)).start();\n38.\n}\n39. }\nIl costruttore alla linea 8 crea una istanza di un oggetto ServerSocket associandolo alla porta 2000. Ogni eccezione viene propagata al metodo chiamante.\nLoggetto NetServ implementa Runnable, ma non crea il proprio thread. Sar responsabilit dellutente di questa classe creare e lanciare il thread associato a questo oggetto.\nIl metodo run() estremamente semplice. Alla linea 21 viene accettata la connessione da parte del client. La chiamata server.accept() ritorna un oggetto socket connesso con il client. A questo punto, NetServ crea una istanza di Xfer utilizzando il Socket (linea 27) generando un nuovo thread che gestisca la comunicazione con il client.\nLa seconda classe semplicemente rappresenta il programma con il suo metodo main(). Nelle righe 36 e 37 viene creato un oggetto NetServ, viene generato il thread associato e quindi avviato.\n http://www.java-net.tv 144\nIl client Loggetto NetClient effettua una connessione ad un host specifico su una porta specifica,e legge i dati in arrivo dal server linea per linea. Per convertire i dati di input viene utilizzato un oggetto DataInputStream, ed il client utilizza un thread per leggere i dati in arrivo.\n1. import java.net.* ;\n2. import java.lang.* ;\n3. import java.io.* ;\n4.\n5. public class NetClient implements Runnable 6. {\n7.\nprivate Socket s;\n8.\nprivate DataInputStream input;\n9.\npublic NetClient(String host, int port) throws Exception 10.\n{\n11.\ns = new Socket(host, port);\n12.\n}\n13.\npublic String read() throws Exception 14.\n{\n15.\nif (input == null)\n16.\ninput = new DataInputStream(s.getInputStream());\n17.\nreturn input.readLine();\n18.\n}\n19.\npublic void run()\n20.\n{\n40.\nwhile (true)\n41.\n{\n42.\ntry {\n43.\nSystem.out.println(nc.read());\n44.\n} catch (Exception e) {\n45.\nSystem.out.println(e.toString());\n46.\n}\n21.\n}\n22.\n}\n23. }\n24.\n25. class ClientProgram 26. {\n27.\npublic static void main(String args[])\n28.\n{\n29.\nif(args.length<1) System.exit(1);\n30.\nNetClient nc = new NetClient(args[0], 2000);\n31.\n(new Thread(nc)).start();\n32.\n}\n33. }\n http://www.java-net.tv 145\nParte Seconda Applicazioni Server Side Versione 0.1 http://www.java-net.tv -one-mail.net 146\nCapitolo 12 Java Enterprise Computing Introduzione\nIl termine Enterprise Computing (che per semplicit in futuro indicheremo con EC) sinonimo di Distributed Computing ovvero calcolo eseguito da un gruppo di programmi interagenti attraverso una rete. La figura 11-1 mostra schematicamente un ipotetico scenario di Enterprise Computing evidenziando alcune possibili integrazioni tra componenti server-side. Appare chiara la disomogeneit tra le componenti e di conseguenza la complessit strutturale di questi sistemi.\nFigura 11-1 Dalla figura appaiono chiari alcuni aspetti. Primo, lEC generalmente legato ad architetture di rete eterogenee in cui la potenza di calcolo distribuita tra Main Frame, Super Computer e semplici PC. Lunico denominatore comune tra le componenti il protocollo di rete utilizzato, in genere il TCP/IP. Secondo,\napplicazioni server di vario tipo girano allinterno delle varie tipologie di hardware. Ed infine lEC comporta spesso luso di molti protocolli di rete e altrettanti standard differenti, alcuni dei quali vengono implementati dallindustria del software con componenti specifiche della piattaforma.\nE quindi evidente la complessit di tali sistemi e di conseguenza le problematiche che un analista od un programmatore sono costretti ad affrontare.\nJava tende a semplificare tali aspetti fornendo un ambiente di sviluppo completo di API e metodologie di approccio al problem-solving. La soluzione composta da Sun di Mass http://www.java-net.tv tarquini@all-one-mail.net 147\ncompone di quattro elementi principali: specifiche, Reference Implementation, test di compatibilit e Application Programming Model.\nLe specifiche elencano gli elementi necessari alla piattaforma e le procedure da seguire per una corretta implementazione con J2EE. La reference implementation contiene prototipi che rappresentano istanze semanticamente corrette di J2EE al fine di fornire allindustria del software modelli completi per test. Include tool per il deployment e lamministrazione di sistema, EJBs, JSPs, un container per il supporto a runtime e con supporto verso le transazioni, Java Messaging Service e altri prodotti di terzi. L Application Programming Model un modello per la progettazione e programmazione di applicazioni basato sulla metodologia best-practiceper favorire un approccio ottimale alla piattaforma. Guida il programmatore analizzando quanto va fatto e quanto no con J2EE, e fornisce le basi della metodologia legata allo sviluppo di sistemi multi-tier con J2EE.\nFigura 11-2 Nella figura 11-2 viene illustrato un modello di EC alternativo al precedente in cui viene illustrato con maggior dettaglio il modello precedente con una particolare attenzione ad alcune delle tecnologie di Sun e le loro modalit di interconnessione.\nArchitettura di J2EE Larchitettura proposta dalla piattaforma J2EE divide le applicazioni enterprise in tre strati applicativi fondamentali (figura 11-3): componenti, contenitori e connettori.\nIl modello di programmazione prevede lo sviluppo di soluzioni utilizzando componenti a supporto delle quali fornisce quattro tecnologie fondamentali:\nEnterprise Java Beans;\nServelet ;\n http://www.java-net.tv tarquini@all-one-mail.net 148\nJava Server Pages ;\nApplet.\nLa prima delle tre che per semplicit denoteremo con EJB fornisce supporto per la creazione di componenti server-side che possono essere generate indipendentemente da uno specifico database, da uno specifico transaction server o dalla piattaforma su cui gireranno. La seconda, servlet, consente la costruzione di servizi web altamente performanti ed in grado di funzionare sulla maggior parte dei web server ad oggi sul mercato. La terza, JavaServer Pages o JSP, permette di costruire pagine web dai contenuti dinamici utilizzando tutta la potenza del linguaggio java. Le applet, anche se sono componenti client-side rappresentano comunque tecnologie appartenenti allo strato delle componenti.\nIn realt esiste una quinta alternativa alle quattro riportate per la quale per non si pu parlare di tecnologia dedicate, ed rappresentata dalle componenti serverside sviluppate utilizzando java.\nFigura 11-3 In realt esiste una quinta alternativa alle quattro riportate per la quale per non si pu parlare di tecnologia dedicate, ed rappresentata dalle componenti serverside sviluppate utilizzando java.\nIl secondo strato rappresentato dai contenitori ovvero supporti tecnologici alle tecnologie appartenenti al primo strato logico della architettura. La possibilit di costruire contenitori rappresenta la caratteristica fondamentale del sistema in quanto fornisce ambienti scalari con alte performance.\nInfine i connettori consentono alle soluzioni basate sulla tecnologia J2EE di preservare e proteggere investimenti in tecnologie gi esistenti fornendo uno strato di connessione verso applicazioni-server o middleware di varia natura: dai database relazionali con JDBC fino ai server LDAP con JNDI.\nGli application-server compatibili con questa tecnologia riuniscono tutti e tre gli strati in un una unica piattaforma standard e quindi indipendente dal codice Massimiliano Tarquini http://www.java-net.tv tarquini@all-one-mail.net 149\nproprietario, consentendo lo sviluppo di componenti server-centricin grado di girare in qualunque container compatibile con J2EE indipendentemente dal fornitore di software, e di interagire con una vasta gamma di servizi pre-esistenti tramite i connettori.\nAd appoggio di questa soluzione, la Sun mette a disposizione dello sviluppatore un numero elevato di tecnologie specializzate nella soluzione di singoli problemi.\nGli EJBs forniscono un modello a componenti per il server-side computing, Servlet offrono un efficiente meccanismo per sviluppare estensioni ai Web Server in grado di girare in qualunque sistema purch implementi il relativo container. Infine Java Server Pages consente di scrivere pagine web dai contenuti dinamici sfruttando a pieno le caratteristiche di java.\nUn ultima considerazione, non di secondaria importanza, va fatta sul modello di approccio al problem-solving: la suddivisione netta che la soluzione introduce tra logiche di business, logiche di client, e logiche di presentazione consente un approccio per strati al problema garantendo ordine nella progettazione e nello sviluppo di una soluzione.\nJ2EE Application Model Date le caratteristiche della piattaforma, laspetto pi interessante legato a quello che le applicazioni non devono fare; la complessit intrinseca delle applicazioni enterprise quali gestione delle transazioni, ciclo di vita delle componenti,\npooling delle risorse viene inglobata allinterno della piattaforma che provvede autonomamente alle componenti ed al loro supporto.\nFigura 11-4 Programmatori e analisti sono quindi liberi di concentrarsi su aspetti specifici della applicazione come presentazione o logiche di business non dovendosi http://www.java-net.tv 150\noccupare di aspetti la cui complessit non irrilevante e, in ambito progettuale ha un impatto notevolissimo su costi e tempi di sviluppo.\nA supporto di questo, lApplication Model descrive la stratificazione orizzontale tipica di una applicazione J2EE. Tale stratificazione identifica quattro settori principali\n(figura 11-4) : Client Tier, Web Tier, Business-Tier, EIS-Tier.\nClient Tier Appartengono allo strato client le applicazioni che forniscono allutente una interfaccia semplificata verso il mondo enterprise e rappresentano quindi la percezione che lutente ha della applicazione J2EE. Tali applicazioni si suddividono in due classi di appartenenza : le applicazioni web-based e le applicazioni non-webbased.\nFigura 11-5 Le prime sono quelle applicazioni che utilizzano il browser come strato di supporto alla interfaccia verso lutente ed i cui contenuti vengono generati dinamicamente da Servlet o Java Server Pages o staticamente in HTML.\nLe seconde (non-web-based) sono invece tutte quelle basate su applicazioni stand-alone che sfruttano lo strato di rete disponibile sul client per interfacciarsi direttamente con la applicazione J2EE senza passare per il Web-Tier.\nNella figura 11-5 vengono illustrate schematicamente le applicazioni appartenenti a questo strato e le modalit di interconnessione verso gli strati componenti la architettura del sistema.\n http://www.java-net.tv 151\nWeb Tier Le componenti web-tier di J2EE sono rappresentate da pagine JSP, server-side applet e Servlet. Le pagine HTML che invocano Servlet o JSP secondo lo standard J2EE non sono considerate web-components, ed il motivo il seguente : come illustrato nei paragrafi precedenti si considerano componenti, oggetti caricabili e gestibili allinterno di un contenitore in grado di sfruttarne i servizi messi a disposizione. Nel nostro caso, Servlet e JSP hanno il loro ambiente runtime allinterno del Servlet-Container che provvede al loro ciclo di vita, nonch alla fornitura di servizi quali client-request e client-response ovvero come un client appartenente allo strato client-tier rappresenta la percezione che lutente ha della applicazione J2EE, il contenitore rappresenta la percezione che una componente al suo interno ha della interazione verso lesterno (Figura 11-6).\nFigura 11-6 La piattaforma J2EE prevede quattro tipi di applicazioni web : basic HTML,\nHTML with base JSP and Servlet, Servlet and JSP with JavaBeans components,\nHigh Structured Application con componenti modulari, Servlet ed Enterprise Beans. Di queste, le prime tre sono dette applicazioni web-centric, quelle appartenenti al quarto tipo sono dette applicazioni EJB Centric. La scelta di un tipo di applicazione piuttosto che di un altro dipende ovviamente da vari fattori tra cui:\nComplessit del problema;\nRisorse del Team di sviluppo;\nLongevit della applicazione;\nDinamismo dei contenuti da gestire e proporre.\n http://www.java-net.tv 152\nFigura 11-7 Nella figura 11-77 viene presentata in modo schematico tutta la gamma di applicazioni web ed il loro uso in relazione a due fattori principali : complessit e robustezza.\nBusiness Tier Nellambito di una applicazione enterprise, questo lo strato che fornisce servizi specifici: gestione delle transazioni, controllo della concorrenza, gestione della sicurezza, ed implementa inoltre logiche specifiche circoscritte allambito applicativo ed alla manipolazione dei dati. Mediante un approccio di tipo Object Oriented\npossibile decomporre tali logiche o logiche di business in un insieme di componenti ed elementi chiamati business object.\nLa tecnologia fornita da Sun per implementare i business object quella che in precedenza abbiamo indicato come EJBs (Enterprise Java Beans). Tali componenti si occupano di:\nRicevere dati da un client, processare tali dati (se necessario), inviare i dati allo strato EIS per la loro memorizzazione su base dati;\n(Viceversa) Acquisire dati da un database appartenente allo strato EIS,\nprocessare tali dati (se necessario), inviare tali dati al programma client che ne abbia fatto richiesta.\nEsistono due tipi principali di EJBs : entity beans e session beans. Per session bean si intende un oggetto di business che rappresenta una risorsa privatarispetto al client che lo ha creato. Un entity bean al contrario rappresenta in modo univoco un Massimiliano Tarquini http://www.java-net.tv 153\ndato esistente allinterno dello strato EIS ed ha quindi una sua precisa identit rappresentata da una chiave primaria (figura 11-8).\nFigura 11-8 Oltre alle componenti, la architettura EJB definisce altre 3 entit fondamentali:\nservers, containers e client. Un Enterprise Bean vive allinterno del container che provvede al ciclo vitale della componente e ad una variet di latri servizi quali gestione della concorrenza e scalabilit. LEJB Container a sua volta parte di un EJB server che fornisce tutti i servizi di naming e di directory (tali problematiche verranno affrontate negli articoli successivi).\nQuando un client invoca una operazione su un EJB, la chiamata viene intergettata dal container. Questa intercessione del container tra client ed EJB a livello di chiamata a metodo consente al container la gestione di quei servizi di cui si parlato allinizio del paragrafo oppure della propagazione della chiamata ad altre componenti (Load Balancing) o ad altri container (Scalabilit) su altri server sparsi per la rete su differenti macchine.\nNella implementazione di una architettura enterprise, oltre a decidere che tipo di enterprise beans utilizzare, un programmatore deve effettuare altre scelte strategiche nella definizione del modello a componenti :\nChe tipo di oggetto debba rappresentare un Enterprise Bean;\nChe ruolo tale oggetto deve avere allinterno di un gruppo di componenti che collaborino tra di loro.\nDal momento che gli enterprise beans sono oggetti che necessitano di abbondanti risorse di sistema e di banda di rete, non sempre soluzione ottima modellare tutti i business object come EJBs. In generale una soluzione consigliabile http://www.java-net.tv 154\nquella di adottare tale modello solo per quelle componenti che necessitino un accesso diretto da parte di un client.\nEIS-Tier Le applicazioni enterprise implicano per definizione laccesso ad altre applicazioni, dati o servizi sparsi allinterno delle infrastrutture informatiche del fornitore di servizi. Le informazioni gestite ed i dati contenuti allinterno di tali infrastrutture rappresentano la ricchezza del fornitore, e come tale vanno trattati con estrema cura garantendone la integrit.\nFigura 11-9 Al modello bidimensionale delle vecchie forme di business legato ai sistemi informativi (figura 11-9) stato oggi sostituito da un nuovo modello (e-business) che introduce una terza dimensione che rappresenta la necessit da parte del fornitore di garantire accesso ai dati contenuti nella infrastruttura enterprise via web a: partner commerciali, consumatori, impiegati e altri sistemi informativi.\nGli scenari di riferimento sono quindi svariati e comprendono vari modelli di configurazione che le architetture enterprise vanno ad assumere per soddisfare le necessit della new-economy. Un modello classico quello rappresentato da sistemi di commercio elettronico (figura 11-10) .\nNei negozi virtuali o E-Store lutente web interagisce tramite browser con i cataloghi on-line del fornitore, seleziona i prodotti, inserisce i prodotti selezionati nel carrello virtuale, avvia una transazione di pagamento con protocolli sicuri.\n http://www.java-net.tv 155\nFigura 11-10 Le API di J2EE Le API di J2EE forniscono supporto al programmatore per lavorare con le pi comuni tecnologie utilizzate nellambito della programmazione distribuita e dei servizi di J2EE Technologies interconnessione via rete. I prossimi paragrafi forniranno una breve introduzione alle API Java IDL RMI/IIOP componenti lo strato tecnologico fornito con la JDBC\npiattaforma definendo volta per volta la filosofia alla JDBC 2.0 Client Parts base di ognuna di esse e tralasciando le API relative JNDI\nServlet a Servlet, EJBs e JavaServer Pages gi introdotte Javaserver Pages nei paragrafi precedenti.\nJavamail, JavaBeans Activation Framework JTS\nEJB JTA\nJMS Connector/Resource Mgmt. Comp.\nJDBC : Java DataBase Connectivity Rappresentano le API di J2EE per poter lavorare con database relazionali. Esse consentono al programmatore di inviare query ad un database relazionale, di effettuare dolete o update dei dati allinterno di tabelle, di lanciare stored-procedure o di ottenere meta-informazioni relativamente al database o le entit che lo compongono.\n http://www.java-net.tv 156\nFigura 11-11 Architetturalmente JDBC sono suddivisi in due strati principali : il primo che fornisce una interfaccia verso il programmatore, il secondo di livello pi basso che fornisce invece una serie di API per i produttori di drivers verso database relazionali e nasconde allutente i dettagli del driver in uso.Questa caratteristica rende la tecnologia indipendente rispetto al motore relazionale che il programmatore deve interfacciare. I driver JDBC possono essere suddivisi in 4 tipi fondamentali come da tabella:\nTipo 4 Tipo 3 Tipo 2 Tipo 1 Direct-to-Database Pure Java Driver Pure Java Driver for Database Middleware;\nJDBC-ODBC Bridge plus ODBC Driver;\nA native-API partly Java technology-enabled driver.\nI driver di tipo 4 e 3 appartengono a quella gamma di drivers che convertono le chiamate JDBC nel protocollo di rete utilizzato direttamente da un server relazionale o un middleware che fornisca connettivit attraverso la rete verso uno o pi database (figura 11-11) e sono scritti completamente in Java.\n http://www.java-net.tv 157\nFigura 11-12 I driver di tipo 2 sono driver scritti parzialmente in Java e funzionano da interfaccia verso API native di specifici prodotti. I driver di tipo 1, anchessi scritti parzialmente in java hanno funzioni di bridge verso il protocollo ODBC rilasciato da Microsoft. Questi driver sono anche detti JDBC/ODBC Bridge (Figura 11-12) e rappresentano una buona alternativa in situazioni in cui non siano disponibili driver di tipo 3 o 4.\nRMI : Remote Method Invocation Remote Method Invocation fornisce il supporto per sviluppare applicazioni java in grado di invocare metodi di oggetti distribuiti su virtual-machine differenti sparse per la rete. Grazie a questa tecnologia possibile realizzare architetture distribuite in cui un client invoca metodi di oggetti residenti su un server che a sua volta pu essere client nei confronti di un altro server.\nOltre a garantire tutte i vantaggi tipici di una architettura distribuita, essendo fortemente incentrato su Java RMI consente di trasportare in ambiente distribuito tutte le caratteristiche di portabilit e semplicit legata allo sviluppo di componenti Object Oriented apportando nuovi e significativi vantaggi rispetto alle ormai datate tecnologie distribuite (vd. CORBA).\nPrimo, RMI in grado di passare oggetti e ritornare valori durante una chiamata a metodo oltre che a tipi di dati predefiniti. Questo significa che dati strutturati e complessi come le Hashtable possono essere passati come un singolo argomento senza dover decomporre loggetto in tipi di dati primitivi. In poche parole RMI http://www.java-net.tv 158\npermette di trasportare oggetti attraverso le infrastrutture di una architettura enterprise senza necessitare di codice aggiuntivo.\nSecondo, RMI consente di delegare limplementazione di una classe dal client al server o viceversa. Questo fornisce una enorme flessibilit al programmatore che scriver solo una volta il codice per implementare un oggetto che sar immediatamente visibile sia a client che al server. Terzo, RMI estende le architetture distribuite consentendo luso di thread da parte di un server RMI per garantire la gestione ottimale della concorrenza tra oggetti distribuiti.\nInfine RMI abbraccia completamente la filosofia Write Once Run Anywhere di Java. Ogni sistema RMI portabile al 100% su ogni Java Virtual Machine.\nJava IDL RMI fornisce una soluzione ottima come supporto ad oggetti distribuiti con la limitazione che tali oggetti debbano essere scritti con Java. Tale soluzione non si adatta invece alle architetture in cui gli oggetti distribuiti siano scritti con linguaggi arbitrari. Per far fronte a tali situazioni, la Sun offre anche la soluzione basata su CORBA per la chiamata ad oggetti remoti.\nCORBA (Common Object Request Broker Architecture) uno standard largamente utilizzato introdotto dallOMG (Object Managment Group) e prevede la definizione delle interfacce verso oggetti remoti mediante un IDL (Interface Definition Language) indipendente dalla piattaforma e dal linguaggio di riferimento con cui loggetto stato implementato.\nLimplementazione di questa tecnologia rilasciata da Sun comprende un ORB\n(Object Request Broker) in grado di interagire con altri ORB presenti sul mercato,\nnonch di un pre-compilatore IDL che traduce una descrizione IDL di una interfaccia remota in una classe Java che ne rappresenti il dato.\nJNDI Java Naming and Directory Interface quellinsieme di API che forniscono laccesso a servizi generici di Naming o Directory attraverso la rete. Consentono, alla applicazione che ne abbia bisogno, di ottenere oggetti o dati tramite il loro nome o di ricercare oggetti o dati mediante luso di attributi a loro associati.\nAdesempio tramite JNDI possibile accedere ad informazioni relative ad utenti di rete, server o workstation, sottoreti o servizi generici (figura 11-13).\nCome per JDBC le API JNDI non nascono per fornire accesso in modo specifico ad un particolare servizio, ma costituiscono un set generico di strumenti in grado di interfacciarsi a servizi mediante driver rilasciati dal produttore del servizio e che mappano le API JNDI nel protocollo proprietario di ogni specifico servizio.\nTali driver vengono detti Service Providers e forniscono accesso a protocolli come LDAP, NIS, Novell NDS oltre che ad una gran quantit di servizi come DNS,\nRMI o CORBA Registry.\n http://www.java-net.tv 159\nFigura 11-13 JMS\nJava Message Service o Enterprise Messaging rappresentano le API forniscono supporto alle applicazioni enterprise nella gestione asincrona della comunicazione verso servizi di messaging o nella creazione di nuovi MOM (Message Oriented Middleware). Nonostante JMS non sia cos largamente diffuso come le altre tecnologie, svolge un ruolo importantissimo nellambito di sistemi enterprise.\nPer meglio comprenderne il motivo necessario comprendere il significato della parola messaggio che in ambito JMS rappresenta tutto linsieme di messaggi asincroni utilizzati dalle applicazioni enterprise, non dagli utenti umani, contenenti dati relativi a richieste, report o eventi che si verificano allinterno del sistema fornendo informazioni vitali per il coordinamento delle attivit tra i processi. Essi contengono informazioni impacchettate secondo specifici formati relativi a particolari eventi di business.\nGrazie a JMS possibile scrivere applicazioni di business message-based altamente portabili fornendo una alternativa a RMI che risulta necessaria in determinati ambiti applicativi. Nella figura 11-14 schematizzata una soluzione tipo di applicazioni basate su messaggi. Una applicazione di Home Banking deve interfacciarsi con il sistema di messagistica bancaria ed interbancaria da cui trarre tutte le informazioni relative alla gestione economica dellutente.\n http://www.java-net.tv 160\nFigura 11-14 Nel modello proposto da J2EE laccesso alle informazioni contenute allinterno di questo strato possibile tramite oggetti chiamati connettoriche rappresentano una architettura standard per integrare applicazioni e componenti enterprise eterogenee con sistemi informativi enterprise anche loro eterogenei.\nI connettori sono messi a disposizione della applicazione enterprise grazie al server J2EE che li contiene sotto forma di servizi di varia natura (es. Pool di connessioni) e che tramite questi collabora con i sistemi informativi appartenenti allo strato EIS in modo da rendere ogni meccanismo a livello di sistema completamente trasparente alle applicazioni enterprise.\nLo stato attuale dellarte prevede che la piattaforma J2EE consenta pieno supporto per la connettivit verso database relazionali tramite le API JDBC, le prossime versioni della architettura J2EE prevedono invece pieno supporto transazionale verso i pi disparati sistemi enterprise oltre che a database relazionali.\n http://www.java-net.tv 161\nCapitolo 13 Architettura del Web Tier Introduzione\nChi ha potuto accedere ad internet a partire dagli inizi degli anni 90, quando ancora la diffusione della tecnologia non aveva raggiunto la massa ed i costi erano eccessivi (ricordo che nel 1991 pagai un modem interno usato da 9600 bps la cifra incredibile di 200.000 lire), ha assistito alla incredibile evoluzione che ci ha portato oggi ad una diversa concezione del computer.\nA partire dai primi siti internet dai contenuti statici, siamo oggi in grado di poter effettuare qualsiasi operazione tramite Web da remoto. Questa enorme crescita,\ncome una vera rivoluzione, ha voluto le sua vittime. Nel corso degli anni sono nate e poi completamente scomparse un gran numero di tecnologie a supporto di un sistema in continua evoluzione.\nServlet e JavaServer Pages rappresentano oggi lo stato dellarte delle tecnologie web. Raccogliendo la pesante eredit lasciata dai suoi predecessori, la soluzione proposta da SUN rappresenta quanto di pi potente e flessibile possa essere utilizzato per sviluppare applicazioni web.\nLarchitettura del Web Tier Prima di affrontare il tema dello sviluppo di applicazioni web con Servlet e JavaServer Pages importante fissare alcuni concetti. Il web-server gioca un ruolo fondamentale allinterno di questo strato. In ascolto su un server, riceve richieste da parte del browser (client), le processa, quindi restituisce al client una entit o un eventuale codice di errore come prodotto della richiesta (Figura 0-12).\nFigura 0-12 Nei Box 1 e 2 sono riportati i dati relativi alla distribuzione dei web-server sul mercato negli ultimi anni (i dati sono disponibili nella forma completa allindirizzo internet http://www.netcraft.com/survey).\n http://www.java-net.tv tarquini@all-one-mail.net 162\nBox 1 : Grafici di distribuzione dei web server Market Share for Top Servers Across All Domains August 1995 - December 2000 Box 2 : Distribuzione dei web server Top Developers Developer\nApache Microsoft\niPlanet November\n2000 14193854\n4776220 1643977\nPercent 59.69 20.09 6.91 December\n2000 15414726\n5027023 1722228\nPercent Change 60.04 19.58 6.71 0.35\n-0.51\n-0.20 Top Servers Server\nApache MicrosoftIIS\nNetscapeEnterprise WebLogic\nZeus Rapidsite\nthttpd tigershark\nAOLserver WebSitePro\nNovember 2000\n14193854 Percent\nChange 59.69 December\n2000 15414726\n60.04 0.35 4774050\n20.08 5025017\n19.57\n-0.51 1605438\n6.75 1682737\n6.55\n-0.20 789953\n640386 347307\n226867 120213\n136326 106618\n3.32 2.69 1.46 0.95 0.51 0.57 0.45 890791\n676526 365807\n321944 139300\n125513 110681\n3.47 2.63 1.42 1.25 0.54 0.49 0.43 0.15\n-0.06\n-0.04 0.30 0.03\n-0.08\n-0.02 Percent\nhttp://www.java-net.tv Server\nApache MicrosoftIIS\nNetscapeEnterprise WebLogic\nZeus Rapidsite\nthttpd tigershark\nAOLserver WebSitePro\n 163\nLe entit prodotte da un web-server possono essere entit statiche o entit dinamiche. Una entit statica ad esempio un file html residente sul file-system del server. Rispetto alle entit statiche, unico compito del web-server quello di recuperare la risorsa dal file-system ed inviarla al browser che si occuper della visualizzazione dei contenuti.\nQuello che pi ci interessa sono invece le entit dinamiche, ossia entit prodotte dalla esecuzione di applicazioni eseguite dal web-server su richiesta del client.\nIl modello proposto nella immagine 1 ora si complica in quanto viene introdotto un nuovo grado di complessit (Figura 2-12) nella architettura del sistema che, oltre a fornire accesso a risorse statiche dovr fornire un modo per accedere a contenuti e dati memorizzati su una Base Dati, dati con i quali un utente internet potr interagire da remoto.\nFigura 2-12 Inviare dati Mediante form HTML possibile inviare dati ad un web-server. Tipicamente lutente riempie alcuni campi il cui contenuto, una volta premuto il pulsante submit viene inviato al server con il messaggio di richiesta. La modalit con cui questi dati vengono inviati dipende dal metodo specificato nella richiesta. Utilizzando il metodo GET, i dati vengono appesi alla request-URI nella forma di coppie chiave=valore separati tra di loro dal carattere &. La stringa seguente un esempio di campo request-URI per una richiesta di tipo GET.\nhttp://www.java-net.tv/servelt/Hello?nome=Massimo&cognome=Rossi http://www.java-net.tv rappresenta lindirizzo del web-server a cui inviare la richiesta. I campi /servlet/Hello rappresenta la locazione della applicazione web da http://www.java-net.tv 164\neseguire. Il carattere ? separa lindirizzo dai dati e il carattere & separa ogni coppia chiave=valore.\nQuesto metodo utilizzato per default dai browser a meno di specifiche differenti,\nviene utilizzato nei casi in cui si richieda al server il recupero di informazioni mediante query su un database.\nIl metodo POST pur producendo gli stessi effetti del precedente, utilizza una modalit di trasmissione dei dati differente impacchettando i contenuti dei campi di un form allinterno di un message-header. Rispetto al precedente, il metodo POST consente di inviare una quantit maggiore di dati ed quindi utilizzato quando\nnecessario inviare al server nuovi dati affinch possano essere memorizzati allinterno della Base Dati.\nSviluppare applicazioni web A meno di qualche eccezione una applicazione web paragonabile ad una qualsiasi applicazione con la differenza che deve essere accessibile al web-server che fornir lambiente di runtime per lesecuzione. Affinch ci sia possibile\nnecessario che esista un modo affinch il web-server possa trasmettergli i dati inviati dal client, che esista un modo univoco per laccesso alle funzioni fornite dalla applicazione (entry-point), che lapplicazione sia in grado di restituire al web-server i dati prodotti in formato HTML da inviare al client nel messaggio di risposta.\nEsistono molte tecnologie per scrivere applicazioni web che vanno dalla pi comune CGI a soluzioni proprietarie come ISAPI di Microsoft o NSAPI della Netscape.\nCommon Gateway Interface CGI sicuramente la pi comune e datata tra le tecnologie server-side per lo sviluppo di applicazioni web. Scopo principale di un CGI quello di fornire funzioni di gatewaytra il web-server e la base dati del sistema.\nI CGI possono essere scritti praticamente con tutti i linguaggi di programmazione.\nQuesta caratteristica classifica i CGI in due categorie: CGI sviluppati mediante linguaggi script e CGI sviluppati con linguaggi compilati. I primi, per i quali viene generalmente utilizzato il linguaggio PERL, sono semplici da implementare, ma hanno lo svantaggio di essere molto lenti e per essere eseguiti richiedono lintervento di un traduttore che trasformi le chiamate al linguaggio script in chiamate di sistema. I secondi a differenza dei primi sono molto veloci, ma risultano difficili da programmare\n(generalmente sono scritti mediante linguaggio C).\nFigura 3-12 http://www.java-net.tv tarquini@all-one-mail.net 165\nNella Figura 3-12 schematizzato il ciclo di vita di un CGI. Il pi grande svantaggio nelluso dei CGI sta nella scarsa scalabilit della tecnologia infatti, ogni volta che il web-server riceve una richiesta deve creare una nuova istanza del CGI\n(Figura 4-12). Il dover stanziare un processo per ogni richiesta ha come conseguenza enormi carichi in fatto di risorse macchina e tempi di esecuzione (per ogni richiesta devono essere ripetuti i passi come nella Figura 3-12). A meno di non utilizzare strumenti di altro tipo inoltre impossibile riuscire ad ottimizzare gli accessi al database. Ogni istanza del CGI sar difatti costretta ad aprire e chiudere una propria connessione verso il DBMS.\nQuesti problemi sono stati affrontati ed in parte risolti dai Fast-CGI grazie ai quali\n possibile condividere una stessa istanza tra pi richieste http.\nFigura 3-12: Un CGI non una tecnologia scalabile ISAPI ed NSAPI Per far fronte ai limiti tecnologici imposti dai CGI, Microsoft e Netscape hanno sviluppato API proprietarie mediante le quali creare librerie ed applicazioni che possono essere caricate dal web-server al suo avvio ed utilizzate come proprie estensioni.\nLinsuccesso di queste tecnologie stato per segnato proprio dalla loro natura di tecnologie proprietarie e quindi non portabili tra le varie piattaforme sul mercato.\nEssendo utilizzate come moduli del web-server era inoltre caso frequente che un loro accesso errato alla memoria causasse il crash dellintero web-server provocando enormi danni al sistema che doveva ogni volta essere riavviato.\nASP Active Server Pages Active Server Pages stata lultima tecnologia web rilasciata da Microsoft. Una applicazione ASP tipicamente un misto tra HTML e linguaggi script come VBScript o JavaScript mediante i quali si pu accedere ad oggetti del server.\nUna pagina ASP, a differenza di ISAPI, non viene eseguita come estensione del web-server, ma viene compilata alla prima chiamata, ed il codice compilato pu quindi essere utilizzato ad ogni richiesta HTTP.\nNonostante sia oggi largamente diffusa, ASP come ISAPI rimane una tecnologia proprietaria e quindi in grado di funzionare solamente su piattaforma Microsoft, ma il Massimiliano Tarquini http://www.java-net.tv tarquini@all-one-mail.net 166\nreale svantaggio di ASP per legato alla sua natura di mix tra linguaggi script ed HTML. Questa sua caratteristica ha come effetto secondario quello di riunire in un unico contenitore sia le logiche applicative che le logiche di presentazione rendendo estremamente complicate le normali operazioni di manutenzione delle pagine.\nJava Servlet e JavaServer Pages Sun cerca di risolvere i problemi legati alle varie tecnologie illustrate, mettendo a disposizione del programmatore due tecnologie che raccogliendo leredit dei predecessori, ne abbattono i limiti mantenendo e migliorando gli aspetti positivi di ognuna. In aggiunta Servlet e JavaServer Pages ereditano tutte quelle caratteristiche che rendono le applicazioni Java potenti, flessibili e semplici da mantenere:\nportabilit del codice, paradigma object oriented.\nRispetto ai CGI, Servlet forniscono un ambiente ideale per quelle applicazioni per cui sia richiesta una massiccia scalabilit e di conseguenza lottimizzazione degli accessi alle basi dati di sistema.\nRispetto ad ISAPI ed NSAPI, pur rappresentando una estensione al web server,\nmediante il meccanismo delle eccezioni risolvono a priori tutti gli errori che potrebbero causare la terminazione prematura del sistema.\nRispetto ad ASP, Servlet e JavaServer Pages separano completamente le logiche di business dalle logiche di presentazione dotando il programmatore di un ambiente semplice da modificare o mantenere.\n http://www.java-net.tv 167\nCapitolo 14 Java Servlet API Introduzione\nJava Servlet sono oggetti Java con propriet particolari che vengono caricati ed eseguiti dal web server che le utilizzer come proprie estensioni. Il web server di fatto mette a disposizione delle Servlet il container che si occuper della gestione del loro ciclo di vita, delle gestione dellambiente allinterno delle quali le servlet girano,\ndei servizi di sicurezza. Il container ha anche funzione passare i dati dal client verso le servlet e viceversa ritornare al client i dati prodotti dalla loro esecuzione.\nDal momento che una servlet un oggetto server-side, pu accedere a tutte le risorse messe a disposizione dal server per generare pagine dai contenuti dinamici come prodotto della esecuzione delle logiche di business. Eovvio che sar cura del programmatore implementare tali oggetti affinch gestiscano le risorse del server in modo appropriato evitando di causare danni al sistema che le ospita.\nIl package javax.servlet Questo package il package di base delle Servlet API, e contiene le classi per definire Servlet standard indipendenti dal protocollo. Tecnicamente una Servlet generica una classe definita a partire dallinterfaccia Servlet contenuta allinterno del package javax.servlet. Questa interfaccia contiene i prototipi di tutti i metodi necessari alla esecuzione delle logiche di business, nonch alla gestione del ciclo di vita delloggetto dal momento del suo istanziamento, sino al momento della sua terminazione.\npackage javax.servlet;\nimport java.io.*;\npublic interface Servlet\n{\npublic abstract void destroy();\npublic ServletConfig getServletConfig();\npublic String getServletInfo();\npublic void service (ServletRequest req, ServletResponse res) throws IOException, ServletException;\n}\nI metodi definiti in questa interfaccia devono essere supportati da tutte le servlet o possono essere ereditati attraverso la classe astratta GenericServlet che rappresenta una implementazione base di una servlet generica. Nella Figura 14-1 viene schematizzata la gerarchia di classi di questo package.\nIl package include inoltre una serie di classi utili alla comunicazione tra client e server, nonch alcune interfacce che definiscono i prototipi di oggetti utilizzati per tipizzare le classi che saranno necessarie alla specializzazione della servlet generica in servlet dipendenti da un particolare protocollo.\n http://www.java-net.tv 168\nInputStream InputStream\nServletInputStream ServletInputStream\nOutputStream OutputStream\nOutputStream OutputStream\nServlet Servlet\nServletConfig ServletConfig\nServletContext ServletContext\nSeriaizable Seriaizable\nServletRequest ServletRequest\nServletResponse ServletResponse\nObject Object\nGenericServlet GenericServlet\nException Exception\nServletException ServletException\nSingleThreadModel SingleThreadModel\nUnavoidableException UnavoidableException\nRequestDispatcher RequestDispatcher\nEstende Classi Astratte Classi Astratte Interfacce\nInterfacce Classi\nClassi Implementa\nFigura 14-1: il package javax.servlet Il package javax.servlet.http Questo package supporta lo sviluppo di Servlet che specializzando la classe base astratta GenericServlet definita nel package javax.servlet utilizzano il protocollo http. Le classi di questo package estendono le funzionalit di base di una servlet supportando tutte le caratteristiche della trasmissione di dati con protocollo http compresi cookies, richieste e risposte http nonch metodi http (get, post head, put ecc. ecc.). Nella Figura 14-2 schematizzata la gerarchia del package in questione.\nFormalmente quindi, una servlet specializzata per generare contenuti specifici per il mondo web sar ottenibile estendendo la classe base astratta javax.servlet.http.HttpServlet.\n http://www.java-net.tv 169\nEventObject EventObject\nHTTPSessionBindingEvent HTTPSessionBindingEvent\nEventListener EventListener\nHTTPSessionBindingListener HTTPSessionBindingListener\nCookie Cookie\nHTTPSession HTTPSession\nHttpUtils HttpUtils\nSeriaizable Seriaizable\nHTTPSessionContext HTTPSessionContext\nObject Object\nGenericServlet GenericServlet\nCloneable Cloneable\nHttpServlet HttpServlet\nServlet Servlet\nServletRequest ServletRequest\nHttpServletRequest HttpServletRequest\nServletResponse ServletResponse\nHttpServletResponse HttpServletResponse\nEstende Classi Astratte Classi Astratte Interfacce\nInterfacce Classi\nClassi Implementa\nFigura 14-2 : il package javax.servlet Ciclo di vita di una servlet Il ciclo di vita di una servlet definisce come una servlet sar caricata ed inizializzata, come ricever e risponder a richieste dal client ed infine come sar terminata prima di passare sotto la responsabilit del garbage collector. Il ciclo di vita di una servlet schematizzato nel diagramma seguente (Figura 14- 3).\nFigura 14-3: Ciclo di vita di una servlet Il caricamento e listanziamento di una o pi servlet a carico del web server ed avviene al momento della prima richiesta http da parte di un client, o se specificato direttamente, al momento dellavvio del servizio. Questa fase viene eseguita dal web server utilizzando loggetto Class di java.lang .\n http://www.java-net.tv 170\nDopo che stata caricata, necessario che la servlet venga inizializzata.\nDurante questa fase, la servlet generalmente carica dati persistenti, apre connessioni verso il database o stabilisce legami con altre entit esterne.\nLinizializzazione della servlet avviene mediante la chiamata al metodo init(),\ndefinito nella interfaccia javax.servlet.Servlet ed ereditato dalla classe base astratta javax.servlet.http.HttpServlet. Nel caso in cui il metodo non venga riscritto, il metodo ereditato non eseguir nessuna operazione. Il metodo init di una servlet prende come parametro di input un oggetto di tipo ServletConfig che consente di accedere a parametri di inizializzazione passati attraverso il web server nella forma di coppie chiave-valore.\nDopo che la nostra servlet stata inizializzata, pronta ad eseguire richieste da parte di un client. Le richieste da parte di un client vengono inoltrate alla servlet dal container nella forma di oggetti di tipo HttpServletRequest e HttpServletResponse mediante passaggio di parametri al momento della chiamata del metodo service().\nCome per init(), il metodo service() viene ereditato di default dalla classe base astratta HttpServlet. In questo caso per il metodo ereditato a meno che non venga ridefinito eseguir alcune istruzioni di default come vedremo tra qualche paragrafo.\nEcomunque importante ricordare che allinterno di questo metodo vengono definite le logiche di business della nostra applicazione. Mediante loggetto HttpServletRequest saremo in grado di accedere ai parametri passati in input dal client, processarli e rispondere con un oggetto di tipo HttpServletResponse.\nInfine, quando una servlet deve essere distrutta (tipicamente quando viene terminata lesecuzione del web server), il container chiama di default il metodo destroy(). LOverriding di questo metodo ci consentir di rilasciare tutte le risorse utilizzate dalla servlet, ad esempio le connessioni a basi dati, garantendo che il sistema non rimanga in uno stato inconsistente a causa di una gestione malsana da parte della applicazione web.\nServlet e multithreading Tipicamente quando n richieste da parte del client arrivano al web server,\nvengono creati n thread differenti in grado di accedere ad una particolare servlet in maniera concorrente (Figura 14-4).\nFigura 14-4 : Accessi concorrenti a servlet Come tutti gli oggetti Java, servlet non sono oggetti thread-safe, ovvero\nnecessario che il programmatore definisca le politiche di accesso alla istanza della classe da parte del thread. Inoltre, lo standard definito da SUN Microsystem prevede http://www.java-net.tv tarquini@all-one-mail.net 171\nche un server possa utilizzare una sola istanza di questi oggetti (questa limitazione anche se tale aiuta alla ottimizzazione della gestione delle risorse percui ad esempio una connessione ad un database sar condivisa tra tante richieste da parte di client).\nMediante lutilizzo delloperatore synchronized, possibile sincronizzare laccesso alla classe da parte dei thread dichiarando il metodo service() di tipo sincronizzato o limitando lutilizzo del modificatore a singoli blocci di codice che contengono dati sensibili (vd. Capitolo 9).\nLinterfaccia SingleThreadModel Quando un thread accede al metodo sincronizzato di una servlet, ottiene il lock sulla istanza delloggetto. Abbiamo inoltre detto che un web server per definizione utilizza una sola istanza di servlet condividendola tra le varie richieste da parte dei client. Stiamo creando un collo di bottiglia che in caso di sistemi con grossi carichi di richieste potrebbe ridurre significativamente le prestazioni del sistema.\nSe il sistema dispone di abbondanti risorse, le Servlet API ci mettono a disposizione un metodo per risolvere il problema a scapito delle risorse della macchina rendendo le servlet classi thread-safe.\nFormalmente, una servlet viene considerata thread-safe se implementa linterfaccia javax.servlet.SingleThreadModel . In questo modo saremo sicuri che solamente un thread avr accesso ad una istanza della classe in un determinato istante. A differenza dellutilizzo del modificatore synchronized, in questo caso il web server creer pi istanze di una stessa servlet (tipicamente in numero limitato e definito) al momento del caricamento delloggetto, e utilizzer le varie istanze assegnando al thread che ne faccia richiesta, la prima istanza libera (Figura 14-5).\nFigura 14-5 : SingleThreadModel Un primo esempio di classe Servlet Questa prima servlet di esempio fornisce la versione web della applicazione Java HelloWorld. La nostra servlet una volta chiamata ci restituir una pagina HTML contenente semplicemente la stringa HelloWorld.\nHelloWorldServlet.java import javax.servlet.* ;\nimport javax.servlet.http.* ;\npublic class HelloWorldServlet extends HttpServlet\n{\n http://www.java-net.tv 172\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(text/html);\nServletOutputStream out = res.getOutputStream();\nout.println();\nout.println(Hello World);\nout.println();\nout.println(

Hello World

);\nout.println();\n}\n}\nIl metodo service()\nSe il metodo service() di una servlet non viene modificato, la nostra classe eredita di default il metodo service definito allinterno della classe astratta HttpServlet\n(Figura 14-6). Essendo il metodo chiamato in causa al momento dellarrivo di una richiesta da parte di un client, nella sua forma originale questo metodo ha funzioni di dispatchertra altri metodi basati sul tipo di richiesta http in arrivo dal client.\nFigura 14-6: La classe HttpServlet Come abbiamo gi introdotto nel capitolo precedente, il protocollo http ha una variet di tipi differenti di richieste che possono essere avanzate da parte di un client.\nComunemente quelle di uso pi frequente sono le richieste di tipo GET e POST.\nNel caso di richiesta di tipo GET o POST, il metodo service definito allinterno della classe astratta HttpServlet chiamer i metodi rispettivamente doGet() o doPost() che conterranno ognuno il codice per gestire la particolare richiesta. In questo caso quindi, non avendo applicato la tecnica di Overriding sul metodo service() , sar necessario implementare uno di questi metodi allinterno della nostra nuova classe a seconda del tipo di richieste che dovr esaudire (Figura 13-7).\n http://www.java-net.tv 173\nFigura 14-7 : service() ha funzioni di bridge Massimil http://www.java-net.tv 174\nCapitolo 15 Servlet HTTP Introduzione\nHttp servlet rappresentano una specializzazione di servlet generiche e sono specializzate per comunicare mediante protocollo http. Il package javax.servlet.http mette a disposizione una serie di definizioni di classe che rappresentano strumenti utili alla comunicazione tra client e server con questo protocollo, nonch forniscono uno strumento flessibile per accedere alle strutture definite nel protocollo, al tipo di richieste inviate ai dati trasportati.\nLe interfacce ServletRequest e ServletResponse rappresentano rispettivamente richieste e risposte http. In questo capitolo le analizzeremo in dettaglio con lo scopo di comprendere i meccanismi di ricezione e manipolazione dei dati di input nonch di trasmissione delle entit dinamiche prodotte.\nIl protocollo HTTP 1.1 Rispetto alla classificazione fornita nei paragrafi precedenti riguardo i protocolli di rete, http (HyperText Trasfer Protocol) appartiene allinsieme dei protocolli applicativi e, nella sua ultima versione, fornisce un meccanismo di comunicazione tra applicazioni estremamente flessibile dotato di capacit praticamente infinita nel descrivere possibili richieste nonch i possibili scopi per cui la richiesta stata inviata. Grazie a queste caratteristiche http largamente utilizzato per la comunicazione tra applicazioni in cui sia necessaria la possibilit di negoziare dati e risorse, ecco perch luso del protocollo come standard per i web server.\nIl protocollo fu adottato nel 1990 dalla World Wide Web Global Information Initiativea partire dalla versione 0.9 come schematizzato nella tabella sottostante:\nHTTP 0.9 HTTP 1.0 Semplice protocollo per la trasmissione dei dati via internet.\nIntroduzione rispetto alla versione precedente del concetto di Mime-Type.\nIl protocollo ora in grado di trasportare meta-informazioni relative ai dati trasferiti.\nHTTP 1.1 Estende la versione precedente affinch il protocollo contenga informazioni che tengono in considerazione problematiche a livello applicativo come ad esempio quelle legate alla gestione della cache.\nScendendo nei dettagli, http un protocollo di tipo Request/Response: ovvero un client invia una richiesta al server e rimane in attesa di una sua risposta. Entrambe richiesta e risposta http hanno una struttura che identifica due sezioni principali: un message-header ed un message-body come schematizzato nella figura 15-1. Il message-header contiene tutte le informazioni relative alla richiesta o risposta,\nmentre il message-body contiene eventuali entit trasportate dal pacchetto\n(intendendo per entit i contenuti dinamici del protocollo come pagine html) e tutte le informazioni relative: ad esempio mime-type, dimensioni ecc. Le entit trasportate allinterno del message-body vengono inserite allinterno dellentity-body.\nLe informazioni contenute allinterno di un messaggio http sono separate tra di loro dalla sequenza di caratteri CRLF dove CR il carattere Carriage Return(US ASCII 13) e LF il carattere Line Feed(US ASCII 10). Tale regola non applicabile ai contenuti dellentity-body che rispettano il formato come definito dal rispettivo MIME.\n http://www.java-net.tv tarquini@all-one-mail.net 175\nFigura 15-1 : pacchetti http Per dare una definizione formale del protocollo http utilizzeremo la sintassi della forma estesa di Backup Nauer che per semplicit indicheremo con lacronimo BNF.\nSecondala BNF, un messaggio http generico definito dalla seguente regola:\nHTTP-Message = Request | Response Request = generic-message Response = generic-message generic-message = start-line *(message-header CRLF) CRLF [message-body]\nstart-line = Request-line | Response-line Richiesta HTTP Scendendo nei dettagli, una richiesta http da un client ad un server definita dalla seguente regola BNF:\nRequest = Request-line *((general-header\n| request-header\n| entity-header) CRLF)\nCRLF\n[message-body]\nLa Request-line formata da tre token separati dal carattere SP o Spazio (US ASCII 32) che rappresentano rispettivamente: metodo, indirizzo della risorsa o URI,\nversione del protocollo.\nRequest-line = Method SP Request-URI SP http-version CRLF\nSP = \nMethod = OPTIONS| GET| HEAD| POST| PUT\n| DELETE| TRACE| CONNECT| extension-method extension-method = token Request-URI = *| absoluteURI | abs-path | authority HTTP-version = HTTP/1*DIGIT .1*DIGIT http://www.java-net.tv 176\nDIGIT = \nUn esempio di Request-line inviata da client ha server potrebbe essere :\nGET /lavora.html HTTP/1.1 Il campo General-header ha valore generale per entrambi I messagi di richiesta o risposta e non contiene dati applicabili alla entit trasportata con il messaggio:\nGeneral-header = Cache-Control\n| Connection\n| Date\n| Pragma\n| Trailer\n| Trasfer-Encoding\n| Upgrade\n| Via\n| Warning Senza scendere nei dettagli di ogni singolo campo contenuto nel Generalheader, importante comprenderne lutilizzo. Questo campo infatti estremamente importante in quanto trasporta le informazioni necessarie alla negoziazione tra le applicazioni. Ad esempio, il campo Connection pu essere utilizzato da un server proxy per determinare lo stato della connessione tra client e server e decidere su eventuali misura da applicare.\nI campi di request-header consentono al client di inviare informazioni relative alla richiesta in corso ed al client stesso.\nRequest-header = Accept\n| Accept-Charset\n| Accept-Encoding\n| Accept-Language\n| Authorization\n| Expect\n| From\n| Host\n| If-Match\n| If-Modified-Since\n| If-None-Match\n| If-Range\n| If-Unmodified-Since\n| Max-Forwards\n| Proxy-Authorization\n| Range\n| Referer\n| TE\n| User-Agent Entity-header e Message-Body verranno trattati nei paragrafi seguenti.\n http://www.java-net.tv 177\nRisposta HTTP Dopo aver ricevuto un messaggio di richiesta, il server risponde con un messaggio di risposta definito dalla regola BNF:\nResponse = Status-line\n*((general-header\n| response-header\n| entity-header) CRLF)\nCRLF\n[message-body]\nLa Status-line la prima linea di un messaggio di risposta http e consiste di tre token separati da spazio contenenti rispettivamente informazioni sulla versione del protocollo, un codice di stato che indica un errore o leventuale buon fine della richiesta, una breve descrizione del codice di stato.\nStatus-line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF SP = \nStatus-Code =\n\"100\" : Continue\n| \"101 : Switching Protocols\n| \"200\" : OK\n| \"201\" : Created\n| \"202\" : Accepted\n| \"203\" : Non-Authoritative Information\n| \"204\" : No Content\n| \"205\" : Reset Content\n| \"206\" : Partial Content\n| \"300\" : Multiple Choices\n| \"301\" : Moved Permanently\n| \"302\" : Found\n| \"303\" : See Other\n| \"304\" : Not Modified\n| \"305\" : Use Proxy\n| \"307\" : Temporary Redirect\n| \"400\" : Bad Request\n| \"401\" : Unauthorized\n| \"402\" : Payment Required\n| \"403\" : Forbidden\n| \"404\" : Not Found\n| \"405\" : Method Not Allowed\n| \"406\" : Not Acceptable\n| \"407\" : Proxy Authentication Required\n| \"408\" : Request Time-out\n| \"409\" : Conflict\n| \"410\" : Gone\n| \"411\" : Length Required\n| \"412\" : Precondition Failed\n| \"413\" : Request Entity Too Large\n| \"414\" : Request-URI Too Large\n| \"415\" : Unsupported Media Type\n| \"416\" : Requested range not satisfiable\n| \"417\" : Expectation Failed\n| \"500\" : Internal Server Error Massimiliano Tarquini http://www.java-net.tv tar 178\n| \"501\" : Not Implemented\n| \"502\" : Bad Gateway\n| \"503\" : Service Unavailable\n| \"504\" : Gateway Time-out\n| \"505\" : HTTP Version not supported\n| extension-code extension-code = 3DIGIT Reason-Phrase = *\nUn codice di stato un intero a 3 cifre ed il risultato della processazione da parte del server della richiesta mentre la Reason-Phrase intende fornire una breve descrizione del codice di stato. La prima cifra di un codice di stato definisce la regola per suddividere i vari codici:\n1xx : Informativo Richiesta ricevuta, continua la processazione dei dati;\n2xx : Successo Lazione stata ricevuta con successo, compresa ed accettata;\n3xx : Ridirezione Ulteriori azioni devono essere compiute al fine di completare la richiesta;\n4xx : Client-Error La richiesta sintatticamente errata e non pu essere soddisfatta;\n5xx : Server-Error Il server non ha soddisfatto la richiesta apparentemente valida.\nCome per il Request-Header, il Response-Header contiene campi utili alla trasmissione di informazioni aggiuntive relative alla risposta e quindi anchesse utili alla eventuale negoziazione :\nresponse-header = Accept-Ranges\n| Age\n| Etag\n| Location\n| Proxy-Authenticate\n| Retry-After\n| Server\n| www-autheticate Entit\nCome abbiamo visto, richiesta e risposta http possono trasportare entit a meno che non sia previsto diversamente dallo status-code della risposta o dal requestmethod della richiesta (cosa che vedremo nel paragrafo successivo). In alcuni casi un messaggio di risposta pu contenere solamente il campo entity-header (ossia il campo descrittore della risorsa trasportata). Come regola generale, entity-header trasporta meta-informazioni relative alla risorsa identificata dalla richiesta.\nentity-header = Allow\n| Content-Encoding\n| Content-Language\n| Content-Length\n| Content-Location\n| Content-MD5\n| Content-Range\n| Content-Type\n| Expires http://www.java-net.tv tarquini-one-mail.net 179\n| Last-Modified\n| extension-header extension-header = message-header Queste informazioni, a seconda dei casi possono essere necessarie od opzionali.\nIl campo extension-header consente laggiunta di una nuove informazioni non previste, ma necessarie, senza apportare modifiche al protocollo.\nI metodi di request I metodi definiti dal campo request-method sono necessari al server per poter prendere decisioni sulle modalit di processazione della richiesta. Le specifiche del protocollo http prevedono nove metodi, tuttavia, tratteremo brevemente i tre pi comuni: HEAD, GET, POST.\nIl metodo GET significa voler ottenere dal server qualsiasi informazione (nella forma di entit) come definita nel campo request-URI. Se utilizzato per trasferire dati mediante form HTML, una richiesta di tipo GET invier i dati contenuti nel form scrivendoli in chiaro nella request-URI.\nSimile al metodo GET il metodo HEAD che ha come effetto quello di indicare al server che non necessario includere nella risposta un message-body contenente la entit richiesta in request-URI. Tale metodo ha lo scopo di ridurre i carichi di rete in quei casi in cui non sia necessario linvio di una risorsa: ad esempio nel caso in cui il client disponga di un meccanismo di caching.\nIl metodo POST quello generalmente utilizzato l dove siano necessarie operazioni in cui richiesto il trasferimento di dati al server affinch siano processati.\nUna richiesta di tipo POST non utilizza il campo Request-URI per trasferire i parametri, bens invia un pacchetto nella forma di message-header con relativo entity-header. Il risultato di una operazione POST non produce necessariamente entit. In questo caso uno status-code 204 inviato dal server indicher al client che la processazione andata a buon fine senza che per abbia prodotto entit.\nInizializzazione di una Servlet Linterfaccia ServletConfig rappresenta la configurazione iniziale di una servlet.\nOggetti definiti per implementazione di questa interfaccia, contengono i parametri di inizializzazione della servlet (se esistenti) nonch permettono alla servlet di comunicare con il servlet container restituendo un oggetto di tipo ServletContext.\npublic interface ServletConfig\n{\npublic ServletContext getServletContext();\npublic String getInitParameter(String name);\npublic Enumeration getInitParameterNames();\n}\nI parametri di inizializzazione di una servlet devono essere definiti allinterno dei file di configurazione del web server che si occuper di comunicarli alla servlet in forma di coppie chiave=valore. I metodi messi a disposizione da oggetti di tipo ServletConfig per accedere a questi parametri sono due: il metodo getInitParametrNames() che restituisce un elenco (enumerazione) dei nomi dei parametri, ed il metodo getInitParameter(String) che preso in input il nome del parametro in forma di oggetto String, restituisce a sua volta una stringa contenente il valore del parametro di inizializzazione. Nellesempio di seguito, utilizziamo il met http://www.java-net.tv 180\ngetInitParameter(String) per ottenere il valore del parametro di input con chiave CHIAVEPARAMETRO:\nString key = CHIAVE_PARAMETRO;\nString val = config.getInitParameter(key);\nDove config rappresenta un oggetto di tipo ServletConfig passato come parametro di input al metodo init(ServletConfig) della servlet.\nIl metodo getServletContext(), restituisce invece un oggetto di tipo ServletContext tramite il quale possibile richiedere al container lo stato dellambiente allinterno del quale le servlet stanno girando.\nUn metodo alternativo per accedere ai parametri di configurazione della servlet\nmesso a disposizione dal metodo getServletConfig() definito allinterno della interfaccia servlet di javax.servlet. Utilizzando questo metodo sar di fatto possibile accedere ai parametri di configurazione anche allinterno del metodo service().\nNel prossimo esempio viene definita una servlet che legge un parametro di input con chiave INPUTPARAMS, lo memorizza in un dato membro della classe e ne utilizza il valore per stampare una stringa alla esecuzione del metodo service().\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\nimport java.io ;\npublic class Test extends HttpServlet\n{\nString initparameter=null;\npublic void init(ServletConfig config)\n{\ninitparameter = config.getInitParameter(INPUTPARAMS);\n}\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(text/html);\nServletOutputStream out = res.getOutputStream();\nout.println();\nout.println(Test);\nout.println();\nout.println(

Il parametro di input vale + initparameter +

);\nout.println();\n}\n}\nLoggetto HttpServletResponse Questo oggetto definisce il canale di comunicazione tra la servlet ed il client che ha inviato la richiesta (browser). Questo oggetto mette a disposizione della servlet i metodi necessari per inviare al client le entit prodotte dalla manipolazione dei dati di input. Una istanza delloggetto ServletResponse viene definita per implementazione della interfaccia HttpServletResponse definita allinterno del package javax.servlet.http che definisce una specializzazione della interfaccia derivata rispetto al protocollo http.\npackage javax.servlet;\nimport java.io.*;\n http://www.java-net.tv 181\npublic interface ServletResponse extends RequestDispatcher\n{\npublic String getCharacterEncoding();\npublic ServletOutputStream getOutputStream() throws IOException;\npublic PrintWriter getWriter() throws IOException;\npublic void setContentLength(int length);\npublic void setContentType(String type);\n}\npackage javax.servlet.http;\nimport java.util.*;\nimport java.io.*;\npublic interface HttpServletResponse extends javax.servlet.ServletResponse\n{\npublic static final int SC_CONTINUE = 100;\npublic static final int SC_SWITCHING_PROTOCOLS = 101;\npublic static final int SC_OK = 200;\npublic static final int SC_CREATED = 201;\npublic static final int SC_ACCEPTED = 202;\npublic static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;\npublic static final int SC_NO_CONTENT = 204;\npublic static final int SC_RESET_CONTENT = 205;\npublic static final int SC_PARTIAL_CONTENT = 206;\npublic static final int SC_MULTIPLE_CHOICES = 300;\npublic static final int SC_MOVED_PERMANENTLY = 301;\npublic static final int SC_MOVED_TEMPORARILY = 302;\npublic static final int SC_SEE_OTHER = 303;\npublic static final int SC_NOT_MODIFIED = 304;\npublic static final int SC_USE_PROXY = 305;\npublic static final int SC_BAD_REQUEST = 400;\npublic static final int SC_UNAUTHORIZED = 401;\npublic static final int SC_PAYMENT_REQUIRED = 402;\npublic static final int SC_FORBIDDEN = 403;\npublic static final int SC_NOT_FOUND = 404;\npublic static final int SC_METHOD_NOT_ALLOWED = 405;\npublic static final int SC_NOT_ACCEPTABLE = 406;\npublic static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;\npublic static final int SC_REQUEST_TIMEOUT = 408;\npublic static final int SC_CONFLICT = 409;\npublic static final int SC_GONE = 410;\npublic static final int SC_LENGTH_REQUIRED = 411;\npublic static final int SC_PRECONDITION_FAILED = 412;\npublic static final int SC_REQUEST_ENTITY_TOO_LARGE = 413;\npublic static final int SC_REQUEST_URI_TOO_LONG = 414;\npublic static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;\npublic static final int SC_INTERNAL_SERVER_ERROR = 500;\npublic static final int SC_NOT_IMPLEMENTED = 501;\npublic static final int SC_BAD_GATEWAY = 502;\npublic static final int SC_SERVICE_UNAVAILABLE = 503;\npublic static final int SC_GATEWAY_TIMEOUT = 504;\npublic static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;\nvoid addCookie(Cookie cookie);\nboolean containsHeader(String name);\nString encodeRedirectUrl(String url); //deprecated String encodeRedirectURL(String url);\nString encodeUrl(String url);\nString encodeURL(String url);\nvoid sendError(int statusCode) throws java.io.IOException;\n http://www.java-net.tv 182\nvoid sendError(int statusCode, String message) throws java.io.IOException;\nvoid sendRedirect(String location) throws java.io.IOException;\nvoid setDateHeader(String name, long date);\nvoid setHeader(String name, String value);\nvoid setIntHeader(String name, int value);\nvoid setStatus(int statusCode);\nvoid setStatus(int statusCode, String message);\n}\nQuesta interfaccia definisce i metodi per impostare dati relativi alla entit inviata nella risposta (lunghezza e tipo mime), fornisce informazioni relativamente al set di caratteri utilizzato dal browser (in http questo valore viene trasmesso nell header Accept-Charset del protocollo) infine fornisce alla servlet laccesso al canale di comunicazione per inviare lentit al client. I due metodi deputati alla trasmissione sono quelli definiti nella interfaccia ServletResponse. Il primo, ServletOutputStream getOutputStream(), restituisce un oggetto di tipo ServletOutputStream e consente di inviare dati al client in forma binaria (ad esempio il browser richiede il download di un file) . Il secondo PrintWriter getWriter() restituisce un oggetto di tipo PrintWriter e quindi consente di trasmettere entit allo stesso modo di una System.out. Utilizzando questo secondo metodo, il codice della servlet mostrato nel paragrafo precedente diventa quindi:\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\nimport java.io ;\npublic class Test extends HttpServlet\n{\nString initparameter=null;\npublic void init(ServletConfig config)\n{\ninitparameter = config.getInitParameter(INPUTPARAMS);\n}\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(text/html);\nPrintWriter out = res. getWriter ();\nout.println();\nout.println(Test);\nout.println();\nout.println(

Il parametro di input vale + initparameter +

);\nout.println();\n}\n}\nNel caso in cui sia necessario utilizzare il metodo setContentType, sar obbligatorio effettuarne la chiamata prima di utilizzare il canale di output.\nI metodi specializzati di HttpServletResponse Nel paragrafo precedente abbiamo analizzato i metodi di HttpServletResponse ereditati a partire dalla interfaccia ServletResponse. Come si vede dal codice riportato nel paragrafo precedente, HttpServletResponse specializza un oggetto http://www.java-net.tv 183\nresponse affinch possa utilizzare gli strumenti tipici del protocollo http mediante metodi specializzati e legati alla definizione del protocollo.\nI metodi definiti allinterno di questa interfaccia coprono la possibilit di modificare o aggiungere campi allinterno dellheader del protocollo http, metodi per lavorare utilizzando i cookie, metodi per effettuare url encoding o per manipolare errori http. E inoltre possibile mediante il metodo sendRedirect() provocare il reindirizzamento della connessione verso un altro server sulla rete.\nNotificare errori utilizzando Java Servlet Allinterno della interfaccia HttpServletResponse, oltre ai prototipi dei metodi vengono dichiarate tutta una serie di costanti che rappresentano i codici di errore come definiti dallo standard http. Il valore di queste variabili costanti pu essere utilizzato con i metodi sendError(..) e setStatus( ) per inviare al browser particolari messaggi con relativi codici di errore. Un esempio realizzato nella servlet seguente:\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\nimport java.io ;\npublic class TestStatus extends HttpServlet\n{\nString initparameter=null;\npublic void init(ServletConfig config)\n{\n}\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(text/html);\nServletOutputStream out = res.getOutputStream();\nout.println();\nout.println(Test Status Code);\nout.println();\nres.sendError(HttpServletResponse. SC_OK, Il sito e stato temporaneamente sospeso);\nout.println();\n}\n}\nLoggetto HttpServletRequest Come oggetti di tipo HttpServletResponse rappresentano una risposta http,\noggetti di tipo HttpServletRequest rappresentano una richiesta http.\npackage javax.servlet;\nimport java.net.*;\nimport java.io.*;\nimport java.util.*;\npublic interface ServletRequest\n{\npublic Object getAttribute(String name);\npublic Enumeration getAttributeNames();\n http://www.java-net.tv 184\npublic String getCharacterEncoding();\npublic int getContentLength();\npublic String getContentType();\npublic ServletInputStream getInputStream() throws IOException;\npublic String getParameter(String name);\npublic Enumeration getParameterNames();\npublic String[] getParameterValues(String name);\npublic String getProtocol();\npublic BufferedReader getReader() throws IOException;\npublic String getRealPath(String path);\npublic String getRemoteAddr();\npublic String getRemoteHost();\npublic String getScheme();\npublic String getServerName();\npublic int getServerPort();\npublic Object setAttribute(String name, Object attribute);\n}\npackage javax.servlet.http;\nimport java.util.*;\nimport java.io.*;\npublic interface HttpServletRequest extends javax.servlet.ServletRequest {\nString getAuthType();\nCookie[] getCookies();\nlong getDateHeader(String name);\nString getHeader(String name);\nEnumeration getHeaderNames();\nint getIntHeader(String name);\nString getMethod();\nString getPathInfo();\nString getPathTranslated();\nString getQueryString();\nString getRemoteUser();\nString getRequestedSessionId();\nString getRequestURI();\nString getServletPath();\nHttpSession getSession();\nHttpSession getSession(boolean create);\nboolean isRequestedSessionIdFromCookie();\nboolean isRequestedSessionIdFromUrl();\nboolean isRequestedSessionIdFromURL();\nboolean isRequestedSessionIdValid();\n}\nMediante i metodi messi a disposizione da questa interfaccia, possibile accedere ai contenuti della richiesta http inviata dal client compreso eventuali parametri o entit trasportate allinterno del pacchetto http. I metodi ServletInputStream getInputStream() e BufferedReader getReader() ci permettono di accedere ai dati trasportati dal protocollo. Il metodo getParameter(String) ci consente di ricavare i valori dei parametri contenuti allinterno della query string della richiesta referenziandoli tramite il loro nome.\nEsistono inoltre altri metodi che consentono di ottenere meta informazioni relative alla richiesta: ad esempio i metodi\n ..\npublic String getRealPath(String path);\npublic String getRemoteAddr();\n http://www.java-net.tv 185\npublic String getRemoteHost();\npublic String getScheme();\npublic String getServerName();\npublic int getServerPort();\n .\nNel prossimo esempio utilizzeremo questi metodi per implementare una servlet che stampa a video tutte le informazioni relative alla richiesta da parte del client:\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\nimport java.io ;\npublic class Test extends HttpServlet\n{\nString initparameter=null;\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(text/html);\nPrintWriter out = res. getWriter ();\nout.println();\nout.println(Test);\nout.println();\nout.println(Carachter encoding\n+req.getCharacterEncoding()+
);\nout.println(Mime tipe dei contenuti\n+req.getContentType()+
);\nout.println(Protocollo\n+req.getProtocol()+
);\nout.println(Posizione fisica:\n+req.getRealPath()+
);\nout.println(Schema:\n+req.getScheme()+
);\nout.println(Nome del server:\n+req.getServerName()+
);\nout.println(Porta del server:\n+req.getServerPort()+
);\nout.println();\nout.close();\n}\n}\nAltri metodi di questa interfaccia ci consentono di utilizzare i cookie esistenti sul client oppure ottenere meta informazioni relative al client che ha inviato la richiesta.\nInviare dati mediante la query string Nel capitolo 13 abbiamo introdotto la trasmissione di dati tra client e applicazione web. Ricordando quanto detto, utilizzando il metodo GET del protocollo http i dati vengono appesi alla URL che identifica la richiesta nella forma di coppie nome=valore separate tra loro dal carattere &. Questa concatenazione di coppie\ndetta query string ed separata dallindirizzo della risorsa dal carattere ?. Ad esempio la URL http://www.java-net.tv/servelt/Hello?nome=Massimo&cognome=Rossi http://www.java-net.tv 186\ncontiene la query string ?nome=Massimo&cognome=Rossi. Abbiamo inoltre accennato al fatto che se il metodo utilizzato il metodo POST, i dati non vengono trasmessi in forma di query string ma vengono accodati nella sezione dati del protocollo http.\nLe regole utilizzare in automatiche dal browser e necessarie al programmatore per comporre la query string sono le seguenti:\nLa query string inizia con il carattere ?.\nUtilizza coppie nome=valore per trasferire i dati.\nOgni coppia deve essere separata dal carattere &.\nOgni carattere spazio deve essere sostituito dalla sequenza %20.\nOgni carattere % deve essere sostituito dalla sequenza %33.\nI valori di una query string possono essere recuperati da una servlet utilizzando i metodi messi a disposizione da oggetti di tipo HttpServletRequest. In particolare nellinterfaccia HttpServletRequest vengono definiti quattro metodi utili alla manipolazione dei parametri inviati dal browser.\npublic String getQueryString ();\npublic Enumeration getParameterNames();\npublic String getParameter(String name);\npublic String[] getParameterValues(String name);\nIl primo di questi metodi ritorna una stringa contenente la query string se inviata dal client (null in caso contrario), il secondo ritorna una Enumerazione dei nomi dei parametri contenuti nella query string, il terzo il valore di un parametro a partire dal suo nome ed infine il quarto ritorna un array di valori del parametro il cui nome viene passato in input. Questultimo metodo viene utilizzato quando il client utilizza oggetti di tipo checkboxche possono prendere pi valori contemporaneamente.\nNel caso in cui venga utilizzato il metodo POST il metodo getQueryString risulter inutile dal momento che questo metodo non produce la query string.\nQuery String e Form Html Il linguaggio HTML pu produrre URL contenenti query string definendo allinterno della pagina HTML dei form. La sintassi per costruire form HTML la seguente:\n
\n\n\n .\n\n\n
\nNellistante in cui lutente preme il pulsante SUBMIT, il browser crea una query string contenente le coppie nome=valore che identificano i dati nel form e la appende alla URL che punter alla risorsa puntata dal campo action del tag
.\nVediamo un form di esempio:\nesempio.html http://www.java-net.tv tarquini@all-one-mail.net 187\n\n\n\n
\nNome:

\nCognome:

\nEt:

\n\n\n\n\nNella Figura 15-1 viene riportato il form cos come il browser lo presenta allutente:\nFigura 15-1 : form html Dopo aver inserito i valori nei tre campi di testo, la pressione del pulsante provocher linvio da parte del client di una richiesta http identificata dalla URL seguente:\nhttp://www.javanet.tv/Prova?param=nasconto&nome=nomeutente&cognome=cogno meutente&eta=etautente http://www.java-net.tv 188\nI limiti del protocollo http : cookies Il limite maggiore del protocollo http legato alla sua natura di protocollo non transazionale ovvero non in grado di mantenere dati persistenti tra i vari pacchetti http. Fortunatamente esistono due tecniche per aggirare il problema: i cookies e la gestione di sessioni utente. I cookies sono piccoli file contenenti una informazione scritta allinterno secondo un certo formato che vengono depositati dal server sul client e contengono informazioni specifiche relative alla applicazione che li genera.\nSe utilizzati correttamente consentono di memorizzare dati utili alla gestione del flusso di informazioni creando delle entit persistenti in grado di fornire un punto di appoggio per garantire un minimo di transazionalit alla applicazione web Formalmente i cookie contengono al loro interno una singola informazione nella forma nome=valore pi una serie di informazioni aggiuntive che rappresentano:\nIl dominio applicativo del cookie;\nIl path della applicazione;\nLa durata della validit del file;\nUn valore booleano che identifica se il cookie criptato o no.\nIl dominio applicativo del cookie consente al browser di determinare se, al momento di inviare una richiesta http dovr associarle il cookie da inviare al server.\nUn valore del tipo www.java-web.tv indicher al browser che il cookie sar valido solo per la macchina www allinterno del dominio java-web.tv . Il path della applicazione rappresenta il percorso virtuale della applicazione per la quale il cookie\n valido.\nUn valore del tipo / indica al browser che qualunque richiesta http da inviare al dominio definito nel campo precedente dovr essere associata al cookie. Un valore del tipo /servlet/ServletProvaindicher invece al browser che il cookie dovr essere inviato in allegato a richieste http del tipo http://www.java-net.tv/servlt/ServletProva.\nLa terza propriet comunemente detta expirationindica il tempo di durata della validit del cookie in secondi prima che il browser lo cancelli definitivamente.\nMediante questo campo possibile definire cookie persistenti ossia senza data di scadenza.\nManipolare cookies con le Servlet Una servlet pu inviare uno o pi cookie ad un browser mediante il metodo addCookie(Cookie) definito nellinterfaccia HttpServletResponse che consente di appendere lentit ad un messaggio di risposta al browser. Viceversa, i cookie associati ad una richiesta http possono essere recuperati da una servlet utilizzando il metodo getCookie() definito nella interfaccia HttpServletRequest che ritona un array di oggetti.\nIl cookie in Java viene rappresentato dalla classe javax.servlet.http.Cookie il cui prototipo riportato nel codice seguente.\nCookie.java package javax.servlet.http;\npublic class Cookie implements Cloneable {\npublic Cookie(String name, String value);\npublic String getComment() ;\npublic String getDomain() ;\npublic int getMaxAge();\npublic String getName();\npublic String getPath();\n http://www.java-net.tv 189\npublic boolean getSecure();\npublic String getValue();\npublic int getVersion();\npublic void setComment(String purpose);\npublic void setDomain(String pattern);\npublic void setMaxAge(int expiry);\npublic void setPath(String uri);\npublic void setSecure(boolean flag);\npublic void setValue(String newValue);\npublic void setVersion(int v);\n}\nUn esempio completo Nellesempio implementeremo una servlet che alla prima chiamata invia al server una serie di cookie mentre per ogni chiamata successiva ne stampa semplicemente il valore contenuto.\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\nimport java.io.* ;\npublic class TestCookie extends HttpServlet\n{\nprivate int numrichiesta=0;\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nCookie cookies = null;\nres.setContentType(\"text/html\");\nPrintWriter out = res. getWriter ();\nout.println(\"\");\nout.println(\"Cookie Test\");\nout.println(\"\");\nswitch(numrichiesta)\n{\ncase 0:\n//Appende 10 cookie alla risposta http for (int i=0; i<10; i++)\n{\nString nome=\"cookie\"+i;\nString valore=\"valore\"+i;\ncookies = new Cookie(nome,valore);\ncookies.setMaxAge(1000);\nres.addCookie(cookies);\n}\nout.println(\"

I cookie sono stati appesi a\nquesta risposta

\");\nnumrichiesta++;\nbreak;\ndefault :\n//ricavo l'array dei cookie e stampo le\n//coppie nome=valore Cookie cookies[] = req.getCookies();\nfor (int j=0; j http://www.java-net.tv 190\nCookie appo = cookies[j];\nout.println(\"

\"+appo.getName()+\" =\n\"+appo.getValue()+\"

\");\n}\n}\nout.println(\"\");\nout.close();\n}\n}\nSessioni utente I cookie non sono uno strumento completo per memorizzare lo stato di una applicazione web. Di fatto i cookie sono spesso considerati dallutente poco sicuri e pertanto non accettati dal browser che li rifiuter al momento dellinvio con un messaggio di risposta. Come se non bastasse il cookie ha un tempo massimo di durata prima di essere cancellato dalla macchina dellutente.\nServlet risolvono questo problema mettendo a disposizione del programmatore la possibilit di racchiudere lattivit di un client per tutta la sua durata allinterno di sessioni utente.\nUna servlet pu utilizzare una sessione per memorizzare dati persistenti, dati specifici relativi alla applicazione e recuperarli in qualsiasi istante sia necessario.\nQuesti dati possono essere inviati al client allinterno dellentit prodotta.\nOgni volta che un client effettua una richiesta http, se in precedenza stata definita una sessione utente legata al particolare client, il servlet container identifica il client e determina quale sessione stata associata ad esso. Nel cosa in cui la servlet la richieda, il container gli mette disposizione tutti gli strumenti per utilizzala.\nOgni sessione creata dal container associata in modo univoco ad un identificativo o ID. Due sessioni non possono essere associate ad uno stesso ID.\nSessioni dal punto di vista di una servlet Il servlet container contiene le istanze delle sessioni utente rendendole disponibili ad ogni servlet che ne faccia richiesta (Figura 15-2).\n http://www.java-net.tv 191\nFigura 15-2 : le sessioni sono accessibili da tutte le servlet Ricevendo un identificativo dal client, una servlet pu accedere alla sessione associata allutente. Esistono molti modi per consentire al client di tracciare lidentificativo di una sessione, tipicamente viene utilizzato il meccanismo dei cookie persistenti. Ogni volta che un client esegue una richiesta http, il cookie contenente lidentificativo della richiesta viene trasmesso al server che ne ricava il valore contenuto e lo mette a disposizione delle servlet. Nel caso in cui il browser non consenta lutilizzo di cookies esistono tecniche alternative che risolvono il problema.\nTipicamente una sessione utente deve essere avviata da una servlet dopo aver verificato se gi non ne esista una utilizzando il metodo getSession(boolean) di HttpServletRequest. Se il valore boolean passato al metodo vale true ed esiste gi una sessione associata allutente il metodo semplicemente ritorner un oggetto che la rappresenta, altrimenti ne creer una ritornandola come oggetto di ritorno del metodo. Al contrario se il parametro di input vale false, il metodo torner la sessione se gi esistente null altrimenti.\nQuando una servlet crea una nuova sessione, il container genera automaticamente lidentificativo ed appende un cookie contenente lID alla risposta http in modo del tutto trasparente alla servlet.\nLa classe HttpSession Un oggetto di tipo httpSession viene restituito alla servlet come parametro di ritorno del metodo getSession(boolean) e viene definito dallinterfaccia javax.servlet.http.HttpSession .\nHttpSession.java package javax.servlet.http;\npublic interface HttpSession {\nlong getCreationTime();\n http://www.java-net.tv 192\nString getId();\nlong getLastAccessedTime();\nint getMaxInactiveInterval();\nHttpSessionContext getSessionContext();\nObject getValue(String name);\nString[] getValueNames();\nvoid invalidate();\nboolean isNew();\nvoid putValue(String name, Object value);\nvoid removeValue(String name);\nint setMaxInactiveInterval(int interval);\n}\nUtilizzando i metodi getId()\nlong getCreationTime()\nlong getLastAccessedTime()\nint getMaxInactiveInterval()\nboolean isNew()\npossiamo ottenere le meta informazioni relative alla sessione che stiamo manipolando. E importante notare che i metodi che ritornano un valore che rappresenta un tempo rappresentano il dato in secondi. Sar quindi necessario operare le necessarie conversioni per determinare informazioni tipo date ed ore. Il significato dei metodi descritti risulta chiaro leggendo il nome del metodo. Il primo ritorna lidentificativo della sessione, il secondo il tempo in secondi trascorso dalla creazione della sessione, il terzo il tempo in secondi trascorso dallultimo accesso alla sezione, infine il quarto lintervallo massimo di tempo di inattivit della sessione.\nQuando creiamo una sessione utente, loggetto generato verr messo in uno stato di NEW che sta ad indicare che la sessione stata creata ma non attiva. Dal un punto di vista puramente formale ovvio che per essere attiva la sessione deve essere accettata dal client ovvero una sessione viene accettata dal client solo nel momento in cui invia al server per la prima volta lidentificativo della sessione. Il metodo isNew() restituisce un valore booleano che indica lo stato della sessione.\nI metodi void putValue(String name, Object value)\nvoid removeValue(String name)\nString[] getValueNames(String name)\nObject getValue(String name)\nConsentono di memorizzare o rimuovere oggetti nella forma di coppie nome=oggetto allinterno della sessione consentendo ad una servlet di memorizzare dati (in forma di oggetti) allinterno della sessione per poi utilizzarli ad ogni richiesta http da parte dellutente associato alla sessione.\nQuesti oggetti saranno inoltre accessibili ad ogni servlet che utilizzi la stessa sessione utente potendoli recuperare conoscendo il nome associato.\nUn esempio di gestione di una sessione utente Nel nostro esempio creeremo una servlet che conta il numero di accessi che un determinato utente ha effettuato sul sistema utilizzando il meccanismo delle sessioni.\nimport javax.servlet.* ;\nimport javax.servlet.http.* ;\n http://www.java-net.tv 193\nimport java.io.* ;\npublic class TestSession extends HttpServlet\n{\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nres.setContentType(\"text/html\");\nPrintWriter out = res. getWriter ();\nout.println(\"\");\nout.println(\"Test di una sessione servlet\");\nout.println(\"\");\nHttpSession sessione = req.getSession(true);\nif(session.isNew())\n{\nout.println(\"Id della sessione: \"\n+session.getId()+\"
\");\nout.println(\"Creata al tempo: \"\n+session.creationTime()+\"
\");\nout.println(\"Questa la tua prima\n+connessione al server \");\nsession.putValue(\"ACCESSI\", new Integer(1));\n}else {\nint accessi = ((Integer)session.getValue(\"ACCESSI\")).intValue();\naccessi++;\nsession.putValue(\"ACCESSI\", new Integer(accessi));\nout.println(\"Questa la tua connessione numero: \"\n+accessi);\n}\nout.println(\"\");\nout.close();\n}\n}\nDurata di una sessione utente Una sessione utente rappresenta un oggetto transiente la cui durata deve essere limitata al periodi di attivit dellutente sul server. Utilizzando i metodi void invalidate();\nint setMaxInactiveInterval(int interval)\n possibile invalidare una sessione o disporre che una volta superato lintervallo massimo di inattivit la servlet venga automaticamente resa inattiva dal container.\nURL rewriting Il browser ha la facolt di accettare o no cookies da parte di un server web.\nQuando ci accade impossibile per il server tracciare lidentificativo della sessione e di conseguenza mettere in grado una servlet di accederle.\nUn metodo alternativo quello di codificare lidentificativo della sessione allinterno della URL che il browser invia al server allinterno di una richiesta http.\n http://www.java-net.tv tarquini@all-one-mail.net 194\nQuesta metodologia deve necessariamente essere supportata dal server che dovr prevedere lutilizzo di caratteri speciali allinterno della URL. Server differenti potrebbero utilizzare metodi differenti.\nLinterfaccia HttpServletResponse ci mette a disposizione il metodo encodeURL(String) che prende come parametro di input una URL, determina se\nnecessario riscriverla ed eventualmente codifica allinterno della URL lidentificativo della sessione.\n http://www.java-net.tv 195\nCapitolo 16 JavaServer Pages Introduzione\nLa tecnologia JavaServer Pages rappresenta un ottimo strumento per scrivere pagine web dinamiche ed insieme a servlet consente di separare le logiche di business della applicazione web (servlet) dalle logiche di presentazione.\nBasato su Java, JavaServer Pages sposano il modello write once run anywhere, consentono facilmente luso di classi Java, di JavaBeans o laccesso ad Enterprise JavaBeans.\nJavaServer Pages Una pagina JSP un semplice file di testo che fonde codice html a codice Java a formare una pagina dai contenuti dinamici. La possibilit di fondere codice html con codice Java senza che nessuno interferisca con laltro consente di isolare la rappresentazione dei contenuti dinamici dalle logiche di presentazione. Il disegnatore potr concentrarsi solo sulla impaginazione dei contenuti che saranno inseriti dal programmatore che non dovr preoccuparsi dellaspetto puramente grafico.\nDa sole, JavaServer Pages consentono di realizzare applicazioni web dinamiche\n(Figura 16-1) accedendo a componenti Java contenenti logiche di business o alla base dati del sistema. In questo modello il browser accede direttamente ad una pagina JSP che riceve i dati di input, li processa utilizzando eventualmente oggetti Java, si connette alla base dati effettuando le operazioni necessarie e ritorna al client la pagina html prodotta come risultato della processazione dei dati.\n http://www.java-net.tv 196\nFigura 16-1 : primo modello di accesso Il secondo modello, e forse il pi comune, utilizza JavaServer Pages come strumento per sviluppare template demandando completamente a servlet la processazione dei dati di input (Figura 16-2).\nFigura 16-2 : secondo modello di accesso In questo nuovo modello, il browser invia la sua richiesta ad una servlet che si preoccuper di processare i dati di input utilizzando eventualmente via JDBC la base dati del sistema. La servlet ora generer alcuni oggetti (non pi pagine html) come prodotto della esecuzione del metodo service( ). Utilizzando gli strumenti messi a disposizione dal container, la servlet potr inviare gli oggetti prodotti ad una pagina JavaServer Pages che si preoccuper solamente di ricavare il contenuto di questi Massimiliano Tarquini http://www.java-net.tv 197\noggetti inserendoli allinterno del codice html. Sara infine la pagina JSP ad inviare al client la pagina prodotta.\nCompilazione di una pagina JSP Se dal punto di vista del programmatore una pagina JSP un documento di testo contenente tag html e codice Java, dal punto di vista del server una pagina JSP\nutilizzata allo stesso modo di una servlet. Di fatto, nel momento del primo accesso da parte dellutente, la pagina JSP richiesta viene trasformata in un file Java e compilata dal compilatore interno della virtual machine. Come prodotto della compilazione otterremo una classe Java che rappresenta una servlet di tipo HttpServlet che crea una pagina html e la invia al client.\nTipicamente il web server memorizza su disco tutte le definizioni di classe ottenute dal processo di compilazione appena descritto per poter riutilizzare il codice gi compilato. Lunica volta che una pagina JSP viene compilata al momento del suo primo accesso da parte di un client o dopo modifiche apportate dal programmatore affinch il client acceda sempre alla ultima versione prodotta.\nScrivere pagine JSP Una pagina JSP deve essere memorizzata allinterno di un file di testo con estensione .jsp . Equesta lestensione che il web server riconosce per decidere se compilare o no il documento. Tutte le altre estensioni verranno ignorate.\nEcco quindi un primo esempio di pagina JSP:\nesempio1.jsp\n\n\n

Informazioni sulla richiesta http

\n
\nMetodo richiesto : <%= request.getMethod() %>\n
\nURI : <%= request.getRequestURI() %>\n
\nProtocollo : <%= request.getProtocol() %>\n
\n\n\nUna pagina JSP come si vede chiaramente dallesempio per la maggior parte formata da codice html con in pi un piccolo insieme di tag addizionali. Nel momento in cui avviene la compilazione della pagina il codice html viene racchiuso in istruzioni di tipo out.println(codicehtml) mentre il codice contenuto allinterno dei tag aggiuntivi viene utilizzato come codice eseguibile. Leffetto prodotto sar comunque quello di inserire allinterno del codice html valori prodotti dalla esecuzione di codice Java.\nI tag aggiuntivi rispetto a quelli definiti da html per scrivere pagine jsp sono tre:\nespressioni, scriptlet, dichiarazioni. Le espressioni iniziano con la sequenza di caratteri <%= e terminano con la sequenza %>, le istruzioni contenute non devono terminare con il carattere ; e devono ritornare un valore che pu essere promosso a stringa. Ad esempio una espressione JSP la riga di codice:\n<%= new Integer(5).toString() %>\n http://www.java-net.tv 198\nLe scriptlet iniziano con la sequenza <%, terminano con la sequenza %> e devono contenere codice Java valido. Allinterno di questi tag non si possono scrivere definizioni di classi o di metodi, ma consentono di dichiarare variabili visibili allinterno di tutta la pagina JSP. Una caratteristica importante di questi tag che il codice Java scritto allinterno non deve essere completo ovvero possibile fondere blocchi di codice Java allinterno di questi tag con blocchi di codice html. Ad esempio:\n<% for(int i=0; i<10; i++) { %>\n Il valore di I : <%= new Integer(i).toString() %> \n<% } %>\nInfine le dichiarazioni iniziano con la sequenza <%! e terminano con la sequenza\n%> e possono contenere dichiarazioni di classi o di metodi utilizzabili solo allinterno della pagina, e a differenza del caso precedente, devono essere completi.\nNellesempio utilizziamo questi tag per definire un metodo StampaData() che ritorna la data attuale in formato di stringa:\n<%!\nString StampaData()\n{\nreturn new Date().toString();\n}\n%>\nNel prossimo esempio di pagina jsp, allinterno di un loop di dieci cicli effettuiamo un controllo sulla variabile intera che definisce il contatore del ciclo. Se la variabile pari stampiamo il messaggio Pari, altrimenti il messaggio Dispari.\nEsempio2.jsp\n\n\n<% for(int i=0; i<10; i++) {\nif(i%2==0) {\n%>\n

Pari

\n<% } else { %>\n

Dispari

\n<%\n}\n}\n%>\n\n\nLaspetto pi interessante del codice nellesempio proprio quello relativo alla possibilit si spezzare il codice Java contenuto allinterno delle scriptlets per dar modo al programmatore di non dover fondere tag html allinterno sorgente Java.\nInvocare una pagina JSP da una servlet Nel secondo modello di accesso ad una applicazione web trattato nel paragrafo 2 di questo capitolo abbiamo definito una pagina jsp come template ossia meccanismo di presentazione dei contenuti generati mediante una servlet.\nAffinch sia possibile implementare quanto detto, necessario che esista un meccanismo che consenta ad una servlet di trasmettere dati prodotti alla pagina JSP. Sono necessarie alcune considerazioni: primo, una pagina JSP viene tradotta http://www.java-net.tv 199\nuna in classe Java di tipo HttpServlet e di conseguenza compilata ed eseguita allinterno dello stesso container che fornisce lambiente alle servlet. Secondo, JSP ereditano quindi tutti i meccanismi che il container mette a disposizione delle servlet compresso quello delle sessioni utente.\nLo strumento messo a disposizione dal container per rigirare una chiamata da una servlet ad una JavaServer Pages passando eventualmente parametri loggetto RequestDispatcher restituito dal metodo public ServletContext getRequestDispatcher(String Servlet_or_JSP_RelativeUrl)\ndefinito nella interfaccia javax.servlet.ServletContext.\nRequestDispatcher.java package javax.servlet;\npublic interface RequestDispatcher {\npublic void forward(ServletRequest req, ServletResponse res);\npublic void include(ServletRequest req, ServletResponse res);\n}\ntramite il metodo forward(ServletRequest req, ServletResponse res) possibile reindirizzare la chiamata alla Servlet o JavaServer Page come indicato dalla URL definita dal parametro di input di getRequestDispatcher. Il metodo public void include(ServletRequest req, ServletResponse res), pur producendo a sua volta un reindirizzamento, inserisce il risultato prodotto dalla entit richiamata allinterno del risultato prodotto dalla servlet che ha richiamato il metodo.\nNellesempio viene definita una servlet che trasferisce tramite requestDispatcher la richiesta http alla pagina jsp /appo.jspmemorizzata nella root del web server.\npublic class Redirect extends HttpServlet\n{\npublic void service (HttpServletRequest req, HttpServletResponse res)\nthrows ServletException, IOException\n{\nServletContext contesto = getServletContext();\nRequestDispatcher rd = contesto.getRequestDispatcher(/appo.jsp);\ntry\n{\nrd.forward(req, res);\n}\ncatch(ServletException e)\n{\nSystem.out.println(e.toString());\n}\n}\n}\n http://www.java-net.tv 200\nCapitolo 17 JavaServer Pages Nozioni Avanzate Introduzione\nI tag JSP possono essere rappresentati in due modi differenti: Short-Hand ed XML equivalent. Ogni forma delle due prevede i seguenti tag aggiuntivi rispetto ad html:\nTipo Scriptlet\nShort Hand\n<% codice java %>\nDirettive\n<%@ tipo attributo %>\nDichiarazione\n<%! Dichiarazione %>\nEspressione\n<%= espressione %>\nAzione NA\nXML\n\ncodice java\n\n\n\ndichiarazione;\n\n\nespressione;\n\n\n\n\necc.\nDirettive Le direttive forniscono informazioni aggiuntive sulla allambiente allinterno della quale la JavaServer Page in esecuzione. Le possibili direttive sono due:\nPage : informazioni sulla pagina Include File da includere nel documento e possono contenere gli attributi seguenti:\nAttributo e possibili valori language=Java extends=package.class import=package.*, package.class session=true|false buffer=none|8kb|dimensione Massimiliano Tarquini Descrizione\nDichiara al server il linguaggio utilizzato allinterno della pagina JSP Definisce la classe base a partire dalla quale viene definita la servlet al momento della compilazione. Generalmente non viene utilizzato.\nSimile alla direttiva import di una definizione di classe Java. Deve essere una delle prime direttive e comunque comparire prima di altri tag JSP.\nDi default session vale true e significa che i dati appartenenti alla sessione utente sono disponibili dalla pagina JSP Determina se loutput strema della JavaServer Pages utilizza o no un buffer http://www.java-net.tv tarquini@all-one-mail.net 201\nautoFlush=true|false isThreadSafe=true|false info=info_text errorPage=error_url isErrorPage=true|false contentType=ctinfo di scrittura dei dati. Di default la dimensione di 8k. Questa direttiva va utilizzata\naffiancata dalla\ndirettiva autoflush\nSe impostato a true svuota il buffer di output quando risulta pieno invece di generare una eccezione Di default lattributo impostato a true e indica allambiente che il programmatore si preoccuper di gestire gli accessi concorrenti\nmediante blocchi\nsincronizzati. Se impostato a false viene utilizzata\ndi default\nlinterfaccia SinglkeThreadModel\nin fase\ndi compilazione.\nFornisce informazioni sulla pagina che si sta accedendo attraverso il metodo Servlet.getServletInfo().\nFornisce il path alla pagina jsp che verr richiamata in automatico per gestire eccezioni che non vengono controllate allinterno della pagina attuale.\nDefinisce la pagina come una una pagina di errore.\nDefinisce il mime tipe della pagina prodotta dalla esecuzione.\nUn esempio di blocco di direttive allinterno di una pagina JSP il seguente:\n<%@ page language=Java session=true errorPage=/err.jsp %>\n<%@ page import= java.lang.*, java.io.*%>\n<%@ include file=headers/intestazione.html %>\nDichiarazioni Una dichiarazione rappresenta dal punto di vista del web server che compila la JavaServer Page il blocco di dichiarazione dei dati membro o dei metodi della classe Servlet generata. Per definire un blocco di dichiarazioni si utilizza il tag <%!\nDichiarazione %>. Un esempio:\n<%! String nome =mionome;\nint tipointero=1;\nprivate String stampaNome()\n{\nreturn nome;\n}\n%>\nScriptlets Come gi definito nel capitolo precedente, le scriptlets rappresentano blocchi di codice java incompleti e consentono di fondere codice Java con codice html. Oltre a poter accedere a dati e metodi dichiarati allinterno di tag di dichiarazione consente di accedere ad alcuni oggetti impliciti ereditati dallambiente servlet.\n http://www.java-net.tv 202\nGli oggetti in questione sono otto e sono i seguenti:\nrequest : rappresenta la richiesta del client response : rappresenta la risposta del client out : rappresenta lo strema di output html inviato come risposta al client session : rappresenta la sessione utente page : rappresenta la pagina JSP attuale config : rappresenta i dettagli della configurazione del server pageContext : rappresenta un container per i metodi relativi alle servlet Oggetti impliciti : request Questo oggetto messo a disposizione della pagina JSP in maniera implicita e rappresenta la richiesta http inviata dallutente ovvero implementa linterfaccia javax.servlet.http.HttpServletRequest. Come tale questo oggetto mette e disposizione di una pagina JSP gli stessi metodi utilizzati allinterno di una servlet.\nNellesempio seguente i metodi messi a disposizione vengono utilizzati implicitamente per generare una pagina http che ritorna le informazioni relative alla richiesta:\nTestAmbiente.jsp\n<%@ page language=Java session=true %>\n<%@ page import= java.lang.*, java.io.*, javax.servlet.* , javax.servlet.http.*%>\n\nTest\n\nCarachter encoding\n<%=request.getCharacterEncoding() %>\n
\nMime tipe dei contenuti\n<%=request.getContentType()%>\n
\nProtocollo\n<%=request.getProtocol()%>\n
\nPosizione fisica:\n<%=request.getRealPath()%>\n
\nSchema:\n<%=request.getScheme()%>\n
\nNome del server:\n<%=request.getServerName()%>\n
\nPorta del server:\n<%=request.getServerPort()%>\n
\n\nOggetti impliciti : response Rappresenta la risposta http che la pagina JSP invia al client ed implementa javax.servlet.http.HttpServletResponse. Compito dei metodi messi a disposizione da http://www.java-net.tv 203\nquesto oggetto quello di inviare dati di risposta, aggiungere cookies, impostare headers http e ridirezionare chiamate.\nOggetti impliciti : session Rappresenta la sessione utente come definito per servlet. Anche questo metodo mette a disposizione gli stessi metodi di servlet e consente di accedere ai dati della sessione utente allinterno della pagina JSP.\n http://www.java-net.tv 204\nCapitolo 18 JDBC\nIntroduzione JDBC rappresentano le API di J2EE per poter lavorare con database relazionali.\nEsse consentono al programmatore di inviare query ad un database relazionale, di effettuare delete o update dei dati allinterno di tabelle, di lanciare stored-procedure o di ottenere meta-informazioni relativamente al database o le entit che lo compongono.\nJDBC sono modellati a partire dallo standard ODBC di Microsoft basato a sua volta sulle specifiche X/Open CLI. La differenza tra le due tecnologie sta nel fatto che mentre ODBC rappresenta una serie di C-Level API, JDBC fornisce uno strato di accesso verso database completo e soprattutto completamente ad oggetti.\nArchitettura di JDBC Figura 18-1: Architettura JDBC Architetturalmente JDBC sono suddivisi in due strati principali : il primo che fornisce una interfaccia verso il programmatore, il secondo di livello pi basso che fornisce invece una serie di API per i produttori di drivers verso database relazionali e nasconde allutente i dettagli del driver in uso. Questa caratteristica rende la tecnologia indipendente rispetto al motore relazionale con cui il programmatore deve comunicare.\nI driver utilizzabili con JDBC sono di quattro tipi: il primo rappresentato dal bridge jdbc/odbc che utilizzano linterfaccia ODBC del client per connettersi alla base Mass http://www.java-net.tv tarquini- 205\ndati. Il secondo tipo ha sempre funzioni di bridge (ponte), ma traduce le chiamate JDBC in chiamate di driver nativi gi esistenti sulla macchina. Il terzo tipo ha una architettura multi-tier ossia si connette ad un RDBMS tramite un middleware connesso fisicamente al database e con funzioni di proxy. Infine il quarto tipo rappresenta un driver nativo verso il database scritto in Java e compatibile con il modello definito da JDBC.\nI driver JDBC di qualsiasi tipo siano vengono caricati dalla applicazione in modo dinamico mediante una istruzione del tipo Class.forName(package.class). Una volta che il driver (classe java) viene caricato possibile connettersi al database tramite il driver manager utilizzando il metodo getConnection() che richiede in input la URL della base dati ed una serie di informazioni necessarie ad effettuare la connessione.\nIl formato con cui devono essere passate queste informazioni dipende dal produttore dei driver.\nDriver di tipo 1 Rappresentati dal bridge jdbc/odbc di SUN, utilizzano linterfaccia ODBC del client per connettersi alla base dati (Figura 18-2).\nFigura 18-2 : driver JDBC tipo 1 Questo tipo di driver sono difficili da amministrare e dipendono dalle piattaforme Microsoft. Il fatto di utilizzare meccanismi intermedi per connettersi alla base dati (lo strato ODBC) fa si che non rappresentano la soluzione ottima per tutte le piattaforme in cui le prestazioni del sistema rappresentano laspetto critico.\n http://www.java-net.tv 206\nDriver di tipo 2 I driver di tipo 2 richiedono che sulla macchina client siano installati i driver nativi del database con cui lutente intende dialogare (Figura 18-3). Il driver JDBC convertir quindi le chiamate JDBC in chiamate compatibili con le API native del server.\nLuso di API scritte in codice nativo rende poco portabili le soluzioni basate su questo tipo di driver. I driver JDBC/ODBC possono essere visti come un caso specifico dei driver di tipo 2.\nFigura 18-3 : driver JDBC di tipo 2 Driver di tipo 3 I driver di tipo 3 consentono di non utilizzare codice nativo sulla macchina client e quindi consentono di costruire applicazioni Java portabili.\nFormalmente i driver di tipo 3 sono rappresentati da oggetti che convertono le chiamate JDBC in un protocollo di rete e comunicano con una applicazione middleware chiamata server di rete. Compito del server di rete quello di rigirare le chiamate da JDBC instradandole verso il server database (Immagine 4).\nUtilizzare architetture di questo tipo dette multi-tier comporta molti vantaggi soprattutto in quelle situazioni in cui un numero imprecisato di client deve connettersi ad una moltitudine di server database. In questi casi infatti tutti i client potranno parlare un unico protocollo di rete, quello conosciuto dal middleware, sar compito del server di rete tradurre i pacchetti nel protocollo nativo del database con cui il client sta cercando di comunicare.\nLutilizzo di server di rete consente inoltre di utilizzare politiche di tipo caching e pooling oppure di load balancing del carico.\n http://www.java-net.tv tarquini@all-one-mail.net 207\nFigura 18-4 : driver JDBC di tipo 3 http://www.java-net.tv tarquini@all-one-mail.net 208\nFigura 18-5 : driver JDBC di tipo 4 Driver di tipo 4 Un driver di tipo quattro fornisce accesso diretto ad un database ed un oggetto Java completamente serializzabile (Immagine 4).Questo tipo di driver possono funzionare su tutte le piattaforme e, dal momento che sono serializzabili possono essere scaricati dal server.\nUna prima applicazione di esempio Prima di scendere nei dettagli della tecnologia JDBC soffermiamoci su una prima applicazione di esempio. La applicazione usa driver JDBC di tipo 1 per connettersi ad un database access contenente una sola tabella chiamata impiegati come mostrata nella Figura 18-6.\n http://www.java-net.tv tarquini@all-one-mail.net 209\nFigura 18-6 : tabella access EsempioJDBC.java import java.sql.* ;\npublic class EsempioJDBC\n{\npublic static void main(String args[])\n{\ntry\n{\nClass.forname(sun.jdbc.odbc.JdbcOdbcDriver);\n}\ncatch(ClassNotFoundException e)\n{\nSystem.out.println(e.toString());\nSystem.out.println(Il driver non pu essere caricato);\nSystem.exit(1);\n}\ntry\n{\nConnection conn =\nDriverManager.getConnection(jdbc:odbc:impiegati,,);\nStatement stmt = conn.createStatement();\nResultSet rs =\nstmt.executeQuery(SELECT NOME FROM IMPIEGATI);\nwhile(rs.next())\n{\nSystem.out.println(rs.getString(NOME));\n}\nrs.close();\nstmt.close();\nconn.close();\n}\ncatch(SQLException _sql)\n{\nSystem.out.println(se.getMessage());\nSe.printStackTrace(System.out);\nSystem.exit(1);\n}\n}\n http://www.java-net.tv 210\n}\nDopo aver caricato il driver JDBC utilizzando il metodo statico forname(String)\ndella classe java.lang.Class Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);\nlapplicazione tenta la connessione al database utilizzando il metodo statico getConnection(String,String,String) delloggetto DriverManager definito nel package passando come parametro una di tipo Stringa che rappresenta la URL della base dati con una serie di informazioni aggiuntive.\nConnection conn = DriverManager.getConnection(jdbc:odbc:impiegati,,)\nNel caso in cui la connessione vada a buon fine la chiamata al metodo di DriverManager ci ritorna un oggetto di tipo Connection definito nellinterfaccia java.sql.Connection. Mediante loggetto Connection creiamo quindi un oggetto di tipo java.sql.Statement che rappresenta la definizione uno statement SQL tramite il quale effettueremo la nostra query sul database.\nStatement stmt = conn.createStatement();\nResultSet rs = stmt.executeQuery(SELECT NOME FROM IMPIEGATI);\nLa nostra applicazione visualizzer infine il risultato della query mediante un ciclo while che scorre gli elementi di un oggetto ResultSet definito in java.sql.ResultSet e ritornato come parametro dalla esecuzione del metodo executeQuery(String) di java.sql.Statement.\nRichiedere una connessione ad un database Il primo passo da compiere quando utilizziamo un driver JDBC quello di tentare la connessione al database, sar quindi necessario che il driver sia caricato allinterno della virtual machine utilizzando il metodo statico forName(String)\ndelloggetto Class definito nel package java.lang. Una volta caricato il driver si registrer sul sistema come driver JDBC disponibile chiamando implicitamente il metodo statico registerDriver(Driver driver) della classe DriverManager.\nQuesto meccanismo consente di caricare allinterno del gestore dei driver JDBC pi di un driver per poi utilizzare quello necessario al momento della connessione che rappresenta il passo successivo da compiere. Per connetterci al database la classe DriverManager ci mette a disposizione il metodo statico getConnection() che prende in input tre stringhe e ritorna un oggetto di tipo java.sql.Connection che da questo momento in poi rappresenter la connessione ad uno specifico database a seconda del driver JDBC richiamato:\nConnection conn =\nDriverManager.getConnection(String URL, String user, String password);\nUna URL JDBC identifica un database dal punto di vista del driver JDBC. Di fatto URL per driver differenti possono contenere informazioni differenti, tipicamente iniziano con la string jdbc, contengono indicazioni sul protocollo e informazioni aggiuntive per connettersi al database.\nJDBC URL = jdbc:protocollo:other_info http://www.java-net.tv 211\nPer driver JDBC di tipo 1 (bridge JDBC/ODBC) la JDBC URL diventa JDBC/ODBC URL = jdbc:odbc:id_odbc Dove id_odbc il nome ODBC definito dallutente ed associato ad una particolare connessione ODBC.\nEseguire query sul database Dopo aver ottenuto la nostra sezione vorremmo poter eseguire delle query sulla base dati. Equindi necessario avere un meccanismo che ci consenta di effettuare operazioni di select, delete, update sulle tabelle della base dati.\nLa via pi breve quella che utilizza loggetto java.sql.Statement che rappresenta una istruzione SQL da eseguire ed ritornato dal metodo createStatement() delloggetto java.sql.Connection.\nStatement stmt = conn.createStatement();\nI due metodi principali delloggetto statement sono I metodi:\njavax.sql.ResultSet executeQuery(String sql);\nint executeUpdate(String sql);\nIl primo viene utilizzato per tutte quelle query che ritornano valori multipli (select)\nil secondo per tutte quelle query che non ritornano valori (update o delete). In particolar modo lesecuzione del primo metodo produce come parametro di ritorno un oggetto di tipo java.sql.ResultSet che rappresenta il risultato della query riga dopo riga. Questo oggetto legato allo statement che lo ha generato; se loggetto statement viene rilasciato mediante il metodo close() anche il ResultSet generato non sar pi utilizzabile e viceversa fino a che un oggetto ResultSet non viene rilasciato mediante il suo metodo close() non sar possibile utilizzare Statement per inviare al database nuove query.\nLoggetto ResultSet Loggetto ResultSet rappresenta il risultato di una query come sequenza di record aventi colonne rappresentati dai nomi definiti allinterno della query. Ad esempio la query SELECT NOME, COGNOME FROM DIPENDENTI produrr un ResultSet contenente due colonne identificate rispettivamente dalla stringa NOME e dalla stringa COGNOME (Figura 18-6). Questi identificativi possono essere utilizzati con i metodi delloggetto per recuperare i valori trasportati come risultato della select.\nNel caso in cui la query compaia nella forma SELECT * FROM DIPENDENTIle colonne del ResultSet saranno identificato de un numero intero a partire da 1 da sinistra verso destra (Figura 18-7).\n http://www.java-net.tv 212\nFigura 18-6 : SELECT NOME, COGNOME .\nEsempio2JDBC.java import java.sql.* ;\npublic class Esempio2JDBC\n{\npublic static void main(String args[])\n{\ntry\n{\nClass.forname(sun.jdbc.odbc.JdbcOdbcDriver);\n}\ncatch(ClassNotFoundException e)\n{\nSystem.out.println(e.toString());\nSystem.out.println(Il driver non pu essere caricato);\nSystem.exit(1);\n}\ntry\n{\nConnection conn =\nDriverManager.getConnection(jdbc:odbc:impiegati,,);\nStatement stmt = conn.createStatement();\nResultSet rs =\nstmt.executeQuery(SELECT NOME, COGNOME FROM IMPIEGATI);\nwhile(rs.next())\n{\nSystem.out.println(rs.getString(NOME));\nSystem.out.println(rs.getString(COGNOME));\n http://www.java-net.tv 213\n}\nrs.close();\nstmt.close();\nconn.close();\n}\ncatch(SQLException _sql)\n{\nSystem.out.println(se.getMessage());\nSe.printStackTrace(System.out);\nSystem.exit(1);\n}\n}\n}\nFigura 18-76 : SELECT * FROM .\nEsempio3JDBC.java import java.sql.* ;\npublic class Esempio3JDBC\n{\npublic static void main(String args[])\n{\ntry\n{\nClass.forname(sun.jdbc.odbc.JdbcOdbcDriver);\n}\ncatch(ClassNotFoundException e)\n{\nSystem.out.println(e.toString());\n http://www.java-net.tv 214\nSystem.out.println(Il driver non pu essere caricato);\nSystem.exit(1);\n}\ntry\n{\nConnection conn =\nDriverManager.getConnection(jdbc:odbc:impiegati,,);\nStatement stmt = conn.createStatement();\nResultSet rs =\nstmt.executeQuery(SELECT * FROM IMPIEGATI);\nwhile(rs.next())\n{\nSystem.out.println(rs.getString(1));\nSystem.out.println(rs.getString(2));\nSystem.out.println(rs.getInt(3));\n}\nrs.close();\nstmt.close();\nconn.close();\n}\ncatch(SQLException _sql)\n{\nSystem.out.println(se.getMessage());\nSe.printStackTrace(System.out);\nSystem.exit(1);\n}\n}\n}\n http://www.java-net.tv 215\nAppendice A Java Time-line 1995-1996 23 Maggio 1995 Lancio della tecnologia Java 23 Gennaio 1996 Giorno del rilascio del Java Development Kit 1.0 30 Aprile 1996 I 10 maggiori vendors di software annunciano la loro intenzione di includere la tecnologia Java allinterno dei loro prodotti 29 Maggio 1996 Prima versione di JavaOne, convegno dedicato ai programmatori Java. Annunciata la tecnologia JavaBeans basata su componenti, le librerie multimediali, Java Servlet ed altre tecnologie.\n10 Giugno 1996 50.000 programmatori in attesa del Sun Java Day in Tokio.\n16 Agosto 1996 Sun\nMicrosystem e\nAddison-Wesley pubblicano i Java Tutorial e la prima versione del Java Language Specification Settembre 1996 83.000 pagine web utilizzano tecnologia Java.\nSettembre 1996 Lancio del sito Java Developer Connection.\n16 Ottobre 1996 Completate le specifiche JavaBeans.\n25 Ottobre 1996 La Sun Microsystem annuncia il primo compilatore JIT (Just In Time) per la piattaforma Java.\n29 Ottobre 1996 Annuncio delle API JavaCard.\n9 Dicembre 1996 Rilasciata la versione beta del JDK 1.1 11 Dicembre 1996 Lancio della prima iniziativa 100% Java a cui aderiscono 100 compagnie.\n11 Dicembre 1996 SUN IBM e Netscape iniziano il Java Education World Tour in oltre 40 citt.\n1997 11 Gennaio 1997 SUN rilascia il JavaBeans development kit 18 Febbraio 1997 SUN rilascia il JDK 1.1 28 Febbraio 1997 Netscape annuncia che Communicator supporter tutte le Api e le applicazioni Java.\n http://www.java-net.tv 216\n4 Marzo 1997 Rilasciata la versione beta di Java Web Server e il Java Servlet Development Kit.\n10 Marzo 1997 Introduzione della API Java JNDI : Java Naming and Directory Interface.\n11 Marzo 1997 Raggiunti pi di 220.000 download del JDK 1.1 in tre settimane.\n2 Aprile 1997 JavaOne diventa la pi grande conferenza per sviluppatori del mondo con pi di 10.000 persone in attesa dellevento.\n2 Aprile 1997 SUN annuncia JavaBeans.\nla tecnologia\nEnterprise 2 Aprile 1997 SUN annuncia che la tecnologia Java Foundation Classes sar inclusa nelle revisioni successive della piattaforma Java.\n6 Maggio 1997 Glasgow, software per JavaBeans viene rilasciato in visione al pubblico.\n5 Giugno 1997 Java Web Server 1.0 viene rilasciato nella sua versione definitiva.\n23 Luglio 1997 Annunciate le Java Accessibility API.\n23 Luglio 1997 Rilasciata la piattaforma Java Card 2.0 5 Agosto 1997 Rilasciate\nle Communication.\n5 Agosto 1997 Raggiunti oltre 100.000 download JavaBeans Development Kit.\nAPI Java\nMedia e\ndel 12 Agosto 1997 Pi di 600 applicazioni commerciali basate sulla tecnologia Java.\n23 Settembre 1997 Java Developers Connection 100.000 utenti.\nsupera i\n1998 20 Gennaio 1998 2 milioni di download del JDK 1.1 Marzo 1998 Rilascio del progetto Swing.\n24 Marzo 1998 JavaOne\nattesa da\noltre programmatori in tutto il mondo.\n15.000 24 Marzo 1998 Annunciato il prodotto Java Junpstart 31 Marzo 1998 Ericcson, Sony, Siemens, BEA, Open TV ed altri vendors licenziano la tecnologia Java.\n31 Marzo 1998 http://www.java-net.tv 217\nSUN annuncia il porting della tecnologia Java su piattaforma WinCE.\n20 Aprile 1998 Rilascio dei prodotti Java Plug-In.\n3 Giugno 1998 Visa rilascia la prima smart card basata su Visa Open Platform e Java Card Technology.\n16 Settembre 1998 Motorola annuncia tecnologia Java.\nlintroduzione della\n21 Ottobre 1998 Oltre 500.000 download JFC/Swing.\ndel software\n5 Novembre 1998 Sun inizia a lavorare con Linux Community al porting della tecnologia Java sotto piattaforma Linux.\n5 Novembre 1998 Completate le specifiche di EmbeddedJava.\n8 Dicembre 1998 Rilascio della piattaforma Java 2.\n8 Dicembre 1998 Formalizzazione del programma JCP : Java Community Process.\n1999 13 Gennaio 1999 La tecnologia Java viene supportata perla produzione di televisioni digitali.\n25 Gennaio 1999 Annunciata la tecnologia Jini.\n1 Febbraio 1999 Rilascio della piattaforma PersonalJava 3.0.\n24 Febbraio 1999 Rilascio dei codici sorgenti della piattaforma Java 2.\nFebbraio 1999 Rilascio delle specifiche Java Card 2.1 4 Marzo 1999 Annunciato il supporto XML per Java.\n27 Marzo 1999 Rilascio del motore Java HotSpot.\n2 Giugno 1999 Rilascio della tecnologia JavaServer Pages.\n15 Giugno 1999 SUN annuncia tre edizioni della piattaforma Java: J2SE, J2EE, J2ME.\n29 Giugno 1999 Rilascio della Reference Implementation di J2EE in versione Alfa.\n30 Settembre 1999 Rilascio del software J2EE in beta version.\n22 Novembre 1999 Rilascio della piattaforma J2EE.\n22 Novembre 1999 Rilascio della piattaforma J2SE per Linux.\n http://www.java-net.tv tar-one-mail.net 218\n2000 8 Febbraio 2000 Proposta alla comunit la futura versione di J2EE e J2SE.\n29 Febbraio 2000 Rilascio delle API per XML.\nMaggio 2000 Superato il 1.500.000 di utenti su Java Developer Connection.\n8 Maggio 2000 Rilascio della piattaforma J2SE 1.3 26 Maggio 2000 Oltre 400 Java User Group in tutto il mondo.\n http://www.java-net.tv 219\nAppendice B Glossario dei termini AGE - \"Et\" parlando di protocollo HTTP 1.1 indica la data di invio di una Richiesta da parte del client verso il server.\nANSI - \"American National Standard Institute\" stabilisce e diffonde le specifiche su sistemi e standard di vario tipo. L'istituto ANSI attualmente formato da pi di 1000\naziende pubbliche\ne private.\nApplet - Componenti Java caricate da un browser come parte di una pagina HTML.\nARPANET - le prime quattro lettere significano: \"Advanced Research Projet Agency\", agenzia del Ministero della difesa U.S.A. nata nel 1969 e progenitrice dell'attuale Internet.\nADSL - Asimmetrical Digital Subscriber Line, nuova tecnologia di trasmissione dati per il collegamento ad internet. E' possibile raggiungere velocit di circa 6Mb al secondo per ricevere e 640Kb al secondo per inviare dati.\nB2B - Con la sigla B2B si identificano tutte quelle iniziative tese ad integrare le attivit commerciali di un'azienda con quella dei propri clienti o dei propri fornitori, dove per il cliente non sia anche il consumatore finale del bene o del servizio venduti ma sia un partner attraverso il quale si raggiungono, appunto, i consumatori\nfinali.\nB2C - B2C l'acronimo di Business to Consumer e, contrariamente a quanto detto per il B2B, questo identifica tutte quelle iniziative tese a raggiungere il consumatore\nfinale dei\nbeni o\ndei servizi\nvenduti.\nB2E - B2E l'acronimo di Business to Employee e riguarda un settore particolare delle attivit commerciali di un'azienda, quelle rivolte alla vendita di beni\nai dipendenti.\nBackbone - definizione attribuita ad uno o pi nodi vitali nella distribuzione e nello smistamento del traffico telematico in Internet.\nCache - \"Contenitore\" gestito localmente da una applicazione con lo scopo di mantenere copie di entit o documenti da utilizzare su richiesta. Generalmente il termine largamente usato in ambito internet per indicare la capacit di un browser di mantenere copia di documenti scaricati in precedenza senza doverli scaricare nuovamente riducendo cos i tempi di connessione con il server.\nCGI - (Common Gateway Interface), si tratta di programmi sviluppati in linguaggio C++ o simile, per consentire alle pagine web di diventare interattive.\nViene usato soprattutto in funzioni come l'interazione con database e nei motori di\nricerca.\nChat - \"chiacchiera\" in inglese; permette il dialogo tra due o pi persone in tempo reale, raggruppate o non in appositi canali, comunicando attraverso diversi protocolli tra cui il pi diffuso IRC (Internet Relay Chat).\nClient - Applicazione che stabilisce una connessione con un server allo scopo di trasmettere\ndati.\nConnessione - Canale logico stabilito tra due applicazioni allo scopo di comunicare\ntra loro.\nCORBA - Acronimo di Common Object Request Broker identifica la architettura proposta da Object Management Group per la comunicazione tra oggetti distribuiti.\nDatagram - Pacchetto di dati trasmesso via rete mediante protocolli di tipo\n\"Connectionless\".\nDNS - Acronimo di \"Domain Name System\" un programma eseguito all'interno di un computer Host e si occupa della traduzione di indirizzi IP in nomi o viceversa.\n http://www.java-net.tv 220\nDominio - Sistema attualmente in vigore per la suddivisione e gerarchizzazione delle reti in Internet.\neCommerce - quel \"complesso di attivit che permettono ad un'impresa di condurre affari on line\", di qualunque genere di affari si tratti. Se, invece di porre l'accento sull'attivit svolta, si vuole porre l'accento sul destinatario dei beni o dei servizi offerti, allora la definizione pu diventare pi specifica, come nelle voci B2C\ne B2E\n.\nB2B,\nEJB - Enterprise Java Beans rappresentano nella architettura J2EE lo standard per\nlo sviluppo\ndi Oggetti\ndi Business\ndistribuiti.\nEmail - o posta elettronica il sistema per l'invio di messagistica tra utenti collegati\nalla rete.\nEntit - Informazione trasferita da un client ad un server mediante protocollo HTTP come prodotto di una richiesta o come informazione trasferita da client a server.\nUna entit formata da meta-informazioni nella forma di entity-header e contenuti nella forma di entity-body come descritto nel capitolo 2.\nExtranet - rete basata su tecnologia internet, estende una Intranet al di fuori della azienda proprietaria.\nFAQ - \"Frequently Asked Questions\" ovvero \" domande pi frequenti\".\nFTP - \"File Transfer Potocol\" protocollo di comunicazione precedente all' HTTP,\npermette il trasferimento di file tra due computer.\nGateway - periferica per collegare computer diversi in una rete. Possiede un proprio microprocessore e una propria memoria di elaborazione per gestire conversioni di protocolli di comunicazione diversi.\nHDML - Handless Device Markup Language Il linguaggio per sistemi Wireless,\nattraverso il quale creare pagine Web navigabili dai telefoni cellulari dotati di tecnologia\nWAP.\nHost - uno qualsiasi dei computer raggiungibili in rete. Nella architettura TCP/IP\nsinonimo di\nEnd-System.\nHosting - Servizio che ospita pi siti Web su una singola macchina, assegnando a ognuno di essi un IP differente. In altri termini con il servizio di hosting il sito condivide hard disk e banda disponibile con altri Website ospitati.\nHTML - \"Hyper Text Markup Language\" (Linguaggio di Marcatura per il Testo)\nil linguaggio per scrivere pagine web. Standardizzato dal W3C deriva da SGML ed composto da elementi di contrassegno, tag e attributi.\nHTTP - \"Hyper Text Trasfer Protocol\" protocollo di comunicazione ampiamente diffuso nel Web. HTTP utilizza TCP/IP per il trasferimento di file su Internet.\nHub - o concentratore periferica per collegare e smistare i cavi ai computer di una rete locale, utilizzati una volta solo dalle grandi e medie aziende, oggi pare che stiano facendo la loro comparsa anche nelle piccole aziende e persino nel mondo\ndomestico.\nHyperlink - collegamento tra parti di una stessa pagina o di documenti presenti sul Web.\nIDSL -il termine indica la possibilit di fornire la tecnologia DSL a linee ISDN gi esistenti. Anche se la quantit di dati trasferiti (Transfer rate) pi o meno la stessa dell'ISDN (144 Kbps contro i 128 Kbps) e l'ISDL pu trasmettere solamente dati (e non anche la voce), i maggiori benefici consistono: nel poter usufruire di connessioni sempre attive, eliminando quindi i ritardi dovuti alla configurazione della chiamata, nel pagamento con tariffe che vengono definite Flat rate (cio forfetarie, un tanto al mese, quindi non in base agli scatti effettivi)\ne nella trasmissione di dati su una linea dedicata solo ad essi, piuttosto che sulla normale\nlinea telefonica.\nIMAP - \"Internet Message Access Protocol\", protocollo anch'esso utilizzato per la ricezione delle email. L'ultima versione (IMAP4) simile al POP3, ma supporta alcune funzioni in pi. Per esempio: con IMAP4 possibile effettuare Massimiliano Tarquini http://www.java-net.tv 221\nuna ricerca per Keyword tra i diversi messaggi, quando ancora questi si trovano sul Server di email; in base all'esito della ricerca quindi possibile scegliere quali messaggi scaricare e quali no. Come POP, anche IMAP utilizza SMTP per la comunicazioni tra il client di email ed il server.\nIntranet - rete di computer (LAN) per comunicare all'interno di una medesima azienda; si basa sullo stesso protocollo di Internet (TCP/IP): utilizza i medesimi sistemi di comunicazione, di rappresentazione (pagine web) e di gestione delle informazioni. Una serie di software di protezione evita che le informazioni siano accessibili\nal di\nfuori di\ntale rete.\nIP - un indirizzo formato da quattro gruppi di numeri che vanno da 0,0,0,0 a 255,255,255,255; esso indica in maniera univoca un determinato computer connesso ad Internet o in alcuni casi gruppi di computer all'interno di una rete.\nISDN - \"Integrated Services Digital Network\", rete di linee telefoniche digitali per la trasmissione di dati ad alta velocit, che si aggira sui 64KBps; attualmente\npossibile utilizzare due linee in contemporanea e raggiungere i 128KBps.\nJ2EE Java\n2 Enterprise\nEdition.\nJAF - servizio necessario all'instanziamento di una componente JavaBeans.\nJDBC - Java DataBase Connectivity.\nJMS - (Java Message Service): API Java di Sun che fornisce una piattaforma comune per lo scambio di messaggi fra computer collegati nello stesso network,\nutilizzando uno dei tanti sistemi diversi di messagistica, come MQSeries,\nSonicMQ od altri. E' inoltre possibile utilizzare Java e XML.\nJNDI - Java Naming & Directory Interface.\nLAN - Acronimo di Local Area Network, una rete che connette due o pi computer\nall'interno di\npiccola un'area.\nLINK - alla base degli ipertesti, si tratta di un collegamento sotto forma di immagine o testo a un'altra pagina o file MAIL SERVER - Computer che fornisce i servizi di Posta Elettronica.\nMAN - Acronimo di Metropolitan Area Network.\nMessaggio - Unit base della comunicazione con protocollo HTTP costituita da una sequenza di ottetti legati tra loro secondo lo standard come definito nel capitolo 2.\nNBS - Acronimo di National Bureau of Standards ribattezzato recentemente in NIST.\nNETIQUETTE Galateo\ndella rete.\nnetwork number - Porzione dell'indirizzo IP indicante la rete. Per le reti di classe A, l'indirizzo di rete il primo byte dell'indirizzo IP; per le reti di classe B,\nsono i primi due byte dell'indirizzo IP; per quelle di classe C, sono i primi 3 byte dell'indirizzo IP. In tutti e tre i casi, il resto l'indirizzo dell'host. In Internet, gli indirizzi\ndi rete\nassegnati sono\nunici a\nlivello globale.\nNFS Network File System - Protocollo sviluppato da Sun Microsystems e definito in RFC 1094, che consente a un sistema di elaborazione di accedere ai file dispersi in una rete come se fossero sull'unit a disco locale.\nNIC - Network Information Center : organismo che fornisce informazioni,\nassistenza e servizi agli utenti di una rete.\nPacchetto - E' il termine generico utilizzato per indicare le unit di dati a tutti i livelli di un protocollo, ma l'impiego corretto nella indicazione delle unit di dati delle\napplicazioni.\nPorta - Meccanismo di identificazione di un processo su un computer nei confronti del TCP/IP o punto di ingresso/uscita su internet.\nPPP Point-to-Point Protocol - Il Point-to-Point Protocol, definito in RFC 1548,\nfornisce il metodo per la trasmissione di pacchetti nei collegamenti di tipo seriale da-punto-a-punto.\nProtocollo - Descrizione formale del formato dei messaggi e delle regole che due elaboratori devono adottare per lo scambio di messaggi. I protocolli possono http://www.java-net.tv 222\ndescrivere i particolari low-level delle interfaccia macchina-macchina (cio l'ordine secondo il quale i bit e i bytes vengono trasmessi su una linea) oppure gli scambi high level tra i programmi di allocazione (cio il modo in cui due programmi trasmettono un file su Internet).\nRA - Registration Authority italiana. Autorit con competenze per l'assegnazione di\ndomini con\nsuffisso\n.it.\nRFC - Request for Comments. richiesta di osservazioni. Serie di documenti iniziata nel 1969 che descrive la famiglia di protocolli Internet e relativi esperimenti. Non tutte le RFC (anzi, molto poche, in realt) descrivono gli standard Internet, ma tutti gli standard Internet vengono diffusi sotto forma di RFC.\nRIP Routing\nInformation Protocol.\nRouter - Dispositivo che serve all'inoltro del traffico tra le reti. La decisione di inoltro basata su informazioni relative allo stato della rete e sulle tabelle di instradamento\n(routing tables).\nRPC - Remote Procedure Call: Paradigma facile e diffuso per la realizzazione del modello di elaborazione distribuita client-server. In generale, a un sistema remoto viene inviata una richiesta di svolgere una certa procedura, utilizzando argomenti forniti, restituendo poi il risultato al chiamante. Varianti e sottigliezze distinguono le varie realizzazioni, il che ha dato origine a una variet di protocolli RPC tra loro incompatibili.\nSERVER - Computer o software che fornisce servizi o informazioni ad utenti o computer\nche si\ncollegano.\nSMTP - Acronimo di \"Simple Mail Transfer Protocol\" il Protocollo standard di Internet per l'invio e la ricezione della posta elettronica tra computer.\nTCP/IP - standard sviluppato per le comunicazioni tra calcolatori. E' diventato il protocollo pi usato per la trasmissione dei dati in Internet.\n http://www.java-net.tv 223\nBibliografia\n??, , , - \"Java Enterprise in a nutshell\", OReilly, 1999;\n?? - \" Java 2 Enterprise Edition has turned the language into a total app-development environment \", INFORMATION WEEK On Line, 22 Maggio 2000 Sun Microsystem -\"J2EE Blueprints\", Sun Microsystem, 1999;\n??, , , , , , , , , , , , , and Professional Java Server Programming, Wrox Press, 1999;\n?? - \"Reti di Computer\", McGraw-Hill, 1999;\n?? - \"LAN Architetture e implementazioni delle reti locali\",\n, 1999;\n http://www.java-net.tv 224"}}},{"rowIdx":458,"cells":{"project":{"kind":"string","value":"pygtrie"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"Python"},"content":{"kind":"string","value":"pygtrie documentation\n\n### Navigation\n\n* [pygtrie documentation](index.html#document-index) »\n\npygtrie[¶](#module-pygtrie)\n===\n\nPure Python implementation of a trie data structure compatible with Python 2.x and Python 3.x.\n\n[Trie data structure](http://en.wikipedia.org/wiki/Trie), also known as radix or prefix tree, is a tree associating keys to values where all the descendants of a node have a common prefix (associated with that node).\n\nThe trie module contains [`pygtrie.Trie`](#pygtrie.Trie), [`pygtrie.CharTrie`](#pygtrie.CharTrie) and\n[`pygtrie.StringTrie`](#pygtrie.StringTrie) classes each implementing a mutable mapping interface, i.e. [`dict`](https://docs.python.org/3/library/stdtypes.html#dict) interface. As such, in most circumstances,\n[`pygtrie.Trie`](#pygtrie.Trie) could be used as a drop-in replacement for a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict), but the prefix nature of the data structure is trie’s real strength.\n\nThe module also contains [`pygtrie.PrefixSet`](#pygtrie.PrefixSet) class which uses a trie to store a set of prefixes such that a key is contained in the set if it or its prefix is stored in the set.\n\nFeatures[¶](#features)\n---\n\n* A full mutable mapping implementation.\n* Supports iterating over as well as deleting of a branch of a trie\n(i.e. subtrie)\n* Supports prefix checking as well as shortest and longest prefix look-up.\n* Extensible for any kind of user-defined keys.\n* A PrefixSet supports “all keys starting with given prefix” logic.\n* Can store any value including None.\n\nFor a few simple examples see `example.py` file.\n\nInstallation[¶](#installation)\n---\n\nTo install pygtrie, simply run:\n```\npip install pygtrie\n```\nor by adding line such as:\n```\npygtrie == 2.*\n```\nto project’s [requirements file](https://pip.pypa.io/en/latest/user_guide/#requirements-files).\n\nTrie classes[¶](#trie-classes)\n---\n\n*class* `Trie`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#Trie)[¶](#pygtrie.Trie)\nA trie implementation with dict interface plus some extensions.\n\nKeys used with the [`pygtrie.Trie`](#pygtrie.Trie) class must be iterable which each component being a hashable objects. In other words, for a given key,\n`dict.fromkeys(key)` must be valid expression.\n\nIn particular, strings work well as trie keys, however when getting them back (for example via [`Trie.iterkeys`](#pygtrie.Trie.iterkeys) method), instead of strings,\ntuples of characters are produced. For that reason,\n[`pygtrie.CharTrie`](#pygtrie.CharTrie) or [`pygtrie.StringTrie`](#pygtrie.StringTrie) classes may be preferred when using string keys.\n\n`__delitem__`(*key_or_slice*)[[source]](_modules/pygtrie.html#Trie.__delitem__)[¶](#pygtrie.Trie.__delitem__)\nDeletes value associated with given key or raises KeyError.\n\nIf argument is a key, value associated with it is deleted. If the key is also a prefix, its descendents are not affected. On the other hand,\nif the argument is a slice (in which case it must have only start set),\nthe whole subtrie is removed. For example:\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo'] = 'Foo'\n>>> t['foo/bar'] = 'Bar'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> del t['foo/bar']\n>>> t.keys()\n['foo', 'foo/bar/baz']\n>>> del t['foo':]\n>>> t.keys()\n[]\n```\n| Parameters: | **key_or_slice** – A key to look for or a slice. If key is a slice, the whole subtrie will be removed. |\n| Raises: | * [`ShortKeyError`](#pygtrie.ShortKeyError) – If the key has no value associated with it but is a prefix of some key with a value. This is not thrown if key_or_slice is a slice – in such cases, the whole subtrie is removed. Note that [`ShortKeyError`](#pygtrie.ShortKeyError) is subclass of\n[`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError).\n* [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If key has no value associated with it nor is a prefix of an existing key.\n* [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError) – If key is a slice whose stop or step are not `None`.\n |\n\n`__eq__`(*other*)[[source]](_modules/pygtrie.html#Trie.__eq__)[¶](#pygtrie.Trie.__eq__)\nCompares this trie’s mapping with another mapping.\n\nNote that this method doesn’t take trie’s structure into consideration.\nWhat matters is whether keys and values in both mappings are the same.\nThis may lead to unexpected results, for example:\n```\n>>> import pygtrie\n>>> t0 = StringTrie({'foo/bar': 42}, separator='/')\n>>> t1 = StringTrie({'foo.bar': 42}, separator='.')\n>>> t0 == t1 False\n```\n```\n>>> t0 = StringTrie({'foo/bar.baz': 42}, separator='/')\n>>> t1 = StringTrie({'foo/bar.baz': 42}, separator='.')\n>>> t0 == t1 True\n```\n```\n>>> t0 = Trie({'foo': 42})\n>>> t1 = CharTrie({'foo': 42})\n>>> t0 == t1 False\n```\nThis behaviour is required to maintain consistency with Mapping interface and its __eq__ method. For example, this implementation maintains transitivity of the comparison:\n```\n>>> t0 = StringTrie({'foo/bar.baz': 42}, separator='/')\n>>> d = {'foo/bar.baz': 42}\n>>> t1 = StringTrie({'foo/bar.baz': 42}, separator='.')\n>>> t0 == d True\n>>> d == t1 True\n>>> t0 == t1 True\n```\n```\n>>> t0 = Trie({'foo': 42})\n>>> d = {'foo': 42}\n>>> t1 = CharTrie({'foo': 42})\n>>> t0 == d False\n>>> d == t1 True\n>>> t0 == t1 False\n```\n| Parameters: | **other** – Other object to compare to. |\n| Returns: | `NotImplemented` if this method does not know how to perform the comparison or a `bool` denoting whether the two objects are equal or not. |\n\n`__getitem__`(*key_or_slice*)[[source]](_modules/pygtrie.html#Trie.__getitem__)[¶](#pygtrie.Trie.__getitem__)\nReturns value associated with given key or raises KeyError.\n\nWhen argument is a single key, value for that key is returned (or\n[`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) exception is thrown if the node does not exist or has no value associated with it).\n\nWhen argument is a slice, it must be one with only start set in which case the access is identical to [`Trie.itervalues`](#pygtrie.Trie.itervalues) invocation with prefix argument.\n\nExample\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo/bar'] = 'Bar'\n>>> t['foo/baz'] = 'Baz'\n>>> t['qux'] = 'Qux'\n>>> t['foo/bar']\n'Bar'\n>>> sorted(t['foo':])\n['Bar', 'Baz']\n>>> t['foo'] # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last):\n ...\nShortKeyError: 'foo'\n```\n| Parameters: | **key_or_slice** – A key or a slice to look for. |\n| Returns: | If a single key is passed, a value associated with given key. If a slice is passed, a generator of values in specified subtrie. |\n| Raises: | * [`ShortKeyError`](#pygtrie.ShortKeyError) – If the key has no value associated with it but is a prefix of some key with a value. Note that\n[`ShortKeyError`](#pygtrie.ShortKeyError) is subclass of [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError).\n* [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If key has no value associated with it nor is a prefix of an existing key.\n* [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError) – If `key_or_slice` is a slice but it’s stop or step are not `None`.\n |\n\n`__init__`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#Trie.__init__)[¶](#pygtrie.Trie.__init__)\nInitialises the trie.\n\nArguments are interpreted the same way [`Trie.update`](#pygtrie.Trie.update) interprets them.\n\n`__len__`()[[source]](_modules/pygtrie.html#Trie.__len__)[¶](#pygtrie.Trie.__len__)\nReturns number of values in a trie.\n\nNote that this method is expensive as it iterates over the whole trie.\n\n`__setitem__`(*key_or_slice*, *value*)[[source]](_modules/pygtrie.html#Trie.__setitem__)[¶](#pygtrie.Trie.__setitem__)\nSets value associated with given key.\n\nIf key_or_slice is a key, simply associate it with given value. If it is a slice (which must have start set only), it in addition clears any subtrie that might have been attached to particular key. For example:\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo/bar'] = 'Bar'\n>>> t['foo/baz'] = 'Baz'\n>>> sorted(t.keys())\n['foo/bar', 'foo/baz']\n>>> t['foo':] = 'Foo'\n>>> t.keys()\n['foo']\n```\n| Parameters: | * **key_or_slice** – A key to look for or a slice. If it is a slice, the whole subtrie (if present) will be replaced by a single node with given value set.\n* **value** – Value to set.\n |\n| Raises: | [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError) – If key is a slice whose stop or step are not None. |\n\n`clear`()[[source]](_modules/pygtrie.html#Trie.clear)[¶](#pygtrie.Trie.clear)\nRemoves all the values from the trie.\n\n`copy`(*_Trie__make_copy=>*)[[source]](_modules/pygtrie.html#Trie.copy)[¶](#pygtrie.Trie.copy)\nReturns a shallow copy of the object.\n\n`enable_sorting`(*enable=True*)[[source]](_modules/pygtrie.html#Trie.enable_sorting)[¶](#pygtrie.Trie.enable_sorting)\nEnables sorting of child nodes when iterating and traversing.\n\nNormally, child nodes are not sorted when iterating or traversing over the trie (just like dict elements are not sorted). This method allows sorting to be enabled (which was the behaviour prior to pygtrie 2.0 release).\n\nFor Trie class, enabling sorting of children is identical to simply sorting the list of items since Trie returns keys as tuples. However,\nfor other implementations such as StringTrie the two may behave subtly different. For example, sorting items might produce:\n```\nroot/foo-bar root/foo/baz\n```\neven though foo comes before foo-bar.\n\n| Parameters: | **enable** – Whether to enable sorting of child nodes. |\n\n*classmethod* `fromkeys`(*keys*, *value=None*)[[source]](_modules/pygtrie.html#Trie.fromkeys)[¶](#pygtrie.Trie.fromkeys)\nCreates a new trie with given keys set.\n\nThis is roughly equivalent to calling the constructor with a `(key,\nvalue) for key in keys` generator.\n\n| Parameters: | * **keys** – An iterable of keys that should be set in the new trie.\n* **value** – Value to associate with given keys.\n |\n| Returns: | A new trie where each key from `keys` has been set to the given value. |\n\n`has_key`(*key*)[[source]](_modules/pygtrie.html#Trie.has_key)[¶](#pygtrie.Trie.has_key)\nIndicates whether given key has value associated with it.\n\nSee [`Trie.has_node`](#pygtrie.Trie.has_node) for more detailed documentation.\n\n`has_node`(*key*)[[source]](_modules/pygtrie.html#Trie.has_node)[¶](#pygtrie.Trie.has_node)\nReturns whether given node is in the trie.\n\nReturn value is a bitwise or of `HAS_VALUE` and `HAS_SUBTRIE`\nconstants indicating node has a value associated with it and that it is a prefix of another existing key respectively. Both of those are independent of each other and all of the four combinations are possible.\nFor example:\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo/bar'] = 'Bar'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> t.has_node('qux') == 0 True\n>>> t.has_node('foo/bar/baz') == pygtrie.Trie.HAS_VALUE True\n>>> t.has_node('foo') == pygtrie.Trie.HAS_SUBTRIE True\n>>> t.has_node('foo/bar') == (pygtrie.Trie.HAS_VALUE |\n... pygtrie.Trie.HAS_SUBTRIE)\nTrue\n```\nThere are two higher level methods built on top of this one which give easier interface for the information. [`Trie.has_key`](#pygtrie.Trie.has_key) returns whether node has a value associated with it and [`Trie.has_subtrie`](#pygtrie.Trie.has_subtrie)\nchecks whether node is a prefix. Continuing previous example:\n```\n>>> t.has_key('qux'), t.has_subtrie('qux')\n(False, False)\n>>> t.has_key('foo/bar/baz'), t.has_subtrie('foo/bar/baz')\n(True, False)\n>>> t.has_key('foo'), t.has_subtrie('foo')\n(False, True)\n>>> t.has_key('foo/bar'), t.has_subtrie('foo/bar')\n(True, True)\n```\n| Parameters: | **key** – A key to look for. |\n| Returns: | Non-zero if node exists and if it does a bit-field denoting whether it has a value associated with it and whether it has a subtrie. |\n\n`has_subtrie`(*key*)[[source]](_modules/pygtrie.html#Trie.has_subtrie)[¶](#pygtrie.Trie.has_subtrie)\nReturns whether given key is a prefix of another key in the trie.\n\nSee [`Trie.has_node`](#pygtrie.Trie.has_node) for more detailed documentation.\n\n`items`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.items)[¶](#pygtrie.Trie.items)\nReturns a list of `(key, value)` pairs in given subtrie.\n\nThis is equivalent to constructing a list from generator returned by\n[`Trie.iteritems`](#pygtrie.Trie.iteritems) which see for more detailed documentation.\n\n`iteritems`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.iteritems)[¶](#pygtrie.Trie.iteritems)\nYields all nodes with associated values with given prefix.\n\nOnly nodes with values are output. For example:\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo'] = 'Foo'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> t['qux'] = 'Qux'\n>>> sorted(t.items())\n[('foo', 'Foo'), ('foo/bar/baz', 'Baz'), ('qux', 'Qux')]\n```\nItems are generated in topological order (i.e. parents before child nodes) but the order of siblings is unspecified. At an expense of efficiency, [`Trie.enable_sorting`](#pygtrie.Trie.enable_sorting) method can turn deterministic ordering of siblings.\n\nWith `prefix` argument, only items with specified prefix are generated\n(i.e. only given subtrie is traversed) as demonstrated by:\n```\n>>> t.items(prefix='foo')\n[('foo', 'Foo'), ('foo/bar/baz', 'Baz')]\n```\nWith `shallow` argument, if a node has value associated with it, it’s children are not traversed even if they exist which can be seen in:\n```\n>>> sorted(t.items(shallow=True))\n[('foo', 'Foo'), ('qux', 'Qux')]\n```\n| Parameters: | * **prefix** – Prefix to limit iteration to.\n* **shallow** – Perform a shallow traversal, i.e. do not yield items if their prefix has been yielded.\n |\n| Yields: | `(key, value)` tuples. |\n| Raises: | [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If `prefix` does not match any node. |\n\n`iterkeys`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.iterkeys)[¶](#pygtrie.Trie.iterkeys)\nYields all keys having associated values with given prefix.\n\nThis is equivalent to taking first element of tuples generated by\n[`Trie.iteritems`](#pygtrie.Trie.iteritems) which see for more detailed documentation.\n\n| Parameters: | * **prefix** – Prefix to limit iteration to.\n* **shallow** – Perform a shallow traversal, i.e. do not yield keys if their prefix has been yielded.\n |\n| Yields: | All the keys (with given prefix) with associated values in the trie. |\n| Raises: | [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If `prefix` does not match any node. |\n\n`itervalues`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.itervalues)[¶](#pygtrie.Trie.itervalues)\nYields all values associated with keys with given prefix.\n\nThis is equivalent to taking second element of tuples generated by\n[`Trie.iteritems`](#pygtrie.Trie.iteritems) which see for more detailed documentation.\n\n| Parameters: | * **prefix** – Prefix to limit iteration to.\n* **shallow** – Perform a shallow traversal, i.e. do not yield values if their prefix has been yielded.\n |\n| Yields: | All the values associated with keys (with given prefix) in the trie. |\n| Raises: | [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If `prefix` does not match any node. |\n\n`keys`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.keys)[¶](#pygtrie.Trie.keys)\nReturns a list of all the keys, with given prefix, in the trie.\n\nThis is equivalent to constructing a list from generator returned by\n[`Trie.iterkeys`](#pygtrie.Trie.iterkeys) which see for more detailed documentation.\n\n`longest_prefix`(*key*)[[source]](_modules/pygtrie.html#Trie.longest_prefix)[¶](#pygtrie.Trie.longest_prefix)\nFinds the longest prefix of a key with a value.\n\nThis is roughly equivalent to taking the last object yielded by\n[`Trie.prefixes`](#pygtrie.Trie.prefixes) with additional handling for situations when no prefixes are found.\n\nExample\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo'] = 'Foo'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> t.longest_prefix('foo/bar/baz/qux')\n('foo/bar/baz': 'Baz')\n>>> t.longest_prefix('foo/bar/baz/qux').key\n'foo/bar/baz'\n>>> t.longest_prefix('foo/bar/baz/qux').value\n'Baz'\n>>> t.longest_prefix('does/not/exist')\n(None Step)\n>>> bool(t.longest_prefix('does/not/exist'))\nFalse\n```\n| Parameters: | **key** – Key to look for. |\n| Returns: | `pygtrie.Trie._Step` object (which can be used to extract or set node’s value as well as get node’s key), or a `pygtrie.Trie._NoneStep` object (which is falsy value simulating a _Step with `None` key and value) if no prefix is found.The object can be treated as `(key, value)` pair denoting key with associated value of the prefix. This is deprecated, prefer using\n`key` and `value` properties of the object. |\n\n`merge`(*other*, *overwrite=False*)[[source]](_modules/pygtrie.html#Trie.merge)[¶](#pygtrie.Trie.merge)\nMoves nodes from other trie into this one.\n\nThe merging happens at trie structure level and as such is different than iterating over items of one trie and setting them in the other trie.\n\nThe merging may happen between different types of tries resulting in different (key, value) pairs in the destination trie compared to the source. For example, merging two [`pygtrie.StringTrie`](#pygtrie.StringTrie) objects each using different separators will work as if the other trie had separator of this trie. Similarly, a [`pygtrie.CharTrie`](#pygtrie.CharTrie) may be merged into a [`pygtrie.StringTrie`](#pygtrie.StringTrie) but when keys are read those will be joined by the separator. For example:\n```\n>>> import pygtrie\n>>> st = pygtrie.StringTrie(separator='.')\n>>> st.merge(pygtrie.StringTrie({'foo/bar': 42}))\n>>> list(st.items())\n[('foo.bar', 42)]\n>>> st.merge(pygtrie.CharTrie({'baz': 24}))\n>>> sorted(st.items())\n[('b.a.z', 24), ('foo.bar', 42)]\n```\nNot all tries can be merged into other tries. For example,\na [`pygtrie.StringTrie`](#pygtrie.StringTrie) may not be merged into a [`pygtrie.CharTrie`](#pygtrie.CharTrie) because the latter imposes a requirement for each component in the key to be exactly one character while in the former components may be arbitrary length.\n\nNote that the other trie is cleared and any references or iterators over it are invalidated. To preserve other’s value it needs to be copied first.\n\n| Parameters: | * **other** – Other trie to move nodes from.\n* **overwrite** – Whether to overwrite existing values in this trie.\n |\n\n`pop`(*key*, *default=*)[[source]](_modules/pygtrie.html#Trie.pop)[¶](#pygtrie.Trie.pop)\nDeletes value associated with given key and returns it.\n\n| Parameters: | * **key** – A key to look for.\n* **default** – If specified, value that will be returned if given key has no value associated with it. If not specified, method will throw KeyError in such cases.\n |\n| Returns: | Removed value, if key had value associated with it, or `default`\n(if given). |\n| Raises: | * [`ShortKeyError`](#pygtrie.ShortKeyError) – If `default` has not been specified and the key has no value associated with it but is a prefix of some key with a value. Note that [`ShortKeyError`](#pygtrie.ShortKeyError) is subclass of\n[`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError).\n* [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If default has not been specified and key has no value associated with it nor is a prefix of an existing key.\n |\n\n`popitem`()[[source]](_modules/pygtrie.html#Trie.popitem)[¶](#pygtrie.Trie.popitem)\nDeletes an arbitrary value from the trie and returns it.\n\nThere is no guarantee as to which item is deleted and returned. Neither in respect to its lexicographical nor topological order.\n\n| Returns: | `(key, value)` tuple indicating deleted key. |\n| Raises: | [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If the trie is empty. |\n\n`prefixes`(*key*)[[source]](_modules/pygtrie.html#Trie.prefixes)[¶](#pygtrie.Trie.prefixes)\nWalks towards the node specified by key and yields all found items.\n\nExample\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo'] = 'Foo'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> list(t.prefixes('foo/bar/baz/qux'))\n[('foo': 'Foo'), ('foo/bar/baz': 'Baz')]\n>>> list(t.prefixes('does/not/exist'))\n[]\n```\n| Parameters: | **key** – Key to look for. |\n| Yields: | `pygtrie.Trie._Step` objects which can be used to extract or set node’s value as well as get node’s key.\nThe objects can be treated as `(k, value)` pairs denoting keys with associated values encountered on the way towards the specified key. This is deprecated, prefer using `key` and `value`\nproperties of the object. |\n\n`setdefault`(*key*, *default=None*)[[source]](_modules/pygtrie.html#Trie.setdefault)[¶](#pygtrie.Trie.setdefault)\nSets value of a given node if not set already. Also returns it.\n\nIn contrast to [`Trie.__setitem__`](#pygtrie.Trie.__setitem__), this method does not accept slice as a key.\n\n`shortest_prefix`(*key*)[[source]](_modules/pygtrie.html#Trie.shortest_prefix)[¶](#pygtrie.Trie.shortest_prefix)\nFinds the shortest prefix of a key with a value.\n\nThis is roughly equivalent to taking the first object yielded by\n[`Trie.prefixes`](#pygtrie.Trie.prefixes) with additional handling for situations when no prefixes are found.\n\nExample\n```\n>>> import pygtrie\n>>> t = pygtrie.StringTrie()\n>>> t['foo'] = 'Foo'\n>>> t['foo/bar/baz'] = 'Baz'\n>>> t.shortest_prefix('foo/bar/baz/qux')\n('foo': 'Foo')\n>>> t.shortest_prefix('foo/bar/baz/qux').key\n'foo'\n>>> t.shortest_prefix('foo/bar/baz/qux').value\n'Foo'\n>>> t.shortest_prefix('does/not/exist')\n(None Step)\n>>> bool(t.shortest_prefix('does/not/exist'))\nFalse\n```\n| Parameters: | **key** – Key to look for. |\n| Returns: | `pygtrie.Trie._Step` object (which can be used to extract or set node’s value as well as get node’s key), or a `pygtrie.Trie._NoneStep` object (which is falsy value simulating a _Step with `None` key and value) if no prefix is found.The object can be treated as `(key, value)` pair denoting key with associated value of the prefix. This is deprecated, prefer using\n`key` and `value` properties of the object. |\n\n`strictly_equals`(*other*)[[source]](_modules/pygtrie.html#Trie.strictly_equals)[¶](#pygtrie.Trie.strictly_equals)\nChecks whether tries are equal with the same structure.\n\nThis is stricter comparison than the one performed by equality operator.\nIt not only requires for keys and values to be equal but also for the two tries to be of the same type and have the same structure.\n\nFor example, for two [`pygtrie.StringTrie`](#pygtrie.StringTrie) objects to be equal,\nthey need to have the same structure as well as the same separator as seen below:\n```\n>>> import pygtrie\n>>> t0 = StringTrie({'foo/bar': 42}, separator='/')\n>>> t1 = StringTrie({'foo.bar': 42}, separator='.')\n>>> t0.strictly_equals(t1)\nFalse\n```\n```\n>>> t0 = StringTrie({'foo/bar.baz': 42}, separator='/')\n>>> t1 = StringTrie({'foo/bar.baz': 42}, separator='.')\n>>> t0 == t1 True\n>>> t0.strictly_equals(t1)\nFalse\n```\n| Parameters: | **other** – Other trie to compare to. |\n| Returns: | Whether the two tries are the same type and have the same structure. |\n\n`traverse`(*node_factory*, *prefix=*)[[source]](_modules/pygtrie.html#Trie.traverse)[¶](#pygtrie.Trie.traverse)\nTraverses the tree using node_factory object.\n\nnode_factory is a callable which accepts (path_conv, path, children,\nvalue=…) arguments, where path_conv is a lambda converting path representation to key, path is the path to this node, children is an iterable of children nodes constructed by node_factory, optional value is the value associated with the path.\n\nnode_factory’s children argument is an iterator which has a few consequences:\n\n* To traverse into node’s children, the object must be iterated over.\nThis can by accomplished by a simple `children = list(children)`\nstatement.\n* Ignoring the argument allows node_factory to stop the traversal from going into the children of the node. In other words, whole subtries can be removed from traversal if node_factory chooses so.\n* If children is stored as is (i.e. as a iterator) when it is iterated over later on it may see an inconsistent state of the trie if it has changed between invocation of this method and the iteration.\n\nHowever, to allow constant-time determination whether the node has children or not, the iterator implements bool conversion such that\n`has_children = bool(children)` will tell whether node has children without iterating over them. (Note that `bool(children)` will continue returning `True` even if the iterator has been iterated over).\n\n[`Trie.traverse`](#pygtrie.Trie.traverse) has two advantages over [`Trie.iteritems`](#pygtrie.Trie.iteritems) and similar methods:\n\n1. it allows subtries to be skipped completely when going through the list of nodes based on the property of the parent node; and 2. it represents structure of the trie directly making it easy to convert structure into a different representation.\n\nFor example, the below snippet prints all files in current directory counting how many HTML files were found but ignores hidden files and directories (i.e. those whose names start with a dot):\n```\nimport os import pygtrie\n\nt = pygtrie.StringTrie(separator=os.sep)\n\n# Construct a trie with all files in current directory and all\n# of its sub-directories. Files get set a True value.\n# Directories are represented implicitly by being prefixes of\n# files.\nfor root, _, files in os.walk('.'):\n for name in files: t[os.path.join(root, name)] = True\n\ndef traverse_callback(path_conv, path, children, is_file=False):\n if path and path[-1] != '.' and path[-1][0] == '.':\n # Ignore hidden directory (but accept root node and '.')\n return 0\n elif is_file:\n print path_conv(path)\n return int(path[-1].endswith('.html'))\n else:\n # Otherwise, it's a directory. Traverse into children.\n return sum(children)\n\nprint t.traverse(traverse_callback)\n```\nAs documented, ignoring the children argument causes subtrie to be omitted and not walked into.\n\nIn the next example, the trie is converted to a tree representation where child nodes include a pointer to their parent. As before, hidden files and directories are ignored:\n```\nimport os import pygtrie\n\nt = pygtrie.StringTrie(separator=os.sep)\nfor root, _, files in os.walk('.'):\n for name in files: t[os.path.join(root, name)] = True\n\nclass File(object):\n def __init__(self, name):\n self.name = name\n self.parent = None\n\nclass Directory(File):\n def __init__(self, name, children):\n super(Directory, self).__init__(name)\n self._children = children\n for child in children:\n child.parent = self\n\ndef traverse_callback(path_conv, path, children, is_file=False):\n if not path or path[-1] == '.' or path[-1][0] != '.':\n if is_file:\n return File(path[-1])\n children = filter(None, children)\n return Directory(path[-1] if path else '', children)\n\nroot = t.traverse(traverse_callback)\n```\nNote: Unlike iterators, when used on a deep trie, traverse method is prone to rising a RuntimeError exception when Python’s maximum recursion depth is reached. This can be addressed by not iterating over children inside of the node_factory. For example, the below code converts a trie into an undirected graph using adjacency list representation:\n```\ndef undirected_graph_from_trie(t):\n '''Converts trie into a graph and returns its nodes.'''\n\n Node = collections.namedtuple('Node', 'path neighbours')\n\n class Builder(object):\n def __init__(self, path_conv, path, children, _=None):\n self.node = Node(path_conv(path), [])\n self.children = children\n self.parent = None\n\n def build(self, queue):\n for builder in self.children:\n builder.parent = self.node\n queue.append(builder)\n if self.parent:\n self.parent.neighbours.append(self.node)\n self.node.neighbours.append(self.parent)\n return self.node\n\n nodes = [t.traverse(Builder)]\n i = 0\n while i < len(nodes):\n nodes[i] = nodes[i].build(nodes)\n i += 1\n return nodes\n```\n| Parameters: | * **node_factory** – Makes opaque objects from the keys and values of the trie.\n* **prefix** – Prefix for node to start traversal, by default starts at root.\n |\n| Returns: | Node object constructed by node_factory corresponding to the root node. |\n\n`update`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#Trie.update)[¶](#pygtrie.Trie.update)\nUpdates stored values. Works like [`dict.update`](https://docs.python.org/3/library/stdtypes.html#dict.update).\n\n`values`(*prefix=*, *shallow=False*)[[source]](_modules/pygtrie.html#Trie.values)[¶](#pygtrie.Trie.values)\nReturns a list of values in given subtrie.\n\nThis is equivalent to constructing a list from generator returned by\n[`Trie.itervalues`](#pygtrie.Trie.itervalues) which see for more detailed documentation.\n\n`walk_towards`(*key*)[[source]](_modules/pygtrie.html#Trie.walk_towards)[¶](#pygtrie.Trie.walk_towards)\nYields nodes on the path to given node.\n\n| Parameters: | **key** – Key of the node to look for. |\n| Yields: | `pygtrie.Trie._Step` objects which can be used to extract or set node’s value as well as get node’s key.\nWhen representing nodes with assigned values, the objects can be treated as `(k, value)` pairs denoting keys with associated values encountered on the way towards the specified key. This is deprecated, prefer using `key` and `value` properties or `get`\nmethod of the object. |\n| Raises: | [`KeyError`](https://docs.python.org/3/library/exceptions.html#KeyError) – If node with given key does not exist. It’s all right if they value is not assigned to the node provided it has a child node. Because the method is a generator, the exception is raised only once a missing node is encountered. |\n\n*class* `CharTrie`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#CharTrie)[¶](#pygtrie.CharTrie)\nA variant of a [`pygtrie.Trie`](#pygtrie.Trie) which accepts strings as keys.\n\nThe only difference between [`pygtrie.CharTrie`](#pygtrie.CharTrie) and\n[`pygtrie.Trie`](#pygtrie.Trie) is that when [`pygtrie.CharTrie`](#pygtrie.CharTrie) returns keys back to the client (for instance when [`Trie.keys`](#pygtrie.Trie.keys) method is called),\nthose keys are returned as strings.\n\nCommon example where this class can be used is a dictionary of words in a natural language. For example:\n```\n>>> import pygtrie\n>>> t = pygtrie.CharTrie()\n>>> t['wombat'] = True\n>>> t['woman'] = True\n>>> t['man'] = True\n>>> t['manhole'] = True\n>>> t.has_subtrie('wo')\nTrue\n>>> t.has_key('man')\nTrue\n>>> t.has_subtrie('man')\nTrue\n>>> t.has_subtrie('manhole')\nFalse\n```\n*class* `StringTrie`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#StringTrie)[¶](#pygtrie.StringTrie)\n[`pygtrie.Trie`](#pygtrie.Trie) variant accepting strings with a separator as keys.\n\nThe trie accepts strings as keys which are split into components using a separator specified during initialisation (forward slash, i.e. `/`, by default).\n\nCommon example where this class can be used is when keys are paths. For example, it could map from a path to a request handler:\n```\nimport pygtrie\n\ndef handle_root(): pass def handle_admin(): pass def handle_admin_images(): pass\n\nhandlers = pygtrie.StringTrie()\nhandlers[''] = handle_root handlers['/admin'] = handle_admin handlers['/admin/images'] = handle_admin_images\n\nrequest_path = '/admin/images/foo'\n\nhandler = handlers.longest_prefix(request_path)\n```\n`__init__`(**args*, ***kwargs*)[[source]](_modules/pygtrie.html#StringTrie.__init__)[¶](#pygtrie.StringTrie.__init__)\nInitialises the trie.\n\nExcept for a `separator` named argument, all other arguments are interpreted the same way [`Trie.update`](#pygtrie.Trie.update) interprets them.\n\n| Parameters: | * ***args** – Passed to super class initialiser.\n* ****kwargs** – Passed to super class initialiser.\n* **separator** – A separator to use when splitting keys into paths used by the trie. “/” is used if this argument is not specified. This named argument is not specified on the function’s prototype because of Python’s limitations.\n |\n| Raises: | * [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError) – If `separator` is not a string.\n* [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) – If `separator` is empty.\n |\n\n*classmethod* `fromkeys`(*keys*, *value=None*, *separator='/'*)[[source]](_modules/pygtrie.html#StringTrie.fromkeys)[¶](#pygtrie.StringTrie.fromkeys)\nCreates a new trie with given keys set.\n\nThis is roughly equivalent to calling the constructor with a `(key,\nvalue) for key in keys` generator.\n\n| Parameters: | * **keys** – An iterable of keys that should be set in the new trie.\n* **value** – Value to associate with given keys.\n |\n| Returns: | A new trie where each key from `keys` has been set to the given value. |\n\nPrefixSet class[¶](#prefixset-class)\n---\n\n*class* `PrefixSet`(*iterable=()*, *factory=*, ***kwargs*)[[source]](_modules/pygtrie.html#PrefixSet)[¶](#pygtrie.PrefixSet)\nA set of prefixes.\n\n[`pygtrie.PrefixSet`](#pygtrie.PrefixSet) works similar to a normal set except it is said to contain a key if the key or it’s prefix is stored in the set. For instance, if “foo” is added to the set, the set contains “foo” as well as\n“foobar”.\n\nThe set supports addition of elements but does *not* support removal of elements. This is because there’s no obvious consistent and intuitive behaviour for element deletion.\n\n`__contains__`(*key*)[[source]](_modules/pygtrie.html#PrefixSet.__contains__)[¶](#pygtrie.PrefixSet.__contains__)\nChecks whether set contains key or its prefix.\n\n`__init__`(*iterable=()*, *factory=*, ***kwargs*)[[source]](_modules/pygtrie.html#PrefixSet.__init__)[¶](#pygtrie.PrefixSet.__init__)\nInitialises the prefix set.\n\n| Parameters: | * **iterable** – A sequence of keys to add to the set.\n* **factory** – A function used to create a trie used by the\n[`pygtrie.PrefixSet`](#pygtrie.PrefixSet).\n* **kwargs** – Additional keyword arguments passed to the factory function.\n |\n\n`__iter__`()[[source]](_modules/pygtrie.html#PrefixSet.__iter__)[¶](#pygtrie.PrefixSet.__iter__)\nReturn iterator over all prefixes in the set.\n\nSee [`PrefixSet.iter`](#pygtrie.PrefixSet.iter) method for more info.\n\n`__len__`()[[source]](_modules/pygtrie.html#PrefixSet.__len__)[¶](#pygtrie.PrefixSet.__len__)\nReturns number of keys stored in the set.\n\nSince a key does not have to be explicitly added to the set to be an element of the set, this method does not count over all possible keys that the set contains (since that would be infinity), but only over the shortest set of prefixes of all the keys the set contains.\n\nFor example, if “foo” has been added to the set, the set contains also\n“foobar”, but this method will *not* count “foobar”.\n\n`add`(*value*)[[source]](_modules/pygtrie.html#PrefixSet.add)[¶](#pygtrie.PrefixSet.add)\nAdds given value to the set.\n\nIf the set already contains prefix of the value being added, this operation has no effect. If the value being added is a prefix of some existing values in the set, those values are deleted and replaced by a single entry for the value being added.\n\nFor example, if the set contains value “foo” adding a value “foobar”\ndoes not change anything. On the other hand, if the set contains values\n“foobar” and “foobaz”, adding a value “foo” will replace those two values with a single value “foo”.\n\nThis makes a difference when iterating over the values or counting number of values. Counter intuitively, adding of a value can *decrease*\nsize of the set.\n\n| Parameters: | **value** – Value to add. |\n\n`clear`()[[source]](_modules/pygtrie.html#PrefixSet.clear)[¶](#pygtrie.PrefixSet.clear)\nRemoves all keys from the set.\n\n`copy`()[[source]](_modules/pygtrie.html#PrefixSet.copy)[¶](#pygtrie.PrefixSet.copy)\nReturns a shallow copy of the object.\n\n`discard`(*value*)[[source]](_modules/pygtrie.html#PrefixSet.discard)[¶](#pygtrie.PrefixSet.discard)\nRaises NotImplementedError.\n\n`iter`(*prefix=*)[[source]](_modules/pygtrie.html#PrefixSet.iter)[¶](#pygtrie.PrefixSet.iter)\nIterates over all keys in the set optionally starting with a prefix.\n\nSince a key does not have to be explicitly added to the set to be an element of the set, this method does not iterate over all possible keys that the set contains, but only over the shortest set of prefixes of all the keys the set contains.\n\nFor example, if “foo” has been added to the set, the set contains also\n“foobar”, but this method will *not* iterate over “foobar”.\n\nIf `prefix` argument is given, method will iterate over keys with given prefix only. The keys yielded from the function if prefix is given does not have to be a subset (in mathematical sense) of the keys yielded when there is not prefix. This happens, if the set contains a prefix of the given prefix.\n\nFor example, if only “foo” has been added to the set, iter method called with no arguments will yield “foo” only. However, when called with\n“foobar” argument, it will yield “foobar” only.\n\n`pop`()[[source]](_modules/pygtrie.html#PrefixSet.pop)[¶](#pygtrie.PrefixSet.pop)\nRaises NotImplementedError.\n\n`remove`(*value*)[[source]](_modules/pygtrie.html#PrefixSet.remove)[¶](#pygtrie.PrefixSet.remove)\nRaises NotImplementedError.\n\nCustom exceptions[¶](#custom-exceptions)\n---\n\n*class* `ShortKeyError`[[source]](_modules/pygtrie.html#ShortKeyError)[¶](#pygtrie.ShortKeyError)\nRaised when given key is a prefix of an existing longer key but does not have a value associated with itself.\n\nVersion History[¶](#version-history)\n---\n\n2.5: 2022/07/16\n\n* Add [`pygtrie.Trie.merge`](#pygtrie.Trie.merge) method which merges structures of two tries.\n* Add [`pygtrie.Trie.strictly_equals`](#pygtrie.Trie.strictly_equals) method which compares two tries with stricter rules than regular equality operator. It’s not sufficient that keys and values are the same but the structure of the tries must be the same as well. For example:\n```\n>>> t0 = StringTrie({'foo/bar.baz': 42}, separator='/')\n>>> t1 = StringTrie({'foo/bar.baz': 42}, separator='.')\n>>> t0 == t1 True\n>>> t0.strictly_equals(t1)\nFalse\n```\n* Fix [`pygtrie.Trie.__eq__`](#pygtrie.Trie.__eq__) implementation such that key values are taken into consideration rather than just looking at trie structure. To see what this means it’s best to look at a few examples. Firstly:\n```\n>>> t0 = StringTrie({'foo/bar': 42}, separator='/')\n>>> t1 = StringTrie({'foo.bar': 42}, separator='.')\n>>> t0 == t1 False\n```\nThis used to be true since the two tries have the same node structure. However, as far as Mapping interface is concerned, they use different keys, i.e. ``set(t0) != set(t1)`. Secondly:\n```\n>>> t0 = StringTrie({'foo/bar.baz': 42}, separator='/')\n>>> t1 = StringTrie({'foo/bar.baz': 42}, separator='.')\n>>> t0 == t1 True\n```\nThis used to be false since the two tries have different node structures (the first one splits key into `('foo', 'bar.baz')`\nwhile the second into `('foo/bar', 'baz')`). However, their keys are the same, i.e. ``set(t0) == set(t1)`. And lastly:\n```\n>>> t0 = Trie({'foo': 42})\n>>> t1 = CharTrie({'foo': 42})\n>>> t0 == t1 False\n```\nThis used to be true since the two tries have the same node structure. However, the two classes return key as different values.\n[`pygtrie.Trie`](#pygtrie.Trie) returns keys as tuples while\n[`pygtrie.CharTrie`](#pygtrie.CharTrie) returns them as strings.\n\n2.4.2: 2021/01/03\n\n* Remove use of ‘super’ in `setup.py` to fix compatibility with Python 2.7. This changes build code only; no changes to the library itself.\n\n2.4.1: 2020/11/20\n\n* Remove dependency on `packaging` module from `setup.py` to fix installation on systems without that package. This changes build code only; no changes to the library itself. [Thanks to for reporting]\n\n2.4.0: 2020/11/19 [pulled back from PyPi]\n\n* Change `children` argument of the `node_factory` passed to\n[`pygtrie.Trie.traverse`](#pygtrie.Trie.traverse) from a generator to an iterator with a custom bool conversion. This allows checking whether node has children without having to iterate over them (`bool(children)`)\n\nTo test whether this feature is available, one can check whether Trie.traverse.uses_bool_convertible_children property is true,\ne.g.: `getattr(pygtrie.Trie.traverse,\n'uses_bool_convertible_children', False)`.\n\n[Thanks to P for suggesting the feature]\n\n2.3.3: 2020/04/04\n\n* Fix to ‘[`AttributeError`](https://docs.python.org/3/library/exceptions.html#AttributeError): `_NoChildren` object has no attribute `sorted_items`’ failure when iterating over a trie with sorting enabled. [Thanks to Pallab Pain for reporting]\n* Add `value` property setter to step objects returned by\n[`pygtrie.Trie.walk_towards`](#pygtrie.Trie.walk_towards) et al. This deprecates the\n`set` method.\n* The module now exports pygtrie.__version__ making it possible to determine version of the library at run-time.\n\n2.3.2: 2019/07/18\n\n* Trivial metadata fix\n\n2.3.1: 2019/07/18 [pulled back from PyPi]\n\n* Fix to [`pygtrie.PrefixSet`](#pygtrie.PrefixSet) initialisation incorrectly storing elements even if their prefixes are also added to the set.\n\nFor example, `PrefixSet(('foo', 'foobar'))` incorrectly resulted in a two-element set even though the interface dictates that only\n`foo` is kept (recall that if `foo` is member of the set,\n`foobar` is as well). [Thanks to for reporting]\n* Fix to [`pygtrie.Trie.copy`](#pygtrie.Trie.copy) method not preserving enable-sorting flag and, in case of [`pygtrie.StringTrie`](#pygtrie.StringTrie),\n`separator` property.\n* Add support for the `copy` module so [`copy.copy`](https://docs.python.org/3/library/copy.html#copy.copy) can now be used with trie objects.\n* Leafs and nodes with just one child use more memory-optimised representation which reduces overall memory usage of a trie structure.\n* Minor performance improvement for adding new elements to a [`pygtrie.PrefixSet`](#pygtrie.PrefixSet).\n* Improvements to string representation of objects which now includes type and, for [`pygtrie.StringTrie`](#pygtrie.StringTrie) object, value of separator property.\n\n2.3: 2018/08/10\n\n* New [`pygtrie.Trie.walk_towards`](#pygtrie.Trie.walk_towards) method allows walking a path towards a node with given key accessing each step of the path.\nCompared to pygtrie.Trie.walk_prefixes method, steps for nodes without assigned values are returned.\n* Fix to [`pygtrie.PrefixSet.copy`](#pygtrie.PrefixSet.copy) not preserving type of backing trie.\n* [`pygtrie.StringTrie`](#pygtrie.StringTrie) now checks and explicitly rejects empty separators. Previously empty separator would be accepted but lead to confusing errors later on. [Thanks to Waren Long]\n* Various documentation improvements, Python 2/3 compatibility and test coverage (python-coverage reports 100%).\n\n2.2: 2017/06/03\n\n* Fixes to `setup.py` breaking on Windows which prevents installation among other things.\n\n2.1: 2017/03/23\n\n* The library is now Python 3 compatible.\n* Value returned by [`pygtrie.Trie.shortest_prefix`](#pygtrie.Trie.shortest_prefix) and\n[`pygtrie.Trie.longest_prefix`](#pygtrie.Trie.longest_prefix) evaluates to false if no prefix was found. This is in addition to it being a pair of `None`s of course.\n\n2.0: 2016/07/06\n\n* Sorting of child nodes is disabled by default for better performance. [`pygtrie.Trie.enable_sorting`](#pygtrie.Trie.enable_sorting) method can be used to bring back old behaviour.\n* Tries of arbitrary depth can be pickled without reaching Python’s recursion limits. (N.B. The pickle format is incompatible with one from 1.2 release). `_Node`’s `__getstate__` and `__setstate__`\nmethod can be used to implement other serialisation methods such as JSON.\n\n1.2: 2016/06/21 [pulled back from PyPI]\n\n* Tries can now be pickled.\n* Iterating no longer uses recursion so tries of arbitrary depth can be iterated over. The [`pygtrie.Trie.traverse`](#pygtrie.Trie.traverse) method,\nhowever, still uses recursion thus cannot be used on big structures.\n\n1.1: 2016/01/18\n\n* Fixed PyPI installation issues; all should work now.\n\n1.0: 2015/12/16\n\n* The module has been renamed from `trie` to `pygtrie`. This could break current users but see documentation for how to quickly upgrade your scripts.\n* Added [`pygtrie.Trie.traverse`](#pygtrie.Trie.traverse) method which goes through the nodes of the trie preserving structure of the tree. This is a depth-first traversal which can be used to search for elements or translate a trie into a different tree structure.\n* Minor documentation fixes.\n\n0.9.3: 2015/05/28\n\n* Minor documentation fixes.\n\n0.9.2: 2015/05/28\n\n* Added Sphinx configuration and updated docstrings to work better with Sphinx.\n\n0.9.1: 2014/02/03\n\n* New name.\n\n0.9: 2014/02/03\n\n* Initial release.\n\n### Quick search\n\n### Navigation\n\n* [pygtrie documentation](index.html#document-index) »"}}},{"rowIdx":459,"cells":{"project":{"kind":"string","value":"fExtremes"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘fExtremes’\n October 13, 2022\nTitle Rmetrics - Modelling Extreme Events in Finance\nDate 2022-08-06\nVersion 4021.83\nDescription Provides functions for analysing\n and modelling extreme events in financial time Series. The\n topics include: (i) data pre-processing, (ii) explorative\n data analysis, (iii) peak over threshold modelling, (iv) block\n maxima modelling, (v) estimation of VaR and CVaR, and (vi) the\n computation of the extreme index.\nDepends R (>= 2.15.1)\nImports fBasics, fGarch, graphics, methods, stats, timeDate,\n timeSeries\nSuggests RUnit, tcltk\nLazyData yes\nLicense GPL (>= 2)\nURL https://www.rmetrics.org\nBugReports https://r-forge.r-project.org/projects/rmetrics\nNeedsCompilation no\nAuthor [aut],\n [aut],\n [aut],\n [cre, ctb]\nMaintainer <>\nRepository CRAN\nDate/Publication 2022-08-06 14:10:02 UTC\nR topics documented:\nfExtremes-packag... 2\nDataPreprocessin... 6\nExtremeInde... 9\nExtremesDat... 11\nGevDistributio... 15\nGevMdaEstimatio... 17\nGevModellin... 21\nGevRis... 25\nGpdDistributio... 28\nGpdModellin... 30\ngpdRis... 34\nTimeSeriesDat... 38\nValueAtRis... 38\n fExtremes-package Modelling Extreme Events in Finance\nDescription\n The Rmetrics \"fExtremes\" package is a collection of functions to analyze and model extreme events\n in Finance and Insurance.\nDetails\n Package: \\tab fExtremes\\cr\n Type: \\tab Package\\cr\n License: \\tab GPL Version 2 or later\\cr\n Copyright: \\tab (c) 1999-2014 Rmetrics Assiciation\\cr\n URL: \\tab \\url{https://www.rmetrics.org}\n1 Introduction\n The fExtremes package provides functions for analyzing and modeling extreme events in financial\n time Series. The topics include: (i) data pre-processing, (ii) explorative data analysis, (iii) peak\n over threshold modeling, (iv) block maxima modeling, (v) estimation of VaR and CVaR, and (vi)\n the computation of the extreme index.\n2 Data and their Preprocessing\n Data Sets:\n Data sets used in the examples of the timeSeries packages.\n Data Preprocessing:\n These are tools for data preprocessing, including functions to separate data beyond a threshold\n value, to compute blockwise data like block maxima, and to decluster point process data.\n blockMaxima extracts block maxima from a vector or a time series\n findThreshold finds upper threshold for a given number of extremes\n pointProcess extracts peaks over Threshold from a vector or a time series\n deCluster de-clusters clustered point process data\n2 Explorative Data Analysis of Extremes\n This section contains a collection of functions for explorative data analysis of extreme values in\n financial time series. The tools include plot functions for emprical distributions, quantile plots,\n graphs exploring the properties of exceedances over a threshold, plots for mean/sum ratio and for\n the development of records. The functions are:\n emdPlot plots of empirical distribution function\n qqparetoPlot exponential/Pareto quantile plot\n mePlot plot of mean excesses over a threshold\n mrlPlot another variant, mean residual life plot\n mxfPlot another variant, with confidence intervals\n msratioPlot plot of the ratio of maximum and sum\n recordsPlot Record development compared with iid data\n ssrecordsPlot another variant, investigates subsamples\n sllnPlot verifies Kolmogorov's strong law of large numbers\n lilPlot verifies Hartman-Wintner's law of the iterated logarithm\n xacfPlot plots ACF of exceedances over a threshold\n Parameter Fitting of Mean Excesses:\n normMeanExcessFit fits mean excesses with a normal density\n ghMeanExcessFit fits mean excesses with a GH density\n hypMeanExcessFit fits mean excesses with a HYP density\n nigMeanExcessFit fits mean excesses with a NIG density\n ghtMeanExcessFit fits mean excesses with a GHT density\n3 GPD Peak over Threshold Modeling\n GPD Distribution:\n A collection of functions to compute the generalized Pareto distribution. The functions compute\n density, distribution function, quantile function and generate random deviates for the GPD. In ad-\n dition functions to compute the true moments and to display the distribution and random variates\n changing parameters interactively are available.\n dgpd returns the density of the GPD distribution\n pgpd returns the probability function of the GPD\n qgpd returns quantile function of the GPD distribution\n rgpd generates random variates from the GPD distribution\n gpdSlider displays density or rvs from a GPD\n GPD Moments:\n gpdMoments computes true mean and variance of GDP\n GPD Parameter Estimation:\n This section contains functions to fit and to simulate processes that are generated from the gen-\n eralized Pareto distribution. Two approaches for parameter estimation are provided: Maximum\n likelihood estimation and the probability weighted moment method.\n gpdSim generates data from the GPD distribution\n gpdFit fits data to the GPD istribution\n GPD print, plot and summary methods:\n print print method for a fitted GPD object\n plot plot method for a fitted GPD object\n summary summary method for a fitted GPD object\n GDP Tail Risk:\n The following functions compute tail risk under the GPD approach.\n gpdQPlot estimation of high quantiles\n gpdQuantPlot variation of high quantiles with threshold\n gpdRiskMeasures prescribed quantiles and expected shortfalls\n gpdSfallPlot expected shortfall with confidence intervals\n gpdShapePlot variation of GPD shape with threshold\n gpdTailPlot plot of the GPD tail\n4 GEV Block Maxima Modeling\n GEV Distribution:\n This section contains functions to fit and to simulate processes that are generated from the general-\n ized extreme value distribution including the Frechet, Gumbel, and Weibull distributions.\n dgev returns density of the GEV distribution\n pgev returns probability function of the GEV\n qgev returns quantile function of the GEV distribution\n rgev generates random variates from the GEV distribution\n gevSlider displays density or rvs from a GEV\n GEV Moments:\n gevMoments computes true mean and variance\n GEV Parameter Estimation:\n A collection to simulate and to estimate the parameters of processes generated from GEV distribu-\n tion.\n gevSim generates data from the GEV distribution\n gumbelSim generates data from the Gumbel distribution\n gevFit fits data to the GEV distribution\n gumbelFit fits data to the Gumbel distribution\n print print method for a fitted GEV object\n plot plot method for a fitted GEV object\n summary summary method for a fitted GEV object\n GEV MDA Estimation:\n Here we provide Maximum Domain of Attraction estimators and visualize the results by a Hill plot\n and a common shape parameter plot from the Pickands, Einmal-Decker-deHaan, and Hill estima-\n tors.\n hillPlot shape parameter and Hill estimate of the tail index\n shaparmPlot variation of shape parameter with tail depth\n GEV Risk Estimation:\n gevrlevelPlot k-block return level with confidence intervals\n4 Value at Risk\n Two functions to compute Value-at-Risk and conditional Value-at-Risk.\n VaR computes Value-at-Risk\n CVaR computes conditional Value-at-Risk\n5 Extreme Index\n A collection of functions to simulate time series with a known extremal index, and to estimate the\n extremal index by four different kind of methods, the blocks method, the reciprocal mean cluster\n size method, the runs method, and the method of Ferro and Segers.\n thetaSim simulates a time Series with known theta\n blockTheta computes theta from Block Method\n clusterTheta computes theta from Reciprocal Cluster Method\n runTheta computes theta from Run Method\n ferrosegersTheta computes theta according to Ferro and Segers\n exindexPlot calculatess and plots Theta(1,2,3)\n exindexesPlot calculates Theta(1,2) and plots Theta(1)\nAbout Rmetrics\n The fExtremes Rmetrics package is written for educational support in teaching \"Computational\n Finance and Financial Engineering\" and licensed under the GPL.\n DataPreprocessing Extremes Data Preprocessing\nDescription\n A collection and description of functions for data preprocessing of extreme values. This includes\n tools to separate data beyond a threshold value, to compute blockwise data like block maxima, and\n to decluster point process data.\n The functions are:\n blockMaxima Block Maxima from a vector or a time series,\n findThreshold Upper threshold for a given number of extremes,\n pointProcess Peaks over Threshold from a vector or a time series,\n deCluster Declusters clustered point process data.\nUsage\n blockMaxima(x, block = c(\"monthly\", \"quarterly\"), doplot = FALSE)\n findThreshold(x, n = floor(0.05*length(as.vector(x))), doplot = FALSE)\n pointProcess(x, u = quantile(x, 0.95), doplot = FALSE)\n deCluster(x, run = 20, doplot = TRUE)\nArguments\n block the block size. A numeric value is interpreted as the number of data values in\n each successive block. All the data is used, so the last block may not contain\n block observations. If the data has a times attribute containing (in an ob-\n ject of class \"POSIXct\", or an object that can be converted to that class, see\n as.POSIXct) the times/dates of each observation, then block may instead take\n the character values \"month\", \"quarter\", \"semester\" or \"year\". By default\n monthly blocks from daily data are assumed.\n doplot a logical value. Should the results be plotted? By default TRUE.\n n a numeric value or vector giving number of extremes above the threshold. By\n default, n is set to an integer representing 5% of the data from the whole data set\n x.\n run parameter to be used in the runs method; any two consecutive threshold ex-\n ceedances separated by more than this number of observations/days are consid-\n ered to belong to different clusters.\n u a numeric value at which level the data are to be truncated. By default the\n threshold value which belongs to the 95% quantile, u=quantile(x,0.95).\n x a numeric data vector from which findThreshold and blockMaxima determine\n the threshold values and block maxima values. For the function deCluster\n the argument x represents a numeric vector of threshold exceedances with a\n times attribute which should be a numeric vector containing either the indices\n or the times/dates of each exceedance (if times/dates, the attribute should be an\n object of class \"POSIXct\" or an object that can be converted to that class; see\n as.POSIXct).\nDetails\n Computing Block Maxima:\n The function blockMaxima calculates block maxima from a vector or a time series, whereas the\n function blocks is more general and allows for the calculation of an arbitrary function FUN on\n blocks.\n Finding Thresholds:\n The function findThreshold finds a threshold so that a given number of extremes lie above. When\n the data are tied a threshold is found so that at least the specified number of extremes lie above.\n De-Clustering Point Processes:\n The function deCluster declusters clustered point process data so that Poisson assumption is more\n tenable over a high threshold.\nValue\n blockMaxima\n returns a timeSeries object or a numeric vector of block maxima data.\n findThreshold\n returns a numeric value or vector of suitable thresholds.\n pointProcess\n returns a timeSeries object or a numeric vector of peaks over a threshold.\n deCluster\n returns a timeSeries object or a numeric vector for the declustered point process.\nAuthor(s)\n Some of the functions were implemented from Alec Stephenson’s R-package evir ported from\n ’s S library EVIS, Extreme Values in S, some from Alec Stephenson’s R-package\n ismev based on Stuart Coles code from his book, Introduction to Statistical Modeling of Extreme\n Values and some were written by .\nReferences\n . (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n ., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## findThreshold -\n # Threshold giving (at least) fifty exceedances for Danish data:\n library(timeSeries)\n x <- as.timeSeries(data(danishClaims))\n findThreshold(x, n = c(10, 50, 100))\n ## blockMaxima -\n # Block Maxima (Minima) for left tail of BMW log returns:\n BMW <- as.timeSeries(data(bmwRet))\n colnames(BMW) <- \"BMW.RET\"\n head(BMW)\n x <- blockMaxima( BMW, block = 65)\n head(x)\n ## Not run:\n y <- blockMaxima(-BMW, block = 65)\n head(y)\n y <- blockMaxima(-BMW, block = \"monthly\")\n head(y)\n ## End(Not run)\n ## pointProcess -\n # Return Values above threshold in negative BMW log-return data:\n PP = pointProcess(x = -BMW, u = quantile(as.vector(x), 0.75))\n PP\n nrow(PP)\n ## deCluster -\n # Decluster the 200 exceedances of a particular\n DC = deCluster(x = PP, run = 15, doplot = TRUE)\n DC\n nrow(DC)\n ExtremeIndex Extremal Index Estimation\nDescription\n A collection and description of functions to simulate time series with a known extremal index, and\n to estimate the extremal index by four different kind of methods, the blocks method, the reciprocal\n mean cluster size method, the runs method, and the method of Ferro and Segers.\n The functions are:\n thetaSim Simulates a time Series with known theta,\n blockTheta Computes theta from Block Method,\n clusterTheta Computes theta from Reciprocal Cluster Method,\n runTheta Computes theta from Run Method,\n ferrosegersTheta Computes Theta according to Ferro and Segers,\n exindexPlot Calculate and Plot Theta(1,2,3),\n exindexesPlot Calculate Theta(1,2) and Plot Theta(1).\nUsage\n ## S4 method for signature 'fTHETA'\n show(object)\n thetaSim(model = c(\"max\", \"pair\"), n = 1000, theta = 0.5)\n blockTheta(x, block = 22, quantiles = seq(0.950, 0.995, length = 10),\n title = NULL, description = NULL)\n clusterTheta(x, block = 22, quantiles = seq(0.950, 0.995, length = 10),\n title = NULL, description = NULL)\n runTheta(x, block = 22, quantiles = seq(0.950, 0.995, length = 10),\n title = NULL, description = NULL)\n ferrosegersTheta(x, quantiles = seq(0.950, 0.995, length = 10),\n title = NULL, description = NULL)\n exindexPlot(x, block = c(\"monthly\", \"quarterly\"), start = 5, end = NA,\n doplot = TRUE, plottype = c(\"thresh\", \"K\"), labels = TRUE, ...)\n exindexesPlot(x, block = 22, quantiles = seq(0.950, 0.995, length = 10),\n doplot = TRUE, labels = TRUE, ...)\nArguments\n block [*Theta] -\n an integer value, the block size. Currently only integer specified block sizes are\n supported.\n [exindex*Plot] -\n the block size. Either \"monthly\", \"quarterly\" or an integer value. An integer\n value is interpreted as the number of data values in each successive block. The\n default value is \"monthly\" which corresponds for daily data to an approximately\n 22-day periods.\n description a character string which allows for a brief description.\n doplot a logical, should the results be plotted?\n labels whether or not axes should be labelled. If set to FALSE then user specified labels\n can be passed through the \"...\" argument.\n model [thetaSim] -\n a character string denoting the name of the model. Either \"max\" or \"pair\",\n the first representing the maximimum Frechet series, and the second the paired\n exponential series.\n n [thetaSim] -\n an integer value, the length of the time series to be generated.\n object an object of class \"fTHETA\" as returned by the functions *Theta.\n plottype [exindexPlot] -\n whether plot is to be by increasing threshold (thresh) or increasing K value (K).\n quantiles [exindexesPlot] -\n a numeric vector of quantile values.\n start, end [exindexPlot] -\n start is the lowest value of K at which to plot a point, and end the highest value;\n K is the number of blocks in which a specified threshold is exceeded.\n theta [thetaSim] -\n a numeric value between 0 and 1 setting the value of the extremal index for the\n maximum Frechet time series. (Not used in the case of the paired exponential\n series.)\n title a character string which allows for a project title.\n x a ’timeSeries’ object or any other object which can be transformed by the func-\n tion as.vector into a numeric vector. \"monthly\" and \"quarterly\" blocks\n require x to be an object of class \"timeSeries\".\n ... additional arguments passed to the plot function.\nValue\n exindexPlot\n returns a data frame of results with the following columns: N, K, un, theta2, and theta. A plot\n with K on the lower x-axis and threshold Values on the upper x-axis versus the extremal index is\n displayed.\n exindexesPlot\n returns a data.frame with four columns: thresholds, theta1, theta2, and theta3. A plot with\n quantiles on the x-axis and versus the extremal indexes is displayed.\nAuthor(s)\n , for parts of the exindexPlot function, and\n for the exindexesPlot function.\nReferences\n ., ., . (1997); Modelling Extremal Events, Springer. Chap-\n ter 8, 413–429.\nSee Also\n hillPlot, gevFit.\nExamples\n ## Extremal Index for the right and left tails\n ## of the BMW log returns:\n data(bmwRet)\n par(mfrow = c(2, 2), cex = 0.7)\n library(timeSeries)\n exindexPlot( as.timeSeries(bmwRet), block = \"quarterly\")\n exindexPlot(-as.timeSeries(bmwRet), block = \"quarterly\")\n ## Extremal Index for the right and left tails\n ## of the BMW log returns:\n exindexesPlot( as.timeSeries(bmwRet), block = 65)\n exindexesPlot(-as.timeSeries(bmwRet), block = 65)\n ExtremesData Explorative Data Analysis\nDescription\n A collection and description of functions for explorative data analysis. The tools include plot func-\n tions for emprical distributions, quantile plots, graphs exploring the properties of exceedances over\n a threshold, plots for mean/sum ratio and for the development of records.\n The functions are:\n emdPlot Plot of empirical distribution function,\n qqparetoPlot Exponential/Pareto quantile plot,\n mePlot Plot of mean excesses over a threshold,\n mrlPlot another variant, mean residual life plot,\n mxfPlot another variant, with confidence intervals,\n msratioPlot Plot of the ratio of maximum and sum,\n recordsPlot Record development compared with iid data,\n ssrecordsPlot another variant, investigates subsamples,\n sllnPlot verifies Kolmogorov’s strong law of large numbers,\n lilPlot verifies Hartman-Wintner’s law of the iterated logarithm,\n xacfPlot ACF of exceedances over a threshold,\n normMeanExcessFit fits mean excesses with a normal density,\n ghMeanExcessFit fits mean excesses with a GH density,\n hypMeanExcessFit fits mean excesses with a HYP density,\n nigMeanExcessFit fits mean excesses with a NIG density,\n ghtMeanExcessFit fits mean excesses with a GHT density.\nUsage\n emdPlot(x, doplot = TRUE, plottype = c(\"xy\", \"x\", \"y\", \" \"),\n labels = TRUE, ...)\n qqparetoPlot(x, xi = 0, trim = NULL, threshold = NULL, doplot = TRUE,\n labels = TRUE, ...)\n mePlot(x, doplot = TRUE, labels = TRUE, ...)\n mrlPlot(x, ci = 0.95, umin = mean(x), umax = max(x), nint = 100, doplot = TRUE,\n plottype = c(\"autoscale\", \"\"), labels = TRUE, ...)\n mxfPlot(x, u = quantile(x, 0.05), doplot = TRUE, labels = TRUE, ...)\n msratioPlot(x, p = 1:4, doplot = TRUE, labels = TRUE, ...)\n recordsPlot(x, ci = 0.95, doplot = TRUE, labels = TRUE, ...)\n ssrecordsPlot(x, subsamples = 10, doplot = TRUE, plottype = c(\"lin\", \"log\"),\n labels = TRUE, ...)\n sllnPlot(x, doplot = TRUE, labels = TRUE, ...)\n lilPlot(x, doplot = TRUE, labels = TRUE, ...)\n xacfPlot(x, u = quantile(x, 0.95), lag.max = 15, doplot = TRUE,\n which = c(\"all\", 1, 2, 3, 4), labels = TRUE, ...)\n normMeanExcessFit(x, doplot = TRUE, trace = TRUE, ...)\n ghMeanExcessFit(x, doplot = TRUE, trace = TRUE, ...)\n hypMeanExcessFit(x, doplot = TRUE, trace = TRUE, ...)\n nigMeanExcessFit(x, doplot = TRUE, trace = TRUE, ...)\n ghtMeanExcessFit(x, doplot = TRUE, trace = TRUE, ...)\nArguments\n ci [recordsPlot] -\n a confidence level. By default 0.95, i.e. 95%.\n doplot a logical value. Should the results be plotted? By default TRUE.\n labels a logical value. Whether or not x- and y-axes should be automatically labelled\n and a default main title should be added to the plot. By default TRUE.\n lag.max [xacfPlot] -\n maximum number of lags at which to calculate the autocorrelation functions.\n The default value is 15.\n nint [mrlPlot] -\n the number of intervals, see umin and umax. The default value is 100.\n p [msratioPlot] -\n the power exponents, a numeric vector. By default a sequence from 1 to 4 in\n unit integer steps.\n plottype [emdPlot] -\n which axes should be on a log scale: \"x\" x-axis only; \"y\" y-axis only; \"xy\"\n both axes; \"\" neither axis.\n [msratioPlot] -\n a logical, if set to \"autoscale\", then the scale of the plots are automatically\n determined, any other string allows user specified scale information through the\n ... argument.\n [ssrecordsPlot] -\n one from two options can be select either \"lin\" or \"log\". The default creates a\n linear plot.\n subsamples [ssrecordsPlot] -\n the number of subsamples, by default 10, an integer value.\n threshold, trim\n [qPlot][xacfPlot] -\n a numeric value at which data are to be left-truncated, value at which data are to\n be right-truncated or the threshold value, by default 95%.\n trace a logical flag, by default TRUE. Should the calculations be traced?\n u a numeric value at which level the data are to be truncated. By default the\n threshold value which belongs to the 95% quantile, u=quantile(x,0.95).\n umin, umax [mrlPlot] -\n range of threshold values. If umin and/or umax are not available, then by default\n they are set to the following values: umin=mean(x) and umax=max(x).\n which [xacfPlot] -\n a numeric or character value, if which=\"all\" then all four plots are displayed,\n if which is an integer between one and four, then the first, second, third or fourth\n plot will be displayed.\n x, y numeric data vectors or in the case of x an object to be plotted.\n xi the shape parameter of the generalized Pareto distribution.\n ... additional arguments passed to the FUN or plot function.\nDetails\n Empirical Distribution Function:\n The function emdPlot is a simple explanatory function. A straight line on the double log scale\n indicates Pareto tail behaviour.\n Quantile–Quantile Pareto Plot:\n qqparetoPlot creates a quantile-quantile plot for threshold data. If xi is zero the reference dis-\n tribution is the exponential; if xi is non-zero the reference distribution is the generalized Pareto\n with that parameter value expressed by xi. In the case of the exponential, the plot is interpreted\n as follows: Concave departures from a straight line are a sign of heavy-tailed behaviour, convex\n departures show thin-tailed behaviour.\n Mean Excess Function Plot:\n Three variants to plot the mean excess function are available: A sample mean excess plot over\n increasing thresholds, and two mean excess function plots with confidence intervals for discrimina-\n tion in the tails of a distribution. In general, an upward trend in a mean excess function plot shows\n heavy-tailed behaviour. In particular, a straight line with positive gradient above some threshold is a\n sign of Pareto behaviour in tail. A downward trend shows thin-tailed behaviour whereas a line with\n zero gradient shows an exponential tail. Here are some hints: Because upper plotting points are the\n average of a handful of extreme excesses, these may be omitted for a prettier plot. For mrlPlot and\n mxfPlot the upper tail is investigated; for the lower tail reverse the sign of the data vector.\n Plot of the Maximum/Sum Ratio:\n The ratio of maximum and sum is a simple tool for detecting heavy tails of a distribution and\n for giving a rough estimate of the order of its finite moments. Sharp increases in the curves of a\n msratioPlot are a sign for heavy tail behaviour.\n Plot of the Development of Records:\n These are functions that investigate the development of records in a dataset and calculate the ex-\n pected behaviour for iid data. recordsPlot counts records and reports the observations at which\n they occur. In addition subsamples can be investigated with the help of the function ssrecordsPlot.\n Plot of Kolmogorov’s and Hartman-Wintner’s Laws:\n The function sllnPlot verifies Kolmogorov’s strong law of large numbers, and the function lilPlot\n verifies Hartman-Wintner’s law of the iterated logarithm.\n ACF Plot of Exceedances over a Threshold:\n This function plots the autocorrelation functions of heights and distances of exceedances over a\n threshold.\nValue\n The functions return a plot.\nNote\n The plots are labeled by default with a x-label, a y-label and a main title. If the argument labels\n is set to FALSE neither a x-label, a y-label nor a main title will be added to the graph. To add user\n defined label strings just use the function title(xlab=\"\\dots\", ylab=\"\\dots\", main=\"\\dots\").\nAuthor(s)\n Some of the functions were implemented from Alec Stephenson’s R-package evir ported from\n ’s S library EVIS, Extreme Values in S, some from Alec Stephenson’s R-package\n ismev based on code from his book, Introduction to Statistical Modeling of Extreme\n Values and some were written by .\nReferences\n . (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n Embrechts, P., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## Danish fire insurance data:\n data(danishClaims)\n library(timeSeries)\n danishClaims = as.timeSeries(danishClaims)\n ## emdPlot -\n # Show Pareto tail behaviour:\n par(mfrow = c(2, 2), cex = 0.7)\n emdPlot(danishClaims)\n ## qqparetoPlot -\n # QQ-Plot of heavy-tailed Danish fire insurance data:\n qqparetoPlot(danishClaims, xi = 0.7)\n ## mePlot -\n # Sample mean excess plot of heavy-tailed Danish fire:\n mePlot(danishClaims)\n ## ssrecordsPlot -\n # Record fire insurance losses in Denmark:\n ssrecordsPlot(danishClaims, subsamples = 10)\n GevDistribution Generalized Extreme Value Distribution\nDescription\n Density, distribution function, quantile function, random number generation, and true moments for\n the GEV including the Frechet, Gumbel, and Weibull distributions.\n The GEV distribution functions are:\n dgev density of the GEV distribution,\n pgev probability function of the GEV distribution,\n qgev quantile function of the GEV distribution,\n rgev random variates from the GEV distribution,\n gevMoments computes true mean and variance,\n gevSlider displays density or rvs from a GEV.\nUsage\n dgev(x, xi = 1, mu = 0, beta = 1, log = FALSE)\n pgev(q, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)\n qgev(p, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)\n rgev(n, xi = 1, mu = 0, beta = 1)\n gevMoments(xi = 0, mu = 0, beta = 1)\n gevSlider(method = c(\"dist\", \"rvs\"))\nArguments\n log a logical, if TRUE, the log density is returned.\n lower.tail a logical, if TRUE, the default, then probabilities are P[X <= x], otherwise, P[X >\n x].\n method a character string denoting what should be displayed. Either the density and\n \"dist\" or random variates \"rvs\".\n n the number of observations.\n p a numeric vector of probabilities. [hillPlot] -\n probability required when option quantile is chosen.\n q a numeric vector of quantiles.\n x a numeric vector of quantiles.\n xi, mu, beta xi is the shape parameter, mu the location parameter, and beta is the scale pa-\n rameter. The default values are xi=1, mu=0, and beta=1. Note, if xi=0 the\n distribution is of type Gumbel.\nValue\n d* returns the density,\n p* returns the probability,\n q* returns the quantiles, and\n r* generates random variates.\n All values are numeric vectors.\nAuthor(s)\n for R’s evd and evir package, and\n for this R-port.\nReferences\n . (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n Embrechts, P., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## rgev -\n # Create and plot 1000 Weibull distributed rdv:\n r = rgev(n = 1000, xi = -1)\n plot(r, type = \"l\", col = \"steelblue\", main = \"Weibull Series\")\n grid()\n ## dgev -\n # Plot empirical density and compare with true density:\n hist(r[abs(r)<10], nclass = 25, freq = FALSE, xlab = \"r\",\n xlim = c(-5,5), ylim = c(0,1.1), main = \"Density\")\n box()\n x = seq(-5, 5, by = 0.01)\n lines(x, dgev(x, xi = -1), col = \"steelblue\")\n ## pgev -\n # Plot df and compare with true df:\n plot(sort(r), (1:length(r)/length(r)),\n xlim = c(-3, 6), ylim = c(0, 1.1),\n cex = 0.5, ylab = \"p\", xlab = \"q\", main = \"Probability\")\n grid()\n q = seq(-5, 5, by = 0.1)\n lines(q, pgev(q, xi = -1), col = \"steelblue\")\n ## qgev -\n # Compute quantiles, a test:\n qgev(pgev(seq(-5, 5, 0.25), xi = -1), xi = -1)\n ## gevMoments:\n # Returns true mean and variance:\n gevMoments(xi = 0, mu = 0, beta = 1)\n ## Slider:\n # gevSlider(method = \"dist\")\n # gevSlider(method = \"rvs\")\n GevMdaEstimation Generalized Extreme Value Modelling\nDescription\n A collection and description functions to estimate the parameters of the GEV distribution. To model\n the GEV three types of approaches for parameter estimation are provided: Maximum likelihood\n estimation, probability weighted moment method, and estimation by the MDA approach. MDA in-\n cludes functions for the Pickands, Einmal-Decker-deHaan, and Hill estimators together with several\n plot variants.\n Maximum Domain of Attraction estimators:\n hillPlot shape parameter and Hill estimate of the tail index,\n shaparmPlot variation of shape parameter with tail depth.\nUsage\n hillPlot(x, start = 15, ci = 0.95,\n doplot = TRUE, plottype = c(\"alpha\", \"xi\"), labels = TRUE, ...)\n shaparmPlot(x, p = 0.01*(1:10), xiRange = NULL, alphaRange = NULL,\n doplot = TRUE, plottype = c(\"both\", \"upper\"))\n shaparmPickands(x, p = 0.05, xiRange = NULL,\n doplot = TRUE, plottype = c(\"both\", \"upper\"), labels = TRUE, ...)\n shaparmHill(x, p = 0.05, xiRange = NULL,\n doplot = TRUE, plottype = c(\"both\", \"upper\"), labels = TRUE, ...)\n shaparmDEHaan(x, p = 0.05, xiRange = NULL,\n doplot = TRUE, plottype = c(\"both\", \"upper\"), labels = TRUE, ...)\nArguments\n alphaRange, xiRange\n [saparmPlot] -\n plotting ranges for alpha and xi. By default the values are automatically se-\n lected.\n ci [hillPlot] -\n probability for asymptotic confidence band; for no confidence band set ci to\n zero.\n doplot a logical. Should the results be plotted?\n [shaparmPlot] -\n a vector of logicals of the same lengths as tails defining for which tail depths\n plots should be created, by default plots will be generated for a tail depth of\n 5 percent. By default c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE,\n FALSE, FALSE, FALSE).\n labels [hillPlot] -\n whether or not axes should be labelled.\n plottype [hillPlot] -\n whether alpha, xi (1/alpha) or quantile (a quantile estimate) should be plot-\n ted.\n p [qgev] -\n a numeric vector of probabilities. [hillPlot] -\n probability required when option quantile is chosen.\n start [hillPlot] -\n lowest number of order statistics at which to plot a point.\n x [dgev][devd] -\n a numeric vector of quantiles.\n [gevFit] -\n data vector. In the case of method=\"mle\" the interpretation depends on the value\n of block: if no block size is specified then data are interpreted as block maxima;\n if block size is set, then data are interpreted as raw data and block maxima are\n calculated.\n [hillPlot][shaparmPlot] -\n the data from which to calculate the shape parameter, a numeric vector.\n [print][plot] -\n a fitted object of class \"gevFit\".\n ... [gevFit] -\n control parameters optionally passed to the optimization function. Parameters\n for the optimization function are passed to components of the control argument\n of optim.\n [hillPlot] -\n other graphics parameters.\n [plot][summary] -\n arguments passed to the plot function.\nDetails\n Parameter Estimation:\n gevFit and gumbelFit estimate the parameters either by the probability weighted moment method,\n method=\"pwm\" or by maximum log likelihood estimation method=\"mle\". The summary method\n produces diagnostic plots for fitted GEV or Gumbel models.\n Methods:\n print.gev, plot.gev and summary.gev are print, plot, and summary methods for a fitted object of\n class gev. Concerning the summary method, the data are converted to unit exponentially distributed\n residuals under null hypothesis that GEV fits. Two diagnostics for iid exponential data are offered.\n The plot method provides two different residual plots for assessing the fitted GEV model. Two\n diagnostics for iid exponential data are offered.\n Return Level Plot:\n gevrlevelPlot calculates and plots the k-block return level and 95% confidence interval based\n on a GEV model for block maxima, where k is specified by the user. The k-block return level is that\n level exceeded once every k blocks, on average. The GEV likelihood is reparameterized in terms\n of the unknown return level and profile likelihood arguments are used to construct a confidence\n interval.\n Hill Plot:\n The function hillPlot investigates the shape parameter and plots the Hill estimate of the tail index\n of heavy-tailed data, or of an associated quantile estimate. This plot is usually calculated from the\n alpha perspective. For a generalized Pareto analysis of heavy-tailed data using the gpdFit function,\n it helps to plot the Hill estimates for xi.\n Shape Parameter Plot:\n The function shaparmPlot investigates the shape parameter and plots for the upper and lower tails\n the shape parameter as a function of the taildepth. Three approaches are considered, the Pickands\n estimator, the Hill estimator, and the Decker-Einmal-deHaan estimator.\nValue\n gevSim\n returns a vector of data points from the simulated series.\n gevFit\n returns an object of class gev describing the fit.\n print.summary\n prints a report of the parameter fit.\n summary\n performs diagnostic analysis. The method provides two different residual plots for assessing the\n fitted GEV model.\n gevrlevelPlot\n returns a vector containing the lower 95% bound of the confidence interval, the estimated return\n level and the upper 95% bound.\n hillPlot\n displays a plot.\n shaparmPlot\n returns a list with one or two entries, depending on the selection of the input variable both.tails.\n The two entries upper and lower determine the position of the tail. Each of the two variables is\n again a list with entries pickands, hill, and dehaan. If one of the three methods will be discarded\n the printout will display zeroes.\nNote\n GEV Parameter Estimation:\n If method \"mle\" is selected the parameter fitting in gevFit is passed to the internal function\n gev.mle or gumbel.mle depending on the value of gumbel, FALSE or TRUE. On the other hand, if\n method \"pwm\" is selected the parameter fitting in gevFit is passed to the internal function gev.pwm\n or gumbel.pwm again depending on the value of gumbel, FALSE or TRUE.\nAuthor(s)\n for R’s evd and evir package, and\n for this R-port.\nReferences\n . (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n Embrechts, P., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## Load Data:\n library(timeSeries)\n x = as.timeSeries(data(danishClaims))\n colnames(x) <- \"Danish\"\n head(x)\n ## hillPlot -\n # Hill plot of heavy-tailed Danish fire insurance data\n par(mfrow = c(1, 1))\n hillPlot(x, plottype = \"xi\")\n grid()\n GevModelling Generalized Extreme Value Modelling\nDescription\n A collection and description functions to estimate the parameters of the GEV distribution. To model\n the GEV three types of approaches for parameter estimation are provided: Maximum likelihood\n estimation, probability weighted moment method, and estimation by the MDA approach. MDA in-\n cludes functions for the Pickands, Einmal-Decker-deHaan, and Hill estimators together with several\n plot variants.\n The GEV modelling functions are:\n gevSim generates data from the GEV distribution,\n gumbelSim generates data from the Gumbel distribution,\n gevFit fits data to the GEV distribution,\n gumbelFit fits data to the Gumbel distribution,\n print print method for a fitted GEV object,\n plot plot method for a fitted GEV object,\n summary summary method for a fitted GEV object,\n gevrlevelPlot k-block return level with confidence intervals.\nUsage\n gevSim(model = list(xi = -0.25, mu = 0, beta = 1), n = 1000, seed = NULL)\n gumbelSim(model = list(mu = 0, beta = 1), n = 1000, seed = NULL)\n gevFit(x, block = 1, type = c(\"mle\", \"pwm\"), title = NULL, description = NULL, ...)\n gumbelFit(x, block = 1, type = c(\"mle\", \"pwm\"), title = NULL, description = NULL, ...)\n ## S4 method for signature 'fGEVFIT'\n show(object)\n ## S3 method for class 'fGEVFIT'\n plot(x, which = \"ask\", ...)\n ## S3 method for class 'fGEVFIT'\n summary(object, doplot = TRUE, which = \"all\", ...)\nArguments\n block block size.\n description a character string which allows for a brief description.\n doplot a logical. Should the results be plotted?\n [shaparmPlot] -\n a vector of logicals of the same lengths as tails defining for which tail depths\n plots should be created, by default plots will be generated for a tail depth of\n 5 percent. By default c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE,\n FALSE, FALSE, FALSE).\n model [gevSim][gumbelSim] -\n a list with components shape, location and scale giving the parameters of\n the GEV distribution. By default the shape parameter has the value -0.25, the\n location is zero and the scale is one. To fit random deviates from a Gumbel\n distribution set shape=0.\n n [gevSim][gumbelSim] -\n number of generated data points, an integer value.\n [rgev] -\n the number of observations.\n object [summary][grlevelPlot] -\n a fitted object of class \"gevFit\".\n seed [gevSim] -\n an integer value to set the seed for the random number generator.\n title [gevFit] -\n a character string which allows for a project title.\n type a character string denoting the type of parameter estimation, either by maximum\n likelihood estimation \"mle\", the default value, or by the probability weighted\n moment method \"pwm\".\n which [plot][summary] -\n a vector of logicals, one for each plot, denoting which plot should be displayed.\n Alternatively if which=\"ask\" the user will be interactively asked which of the\n plots should be displayed. By default which=\"all\".\n x [dgev][devd] -\n a numeric vector of quantiles.\n [gevFit] -\n data vector. In the case of method=\"mle\" the interpretation depends on the value\n of block: if no block size is specified then data are interpreted as block maxima;\n if block size is set, then data are interpreted as raw data and block maxima are\n calculated.\n [hillPlot][shaparmPlot] -\n the data from which to calculate the shape parameter, a numeric vector.\n [print][plot] -\n a fitted object of class \"gevFit\".\n xi, mu, beta [*gev] -\n xi is the shape parameter, mu the location parameter, and beta is the scale pa-\n rameter. The default values are xi=1, mu=0, and beta=1. Note, if xi=0 the\n distribution is of type Gumbel.\n ... [gevFit] -\n control parameters optionally passed to the optimization function. Parameters\n for the optimization function are passed to components of the control argument\n of optim.\n [hillPlot] -\n other graphics parameters.\n [plot][summary] -\n arguments passed to the plot function.\nDetails\n Parameter Estimation:\n gevFit and gumbelFit estimate the parameters either by the probability weighted moment method,\n method=\"pwm\" or by maximum log likelihood estimation method=\"mle\". The summary method\n produces diagnostic plots for fitted GEV or Gumbel models.\n Methods:\n print.gev, plot.gev and summary.gev are print, plot, and summary methods for a fitted object of\n class gev. Concerning the summary method, the data are converted to unit exponentially distributed\n residuals under null hypothesis that GEV fits. Two diagnostics for iid exponential data are offered.\n The plot method provides two different residual plots for assessing the fitted GEV model. Two\n diagnostics for iid exponential data are offered.\n Return Level Plot:\n gevrlevelPlot calculates and plots the k-block return level and 95% confidence interval based\n on a GEV model for block maxima, where k is specified by the user. The k-block return level is that\n level exceeded once every k blocks, on average. The GEV likelihood is reparameterized in terms\n of the unknown return level and profile likelihood arguments are used to construct a confidence\n interval.\n Hill Plot:\n The function hillPlot investigates the shape parameter and plots the Hill estimate of the tail index\n of heavy-tailed data, or of an associated quantile estimate. This plot is usually calculated from the\n alpha perspective. For a generalized Pareto analysis of heavy-tailed data using the gpdFit function,\n it helps to plot the Hill estimates for xi.\n Shape Parameter Plot:\n The function shaparmPlot investigates the shape parameter and plots for the upper and lower tails\n the shape parameter as a function of the taildepth. Three approaches are considered, the Pickands\n estimator, the Hill estimator, and the Decker-Einmal-deHaan estimator.\nValue\n gevSim\n returns a vector of data points from the simulated series.\n gevFit\n returns an object of class gev describing the fit.\n print.summary\n prints a report of the parameter fit.\n summary\n performs diagnostic analysis. The method provides two different residual plots for assessing the\n fitted GEV model.\n gevrlevelPlot\n returns a vector containing the lower 95% bound of the confidence interval, the estimated return\n level and the upper 95% bound.\n hillPlot\n displays a plot.\n shaparmPlot\n returns a list with one or two entries, depending on the selection of the input variable both.tails.\n The two entries upper and lower determine the position of the tail. Each of the two variables is\n again a list with entries pickands, hill, and dehaan. If one of the three methods will be discarded\n the printout will display zeroes.\nNote\n GEV Parameter Estimation:\n If method \"mle\" is selected the parameter fitting in gevFit is passed to the internal function\n gev.mle or gumbel.mle depending on the value of gumbel, FALSE or TRUE. On the other hand, if\n method \"pwm\" is selected the parameter fitting in gevFit is passed to the internal function gev.pwm\n or gumbel.pwm again depending on the value of gumbel, FALSE or TRUE.\nAuthor(s)\n for R’s evd and evir package, and\n for this R-port.\nReferences\n . (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n Embrechts, P., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## gevSim -\n # Simulate GEV Data, use default length n=1000\n x = gevSim(model = list(xi = 0.25, mu = 0 , beta = 1), n = 1000)\n head(x)\n ## gumbelSim -\n # Simulate GEV Data, use default length n=1000\n x = gumbelSim(model = list(xi = 0.25, mu = 0 , beta = 1))\n ## gevFit -\n # Fit GEV Data by Probability Weighted Moments:\n fit = gevFit(x, type = \"pwm\")\n print(fit)\n ## summary -\n # Summarize Results:\n par(mfcol = c(2, 2))\n summary(fit)\n GevRisk Generalized Extreme Value Modelling\nDescription\n A collection and description functions to estimate the parameters of the GEV distribution. To model\n the GEV three types of approaches for parameter estimation are provided: Maximum likelihood\n estimation, probability weighted moment method, and estimation by the MDA approach. MDA in-\n cludes functions for the Pickands, Einmal-Decker-deHaan, and Hill estimators together with several\n plot variants.\n The GEV modelling functions are:\n gevrlevelPlot k-block return level with confidence intervals.\nUsage\n gevrlevelPlot(object, kBlocks = 20, ci = c(0.90, 0.95, 0.99),\n plottype = c(\"plot\", \"add\"), labels = TRUE,...)\nArguments\n add [gevrlevelPlot] -\n whether the return level should be added graphically to a time series plot; if\n FALSE a graph of the profile likelihood curve showing the return level and its\n confidence interval is produced.\n ci [hillPlot] -\n probability for asymptotic confidence band; for no confidence band set ci to\n zero.\n kBlocks [gevrlevelPlot] -\n specifies the particular return level to be estimated; default set arbitrarily to 20.\n labels [hillPlot] -\n whether or not axes should be labelled.\n object [summary][grlevelPlot] -\n a fitted object of class \"gevFit\".\n plottype [hillPlot] -\n whether alpha, xi (1/alpha) or quantile (a quantile estimate) should be plot-\n ted.\n ... arguments passed to the plot function.\nDetails\n Parameter Estimation:\n gevFit and gumbelFit estimate the parameters either by the probability weighted moment method,\n method=\"pwm\" or by maximum log likelihood estimation method=\"mle\". The summary method\n produces diagnostic plots for fitted GEV or Gumbel models.\n Methods:\n print.gev, plot.gev and summary.gev are print, plot, and summary methods for a fitted object of\n class gev. Concerning the summary method, the data are converted to unit exponentially distributed\n residuals under null hypothesis that GEV fits. Two diagnostics for iid exponential data are offered.\n The plot method provides two different residual plots for assessing the fitted GEV model. Two\n diagnostics for iid exponential data are offered.\n Return Level Plot:\n gevrlevelPlot calculates and plots the k-block return level and 95% confidence interval based\n on a GEV model for block maxima, where k is specified by the user. The k-block return level is that\n level exceeded once every k blocks, on average. The GEV likelihood is reparameterized in terms\n of the unknown return level and profile likelihood arguments are used to construct a confidence\n interval.\n Hill Plot:\n The function hillPlot investigates the shape parameter and plots the Hill estimate of the tail index\n of heavy-tailed data, or of an associated quantile estimate. This plot is usually calculated from the\n alpha perspective. For a generalized Pareto analysis of heavy-tailed data using the gpdFit function,\n it helps to plot the Hill estimates for xi.\n Shape Parameter Plot:\n The function shaparmPlot investigates the shape parameter and plots for the upper and lower tails\n the shape parameter as a function of the taildepth. Three approaches are considered, the Pickands\n estimator, the Hill estimator, and the Decker-Einmal-deHaan estimator.\nValue\n gevSim\n returns a vector of data points from the simulated series.\n gevFit\n returns an object of class gev describing the fit.\n print.summary\n prints a report of the parameter fit.\n summary\n performs diagnostic analysis. The method provides two different residual plots for assessing the\n fitted GEV model.\n gevrlevelPlot\n returns a vector containing the lower 95% bound of the confidence interval, the estimated return\n level and the upper 95% bound.\n hillPlot\n displays a plot.\n shaparmPlot\n returns a list with one or two entries, depending on the selection of the input variable both.tails.\n The two entries upper and lower determine the position of the tail. Each of the two variables is\n again a list with entries pickands, hill, and dehaan. If one of the three methods will be discarded\n the printout will display zeroes.\nNote\n GEV Parameter Estimation:\n If method \"mle\" is selected the parameter fitting in gevFit is passed to the internal function\n gev.mle or gumbel.mle depending on the value of gumbel, FALSE or TRUE. On the other hand, if\n method \"pwm\" is selected the parameter fitting in gevFit is passed to the internal function gev.pwm\n or gumbel.pwm again depending on the value of gumbel, FALSE or TRUE.\nAuthor(s)\n for R’s evd and evir package, and\n for this R-port.\nReferences\n Coles S. (2001); Introduction to Statistical Modelling of Extreme Values, Springer.\n Embrechts, P., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## Load Data:\n # BMW Stock Data - negative returns\n library(timeSeries)\n x = -as.timeSeries(data(bmwRet))\n colnames(x)<-\"BMW\"\n head(x)\n ## gevFit -\n # Fit GEV to monthly Block Maxima:\n fit = gevFit(x, block = \"month\")\n print(fit)\n ## gevrlevelPlot -\n # Return Level Plot:\n gevrlevelPlot(fit)\n GpdDistribution Generalized Pareto Distribution\nDescription\n A collection and description of functions to compute the generalized Pareto distribution. The func-\n tions compute density, distribution function, quantile function and generate random deviates for the\n GPD. In addition functions to compute the true moments and to display the distribution and random\n variates changing parameters interactively are available.\n The GPD distribution functions are:\n dgpd Density of the GPD Distribution,\n pgpd Probability function of the GPD Distribution,\n qgpd Quantile function of the GPD Distribution,\n rgpd random variates from the GPD distribution,\n gpdMoments computes true mean and variance,\n gpdSlider displays density or rvs from a GPD.\nUsage\n dgpd(x, xi = 1, mu = 0, beta = 1, log = FALSE)\n pgpd(q, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)\n qgpd(p, xi = 1, mu = 0, beta = 1, lower.tail = TRUE)\n rgpd(n, xi = 1, mu = 0, beta = 1)\n gpdMoments(xi = 1, mu = 0, beta = 1)\n gpdSlider(method = c(\"dist\", \"rvs\"))\nArguments\n log a logical, if TRUE, the log density is returned.\n lower.tail a logical, if TRUE, the default, then probabilities are P[X <= x], otherwise, P[X >\n x].\n method [gpdSlider] -\n a character string denoting what should be displayed. Either the density and\n \"dist\" or random variates \"rvs\".\n n [rgpd][gpdSim\\ -\n the number of observations to be generated.\n p a vector of probability levels, the desired probability for the quantile estimate\n (e.g. 0.99 for the 99th percentile).\n q [pgpd] -\n a numeric vector of quantiles.\n x [dgpd] -\n a numeric vector of quantiles.\n xi, mu, beta xi is the shape parameter, mu the location parameter, and beta is the scale pa-\n rameter.\nValue\n All values are numeric vectors:\n d* returns the density,\n p* returns the probability,\n q* returns the quantiles, and\n r* generates random deviates.\nAuthor(s)\n for the functions from R’s evd package,\n for the functions from R’s evir package,\n for the EVIS functions underlying the evir package,\n for this R-port.\nReferences\n ., ., . (1997); Modelling Extremal Events, Springer.\nExamples\n ## rgpd -\n par(mfrow = c(2, 2), cex = 0.7)\n r = rgpd(n = 1000, xi = 1/4)\n plot(r, type = \"l\", col = \"steelblue\", main = \"GPD Series\")\n grid()\n ## dgpd -\n # Plot empirical density and compare with true density:\n # Omit values greater than 500 from plot\n hist(r, n = 50, probability = TRUE, xlab = \"r\",\n col = \"steelblue\", border = \"white\",\n xlim = c(-1, 5), ylim = c(0, 1.1), main = \"Density\")\n box()\n x = seq(-5, 5, by = 0.01)\n lines(x, dgpd(x, xi = 1/4), col = \"orange\")\n ## pgpd -\n # Plot df and compare with true df:\n plot(sort(r), (1:length(r)/length(r)),\n xlim = c(-3, 6), ylim = c(0, 1.1), pch = 19,\n cex = 0.5, ylab = \"p\", xlab = \"q\", main = \"Probability\")\n grid()\n q = seq(-5, 5, by = 0.1)\n lines(q, pgpd(q, xi = 1/4), col = \"steelblue\")\n ## qgpd -\n # Compute quantiles, a test:\n qgpd(pgpd(seq(-1, 5, 0.25), xi = 1/4 ), xi = 1/4)\n GpdModelling GPD Distributions for Extreme Value Theory\nDescription\n A collection and description to functions to fit and to simulate processes that are generated from the\n generalized Pareto distribution. Two approaches for parameter estimation are provided: Maximum\n likelihood estimation and the probability weighted moment method.\n The GPD modelling functions are:\n gpdSim generates data from the GPD,\n gpdFit fits empirical or simulated data to the distribution,\n print print method for a fitted GPD object of class ...,\n plot plot method for a fitted GPD object,\n summary summary method for a fitted GPD object.\nUsage\n gpdSim(model = list(xi = 0.25, mu = 0, beta = 1), n = 1000,\n seed = NULL)\n gpdFit(x, u = quantile(x, 0.95), type = c(\"mle\", \"pwm\"), information =\n c(\"observed\", \"expected\"), title = NULL, description = NULL, ...)\n ## S4 method for signature 'fGPDFIT'\n show(object)\n ## S3 method for class 'fGPDFIT'\n plot(x, which = \"ask\", ...)\n ## S3 method for class 'fGPDFIT'\n summary(object, doplot = TRUE, which = \"all\", ...)\nArguments\n description a character string which allows for a brief description.\n doplot a logical. Should the results be plotted?\n information whether standard errors should be calculated with \"observed\" or \"expected\"\n information. This only applies to the maximum likelihood method; for the\n probability-weighted moments method \"expected\" information is used if pos-\n sible.\n model [gpdSim] -\n a list with components shape, location and scale giving the parameters of\n the GPD distribution. By default the shape parameter has the value 0.25, the\n location is zero and the scale is one.\n n [rgpd][gpdSim\\ -\n the number of observations to be generated.\n object [summary] -\n a fitted object of class \"gpdFit\".\n seed [gpdSim] -\n an integer value to set the seed for the random number generator.\n title a character string which allows for a project title.\n type a character string selecting the desired estimation method, either \"mle\" for the\n maximum likelihood method or \"pwm\" for the probability weighted moment\n method. By default, the first will be selected. Note, the function gpd uses \"ml\".\n u the threshold value.\n which if which is set to \"ask\" the function will interactively ask which plot should\n be displayed. By default this value is set to FALSE and then those plots will be\n displayed for which the elements in the logical vector which ar set to TRUE; by\n default all four elements are set to \"all\".\n x [dgpd] -\n a numeric vector of quantiles.\n [gpdFit] -\n the data vector. Note, there are two different names for the first argument x\n and data depending which function name is used, either gpdFit or the EVIS\n synonym gpd.\n [print][plot] -\n a fitted object of class \"gpdFit\".\n xi, mu, beta xi is the shape parameter, mu the location parameter, and beta is the scale pa-\n rameter.\n ... control parameters and plot parameters optionally passed to the optimization\n and/or plot function. Parameters for the optimization function are passed to\n components of the control argument of optim.\nDetails\n Generalized Pareto Distribution:\n Compute density, distribution function, quantile function and generates random variates for the\n Generalized Pareto Distribution.\n Simulation:\n gpdSim simulates data from a Generalized Pareto distribution.\n Parameter Estimation:\n gpdFit fits the model parameters either by the probability weighted moment method or the maxim\n log likelihood method. The function returns an object of class \"gpd\" representing the fit of a gen-\n eralized Pareto model to excesses over a high threshold. The fitting functions use the probability\n weighted moment method, if method method=\"pwm\" was selected, and the the general purpose opti-\n mization function optim when the maximum likelihood estimation, method=\"mle\" or method=\"ml\"\n is chosen.\n Methods:\n print.gpd, plot.gpd and summary.gpd are print, plot, and summary methods for a fitted ob-\n ject of class gpdFit. The plot method provides four different plots for assessing fitted GPD model.\n gpd* Functions:\n gpdqPlot calculates quantile estimates and confidence intervals for high quantiles above the thresh-\n old in a GPD analysis, and adds a graphical representation to an existing plot. The GPD approxima-\n tion in the tail is used to estimate quantile. The \"wald\" method uses the observed Fisher information\n matrix to calculate confidence interval. The \"likelihood\" method reparametrizes the likelihood\n in terms of the unknown quantile and uses profile likelihood arguments to construct a confidence\n interval.\n gpdquantPlot creates a plot showing how the estimate of a high quantile in the tail of a dataset\n based on the GPD approximation varies with threshold or number of extremes. For every model\n gpdFit is called. Evaluation may be slow. Confidence intervals by the Wald method may be fastest.\n gpdriskmeasures makes a rapid calculation of point estimates of prescribed quantiles and expected\n shortfalls using the output of the function gpdFit. This function simply calculates point estimates\n and (at present) makes no attempt to calculate confidence intervals for the risk measures. If confi-\n dence levels are required use gpdqPlot and gpdsfallPlot which interact with graphs of the tail of\n a loss distribution and are much slower.\n gpdsfallPlot calculates expected shortfall estimates, in other words tail conditional expectation\n and confidence intervals for high quantiles above the threshold in a GPD analysis. A graphical rep-\n resentation to an existing plot is added. Expected shortfall is the expected size of the loss, given that\n a particular quantile of the loss distribution is exceeded. The GPD approximation in the tail is used\n to estimate expected shortfall. The likelihood is reparametrized in terms of the unknown expected\n shortfall and profile likelihood arguments are used to construct a confidence interval.\n gpdshapePlot creates a plot showing how the estimate of shape varies with threshold or number of\n extremes. For every model gpdFit is called. Evaluation may be slow.\n gpdtailPlot produces a plot of the tail of the underlying distribution of the data.\nValue\n gpdSim\n returns a vector of datapoints from the simulated series.\n gpdFit\n returns an object of class \"gpd\" describing the fit including parameter estimates and standard errors.\n gpdQuantPlot\n returns invisible a table of results.\n gpdShapePlot\n returns invisible a table of results.\n gpdTailPlot\n returns invisible a list object containing details of the plot is returned invisibly. This object should\n be used as the first argument of gpdqPlot or gpdsfallPlot to add quantile estimates or expected\n shortfall estimates to the plot.\nAuthor(s)\n for the functions from R’s evd package,\n for the functions from R’s evir package,\n for the EVIS functions underlying the evir package,\n for this R-port.\nReferences\n ., ., . (1997); Modelling Extremal Events, Springer.\n ., ., (1987); Parameter and quantile estimation for the generalized Pareto\n distribution, Technometrics 29, 339–349.\nExamples\n ## gpdSim -\n x = gpdSim(model = list(xi = 0.25, mu = 0, beta = 1), n = 1000)\n ## gpdFit -\n par(mfrow = c(2, 2), cex = 0.7)\n fit = gpdFit(x, u = min(x), type = \"pwm\")\n print(fit)\n summary(fit)\n gpdRisk GPD Distributions for Extreme Value Theory\nDescription\n A collection and description to functions to compute tail risk under the GPD approach.\n The GPD modelling functions are:\n gpdQPlot estimation of high quantiles,\n gpdQuantPlot variation of high quantiles with threshold,\n gpdRiskMeasures prescribed quantiles and expected shortfalls,\n gpdSfallPlot expected shortfall with confidence intervals,\n gpdShapePlot variation of shape with threshold,\n gpdTailPlot plot of the tail,\n tailPlot ,\n tailSlider ,\n tailRisk .\nUsage\n gpdQPlot(x, p = 0.99, ci = 0.95, type = c(\"likelihood\", \"wald\"),\n like.num = 50)\n gpdQuantPlot(x, p = 0.99, ci = 0.95, models = 30, start = 15, end = 500,\n doplot = TRUE, plottype = c(\"normal\", \"reverse\"), labels = TRUE,\n ...)\n gpdSfallPlot(x, p = 0.99, ci = 0.95, like.num = 50)\n gpdShapePlot(x, ci = 0.95, models = 30, start = 15, end = 500,\n doplot = TRUE, plottype = c(\"normal\", \"reverse\"), labels = TRUE,\n ...)\n gpdTailPlot(object, plottype = c(\"xy\", \"x\", \"y\", \"\"), doplot = TRUE,\n extend = 1.5, labels = TRUE, ...)\n gpdRiskMeasures(object, prob = c(0.99, 0.995, 0.999, 0.9995, 0.9999))\n tailPlot(object, p = 0.99, ci = 0.95, nLLH = 25, extend = 1.5, grid =\n TRUE, labels = TRUE, ...)\n tailSlider(x)\n tailRisk(object, prob = c(0.99, 0.995, 0.999, 0.9995, 0.9999), ...)\nArguments\n ci the probability for asymptotic confidence band; for no confidence band set to\n zero.\n doplot a logical. Should the results be plotted?\n extend optional argument for plots 1 and 2 expressing how far x-axis should extend as\n a multiple of the largest data value. This argument must take values greater than\n 1 and is useful for showing estimated quantiles beyond data.\n grid ...\n labels optional argument for plots 1 and 2 specifying whether or not axes should be\n labelled.\n like.num the number of times to evaluate profile likelihood.\n models the number of consecutive gpd models to be fitted.\n nLLH ...\n object [summary] -\n a fitted object of class \"gpdFit\".\n p a vector of probability levels, the desired probability for the quantile estimate\n (e.g. 0.99 for the 99th percentile).\n reverse should plot be by increasing threshold (TRUE) or number of extremes (FALSE).\n prob a numeric value.\n plottype a character string.\n start, end the lowest and maximum number of exceedances to be considered.\n type a character string selecting the desired estimation method, either \"mle\" for the\n maximum likelihood method or \"pwm\" for the probability weighted moment\n method. By default, the first will be selected. Note, the function gpd uses \"ml\".\n x [dgpd] -\n a numeric vector of quantiles.\n [gpdFit] -\n the data vector. Note, there are two different names for the first argument x\n and data depending which function name is used, either gpdFit or the EVIS\n synonym gpd.\n [print][plot] -\n a fitted object of class \"gpdFit\".\n ... control parameters and plot parameters optionally passed to the optimization\n and/or plot function. Parameters for the optimization function are passed to\n components of the control argument of optim.\nDetails\n Generalized Pareto Distribution:\n Compute density, distribution function, quantile function and generates random variates for the\n Generalized Pareto Distribution.\n Simulation:\n gpdSim simulates data from a Generalized Pareto distribution.\n Parameter Estimation:\n gpdFit fits the model parameters either by the probability weighted moment method or the maxim\n log likelihood method. The function returns an object of class \"gpd\" representing the fit of a gen-\n eralized Pareto model to excesses over a high threshold. The fitting functions use the probability\n weighted moment method, if method method=\"pwm\" was selected, and the the general purpose opti-\n mization function optim when the maximum likelihood estimation, method=\"mle\" or method=\"ml\"\n is chosen.\n Methods:\n print.gpd, plot.gpd and summary.gpd are print, plot, and summary methods for a fitted ob-\n ject of class gpdFit. The plot method provides four different plots for assessing fitted GPD model.\n gpd* Functions:\n gpdqPlot calculates quantile estimates and confidence intervals for high quantiles above the thresh-\n old in a GPD analysis, and adds a graphical representation to an existing plot. The GPD approxima-\n tion in the tail is used to estimate quantile. The \"wald\" method uses the observed Fisher information\n matrix to calculate confidence interval. The \"likelihood\" method reparametrizes the likelihood\n in terms of the unknown quantile and uses profile likelihood arguments to construct a confidence\n interval.\n gpdquantPlot creates a plot showing how the estimate of a high quantile in the tail of a dataset\n based on the GPD approximation varies with threshold or number of extremes. For every model\n gpdFit is called. Evaluation may be slow. Confidence intervals by the Wald method may be fastest.\n gpdriskmeasures makes a rapid calculation of point estimates of prescribed quantiles and expected\n shortfalls using the output of the function gpdFit. This function simply calculates point estimates\n and (at present) makes no attempt to calculate confidence intervals for the risk measures. If confi-\n dence levels are required use gpdqPlot and gpdsfallPlot which interact with graphs of the tail of\n a loss distribution and are much slower.\n gpdsfallPlot calculates expected shortfall estimates, in other words tail conditional expectation\n and confidence intervals for high quantiles above the threshold in a GPD analysis. A graphicalx\n representation to an existing plot is added. Expected shortfall is the expected size of the loss, given\n that a particular quantile of the loss distribution is exceeded. The GPD approximation in the tail\n is used to estimate expected shortfall. The likelihood is reparametrized in terms of the unknown\n expected shortfall and profile likelihood arguments are used to construct a confidence interval.\n gpdshapePlot creates a plot showing how the estimate of shape varies with threshold or number of\n extremes. For every model gpdFit is called. Evaluation may be slow.\n gpdtailPlot produces a plot of the tail of the underlying distribution of the data.\nValue\n gpdSim\n returns a vector of datapoints from the simulated series.\n gpdFit\n returns an object of class \"gpd\" describing the fit including parameter estimates and standard errors.\n gpdQuantPlot\n returns invisible a table of results.\n gpdShapePlot\n returns invisible a table of results.\n gpdTailPlot\n returns invisible a list object containing details of the plot is returned invisibly. This object should\n be used as the first argument of gpdqPlot or gpdsfallPlot to add quantile estimates or expected\n shortfall estimates to the plot.\nAuthor(s)\n for the functions from R’s evd package,\n for the functions from R’s evir package,\n for the EVIS functions underlying the evir package,\n for this R-port.\nReferences\n ., ., . (1997); Modelling Extremal Events, Springer.\n ., ., (1987); Parameter and quantile estimation for the generalized Pareto\n distribution, Technometrics 29, 339–349.\nExamples\n ## Load Data:\n library(timeSeries)\n danish = as.timeSeries(data(danishClaims))\n ## Tail Plot:\n x = as.timeSeries(data(danishClaims))\n fit = gpdFit(x, u = 10)\n tailPlot(fit)\n ## Try Tail Slider:\n # tailSlider(x)\n ## Tail Risk:\n tailRisk(fit)\n TimeSeriesData Time Series Data Sets\nDescription\n Data sets used in the examples of the fExtremes packages.\nUsage\n bmwRet\n danishClaims\nFormat\n bmwRet. A data frame with 6146 observations on 2 variables. The first column contains dates\n (Tuesday 2nd January 1973 until Tuesday 23rd July 1996) and the second column contains the\n respective value of daily log returns on the BMW share price made on each of those dates. These\n data are an irregular time series because there is no trading at weekends.\n danishClaims. A data frame with 2167 observations on 2 variables. The first column contains\n dates and the second column contains the respective value of a fire insurance claim in Denmark\n made on each of those dates. These data are an irregular time series.\nExamples\n head(bmwRet)\n head(danishClaims)\n ValueAtRisk Value-at-Risk\nDescription\n A collection and description of functions to compute Value-at-Risk and conditional Value-at-Risk\n The functions are:\n VaR Computes Value-at-Risk,\n CVaR Computes conditional Value-at-Risk.\nUsage\n VaR(x, alpha = 0.05, type = \"sample\", tail = c(\"lower\", \"upper\"))\n CVaR(x, alpha = 0.05, type = \"sample\", tail = c(\"lower\", \"upper\"))\nArguments\n x an uni- or multivariate timeSeries object\n alpha a numeric value, the confidence interval.\n type a character string, the type to calculate the value-at-risk.\n tail a character string denoting which tail will be considered, either \"lower\" or\n \"upper\". If tail=\"lower\", then alpha will be converted to alpha=1-alpha.\nValue\n VaR\n CVaR\n returns a numeric vector or value with the (conditional) value-at-risk for each time series column.\nAuthor(s)\n for this R-port.\nSee Also\n hillPlot, gevFit."}}},{"rowIdx":460,"cells":{"project":{"kind":"string","value":"github.com/untoldwind/gopter"},"source":{"kind":"string","value":"go"},"language":{"kind":"string","value":"Go"},"content":{"kind":"string","value":"README\n [¶](#section-readme)\n---\n\n### GOPTER\n\n... the GOlang Property TestER\n[![Build Status](https://travis-ci.org/leanovate/gopter.svg?branch=master)](https://travis-ci.org/leanovate/gopter)\n[![codecov](https://codecov.io/gh/leanovate/gopter/branch/master/graph/badge.svg)](https://codecov.io/gh/leanovate/gopter)\n[![GoDoc](https://godoc.org/github.com/leanovate/gopter?status.png)](https://godoc.org/github.com/leanovate/gopter)\n[![Go Report Card](https://goreportcard.com/badge/github.com/leanovate/gopter)](https://goreportcard.com/report/github.com/leanovate/gopter)\n\n[Change Log](https://github.com/untoldwind/gopter/blob/v0.2.8/CHANGELOG.md)\n\n#### Synopsis\n\nGopter tries to bring the goodness of [ScalaCheck](https://www.scalacheck.org/) (and implicitly, the goodness of [QuickCheck](http://hackage.haskell.org/package/QuickCheck)) to Go.\nIt can also be seen as a more sophisticated version of the testing/quick package.\n\nMain differences to ScalaCheck:\n\n* It is Go ... duh\n* ... nevertheless: Do not expect the same typesafety and elegance as in ScalaCheck.\n* For simplicity [Shrink](https://www.scalacheck.org/files/scalacheck_2.11-1.14.0-api/index.html#org.scalacheck.Shrink) has become part of the generators. They can still be easily changed if necessary.\n* There is no [Pretty](https://www.scalacheck.org/files/scalacheck_2.11-1.14.0-api/index.html#org.scalacheck.util.Pretty) ... so far gopter feels quite comfortable being ugly.\n* A generator for regex matches\n* No parallel commands ... yet?\n\nMain differences to the testing/quick package:\n\n* Much tighter control over generators\n* Shrinkers, i.e. automatically find the minimum value falsifying a property\n* A generator for regex matches (already mentioned that ... but it's cool)\n* Support for stateful tests\n\n#### Documentation\n\nCurrent godocs:\n\n* [gopter](https://godoc.org/github.com/leanovate/gopter): Main interfaces\n* [gopter/gen](https://godoc.org/github.com/leanovate/gopter/gen): All commonly used generators\n* [gopter/prop](https://godoc.org/github.com/leanovate/gopter/prop): Common helpers to create properties from a condition function and specific generators\n* [gopter/arbitrary](https://godoc.org/github.com/leanovate/gopter/arbitrary): Helpers automatically combine generators for arbitrary types\n* [gopter/commands](https://godoc.org/github.com/leanovate/gopter/commands): Helpers to create stateful tests based on arbitrary commands\n* [gopter/convey](https://godoc.org/github.com/leanovate/gopter/convey): Helpers used by gopter inside goconvey tests\n\n#### License\n\n[MIT Licence](http://opensource.org/licenses/MIT)\n\nDocumentation\n [¶](#section-documentation)\n---\n\n \n### Overview [¶](#pkg-overview)\n\nPackage gopter contain the main interfaces of the GOlang Property TestER.\n\nA simple property test might look like this:\n```\nfunc TestSqrt(t *testing.T) {\n\tproperties := gopter.NewProperties(nil)\n\n\tproperties.Property(\"greater one of all greater one\", prop.ForAll(\n\t\tfunc(v float64) bool {\n\t\t\treturn math.Sqrt(v) >= 1\n\t\t},\n\t\tgen.Float64Range(1, math.MaxFloat64),\n\t))\n\n\tproperties.Property(\"squared is equal to value\", prop.ForAll(\n\t\tfunc(v float64) bool {\n\t\t\tr := math.Sqrt(v)\n\t\t\treturn math.Abs(r*r-v) < 1e-10*v\n\t\t},\n\t\tgen.Float64Range(0, math.MaxFloat64),\n\t))\n\n\tproperties.TestingRun(t)\n}\n```\nGenerally a property is just a function that takes GenParameters and produces a PropResult:\n```\ntype Prop func(*GenParameters) *PropResult\n```\nbut usually you will use prop.ForAll, prop.ForAllNoShrink or arbitrary.ForAll.\nThere is also the commands package, which can be helpful for stateful testing.\n\nExample (Fizzbuzz) [¶](#example-package-Fizzbuzz)\n```\npackage main\n\nimport (\n\t\"errors\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/gen\"\n\t\"github.com/leanovate/gopter/prop\"\n)\n\n// Fizzbuzz: See https://wikipedia.org/wiki/Fizz_buzz func fizzbuzz(number int) (string, error) {\n\tif number <= 0 {\n\t\treturn \"\", errors.New(\"Undefined\")\n\t}\n\tswitch {\n\tcase number%15 == 0:\n\t\treturn \"FizzBuzz\", nil\n\tcase number%3 == 0:\n\t\treturn \"Fizz\", nil\n\tcase number%5 == 0:\n\t\treturn \"Buzz\", nil\n\t}\n\treturn strconv.Itoa(number), nil\n}\n\nfunc main() {\n\tproperties := gopter.NewProperties(nil)\n\n\tproperties.Property(\"Undefined for all <= 0\", prop.ForAll(\n\t\tfunc(number int) bool {\n\t\t\tresult, err := fizzbuzz(number)\n\t\t\treturn err != nil && result == \"\"\n\t\t},\n\t\tgen.IntRange(math.MinInt32, 0),\n\t))\n\n\tproperties.Property(\"Start with Fizz for all multiples of 3\", prop.ForAll(\n\t\tfunc(i int) bool {\n\t\t\tresult, err := fizzbuzz(i * 3)\n\t\t\treturn err == nil && strings.HasPrefix(result, \"Fizz\")\n\t\t},\n\t\tgen.IntRange(1, math.MaxInt32/3),\n\t))\n\n\tproperties.Property(\"End with Buzz for all multiples of 5\", prop.ForAll(\n\t\tfunc(i int) bool {\n\t\t\tresult, err := fizzbuzz(i * 5)\n\t\t\treturn err == nil && strings.HasSuffix(result, \"Buzz\")\n\t\t},\n\t\tgen.IntRange(1, math.MaxInt32/5),\n\t))\n\n\tproperties.Property(\"Int as string for all non-divisible by 3 or 5\", prop.ForAll(\n\t\tfunc(number int) bool {\n\t\t\tresult, err := fizzbuzz(number)\n\t\t\tif err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tparsed, err := strconv.ParseInt(result, 10, 64)\n\t\t\treturn err == nil && parsed == int64(number)\n\t\t},\n\t\tgen.IntRange(1, math.MaxInt32).SuchThat(func(v interface{}) bool {\n\t\t\treturn v.(int)%3 != 0 && v.(int)%5 != 0\n\t\t}),\n\t))\n\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n+ Undefined for all <= 0: OK, passed 100 tests.\n+ Start with Fizz for all multiples of 3: OK, passed 100 tests.\n+ End with Buzz for all multiples of 5: OK, passed 100 tests.\n+ Int as string for all non-divisible by 3 or 5: OK, passed 100 tests.\n```\nShare Format\nRun\n\nExample (Labels) [¶](#example-package-Labels)\n\nExample_labels demonstrates how labels may help, in case of more complex conditions.\nThe output will be:\n```\n! Check spooky: Falsified after 0 passed tests.\n> Labels of failing property: even result a: 3 a_ORIGINAL (44 shrinks): 861384713 b: 0 b_ORIGINAL (1 shrinks): -642623569\n```\n```\npackage main\n\nimport (\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/gen\"\n\t\"github.com/leanovate/gopter/prop\"\n)\n\nfunc spookyCalculation(a, b int) int {\n\tif a < 0 {\n\t\ta = -a\n\t}\n\tif b < 0 {\n\t\tb = -b\n\t}\n\treturn 2*b + 3*(2+(a+1)+b*(b+1))\n}\n\n// Example_labels demonstrates how labels may help, in case of more complex\n// conditions.\n// The output will be:\n//\n//\t! Check spooky: Falsified after 0 passed tests.\n//\t> Labels of failing property: even result\n//\ta: 3\n//\ta_ORIGINAL (44 shrinks): 861384713\n//\tb: 0\n//\tb_ORIGINAL (1 shrinks): -642623569 func main() {\n\tparameters := gopter.DefaultTestParameters()\n\tparameters.Rng.Seed(1234) // Just for this example to generate reproducible results\n\tparameters.MinSuccessfulTests = 10000\n\n\tproperties := gopter.NewProperties(parameters)\n\n\tproperties.Property(\"Check spooky\", prop.ForAll(\n\t\tfunc(a, b int) string {\n\t\t\tresult := spookyCalculation(a, b)\n\t\t\tif result < 0 {\n\t\t\t\treturn \"negative result\"\n\t\t\t}\n\t\t\tif result%2 == 0 {\n\t\t\t\treturn \"even result\"\n\t\t\t}\n\t\t\treturn \"\"\n\t\t},\n\t\tgen.Int().WithLabel(\"a\"),\n\t\tgen.Int().WithLabel(\"b\"),\n\t))\n\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n! Check spooky: Falsified after 0 passed tests.\n> Labels of failing property: even result a: 3 a_ORIGINAL (44 shrinks): 861384713 b: 0 b_ORIGINAL (1 shrinks): -642623569\n```\nShare Format\nRun\n\nExample (Libraries) [¶](#example-package-Libraries)\n```\npackage main\n\nimport (\n\t\"reflect\"\n\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/arbitrary\"\n\t\"github.com/leanovate/gopter/gen\"\n)\n\ntype TestBook struct {\n\tTitle string\n\tContent string\n}\n\nfunc genTestBook() gopter.Gen {\n\treturn gen.Struct(reflect.TypeOf(&TestBook{}), map[string]gopter.Gen{\n\t\t\"Title\": gen.AlphaString(),\n\t\t\"Content\": gen.AlphaString(),\n\t})\n}\n\ntype TestLibrary struct {\n\tName string\n\tLibrarians uint8\n\tBooks []TestBook\n}\n\nfunc genTestLibrary() gopter.Gen {\n\treturn gen.Struct(reflect.TypeOf(&TestLibrary{}), map[string]gopter.Gen{\n\t\t\"Name\": gen.AlphaString().SuchThat(func(s string) bool {\n\n\t\t\treturn s != \"\"\n\t\t}),\n\t\t\"Librarians\": gen.UInt8Range(1, 255),\n\t\t\"Books\": gen.SliceOf(genTestBook()),\n\t})\n}\n\ntype CityName = string type TestCities struct {\n\tLibraries map[CityName][]TestLibrary\n}\n\nfunc genTestCities() gopter.Gen {\n\treturn gen.StructPtr(reflect.TypeOf(&TestCities{}), map[string]gopter.Gen{\n\t\t\"Libraries\": (gen.MapOf(gen.AlphaString(), gen.SliceOf(genTestLibrary()))),\n\t})\n}\nfunc main() {\n\tparameters := gopter.DefaultTestParameters()\n\tparameters.Rng.Seed(1234) // Just for this example to generate reproducible results\n\tparameters.MaxSize = 5\n\tarbitraries := arbitrary.DefaultArbitraries()\n\tarbitraries.RegisterGen(genTestCities())\n\n\tproperties := gopter.NewProperties(parameters)\n\n\tproperties.Property(\"no unsupervised libraries\", arbitraries.ForAll(\n\t\tfunc(tc *TestCities) bool {\n\t\t\tfor _, libraries := range tc.Libraries {\n\t\t\t\tfor _, library := range libraries {\n\t\t\t\t\tif library.Librarians == 0 {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\t))\n\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n+ no unsupervised libraries: OK, passed 100 tests.\n```\nShare Format\nRun\n\nExample (Libraries2) [¶](#example-package-Libraries2)\n```\npackage main\n\nimport (\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/arbitrary\"\n\t\"github.com/leanovate/gopter/gen\"\n)\n\ntype TestBook struct {\n\tTitle string\n\tContent string\n}\n\ntype TestLibrary struct {\n\tName string\n\tLibrarians uint8\n\tBooks []TestBook\n}\n\ntype CityName = string type TestCities struct {\n\tLibraries map[CityName][]TestLibrary\n}\n\nfunc main() {\n\tparameters := gopter.DefaultTestParameters()\n\tparameters.Rng.Seed(1234) // Just for this example to generate reproducible results\n\n\tarbitraries := arbitrary.DefaultArbitraries()\n\t// All string are alphanumeric\n\tarbitraries.RegisterGen(gen.AlphaString())\n\n\tproperties := gopter.NewProperties(parameters)\n\n\tproperties.Property(\"libraries always empty\", arbitraries.ForAll(\n\t\tfunc(tc *TestCities) bool {\n\t\t\treturn len(tc.Libraries) == 0\n\t\t},\n\t))\n\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n! libraries always empty: Falsified after 2 passed tests.\nARG_0: &{Libraries:map[z:[]]}\n```\nShare Format\nRun\n\nExample (Panic) [¶](#example-package-Panic)\n```\npackage main\n\nimport (\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/gen\"\n\t\"github.com/leanovate/gopter/prop\"\n)\n\nfunc main() {\n\tparameters := gopter.DefaultTestParameters()\n\tparameters.Rng.Seed(1234) // Just for this example to generate reproducible results\n\n\tproperties := gopter.NewProperties(parameters)\n\tproperties.Property(\"Will panic\", prop.ForAll(\n\t\tfunc(i int) bool {\n\t\t\tif i%2 == 0 {\n\t\t\t\tpanic(\"hi\")\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\t\tgen.Int().WithLabel(\"number\")))\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n! Will panic: Error on property evaluation after 6 passed tests: Check\n paniced: hi number: 0 number_ORIGINAL (1 shrinks): 2015020988\n```\nShare Format\nRun\n\nExample (Sqrt) [¶](#example-package-Sqrt)\n```\npackage main\n\nimport (\n\t\"math\"\n\n\t\"github.com/leanovate/gopter\"\n\t\"github.com/leanovate/gopter/gen\"\n\t\"github.com/leanovate/gopter/prop\"\n)\n\nfunc main() {\n\tparameters := gopter.DefaultTestParameters()\n\tparameters.Rng.Seed(1234) // Just for this example to generate reproducible results\n\n\tproperties := gopter.NewProperties(parameters)\n\n\tproperties.Property(\"greater one of all greater one\", prop.ForAll(\n\t\tfunc(v float64) bool {\n\t\t\treturn math.Sqrt(v) >= 1\n\t\t},\n\t\tgen.Float64().SuchThat(func(x float64) bool { return x >= 1.0 }),\n\t))\n\n\tproperties.Property(\"squared is equal to value\", prop.ForAll(\n\t\tfunc(v float64) bool {\n\t\t\tr := math.Sqrt(v)\n\t\t\treturn math.Abs(r*r-v) < 1e-10*v\n\t\t},\n\t\tgen.Float64().SuchThat(func(x float64) bool { return x >= 0.0 }),\n\t))\n\n\t// When using testing.T you might just use: properties.TestingRun(t)\n\tproperties.Run(gopter.ConsoleReporter(false))\n}\n```\n```\nOutput:\n\n+ greater one of all greater one: OK, passed 100 tests.\n+ squared is equal to value: OK, passed 100 tests.\n```\nShare Format\nRun\n\n### Index [¶](#pkg-index)\n\n* [Constants](#pkg-constants)\n* [Variables](#pkg-variables)\n* [func NewLockedSource(seed int64) *lockedSource](#NewLockedSource)\n* [type BiMapper](#BiMapper)\n* + [func NewBiMapper(downstream interface{}, upstream interface{}) *BiMapper](#NewBiMapper)\n* + [func (b *BiMapper) ConvertDown(up []interface{}) []interface{}](#BiMapper.ConvertDown)\n\t+ [func (b *BiMapper) ConvertUp(down []interface{}) []interface{}](#BiMapper.ConvertUp)\n* [type Flag](#Flag)\n* + [func (f *Flag) Get() bool](#Flag.Get)\n\t+ [func (f *Flag) Set()](#Flag.Set)\n\t+ [func (f *Flag) Unset()](#Flag.Unset)\n* [type FormatedReporter](#FormatedReporter)\n* + [func (r *FormatedReporter) ReportTestResult(propName string, result *TestResult)](#FormatedReporter.ReportTestResult)\n* [type Gen](#Gen)\n* + [func CombineGens(gens ...Gen) Gen](#CombineGens)\n\t+ [func DeriveGen(downstream interface{}, upstream interface{}, gens ...Gen) Gen](#DeriveGen)\n* + [func (g Gen) FlatMap(f func(interface{}) Gen, resultType reflect.Type) Gen](#Gen.FlatMap)\n\t+ [func (g Gen) Map(f interface{}) Gen](#Gen.Map)\n\t+ [func (g Gen) MapResult(f func(*GenResult) *GenResult) Gen](#Gen.MapResult)\n\t+ [func (g Gen) Sample() (interface{}, bool)](#Gen.Sample)\n\t+ [func (g Gen) SuchThat(f interface{}) Gen](#Gen.SuchThat)\n\t+ [func (g Gen) WithLabel(label string) Gen](#Gen.WithLabel)\n\t+ [func (g Gen) WithShrinker(shrinker Shrinker) Gen](#Gen.WithShrinker)\n* [type GenParameters](#GenParameters)\n* + [func DefaultGenParameters() *GenParameters](#DefaultGenParameters)\n\t+ [func MinGenParameters() *GenParameters](#MinGenParameters)\n* + [func (p *GenParameters) CloneWithSeed(seed int64) *GenParameters](#GenParameters.CloneWithSeed)\n\t+ [func (p *GenParameters) NextBool() bool](#GenParameters.NextBool)\n\t+ [func (p *GenParameters) NextInt64() int64](#GenParameters.NextInt64)\n\t+ [func (p *GenParameters) NextUint64() uint64](#GenParameters.NextUint64)\n\t+ [func (p *GenParameters) WithSize(size int) *GenParameters](#GenParameters.WithSize)\n* [type GenResult](#GenResult)\n* + [func NewEmptyResult(resultType reflect.Type) *GenResult](#NewEmptyResult)\n\t+ [func NewGenResult(result interface{}, shrinker Shrinker) *GenResult](#NewGenResult)\n* + [func (r *GenResult) Retrieve() (interface{}, bool)](#GenResult.Retrieve)\n\t+ [func (r *GenResult) RetrieveAsValue() (reflect.Value, bool)](#GenResult.RetrieveAsValue)\n* [type Prop](#Prop)\n* + [func SaveProp(prop Prop) Prop](#SaveProp)\n* + [func (prop Prop) Check(parameters *TestParameters) *TestResult](#Prop.Check)\n* [type PropArg](#PropArg)\n* + [func NewPropArg(genResult *GenResult, shrinks int, value, origValue interface{}) *PropArg](#NewPropArg)\n* + [func (p *PropArg) String() string](#PropArg.String)\n* [type PropArgs](#PropArgs)\n* [type PropResult](#PropResult)\n* + [func NewPropResult(success bool, label string) *PropResult](#NewPropResult)\n* + [func (r *PropResult) AddArgs(args ...*PropArg) *PropResult](#PropResult.AddArgs)\n\t+ [func (r *PropResult) And(other *PropResult) *PropResult](#PropResult.And)\n\t+ [func (r *PropResult) Success() bool](#PropResult.Success)\n\t+ [func (r *PropResult) WithArgs(args []*PropArg) *PropResult](#PropResult.WithArgs)\n* [type Properties](#Properties)\n* + [func NewProperties(parameters *TestParameters) *Properties](#NewProperties)\n* + [func (p *Properties) Property(name string, prop Prop)](#Properties.Property)\n\t+ [func (p *Properties) Run(reporter Reporter) bool](#Properties.Run)\n\t+ [func (p *Properties) TestingRun(t *testing.T, opts ...interface{})](#Properties.TestingRun)\n* [type Reporter](#Reporter)\n* + [func ConsoleReporter(verbose bool) Reporter](#ConsoleReporter)\n\t+ [func NewFormatedReporter(verbose bool, width int, output io.Writer) Reporter](#NewFormatedReporter)\n* [type Shrink](#Shrink)\n* + [func ConcatShrinks(shrinks ...Shrink) Shrink](#ConcatShrinks)\n* + [func (s Shrink) All() []interface{}](#Shrink.All)\n\t+ [func (s Shrink) Filter(condition func(interface{}) bool) Shrink](#Shrink.Filter)\n\t+ [func (s Shrink) Interleave(other Shrink) Shrink](#Shrink.Interleave)\n\t+ [func (s Shrink) Map(f interface{}) Shrink](#Shrink.Map)\n* [type Shrinker](#Shrinker)\n* + [func CombineShrinker(shrinkers ...Shrinker) Shrinker](#CombineShrinker)\n* [type TestParameters](#TestParameters)\n* + [func DefaultTestParameters() *TestParameters](#DefaultTestParameters)\n\t+ [func DefaultTestParametersWithSeed(seed int64) *TestParameters](#DefaultTestParametersWithSeed)\n* [type TestResult](#TestResult)\n* + [func (r *TestResult) Passed() bool](#TestResult.Passed)\n\n#### Examples [¶](#pkg-examples)\n\n* [Package (Fizzbuzz)](#example-package-Fizzbuzz)\n* [Package (Labels)](#example-package-Labels)\n* [Package (Libraries)](#example-package-Libraries)\n* [Package (Libraries2)](#example-package-Libraries2)\n* [Package (Panic)](#example-package-Panic)\n* [Package (Sqrt)](#example-package-Sqrt)\n\n### Constants [¶](#pkg-constants)\n\n```\nconst (\n // PropProof THe property was proved (i.e. it is known to be correct and will be always true)\n\tPropProof propStatus = [iota](/builtin#iota)\n // PropTrue The property was true this time\n\tPropTrue\n // PropFalse The property was false this time\n\tPropFalse\n // PropUndecided The property has no clear outcome this time\n\tPropUndecided\n // PropError The property has generated an error\n\tPropError\n)\n```\n\n```\nconst (\n // TestPassed indicates that the property check has passed.\n\tTestPassed testStatus = [iota](/builtin#iota)\n // TestProved indicates that the property has been proved.\n\tTestProved\n // TestFailed indicates that the property check has failed.\n\tTestFailed\n // TestExhausted indicates that the property check has exhausted, i.e. the generators have\n\t// generated too many empty results.\n\tTestExhausted\n // TestError indicates that the property check has finished with an error.\n\tTestError\n)\n```\n### Variables [¶](#pkg-variables)\n\n```\nvar (\n\t// DefaultGenParams can be used as default für *GenParameters\n DefaultGenParams = [DefaultGenParameters](#DefaultGenParameters)()\n MinGenParams = [MinGenParameters](#MinGenParameters)()\n)\n```\n\n```\nvar NoShrink = [Shrink](#Shrink)(func() (interface{}, [bool](/builtin#bool)) {\n\treturn [nil](/builtin#nil), [false](/builtin#false)\n})\n```\nNoShrink is an empty shrink.\n\n```\nvar NoShrinker = [Shrinker](#Shrinker)(func(value interface{}) [Shrink](#Shrink) {\n\treturn [NoShrink](#NoShrink)\n})\n```\nNoShrinker is a shrinker for NoShrink, i.e. a Shrinker that will not shrink any values.\nThis is the default Shrinker if none is provided.\n\n### Functions [¶](#pkg-functions)\n\n#### \nfunc [NewLockedSource](https://github.com/untoldwind/gopter/blob/v0.2.8/locked_source.go#L20) [¶](#NewLockedSource)\n\nadded in v0.2.2\n```\nfunc NewLockedSource(seed [int64](/builtin#int64)) *lockedSource\n```\nNewLockedSource takes a seed and returns a new lockedSource for use with rand.New\n\n### Types [¶](#pkg-types)\n\n#### \ntype [BiMapper](https://github.com/untoldwind/gopter/blob/v0.2.8/bi_mapper.go#L10) [¶](#BiMapper)\n```\ntype BiMapper struct {\n UpTypes [][reflect](/reflect).[Type](/reflect#Type)\n DownTypes [][reflect](/reflect).[Type](/reflect#Type)\n Downstream [reflect](/reflect).[Value](/reflect#Value)\n Upstream [reflect](/reflect).[Value](/reflect#Value)\n}\n```\nBiMapper is a bi-directional (or bijective) mapper of a tuple of values (up)\nto another tuple of values (down).\n\n#### \nfunc [NewBiMapper](https://github.com/untoldwind/gopter/blob/v0.2.8/bi_mapper.go#L21) [¶](#NewBiMapper)\n```\nfunc NewBiMapper(downstream interface{}, upstream interface{}) *[BiMapper](#BiMapper)\n```\nNewBiMapper creates a BiMapper of two functions `downstream` and its inverse `upstream`.\nThat is: The return values of `downstream` must match the parameters of\n`upstream` and vice versa.\n\n#### \nfunc (*BiMapper) [ConvertDown](https://github.com/untoldwind/gopter/blob/v0.2.8/bi_mapper.go#L92) [¶](#BiMapper.ConvertDown)\n```\nfunc (b *[BiMapper](#BiMapper)) ConvertDown(up []interface{}) []interface{}\n```\nConvertDown calls the Downstream function on the elements of the up array and returns the results.\n\n#### \nfunc (*BiMapper) [ConvertUp](https://github.com/untoldwind/gopter/blob/v0.2.8/bi_mapper.go#L69) [¶](#BiMapper.ConvertUp)\n```\nfunc (b *[BiMapper](#BiMapper)) ConvertUp(down []interface{}) []interface{}\n```\nConvertUp calls the Upstream function on the arguments in the down array and returns the results.\n\n#### \ntype [Flag](https://github.com/untoldwind/gopter/blob/v0.2.8/flag.go#L6) [¶](#Flag)\n```\ntype Flag struct {\n\t// contains filtered or unexported fields\n}\n```\nFlag is a convenient helper for an atomic boolean\n\n#### \nfunc (*Flag) [Get](https://github.com/untoldwind/gopter/blob/v0.2.8/flag.go#L11) [¶](#Flag.Get)\n```\nfunc (f *[Flag](#Flag)) Get() [bool](/builtin#bool)\n```\nGet the value of the flag\n\n#### \nfunc (*Flag) [Set](https://github.com/untoldwind/gopter/blob/v0.2.8/flag.go#L16) [¶](#Flag.Set)\n```\nfunc (f *[Flag](#Flag)) Set()\n```\nSet the the flag\n\n#### \nfunc (*Flag) [Unset](https://github.com/untoldwind/gopter/blob/v0.2.8/flag.go#L21) [¶](#Flag.Unset)\n```\nfunc (f *[Flag](#Flag)) Unset()\n```\nUnset the flag\n\n#### \ntype [FormatedReporter](https://github.com/untoldwind/gopter/blob/v0.2.8/formated_reporter.go#L14) [¶](#FormatedReporter)\n```\ntype FormatedReporter struct {\n\t// contains filtered or unexported fields\n}\n```\nFormatedReporter reports test results in a human readable manager.\n\n#### \nfunc (*FormatedReporter) [ReportTestResult](https://github.com/untoldwind/gopter/blob/v0.2.8/formated_reporter.go#L38) [¶](#FormatedReporter.ReportTestResult)\n```\nfunc (r *[FormatedReporter](#FormatedReporter)) ReportTestResult(propName [string](/builtin#string), result *[TestResult](#TestResult))\n```\nReportTestResult reports a single property result\n\n#### \ntype [Gen](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L17) [¶](#Gen)\n```\ntype Gen func(*[GenParameters](#GenParameters)) *[GenResult](#GenResult)\n```\nGen generator of arbitrary values.\nUsually properties are checked by verifing a condition holds true for arbitrary input parameters generated by a Gen.\n\nIMPORTANT: Even though a generator is supposed to generate random values, it should do this in a reproducible way. Therefore a generator has to create the same result for the same GenParameters, i.e. ensure that you just use the RNG provided by GenParameters and no external one.\nIf you just plug generators together you do not have to worry about this.\n\n#### \nfunc [CombineGens](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L221) [¶](#CombineGens)\n```\nfunc CombineGens(gens ...[Gen](#Gen)) [Gen](#Gen)\n```\nCombineGens creates a generators from a list of generators.\nThe result type will be a []interface{} containing the generated values of each generators in the list.\nNote: The combined generator will not have a sieve or shrinker.\n\n#### \nfunc [DeriveGen](https://github.com/untoldwind/gopter/blob/v0.2.8/derived_gen.go#L96) [¶](#DeriveGen)\n```\nfunc DeriveGen(downstream interface{}, upstream interface{}, gens ...[Gen](#Gen)) [Gen](#Gen)\n```\nDeriveGen derives a generator with shrinkers from a sequence of other generators mapped by a bijective function (BiMapper)\n\n#### \nfunc (Gen) [FlatMap](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L191) [¶](#Gen.FlatMap)\n```\nfunc (g [Gen](#Gen)) FlatMap(f func(interface{}) [Gen](#Gen), resultType [reflect](/reflect).[Type](/reflect#Type)) [Gen](#Gen)\n```\nFlatMap creates a derived generator by passing a generated value to a function which itself creates a generator.\n\n#### \nfunc (Gen) [Map](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L107) [¶](#Gen.Map)\n```\nfunc (g [Gen](#Gen)) Map(f interface{}) [Gen](#Gen)\n```\nMap creates a derived generator by mapping all generatored values with a given function.\nf: has to be a function with one parameter (matching the generated value) and a single return.\nNote: The derived generator will not have a sieve or shrinker unless you are mapping to the same type Note: The mapping function may have a second parameter \"*GenParameters\"\nNote: The first parameter of the mapping function and its return may be a *GenResult (this makes MapResult obsolete)\n\n#### \nfunc (Gen) [MapResult](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L211) [¶](#Gen.MapResult)\n```\nfunc (g [Gen](#Gen)) MapResult(f func(*[GenResult](#GenResult)) *[GenResult](#GenResult)) [Gen](#Gen)\n```\nMapResult creates a derived generator by mapping the GenResult directly.\nContrary to `Map` and `FlatMap` this also allow the conversion of shrinkers and sieves, but implementation is more cumbersome.\nDeprecation note: Map now has the same functionality\n\n#### \nfunc (Gen) [Sample](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L27) [¶](#Gen.Sample)\n```\nfunc (g [Gen](#Gen)) Sample() (interface{}, [bool](/builtin#bool))\n```\nSample generate a sample value.\nDepending on the state of the RNG the generate might fail to provide a sample\n\n#### \nfunc (Gen) [SuchThat](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L47) [¶](#Gen.SuchThat)\n```\nfunc (g [Gen](#Gen)) SuchThat(f interface{}) [Gen](#Gen)\n```\nSuchThat creates a derived generator by adding a sieve.\nf: has to be a function with one parameter (matching the generated value) returning a bool.\nAll generated values are expected to satisfy\n```\nf(value) == true.\n```\nUse this care, if the sieve to to fine the generator will have many misses which results in an undecided property.\n\n#### \nfunc (Gen) [WithLabel](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L33) [¶](#Gen.WithLabel)\n```\nfunc (g [Gen](#Gen)) WithLabel(label [string](/builtin#string)) [Gen](#Gen)\n```\nWithLabel adds a label to a generated value.\nLabels are usually used for reporting for the arguments of a property check.\n\n#### \nfunc (Gen) [WithShrinker](https://github.com/untoldwind/gopter/blob/v0.2.8/gen.go#L90) [¶](#Gen.WithShrinker)\n```\nfunc (g [Gen](#Gen)) WithShrinker(shrinker [Shrinker](#Shrinker)) [Gen](#Gen)\n```\nWithShrinker creates a derived generator with a specific shrinker\n\n#### \ntype [GenParameters](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L9) [¶](#GenParameters)\n```\ntype GenParameters struct {\n MinSize [int](/builtin#int)\n MaxSize [int](/builtin#int)\n MaxShrinkCount [int](/builtin#int)\n Rng *[rand](/math/rand).[Rand](/math/rand#Rand)\n}\n```\nGenParameters encapsulates the parameters for all generators.\n\n#### \nfunc [DefaultGenParameters](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L59) [¶](#DefaultGenParameters)\n```\nfunc DefaultGenParameters() *[GenParameters](#GenParameters)\n```\nDefaultGenParameters creates default GenParameters.\n\n#### \nfunc [MinGenParameters](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L72) [¶](#MinGenParameters)\n\nadded in v0.2.4\n```\nfunc MinGenParameters() *[GenParameters](#GenParameters)\n```\nMinGenParameters creates minimal GenParameters.\nNote: Most likely you do not want to use these for actual testing\n\n#### \nfunc (*GenParameters) [CloneWithSeed](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L49) [¶](#GenParameters.CloneWithSeed)\n```\nfunc (p *[GenParameters](#GenParameters)) CloneWithSeed(seed [int64](/builtin#int64)) *[GenParameters](#GenParameters)\n```\nCloneWithSeed clone the current parameters with a new seed.\nThis is useful to create subsections that can rerun (provided you keep the seed)\n\n#### \nfunc (*GenParameters) [NextBool](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L25) [¶](#GenParameters.NextBool)\n```\nfunc (p *[GenParameters](#GenParameters)) NextBool() [bool](/builtin#bool)\n```\nNextBool create a random boolean using the underlying Rng.\n\n#### \nfunc (*GenParameters) [NextInt64](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L30) [¶](#GenParameters.NextInt64)\n```\nfunc (p *[GenParameters](#GenParameters)) NextInt64() [int64](/builtin#int64)\n```\nNextInt64 create a random int64 using the underlying Rng.\n\n#### \nfunc (*GenParameters) [NextUint64](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L39) [¶](#GenParameters.NextUint64)\n```\nfunc (p *[GenParameters](#GenParameters)) NextUint64() [uint64](/builtin#uint64)\n```\nNextUint64 create a random uint64 using the underlying Rng.\n\n#### \nfunc (*GenParameters) [WithSize](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_parameters.go#L18) [¶](#GenParameters.WithSize)\n```\nfunc (p *[GenParameters](#GenParameters)) WithSize(size [int](/builtin#int)) *[GenParameters](#GenParameters)\n```\nWithSize modifies the size parameter. The size parameter defines an upper bound for the size of generated slices or strings.\n\n#### \ntype [GenResult](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_result.go#L6) [¶](#GenResult)\n```\ntype GenResult struct {\n Labels [][string](/builtin#string)\n Shrinker [Shrinker](#Shrinker)\n ResultType [reflect](/reflect).[Type](/reflect#Type)\n Result interface{}\n Sieve func(interface{}) [bool](/builtin#bool)\n}\n```\nGenResult contains the result of a generator.\n\n#### \nfunc [NewEmptyResult](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_result.go#L28) [¶](#NewEmptyResult)\n```\nfunc NewEmptyResult(resultType [reflect](/reflect).[Type](/reflect#Type)) *[GenResult](#GenResult)\n```\nNewEmptyResult creates an empty generator result.\nUnless the sieve does not explicitly allow it, empty (i.e. nil-valued)\nresults are considered invalid.\n\n#### \nfunc [NewGenResult](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_result.go#L17) [¶](#NewGenResult)\n```\nfunc NewGenResult(result interface{}, shrinker [Shrinker](#Shrinker)) *[GenResult](#GenResult)\n```\nNewGenResult creates a new generator result from for a concrete value and shrinker.\nNote: The concrete value \"result\" not be nil\n\n#### \nfunc (*GenResult) [Retrieve](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_result.go#L38) [¶](#GenResult.Retrieve)\n```\nfunc (r *[GenResult](#GenResult)) Retrieve() (interface{}, [bool](/builtin#bool))\n```\nRetrieve gets the concrete generator result.\nIf the result is invalid or does not pass the sieve there is no concrete value and the property using the generator should be undecided.\n\n#### \nfunc (*GenResult) [RetrieveAsValue](https://github.com/untoldwind/gopter/blob/v0.2.8/gen_result.go#L48) [¶](#GenResult.RetrieveAsValue)\n```\nfunc (r *[GenResult](#GenResult)) RetrieveAsValue() ([reflect](/reflect).[Value](/reflect#Value), [bool](/builtin#bool))\n```\nRetrieveAsValue get the concrete generator result as reflect value.\nIf the result is invalid or does not pass the sieve there is no concrete value and the property using the generator should be undecided.\n\n#### \ntype [Prop](https://github.com/untoldwind/gopter/blob/v0.2.8/prop.go#L10) [¶](#Prop)\n```\ntype Prop func(*[GenParameters](#GenParameters)) *[PropResult](#PropResult)\n```\nProp represent some kind of property that (drums please) can and should be checked\n\n#### \nfunc [SaveProp](https://github.com/untoldwind/gopter/blob/v0.2.8/prop.go#L13) [¶](#SaveProp)\n```\nfunc SaveProp(prop [Prop](#Prop)) [Prop](#Prop)\n```\nSaveProp creates s save property by handling all panics from an inner property\n\n#### \nfunc (Prop) [Check](https://github.com/untoldwind/gopter/blob/v0.2.8/prop.go#L30) [¶](#Prop.Check)\n```\nfunc (prop [Prop](#Prop)) Check(parameters *[TestParameters](#TestParameters)) *[TestResult](#TestResult)\n```\nCheck the property using specific parameters\n\n#### \ntype [PropArg](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_arg.go#L10) [¶](#PropArg)\n```\ntype PropArg struct {\n Arg interface{}\n OrigArg interface{}\n Label [string](/builtin#string)\n Shrinks [int](/builtin#int)\n}\n```\nPropArg contains information about the specific values for a certain property check.\nThis is mostly used for reporting when a property has falsified.\n\n#### \nfunc [NewPropArg](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_arg.go#L25) [¶](#NewPropArg)\n```\nfunc NewPropArg(genResult *[GenResult](#GenResult), shrinks [int](/builtin#int), value, origValue interface{}) *[PropArg](#PropArg)\n```\nNewPropArg creates a new PropArg.\n\n#### \nfunc (*PropArg) [String](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_arg.go#L17) [¶](#PropArg.String)\n```\nfunc (p *[PropArg](#PropArg)) String() [string](/builtin#string)\n```\n#### \ntype [PropArgs](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_arg.go#L22) [¶](#PropArgs)\n```\ntype PropArgs []*[PropArg](#PropArg)\n```\nPropArgs is a list of PropArg.\n\n#### \ntype [PropResult](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L35) [¶](#PropResult)\n```\ntype PropResult struct {\n Status propStatus\n Error [error](/builtin#error)\n ErrorStack [][byte](/builtin#byte)\n Args []*[PropArg](#PropArg)\n Labels [][string](/builtin#string)\n}\n```\nPropResult contains the result of a property\n\n#### \nfunc [NewPropResult](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L44) [¶](#NewPropResult)\n```\nfunc NewPropResult(success [bool](/builtin#bool), label [string](/builtin#string)) *[PropResult](#PropResult)\n```\nNewPropResult create a PropResult with label\n\n#### \nfunc (*PropResult) [AddArgs](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L71) [¶](#PropResult.AddArgs)\n```\nfunc (r *[PropResult](#PropResult)) AddArgs(args ...*[PropArg](#PropArg)) *[PropResult](#PropResult)\n```\nAddArgs add argument descriptors to the PropResult for reporting\n\n#### \nfunc (*PropResult) [And](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L78) [¶](#PropResult.And)\n```\nfunc (r *[PropResult](#PropResult)) And(other *[PropResult](#PropResult)) *[PropResult](#PropResult)\n```\nAnd combines two PropResult by an and operation.\nThe resulting PropResult will be only true if both PropResults are true.\n\n#### \nfunc (*PropResult) [Success](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L60) [¶](#PropResult.Success)\n```\nfunc (r *[PropResult](#PropResult)) Success() [bool](/builtin#bool)\n```\nSuccess checks if the result was successful\n\n#### \nfunc (*PropResult) [WithArgs](https://github.com/untoldwind/gopter/blob/v0.2.8/prop_result.go#L65) [¶](#PropResult.WithArgs)\n```\nfunc (r *[PropResult](#PropResult)) WithArgs(args []*[PropArg](#PropArg)) *[PropResult](#PropResult)\n```\nWithArgs sets argument descriptors to the PropResult for reporting\n\n#### \ntype [Properties](https://github.com/untoldwind/gopter/blob/v0.2.8/properties.go#L6) [¶](#Properties)\n```\ntype Properties struct {\n\t// contains filtered or unexported fields\n}\n```\nProperties is a collection of properties that should be checked in a test\n\n#### \nfunc [NewProperties](https://github.com/untoldwind/gopter/blob/v0.2.8/properties.go#L14) [¶](#NewProperties)\n```\nfunc NewProperties(parameters *[TestParameters](#TestParameters)) *[Properties](#Properties)\n```\nNewProperties create new Properties with given test parameters.\nIf parameters is nil default test parameters will be used\n\n#### \nfunc (*Properties) [Property](https://github.com/untoldwind/gopter/blob/v0.2.8/properties.go#L26) [¶](#Properties.Property)\n```\nfunc (p *[Properties](#Properties)) Property(name [string](/builtin#string), prop [Prop](#Prop))\n```\nProperty add/defines a property in a test.\n\n#### \nfunc (*Properties) [Run](https://github.com/untoldwind/gopter/blob/v0.2.8/properties.go#L32) [¶](#Properties.Run)\n```\nfunc (p *[Properties](#Properties)) Run(reporter [Reporter](#Reporter)) [bool](/builtin#bool)\n```\nRun checks all definied propertiesand reports the result\n\n#### \nfunc (*Properties) [TestingRun](https://github.com/untoldwind/gopter/blob/v0.2.8/properties.go#L49) [¶](#Properties.TestingRun)\n```\nfunc (p *[Properties](#Properties)) TestingRun(t *[testing](/testing).[T](/testing#T), opts ...interface{})\n```\nTestingRun checks all definied properties with a testing.T context.\nThis the preferred wait to run property tests as part of a go unit test.\n\n#### \ntype [Reporter](https://github.com/untoldwind/gopter/blob/v0.2.8/reporter.go#L4) [¶](#Reporter)\n```\ntype Reporter interface {\n // ReportTestResult reports a single property result\n\tReportTestResult(propName [string](/builtin#string), result *[TestResult](#TestResult))\n}\n```\nReporter is a simple interface to report/format the results of a property check.\n\n#### \nfunc [ConsoleReporter](https://github.com/untoldwind/gopter/blob/v0.2.8/formated_reporter.go#L33) [¶](#ConsoleReporter)\n```\nfunc ConsoleReporter(verbose [bool](/builtin#bool)) [Reporter](#Reporter)\n```\nConsoleReporter creates a FormatedReporter writing to the console (i.e. stdout)\n\n#### \nfunc [NewFormatedReporter](https://github.com/untoldwind/gopter/blob/v0.2.8/formated_reporter.go#L24) [¶](#NewFormatedReporter)\n```\nfunc NewFormatedReporter(verbose [bool](/builtin#bool), width [int](/builtin#int), output [io](/io).[Writer](/io#Writer)) [Reporter](#Reporter)\n```\nNewFormatedReporter create a new formated reporter verbose toggles verbose output of the property results width is the maximal width per line output is the writer were the report will be written to\n\n#### \ntype [Shrink](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L16) [¶](#Shrink)\n```\ntype Shrink func() (interface{}, [bool](/builtin#bool))\n```\nShrink is a stream of shrunk down values.\nOnce the result of a shrink is false, it is considered to be exhausted.\nImportant notes for implementors:\n\n* Ensure that the returned stream is finite, even though shrinking will eventually be aborted, infinite streams may result in very slow running test.\n* Ensure that modifications to the returned value will not affect the internal state of your Shrink. If in doubt return by value not by reference\n\n#### \nfunc [ConcatShrinks](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L86) [¶](#ConcatShrinks)\n```\nfunc ConcatShrinks(shrinks ...[Shrink](#Shrink)) [Shrink](#Shrink)\n```\nConcatShrinks concats an array of shrinks to a single shrinks\n\n#### \nfunc (Shrink) [All](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L59) [¶](#Shrink.All)\n```\nfunc (s [Shrink](#Shrink)) All() []interface{}\n```\nAll collects all shrinks as a slice. Use with care as this might create large results depending on the complexity of the shrink\n\n#### \nfunc (Shrink) [Filter](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L19) [¶](#Shrink.Filter)\n```\nfunc (s [Shrink](#Shrink)) Filter(condition func(interface{}) [bool](/builtin#bool)) [Shrink](#Shrink)\n```\nFilter creates a shrink filtered by a condition\n\n#### \nfunc (Shrink) [Interleave](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L124) [¶](#Shrink.Interleave)\n```\nfunc (s [Shrink](#Shrink)) Interleave(other [Shrink](#Shrink)) [Shrink](#Shrink)\n```\nInterleave this shrink with another Both shrinks are expected to produce the same result\n\n#### \nfunc (Shrink) [Map](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L34) [¶](#Shrink.Map)\n```\nfunc (s [Shrink](#Shrink)) Map(f interface{}) [Shrink](#Shrink)\n```\nMap creates a shrink by applying a converter to each element of a shrink.\nf: has to be a function with one parameter (matching the generated value) and a single return.\n\n#### \ntype [Shrinker](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L133) [¶](#Shrinker)\n```\ntype Shrinker func(value interface{}) [Shrink](#Shrink)\n```\nShrinker creates a shrink for a given value\n\n#### \nfunc [CombineShrinker](https://github.com/untoldwind/gopter/blob/v0.2.8/shrink.go#L157) [¶](#CombineShrinker)\n```\nfunc CombineShrinker(shrinkers ...[Shrinker](#Shrinker)) [Shrinker](#Shrinker)\n```\nCombineShrinker create a shrinker by combining a list of shrinkers.\nThe resulting shrinker will shrink an []interface{} where each element will be shrunk by the corresonding shrinker in 'shrinkers'.\nThis method is implicitly used by CombineGens.\n\n#### \ntype [TestParameters](https://github.com/untoldwind/gopter/blob/v0.2.8/test_parameters.go#L9) [¶](#TestParameters)\n```\ntype TestParameters struct {\n MinSuccessfulTests [int](/builtin#int)\n // MinSize is an (inclusive) lower limit on the size of the parameters\n\tMinSize [int](/builtin#int)\n\t// MaxSize is an (exclusive) upper limit on the size of the parameters\n MaxSize [int](/builtin#int)\n MaxShrinkCount [int](/builtin#int)\n Seed [int64](/builtin#int64)\n Rng *[rand](/math/rand).[Rand](/math/rand#Rand)\n Workers [int](/builtin#int)\n MaxDiscardRatio [float64](/builtin#float64)\n}\n```\nTestParameters to run property tests\n\n#### \nfunc [DefaultTestParameters](https://github.com/untoldwind/gopter/blob/v0.2.8/test_parameters.go#L37) [¶](#DefaultTestParameters)\n```\nfunc DefaultTestParameters() *[TestParameters](#TestParameters)\n```\nDefaultTestParameterWithSeeds creates reasonable default Parameters for most cases with an undefined RNG-seed\n\n#### \nfunc [DefaultTestParametersWithSeed](https://github.com/untoldwind/gopter/blob/v0.2.8/test_parameters.go#L23) [¶](#DefaultTestParametersWithSeed)\n\nadded in v0.2.2\n```\nfunc DefaultTestParametersWithSeed(seed [int64](/builtin#int64)) *[TestParameters](#TestParameters)\n```\nDefaultTestParameterWithSeeds creates reasonable default Parameters for most cases based on a fixed RNG-seed\n\n#### \ntype [TestResult](https://github.com/untoldwind/gopter/blob/v0.2.8/test_result.go#L38) [¶](#TestResult)\n```\ntype TestResult struct {\n Status testStatus\n Succeeded [int](/builtin#int)\n Discarded [int](/builtin#int)\n Labels [][string](/builtin#string)\n Error [error](/builtin#error)\n ErrorStack [][byte](/builtin#byte)\n Args [PropArgs](#PropArgs)\n Time [time](/time).[Duration](/time#Duration)\n}\n```\nTestResult contains the result of a property property check.\n\n#### \nfunc (*TestResult) [Passed](https://github.com/untoldwind/gopter/blob/v0.2.8/test_result.go#L50) [¶](#TestResult.Passed)\n```\nfunc (r *[TestResult](#TestResult)) Passed() [bool](/builtin#bool)\n```\nPassed checks if the check has passed"}}},{"rowIdx":461,"cells":{"project":{"kind":"string","value":"brglm"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘brglm’\n October 12, 2022\nType Package\nTitle Bias Reduction in Binomial-Response Generalized Linear Models\nVersion 0.7.2\nURL https://github.com/ikosmidis/brglm\nBugReports https://github.com/ikosmidis/brglm/issues\nDescription Fit generalized linear models with binomial responses using either an adjusted-score ap-\n proach to bias reduction or maximum penalized likelihood where penalization is by Jeffreys in-\n variant prior. These procedures return estimates with improved frequentist proper-\n ties (bias, mean squared error) that are always finite even in cases where the maximum likeli-\n hood estimates are infinite (data separation). Fitting takes place by fitting generalized linear mod-\n els on iteratively updated pseudo-data. The interface is essentially the same as 'glm'. More flexi-\n bility is provided by the fact that custom pseudo-data representations can be speci-\n fied and used for model fitting. Functions are provided for the construction of confidence inter-\n vals for the reduced-bias estimates.\nLicense GPL (>= 2)\nDepends R (>= 2.6.0), profileModel\nSuggests MASS\nNeedsCompilation yes\nAuthor [aut, cre] ()\nMaintainer <>\nRepository CRAN\nDate/Publication 2021-04-22 11:30:05 UTC\nR topics documented:\nbrgl... 2\nbrglm.contro... 7\nconfint.brgl... 8\ngethat... 12\nglm.control... 12\nlizard... 13\nmodification... 14\nplot.profile.brgl... 18\nprofile.brgl... 20\nprofileObjectives-brgl... 21\nseparation.detectio... 22\n brglm Bias reduction in Binomial-response GLMs\nDescription\n Fits binomial-response GLMs using the bias-reduction method developed in Firth (1993) for the\n removal of the leading (O(n−1 )) term from the asymptotic expansion of the bias of the maximum\n likelihood estimator. Fitting is performed using pseudo-data representations, as described in Kos-\n midis (2007, Chapter 5). For estimation in binomial-response GLMs, the bias-reduction method is\n an improvement over traditional maximum likelihood because:\n • the bias-reduced estimator is second-order unbiased and has smaller variance than the maxi-\n mum likelihood estimator and\n • the resulting estimates and their corresponding standard errors are always finite while the\n maximum likelihood estimates can be infinite (in situations where complete or quasi sepa-\n ration occurs); see Kosmidis & Firth (2021) for the proof of finiteness in logistic regression\n models.\nUsage\n brglm(formula, family = binomial, data, weights, subset, na.action,\n start = NULL, etastart, mustart, offset,\n control.glm = glm.control1(...), model = TRUE, method = \"brglm.fit\",\n pl = FALSE, x = FALSE, y = TRUE, contrasts = NULL,\n control.brglm = brglm.control(...), ...)\n brglm.fit(x, y, weights = rep(1, nobs), start = NULL, etastart = NULL,\n mustart = NULL, offset = rep(0, nobs), family = binomial(),\n control = glm.control(), control.brglm = brglm.control(),\n intercept = TRUE, pl = FALSE)\nArguments\n formula as in glm.\n family as in glm. brglm currently supports only the \"binomial\" family with links\n \"logit\", \"probit\", \"cloglog\", \"cauchit\".\n data as in glm.\n weights as in glm.\n subset as in glm.\n na.action as in glm.\n start as in glm.\n etastart as in glm.\n mustart as in glm.\n offset as in glm.\n control.glm control.glm replaces the control argument in glm but essentially does the\n same job. It is a list of parameters to control glm.fit. See the documentation\n of glm.control1 for details.\n control same as in glm. Only available to brglm.fit.\n intercept as in glm.\n model as in glm.\n method the method to be used for fitting the model. The default method is \"brglm.fit\",\n which uses either the modified-scores approach to estimation or maximum pe-\n nalized likelihood (see the pl argument below). The standard glm methods\n \"glm.fit\" for maximum likelihood and \"model.frame\" for returning the model\n frame without any fitting, are also accepted.\n pl a logical value indicating whether the model should be fitted using maximum\n penalized likelihood, where the penalization is done using Jeffreys invariant\n prior, or using the bias-reducing modified scores. It is only used when method =\n \"brglm.fit\". The default value is FALSE (see also the Details section).\n x as in glm.\n y as in glm.\n contrasts as in glm.\n control.brglm a list of parameters for controlling the fitting process when method = \"brglm.fit\".\n See documentation of brglm.control for details.\n ... further arguments passed to or from other methods.\nDetails\n brglm.fit is the workhorse function for fitting the model using either the bias-reduction method\n or maximum penalized likelihood. If method = \"glm.fit\", usual maximum likelihood is used via\n glm.fit.\n The main iteration of brglm.fit consists of the following steps:\n 1. Calculate the diagonal components of the hat matrix (see gethats and hatvalues).\n 2. Obtain the pseudo-data representation at the current value of the parameters (see modifications\n for more information).\n 3. Fit a local GLM, using glm.fit on the pseudo data.\n 4. Adjust the quadratic weights to agree with the original binomial totals.\n Iteration is repeated until either the iteration limit has been reached or the sum of the absolute\n values of the modified scores is less than some specified positive constant (see the br.maxit and\n br.epsilon arguments in brglm.control).\n The default value (FALSE) of pl, when method = \"brglm.fit\", results in estimates that are free\n of any O(n−1 ) terms in the asymptotic expansion of their bias. When pl = TRUE bias-reduction\n is again achieved but generally not at such order of magnitude. In the case of logistic regression\n the value of pl is irrelevant since maximum penalized likelihood and the modified-scores approach\n coincide for natural exponential families (see Firth, 1993).\n For other language related details see the details section in glm.\nValue\n brglm returns an object of class \"brglm\". A \"brglm\" object inherits first from \"glm\" and then from\n \"lm\" and is a list containing the following components:\n coefficients as in glm.\n residuals as in glm.\n fitted.values as in glm.\n effects as in glm.\n R as in glm.\n rank as in glm.\n qr as in glm.\n family as in glm.\n linear.predictors\n as in glm.\n deviance as in glm.\n aic as in glm (see Details).\n null.deviance as in glm.\n iter as in glm.\n weights as in glm.\n prior.weights as in glm.\n df.residual as in glm.\n df.null as in glm.\n y as in glm.\n converged as in glm.\n boundary as in glm.\n ModifiedScores the vector of the modified scores for the parameters at the final iteration. If pl =\n TRUE they are the derivatives of the penalized likelihood at the final iteration.\n FisherInfo the Fisher information matrix evaluated at the resulting estimates. Only avail-\n able when method = \"brglm.fit\".\n hats the diagonal elements of the hat matrix. Only available when method = \"brglm.fit\"\n nIter the number of iterations that were required until convergence. Only available\n when method = \"brglm.fit\".\n cur.model a list with components ar and at which contains the values of the additive mod-\n ifications to the responses (y) and to the binomial totals (prior.weights) at the\n resulting estimates (see modifications for more information). Only available\n when method = \"brglm.fit\".\n model as in glm.\n call as in glm.\n formula as in glm.\n terms as in glm.\n data as in glm.\n offset as in glm.\n control.glm as control in the result of glm.\n control.brglm the control.brglm argument that was passed to brglm. Only available when\n method = \"brglm.fit\".\n method the method used for fitting the model.\n contrasts as in glm.\n xlevels as in glm.\n pl logical having the same value with the pl argument passed to brglm. Only\n available when method = \"brglm.fit\".\nWarnings\n 1. It is not advised to use methods associated with model comparison (add1, drop1, anova, etc.)\n on objects of class \"brglm\". Model comparison when estimation is performed using the modified\n scores or the penalized likelihood is an on-going research topic and will be implemented as soon as\n it is concluded.\n 2. The use of Akaike’s information criterion (AIC) for model selection when method = \"brglm.fit\"\n is asymptotically valid, because the log-likelihood derivatives dominate the modification (in terms\n of asymptotic order).\nNote\n 1. Supported methods for objects of class \"brglm\" are:\n • printthrough print.brglm.\n • summarythrough summary.brglm.\n • coefficientsinherited from the \"glm\" class.\n • vcovinherited from the\"glm\" class.\n • predictinherited from the\"glm\" class.\n • residualsinherited from the\"glm\" class.\n • and other methods that apply to objects of class \"glm\"\n 2. A similar implementation of the bias-reduction method could be done for every GLM, following\n Kosmidis (2007) (see also Kosmidis and Firth, 2009). The full set of families and links will be\n available in a future version. However, bias-reduction is not generally beneficial as it is in the\n binomial family and it could cause inflation of the variance (see Firth, 1993).\n 3. Basically, the differences between maximum likelihood, maximum penalized likelihood and the\n modified scores approach are more apparent in small sample sizes, in sparse data sets and in cases\n where complete or quasi-complete separation occurs. Asymptotically (as n goes to infinity), the\n three different approaches are equivalent to first order.\n 4. When an offset is not present in the model, the modified-scores based estimates are usually\n smaller in magnitude than the corresponding maximum likelihood estimates, shrinking towards the\n origin of the scale imposed by the link function. Thus, the corresponding estimated asymptotic\n standard errors are also smaller.\n The same is true for the maximum penalized likelihood estimates when for example, the logit\n (where the maximum penalized likelihood and modified-scores approaches coincide) or the pro-\n bit links are used. However, generally the maximum penalized likelihood estimates do not shrink\n towards the origin. In terms of mean-value parameterization, in the case of maximum penalized\n likelihood the fitted probabilities would shrink towards the point where the Jeffreys prior is max-\n imized or equivalently where the quadratic weights are simultaneously maximized (see Kosmidis,\n 2007).\n 5. Implementations of the bias-reduction method for logistic regressions can also be found in the\n logistf package. In addition to the obvious advantage of brglm in the range of link functions that\n can be used (\"logit\", \"probit\", \"cloglog\" and \"cauchit\"), brglm is also more efficient compu-\n tationally. Furthermore, for any user-specified link function (see the Example section of family),\n the user can specify the corresponding pseudo-data representation to be used within brglm (see\n modifications for details).\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n ., . and . (2007). Confidence intervals for multinomial logistic\n regression in sparse data. Statistics in Medicine 26, 903–918.\n . (1992) Bias reduction, the Jeffreys prior and GLIM. In Advances in GLIM and statisti-\n cal modelling: Proceedings of the GLIM 92 conference, Munich, Eds. L.~Fahrmeir, B.~Francis,\n R.~Gilchrist and G.Tutz, pp. 91–100. New York: Springer.\n Firth, D. (1992) Generalized linear models and Jeffreys priors: An iterative generalized least-\n squares approach. In Computational Statistics I, Eds. and . Heidelberg:\n Physica-Verlag.\n . (1993). Bias reduction of maximum likelihood estimates. Biometrika 80, 27–38.\n . and . (2002). A solution to the problem of separation in logistic regression.\n Statistics in Medicine 21, 2409–2419.\n . (2007). Bias reduction in exponential family nonlinear models. PhD Thesis, Depart-\n ment of Statistics, University of Warwick.\n . and . (2009). Bias reduction in exponential family nonlinear models. Biometrika\n 96, 793–804.\nSee Also\n glm, glm.fit\nExamples\n ## Begin Example\n data(lizards)\n # Fit the GLM using maximum likelihood\n lizards.glm <- brglm(cbind(grahami, opalinus) ~ height + diameter +\n light + time, family = binomial(logit), data=lizards,\n method = \"glm.fit\")\n # Now the bias-reduced fit:\n lizards.brglm <- brglm(cbind(grahami, opalinus) ~ height + diameter +\n light + time, family = binomial(logit), data=lizards,\n method = \"brglm.fit\")\n lizards.glm\n lizards.brglm\n # Other links\n update(lizards.brglm, family = binomial(probit))\n update(lizards.brglm, family = binomial(cloglog))\n update(lizards.brglm, family = binomial(cauchit))\n # Using penalized maximum likelihood\n update(lizards.brglm, family = binomial(probit), pl = TRUE)\n update(lizards.brglm, family = binomial(cloglog), pl = TRUE)\n update(lizards.brglm, family = binomial(cauchit), pl = TRUE)\n brglm.control Auxiliary for Controlling BRGLM Fitting\nDescription\n Auxiliary function as user interface for brglm fitting. Typically only used when calling brglm or\n brglm.fit.\nUsage\n brglm.control(br.epsilon = 1e-08, br.maxit = 100, br.trace=FALSE,\n br.consts = NULL, ...)\nArguments\n br.epsilon positive convergence tolerance for the iteration described in brglm.fit.\n br.maxit integer giving the maximum number of iterations for the iteration in brglm.fit.\n br.trace logical indicating if output should be prooduced for each iteration.\n br.consts a (small) positive constant or a vector of such.\n ... further arguments passed to or from other methods.\nDetails\n If br.trace=TRUE then for each iteration the iteration number and the current value of the modified\n scores is cat’ed. If br.consts is specified then br.consts is added to the original binomial counts\n and 2*br.consts. Then the model is fitted to the adjusted data to provide starting values for the\n iteration in brglm.fit. If br.consts = NULL (default) then brglm.fit adjusts the responses and\n totals by \"number of parameters\"/\"number of observations\" and twice that, respectively.\nValue\n A list with the arguments as components.\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n . (2007). Bias reduction in exponential family nonlinear models. PhD Thesis, Depart-\n ment of Statistics, University of Warwick.\nSee Also\n brglm.fit, the fitting procedure used by brglm.\n confint.brglm Computes confidence intervals of parameters for bias-reduced estima-\n tion\nDescription\n Computes confidence intervals for one or more parameters when estimation is performed using\n brglm. The resulting confidence intervals are based on manipulation of the profiles of the deviance,\n the penalized deviance and the modified score statistic (see profileObjectives).\nUsage\n ## S3 method for class 'brglm'\n confint(object, parm = 1:length(coef(object)), level = 0.95,\n verbose = TRUE, endpoint.tolerance = 0.001,\n max.zoom = 100, zero.bound = 1e-08, stepsize = 0.5,\n stdn = 5, gridsize = 10, scale = FALSE, method = \"smooth\",\n ci.method = \"union\", n.interpolations = 100, ...)\n ## S3 method for class 'profile.brglm'\n confint(object, parm, level = 0.95, method = \"smooth\",\n ci.method = \"union\", endpoint.tolerance = 0.001,\n max.zoom = 100, n.interpolations = 100, verbose = TRUE,\n ...)\nArguments\n object an object of class \"brglm\" or \"profile.brglm\".\n parm either a numeric vector of indices or a character vector of names, specifying the\n parameters for which confidence intervals are to be estimated. The default is\n all parameters in the fitted model. When object is of class \"profile.brglm\",\n parm is not used and confidence intervals are returned for all the parameters for\n which profiling took place.\n level the confidence level required. The default is 0.95. When object is of class\n \"profile.brglm\", level is not used and the level attribute of object is used\n instead.\n verbose logical. If TRUE (default) progress indicators are printed during the progress of\n calculating the confidence intervals.\n endpoint.tolerance\n as in confintModel.\n max.zoom as in confintModel.\n zero.bound as in confintModel.\n stepsize as in confintModel.\n stdn as in confintModel.\n gridsize as in confintModel.\n scale as in confintModel.\n method as in confintModel.\n ci.method The method to be used for the construction of confidence intervals. It can take\n values \"union\" (default) and \"mean\" (see Details).\n n.interpolations\n as in confintModel.\n ... further arguments to or from other methods.\nDetails\n In the case of logistic regression (2002) and Bull et. al. (2007) suggest the\n use of confidence intervals based on the profiles of the penalized likelihood, when estimation is\n performed using maximum penalized likelihood.\n Kosmidis (2007) illustrated that because of the shape of the penalized likelihood, confidence in-\n tervals based on the penalized likelihood could exhibit low or even zero coverage for hypothesis\n testing on large parameter values and also misbehave illustrating severe oscillation (see Brown et.\n al., 2001); see, also Kosmidis & Firth (2021) for discussion on the schrinkage implied by bias re-\n duction and what that entails for inference. Kosmidis (2007) suggested an alternative confidence\n interval that is based on the union of the confidence intervals resulted by profiling the ordinary de-\n viance for the maximum likelihood fit and by profiling the penalized deviance for the maximum\n penalized fit. Such confidence intervals, despite of being slightly conservative, illustrate less oscil-\n lation and avoid the loss of coverage. Another possibility is to use the mean of the corresponding\n endpoints instead of “union”. Yet unpublished simulation studies suggest that such confidence in-\n tervals are not as conservative as the “union” based intervals but illustrate more oscillation, which\n however is not as severe as in the case of the penalized likelihood based ones.\n The properties of the “union” and “mean” confidence intervals extend to all the links that are sup-\n ported by brglm, when estimation is performed using maximum penalized likelihood.\n In the case of estimation using modified scores and for models other than logistic, where there is not\n an objective that is maximized, the profiles of the penalized likelihood for the construction of the\n “union” and “mean” confidence intervals can be replaced by the profiles of modified score statistic\n (see profileObjectives).\n The confint method for brglm and profile.brglm objects implements the “union” and “mean”\n confidence intervals. The method is chosen through the ci.method argument.\nValue\n A matrix with columns the endpoints of the confidence intervals for the specified (or profiled)\n parameters.\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n ., . and . (2001). Interval estimation for a binomial proportion\n (with discussion). Statistical Science 16, 101–117.\n ., . and . (2007). Confidence intervals for multinomial logistic\n regression in sparse data. Statistics in Medicine 26, 903–918.\n . and . (2002). A solution to the problem of separation in logistic regression.\n Statistics in Medicine 21, 2409–2419.\n . (2007). Bias reduction in exponential family nonlinear models. PhD Thesis, Depart-\n ment of Statistics, University of Warwick.\nSee Also\n confintModel, profileModel, profile.brglm.\nExamples\n ## Begin Example 1\n ## Not run:\n library(MASS)\n data(bacteria)\n contrasts(bacteria$trt) <- structure(contr.sdif(3),\n dimnames = list(NULL, c(\"drug\", \"encourage\")))\n # fixed effects analyses\n m.glm.logit <- brglm(y ~ trt * week, family = binomial,\n data = bacteria, method = \"glm.fit\")\n m.brglm.logit <- brglm(y ~ trt * week, family = binomial,\n data = bacteria, method = \"brglm.fit\")\n p.glm.logit <- profile(m.glm.logit)\n p.brglm.logit <- profile(m.brglm.logit)\n #\n plot(p.glm.logit)\n plot(p.brglm.logit)\n # confidence intervals for the glm fit based on the profiles of the\n # ordinary deviance\n confint(p.glm.logit)\n # confidence intervals for the brglm fit\n confint(p.brglm.logit, ci.method = \"union\")\n confint(p.brglm.logit, ci.method = \"mean\")\n # A cloglog link\n m.brglm.cloglog <- update(m.brglm.logit, family = binomial(cloglog))\n p.brglm.cloglog <- profile(m.brglm.cloglog)\n plot(p.brglm.cloglog)\n confint(m.brglm.cloglog, ci.method = \"union\")\n confint(m.brglm.cloglog, ci.method = \"mean\")\n ## End example\n ## End(Not run)\n ## Not run:\n ## Begin Example 2\n y <- c(1, 1, 0, 0)\n totals <- c(2, 2, 2, 2)\n x1 <- c(1, 0, 1, 0)\n x2 <- c(1, 1, 0, 0)\n m1 <- brglm(y/totals ~ x1 + x2, weights = totals,\n family = binomial(cloglog))\n p.m1 <- profile(m1)\n confint(p.m1, method=\"zoom\")\n ## End(Not run)\n gethats Calculates the Leverages for a GLM through a C Routine\nDescription\n Calculates the leverages of a GLM through a C routine. It is intended to be used only within\n brglm.fit.\nUsage\n gethats(nobs, nvars, x.t, XWXinv, ww)\nArguments\n nobs The number of observations, i.e. dim(X)[1].\n nvars The number of parameters, i.e. dim(X)[1], where X is the model matrix, ex-\n cluding the columns that correspond to aliased parameters.\n x.t t(X).\n XWXinv The inverse of the Fisher information.\n ww The ‘working’ weights.\nValue\n A vector containing the diagonal elements of the hat matrix.\nAuthor(s)\n , <>\nSee Also\n hatvalues, brglm.fit\n glm.control1 Auxiliary for Controlling BRGLM Fitting\nDescription\n Auxiliary function as user interface for brglm fitting. Typically only used when calling brglm or\n brglm.fit.\nUsage\n glm.control1(epsilon = 1e-08, maxit = 25, trace = FALSE, ...)\nArguments\n epsilon as in glm.control.\n maxit as in glm.control.\n trace as in glm.control.\n ... further arguments passed to or from other methods.\nDetails\n The only difference with glm.control is that glm.control1 supports further arguments to be\n passed from other methods. However, this additional arguments have no effect on the resulting list.\nAuthor(s)\n , <>\n lizards Habitat Preferences of Lizards\nDescription\n The lizards data frame has 23 rows and 6 columns. Variables grahami and opalinus are counts\n of two lizard species at two different perch heights, two different perch diameters, in sun and in\n shade, at three times of day.\nUsage\n data(lizards)\nFormat\n This data frame contains the following columns:\n grahami count of grahami lizards\n opalinus count of opalinus lizards\n height a factor with levels \"<5ft\", \">=5ft\"\n diameter a factor with levels \"<=2in\", \">2in\"\n light a factor with levels \"sunny\", \"shady\"\n time a factor with levels \"early\", \"midday\", \"late\"\nSource\n . and . (1989) Generalized Linear Models (2nd Edition). London: Chap-\n man and Hall.\n Originally from\n . (1970) Nonsynchronous spatial overlap of lizards in patchy habitats. Ecology 51,\n 408–418.\nExamples\n data(lizards)\n glm(cbind(grahami, opalinus) ~ height + diameter + light + time,\n family = binomial, data=lizards)\n brglm(cbind(grahami, opalinus) ~ height + diameter + light + time,\n family = binomial, data=lizards)\n modifications Additive Modifications to the Binomial Responses and Totals for Use\n within ‘brglm.fit’\nDescription\n Get, test and set the functions that calculate the additive modifications to the responses and totals\n in binomial-response GLMs, for the application of bias-reduction either via modified scores or via\n maximum penalized likelihood (where penalization is by Jeffreys invariant prior).\nUsage\n modifications(family, pl = FALSE)\nArguments\n family a family object of the form binomial(link = \"link\"), where \"link\" can be\n one of \"logit\", \"probit\", \"cloglog\" and \"cauchit\". The usual ways of\n giving the family name are supported (see family).\n pl logical determining whether the function returned corresponds to modifications\n for the penalized maximum likelihood approach or for the modified-scores ap-\n proach to bias-reduction. Default value is FALSE.\nDetails\n The function returned from modifications accepts the argument p which are the binomial prob-\n abilities and returns a list with components ar and at, which are the link-dependent parts of the\n additive modifications to the actual responses and totals, respectively.\n Since the resulting function is used in brglm.fit, for efficiency reasons no check is made for p >=\n 0 | p <= 1, for length(at) == length(p) and for length(ap) == length(p).\nConstruction of custom pseudo-data representations\n If y ∗ are the pseudo-responses (pseudo-counts) and m∗ are the pseudo-totals then we call the pair\n (y ∗ , m∗ ) a pseudo-data representation. Both the modified-scores approach and the maximum pe-\n nalized likelihood have a common property:\n there exists (y ∗ , m∗ ) such that if we replace the actual data (y, m) with (y ∗ , m∗ ) in the expres-\n sion for the ordinary scores (first derivatives of the likelihood) of a binomial-response GLM, then\n we end-up either with the modified-scores or with the derivatives of the penalized likelihood (see\n Kosmidis, 2007, Chapter 5).\n Let µ be the mean of the binomial response y (i.e. µ = mp, where p is the binomial probability\n corresponding to the count y). Also, let d and d0 denote the first and the second derivatives, respec-\n tively, of µ with respect to the linear predictor η of the model. All the above are viewed as functions\n of p. The pseudo-data representations have the generic form\n pseudo-response : y ∗ = y + har (p)\n pseudo-totals : m∗ = m + hat (p),\n where h is the leverage corresponding to y. The general expressions for ar (p) (\"r\" for \"response\")\n and at (p) (\"t\" for \"totals\") are:\n modified-scores approach\n ar (p) = d0 (p)/(2w(p))\n at (p) = 0,\n maximum penalized likelihood approach\n ar (p) = d0 (p)/w(p) + p − 0.5\n at (p) = 0.\n For supplying (y ∗ , m∗ ) in glm.fit (as is done by brglm.fit), an essential requirement for the\n pseudo-data representation is that it should mimic the behaviour of the original responses and totals,\n i.e. 0 ≤ y ∗ ≤ m∗ . Since h ∈ [0, 1], the requirement translates to 0 ≤ ar (p) ≤ at (p) for every\n p ∈ (0, 1). However, the above definitions of ar (p) and at (p) do not necessarily respect this\n requirement.\n On the other hand, the pair (ar (p), at (p)) is not unique in the sense that for a given link function\n and once the link-specific structure of the pair has been extrapolated, there is a class of equivalent\n pairs that can be resulted following only the following two rules:\n • add and subtract the same quantity from either ar (p) or at (p).\n • if a quantity is to be moved from ar (p) to at (p) it first has to be divided by −p.\n For example, in the case of penalized maximum likelihood, the pairs (d0 (p)/w(p) + p − 0.5, 0)\n and (d0 (p)/w(p) + p, 0.5/p) are equivalent, in the sense that if the corresponding pseudo-data\n representations are substituted in the ordinary scores both return the same expression.\n So, in order to construct a pseudo-data representation that corresponds to a user-specified link func-\n tion and has the property 0 ≤ ar (p) ≤ at (p) for every p ∈ (0, 1), one merely has to pursue a simple\n algebraic calculation on the initial pair (ar (p), at (p)) using only the two aforementioned rules until\n an appropriate pair is resulted. There is always a pair!\n Once the pair has been found the following steps should be followed.\n 1. For a user-specified link function the user has to write a modification function with name\n \"br.custom.family\" or \"pml.custom.family\" for pl=FALSE or pl=TRUE, respectively. The func-\n tion should take as argument the probabilities p and return a list of two vectors with same\n length as p and with names c(\"ar\", \"at\"). The result corresponds to the pair (ar (p), at (p)).\n 2. Check if the custom-made modifications function is appropriate. This can be done via the\n function checkModifications which has arguments fun (the function to be tested) and Length\n with default value Length=100. Length is to be used when the user-specified link function\n takes as argument a vector of values (e.g. the logexp link in ?family). Then the value of\n Length should be the length of that vector.\n 3. Put the function in the search patch so that modifications can find it.\n 4. brglm can now be used with the custom family as glm would be used.\nNote\n The user could also deviate from modified-scores and maximum penalized likelihood and exper-\n iment with implemented (or not) links, e.g. probit, constructing his own pseudo-data represen-\n tations of the aforementioned general form. This could be done by changing the link name, e.g.\n by\n probitt <- make.link(probit) ; probitt$name <- \"probitt\"\n and then setting a custom br.custom.family that does not necessarily depend on the probit link.\n Then, brglm could be used with pl=FALSE.\n A further generalization would be to completely remove the hat value h in the generic expression of\n the pseudo-data representation and have general additive modifications that depend on p. To do this\n divide both ar and at by pmax(get(\"hats\",parent.frame()),.Machine\\$double.eps) within\n the custom modification function (see also Examples).\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n Kosmidis, I. (2007). Bias reduction in exponential family nonlinear models. PhD Thesis, Depart-\n ment of Statistics, University of Warwick.\nSee Also\n brglm, brglm.fit\nExamples\n ## Begin Example 1\n ## logistic exposure model, following the Example in ?family. See,\n ## . 2004. Auk 121(2): 526-540.\n # Definition of the link function\n logexp <- function(days = 1) {\n linkfun <- function(mu) qlogis(mu^(1/days))\n linkinv <- function(eta) plogis(eta)^days\n mu.eta <- function(eta) days * plogis(eta)^(days-1) *\n binomial()$mu.eta(eta)\n valideta <- function(eta) TRUE\n link <- paste(\"logexp(\", days, \")\", sep=\"\")\n structure(list(linkfun = linkfun, linkinv = linkinv,\n mu.eta = mu.eta, valideta = valideta, name = link),\n class = \"link-glm\")\n }\n # Here d(p) = days * p * ( 1 - p^(1/days) )\n # d'(p) = (days - (days+1) * p^(1/days)) * d(p)\n # w(p) = days^2 * p * (1-p^(1/days))^2 / (1-p)\n # Initial modifications, as given from the general expressions above:\n br.custom.family <- function(p) {\n etas <- binomial(logexp(.days))$linkfun(p)\n # the link function argument `.days' will be detected by lexical\n # scoping. So, make sure that the link-function inputted arguments\n # have unusual names, like `.days' and that\n # the link function enters `brglm' as\n # `family=binomial(logexp(.days))'.\n list(ar = 0.5*(1-p)-0.5*(1-p)*exp(etas)/.days,\n at = 0*p/p) # so that to fix the length of at\n }\n .days <-3\n # `.days' could be a vector as well but then it should have the same\n # length as the number of observations (`length(.days)' should be\n # equal to `length(p)'). In this case, `checkModifications' should\n # have argument `Length=length(.days)'.\n #\n # Check:\n ## Not run: checkModifications(br.custom.family)\n # OOOPS error message... the condition is not satisfied\n #\n # After some trivial algebra using the two allowed operations, we\n # get new modifications:\n br.custom.family <- function(p) {\n etas <- binomial(logexp(.days))$linkfun(p)\n list(ar=0.5*p/p, # so that to fix the length of ar\n at=0.5+exp(etas)*(1-p)/(2*p*.days))\n }\n # Check:\n checkModifications(br.custom.family)\n # It is OK.\n # Now,\n modifications(binomial(logexp(.days)))\n # works.\n # Notice that for `.days <- 1', `logexp(.days)' is the `logit' link\n # model and `a_r=0.5', `a_t=1'.\n # In action:\n library(MASS)\n example(birthwt)\n m.glm <- glm(formula = low ~ ., family = binomial, data = bwt)\n .days <- bwt$age\n m.glm.logexp <- update(m.glm,family=binomial(logexp(.days)))\n m.brglm.logexp <- brglm(formula = low ~ ., family =\n binomial(logexp(.days)), data = bwt)\n # The fit for the `logexp' link via maximum likelihood\n m.glm.logexp\n # and the fit for the `logexp' link via modified scores\n m.brglm.logexp\n ## End Example\n ## Begin Example 2\n ## Another possible use of brglm.fit:\n ## Deviating from bias reducing modified-scores:\n ## Add 1/2 to the response of a probit model.\n y <- c(1,2,3,4)\n totals <- c(5,5,5,5)\n x1 <- c(1,0,1,0)\n x2 <- c(1,1,0,0)\n my.probit <- make.link(\"probit\")\n my.probit$name <- \"my.probit\"\n br.custom.family <- function(p) {\n h <- pmax(get(\"hats\",parent.frame()),.Machine$double.eps)\n list(ar=0.5/h,at=1/h)\n }\n m1 <- brglm(y/totals~x1+x2,weights=totals,family=binomial(my.probit))\n m2 <- glm((y+0.5)/(totals+1)~x1+x2,weights=totals+1,family=binomial(probit))\n # m1 and m2 should be the same.\n # End example\n # Begin example 3: Maximum penalized likelihood for logistic regression,\n # with the penalty being a powerof the Jeffreys prior (`.const` below)\n # Setup a custom logit link\n mylogit <- make.link(\"logit\")\n mylogit$name <- \"mylogit\"\n ## Set-up the custom family\n br.custom.family <- function(p) {\n list(ar = .const * p/p, at = 2 * .const * p/p)\n }\n data(\"lizards\")\n ## The reduced-bias fit is\n .const <- 1/2\n brglm(cbind(grahami, opalinus) ~ height + diameter +\n light + time, family = binomial(mylogit), data=lizards)\n ## which is the same as what brglm does by default for logistic regression\n brglm(cbind(grahami, opalinus) ~ height + diameter +\n light + time, family = binomial(logit), data=lizards)\n ## Stronger penalization (e.g. 5/2) can be achieved by\n .const <- 5/2\n brglm(cbind(grahami, opalinus) ~ height + diameter +\n light + time, family = binomial(mylogit), data=lizards)\n # End example\n plot.profile.brglm Plot methods for ’profile.brglm’ objects\nDescription\n plot.profile.brglm plots the objects of class \"profileModel\" that are contained in an object\n of class \"profile.brglm\". pairs.profile.brglm is a diagnostic tool that plots pairwise profile\n traces.\nUsage\n ## S3 method for class 'profile.brglm'\n plot(x, signed = FALSE, interpolate = TRUE,\n n.interpolations = 100, print.grid.points = FALSE, ...)\n ## S3 method for class 'profile.brglm'\n pairs(x, colours = 2:3, ...)\nArguments\n x a \"profile.brglm\" object.\n signed as in plot.profileModel.\n interpolate as in plot.profileModel.\n n.interpolations\n as in plot.profileModel.\n print.grid.points\n as in plot.profileModel.\n colours as in plot.profileModel.\n ... further arguments passed to or from other methods.\nDetails\n See Details in plot.profileModel.\nAuthor(s)\n , <>\nSee Also\n plot.profileModel, profile.brglm.\nExamples\n # see example in 'confint.brglm'.\n profile.brglm Calculate profiles for objects of class ’brglm’.\nDescription\n Creates \"profile.brglm\" objects to be used for the calculation of confidence intervals and for\n plotting.\nUsage\n ## S3 method for class 'brglm'\n profile(fitted, gridsize = 10, stdn = 5,\n stepsize = 0.5, level = 0.95,\n which = 1:length(coef(fitted)), verbose = TRUE,\n zero.bound = 1e-08, scale = FALSE, ...)\nArguments\n fitted an object of class \"brglm\".\n gridsize as in profileModel.\n stdn as in profileModel.\n stepsize as in profileModel.\n level qchisq(level,1) indicates the range that the profiles must cover.\n which as in profileModel.\n verbose as in profileModel.\n zero.bound as in profileModel.\n scale as in profileModel.\n ... further arguments passed to or from other methods.\nDetails\n profile.brglm calculates the profiles of the appropriate objectives to be used for the construction\n of confidence intervals for the bias-reduced estimates (see confint.brglm for the objectives that\n are profiled).\nValue\n An object of class \"profile.glm\" with attribute “level” corresponding to the argument level. The\n object supports the methods print, plot, pairs and confint and it is a list of the components:\n profilesML a \"profileModel\" object containing the profiles of the ordinary deviance for\n the maximum likelihood fit corresponding to fitted.\n profilesBR NULL if method = \"glm.fit\" in brglm. If method = \"brglm.fit\" and pl =\n TRUE, profilesBR is a \"profileModel\" object containing the profiles of the\n penalized deviance for the parameters of fitted. If method = \"brglm.fit\"\n and pl = FALSE profilesBR is a \"profileModel\" object containing the profiles\n of the modified score statistic (see profileObjectives) for the parameters of\n fitted.\nNote\n Objects of class \"profile.brglm\" support the methods:\n • printwhich prints the \"level\" attribute of the object, as well as the supported methods.\n • confintsee confint.brglm.\n • plotsee plot.profile.brglm.\n • pairssee plot.profile.brglm.\nAuthor(s)\n , <>\nSee Also\n profileModel, profile.brglm.\nExamples\n # see example in 'confint.brglm'.\n profileObjectives-brglm\n Objectives to be profiled\nDescription\n Objectives that are used in profile.brglm\nUsage\n penalizedDeviance(fm, X, dispersion = 1)\n modifiedScoreStatistic(fm, X, dispersion = 1)\nArguments\n fm the restricted fit.\n X the model matrix of the fit on all parameters.\n dispersion the dispersion parameter.\nDetails\n These objectives follow the specifications for objectives in the profileModel package and are used\n from profile.brglm.\n penalizedDeviance returns a deviance-like value corresponding to a likelihood function penalized\n by Jeffreys invariant prior. It has been used by Heinze & Schemper (2002) and by Bull et. al. (2002)\n for the construction of confidence intervals for the bias-reduced estimates in logistic regression. The\n X argument is the model matrix of the full (not the restricted) fit.\n modifiedScoreStatistic mimics RaoScoreStatistic in profileModel, but with the ordinary\n scores replaced with the modified scores used for bias reduction. The argument X has the same\n interpretation as for penalizedDeviance.\nValue\n A scalar.\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n ., . and . (2007). Confidence intervals for multinomial logistic\n regression in sparse data. Statistics in Medicine 26, 903–918.\n . and . (2002). A solution to the problem of separation in logistic regression.\n Statistics in Medicine 21, 2409–2419.\nSee Also\n profileModel, profile.brglm.\n separation.detection Separation Identification.\nDescription\n Provides a tool for identifying whether or not separation has occurred.\nUsage\n separation.detection(fit, nsteps = 30)\nArguments\n fit the result of a glm call.\n nsteps Starting from maxit = 1, the GLM is refitted for maxit = 2, maxit = 3, . . . ,\n maxit = nsteps. Default value is 30.\nDetails\n Identifies separated cases for binomial-response GLMs, by refitting the model. At each iteration\n the maximum number of allowed IWLS iterations is fixed starting from 1 to nsteps (by setting\n control = glm.control(maxit = j), where j takes values 1, . . . , nsteps in glm). For each value\n of maxit, the estimated asymptotic standard errors are divided to the corresponding ones resulted\n for control = glm.control(maxit = 1). Based on the results in Lesaffre & Albert (1989), if the\n sequence of ratios in any column of the resulting matrix diverges, then separation occurs and the\n maximum likelihood estimate for the corresponding parameter has value minus or plus infinity.\nValue\n A matrix of dimension nsteps by length(coef(fit)), that contains the ratios of the estimated\n asymptotic standard errors.\nAuthor(s)\n , <>\nReferences\n . and . (2021). Jeffreys-prior penalty, finiteness and shrinkage in binomial-\n response generalized linear models. Biometrika, 108, 71–82.\n Lesaffre, E. and . (1989). Partial separation in logistic discrimination. J. R. Statist. Soc.\n B, 51, 109–116.\nExamples\n ## Begin Example\n y <- c(1,1,0,0)\n totals <- c(2,2,2,2)\n x1 <- c(1,0,1,0)\n x2 <- c(1,1,0,0)\n m1 <- glm(y/totals ~ x1 + x2, weights = totals, family = binomial())\n # No warning from glm...\n m1\n # However estimates for (Intercept) and x2 are unusually large in\n # absolute value... Investigate further:\n #\n separation.detection(m1,nsteps=30)\n # Note that the values in the column for (Intercept) and x2 diverge,\n # while for x1 converged. Hence, separation has occurred and the\n # maximum lieklihood estimate for (Intercept) is minus infinity and\n # for x2 is plus infinity. The signs for infinity are taken from the\n # signs of (Intercept) and x1 in coef(m1).\n24 separation.detection\n ## End Example"}}},{"rowIdx":462,"cells":{"project":{"kind":"string","value":"ckb-metrics-config"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate ckb_metrics_config\n===\n\nCKB metrics configurations.\n\nThis crate is used to configure the CKB metrics service.\n\nStructs\n---\n\n* ConfigThe whole CKB metrics configuration.\n* ExporterThe configuration of an exporter.\n\nEnums\n---\n\n* TargetThe target to output the metrics data.\n\nCrate ckb_metrics_config\n===\n\nCKB metrics configurations.\n\nThis crate is used to configure the CKB metrics service.\n\nStructs\n---\n\n* ConfigThe whole CKB metrics configuration.\n* ExporterThe configuration of an exporter.\n\nEnums\n---\n\n* TargetThe target to output the metrics data.\n\nStruct ckb_metrics_config::Config\n===\n\n\n```\npub struct Config {\n pub exporter: HashMap,\n}\n```\nThe whole CKB metrics configuration.\n\nThis struct is used to configure CKB metrics service.\n\nAn example which is used in `ckb.toml`:\n---\n```\n[metrics.exporter.prometheus]\ntarget = { type = \"prometheus\", listen_address = \"127.0.0.1:8100\" }\n```\nFields\n---\n\n`exporter: HashMap`Stores all exporters configurations.\n\nTrait Implementations\n---\n\n### impl Clone for Config\n\n#### fn clone(&self) -> Config\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Config\n\nReturns the “default value” for a type. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Config\n\n### impl Send for Config\n\n### impl Sync for Config\n\n### impl Unpin for Config\n\n### impl UnwindSafe for Config\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct ckb_metrics_config::Exporter\n===\n\n\n```\npub struct Exporter {\n pub target: Target,\n}\n```\nThe configuration of an exporter.\n\nFields\n---\n\n`target: Target`How to output the metrics data.\n\nTrait Implementations\n---\n\n### impl Clone for Exporter\n\n#### fn clone(&self) -> Exporter\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Exporter\n\n### impl Send for Exporter\n\n### impl Sync for Exporter\n\n### impl Unpin for Exporter\n\n### impl UnwindSafe for Exporter\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nEnum ckb_metrics_config::Target\n===\n\n\n```\npub enum Target {\n Prometheus {\n listen_address: String,\n },\n}\n```\nThe target to output the metrics data.\n\nVariants\n---\n\n### Prometheus\n\n#### Fields\n\n`listen_address: String`The HTTP listen address.\n\nOutputs the metrics data through Prometheus.\n\nTrait Implementations\n---\n\n### impl Clone for Target\n\n#### fn clone(&self) -> Target\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Target\n\n### impl Send for Target\n\n### impl Sync for Target\n\n### impl Unpin for Target\n\n### impl UnwindSafe for Target\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,"}}},{"rowIdx":463,"cells":{"project":{"kind":"string","value":"PointersAndMemory.pdf"},"source":{"kind":"string","value":"free_programming_book"},"language":{"kind":"string","value":"Unknown"},"content":{"kind":"string","value":"Pointers and Memory\nBy Copyright 1998-2000, Abstract\nThis document explains how pointers and memory work and how to use themfrom the basic concepts through all the major programming techniques. For each topic there is a combination of discussion, sample C code, and drawings.\nAudience This document can be used as an introduction to pointers for someone with basic programming experience. Alternately, it can be used to review and to fill in gaps for someone with a partial understanding of pointers and memory. Many advanced programming and debugging problems only make sense with a complete understanding of pointers and memory this document tries to provide that understanding. This document concentrates on explaining how pointers work. For more advanced pointer applications and practice problems, see the other resources below.\nPace Like most CS Education Library documents, the coverage here tries to be complete but fast. The document starts with the basics and advances through all the major topics. The pace is fairly quick each basic concept is covered once and usually there is some example code and a memory drawing. Then the text moves on to the next topic. For more practice, you can take the time to work through the examples and sample problems. Also,\nsee the references below for more practice problems.\nTopics Topics include: pointers, local memory, allocation, deallocation, dereference operations,\npointer assignment, deep vs. shallow copies, the ampersand operator (&), bad pointers,\nthe NULL pointer, value parameters, reference parameters, heap allocation and deallocation, memory ownership models, and memory leaks. The text focuses on pointers and memory in compiled languages like C and C++. At the end of each section, there is some related but optional material, and in particular there are occasional notes on other languages, such as Java.\nPointers and Memory document #102 in the Stanford CS Education Library. This and other free educational materials are available at http://cslibrary.stanford.edu/102/. This document is free to be used, reproduced, sold, or retransmitted so long as this notice is clearly reproduced at its beginning.\nOther CS Education Library Documents\n Point Fun With Binky Video (http://cslibrary.stanford.edu/104/)\nA silly video about pointer basics.\n Linked list Basics (http://cslibrary.stanford.edu/103/)\nIntroduces the basic techniques for building linked lists in C.\n2\n Linked List Problems (http://cslibrary.stanford.edu/105/)\n18 classic linked list problems with solutions a great way to practice with realistic, pointer intensive C code, and there's just no substitute for practice!\n Essential C (http://cslibrary.stanford.edu/101/)\nComplete coverage of the C language, including all of the syntax used in this document.\nTable of Contents Section 1 Basic Pointers... pg. 3 The basic rules and drawings for pointers: pointers, pointees, pointer assignment (=), pointer comparison (==), the ampersand operator (&), the NULL pointer, bad pointers, and bad dereferences.\nSection 2 Local Memory ... pg. 11 How local variables and parameters work: local storage, allocation,\ndeallocation, the ampersand bug. Understanding the separation of local memory between separate functions.\nSection 3 Reference Parameters... pg. 17 Combines the previous two sections to show how a function can use\n\"reference parameters\" to communicate back to its caller.\nSection 4 Heap Memory ... pg. 24 Builds on all the previous sections to explain dynamic heap memory: heap allocation, heap deallocation, array allocation, memory ownership models,\nand memory leaks.\nEdition The first edition of this document was on Jan 19, 1999. This Feb 21, 2000 edition represents only very minor changes. The author may be reached at . The CS Education Library may be reached at .\nDedication This document is distributed for the benefit and education of all. That someone seeking education should have the opportunity to find it. May you learn from it in the spirit in which it is given to make efficiency and beauty in your designs, peace and fairness in your actions.\nPreface To The First Edition This article has appeared to hover at around 80% done for 6 months! Every time I add one section, I think of two more which also need to be written. I was motivated to keep working on it since there are so many other articles which use memory, &, ... in passing where I wanted something to refer to. I hope you find it valuable in its current form. I'm going to ship it quickly before I accidentally start adding another section!\n3 Section 1\nBasic Pointers Pointers Before and After There's a lot of nice, tidy code you can write without knowing about pointers. But once you learn to use the power of pointers, you can never go back. There are too many things that can only be done with pointers. But with increased power comes increased responsibility. Pointers allow new and more ugly types of bugs, and pointer bugs can crash in random ways which makes them more difficult to debug. Nonetheless, even with their problems, pointers are an irresistibly powerful programming construct. (The following explanation uses the C language syntax where a syntax is required; there is a discussion of Java at the section.)\nWhy Have Pointers?\nPointers solve two common software problems. First, pointers allow different sections of code to share information easily. You can get the same effect by copying information back and forth, but pointers solve the problem better. Second, pointers enable complex\n\"linked\" data structures like linked lists and binary trees.\nWhat Is A Pointer?\nSimple int and float variables operate pretty intuitively. An int variable is like a box which can store a single int value such as 42. In a drawing, a simple variable is a box with its current value drawn inside.\nnum 42\nA pointer works a little differently it does not store a simple value directly. Instead, a pointer stores a reference to another value. The variable the pointer refers to is sometimes known as its \"pointee\". In a drawing, a pointer is a box which contains the beginning of an arrow which leads to its pointee. (There is no single, official, word for the concept of a pointee pointee is just the word used in these explanations.)\nThe following drawing shows two variables: num and numPtr. The simple variable num contains the value 42 in the usual way. The variable numPtr is a pointer which contains a reference to the variable num. The numPtr variable is the pointer and num is its pointee. What is stored inside of numPtr? Its value is not an int. Its value is a reference to an int.\nnum numPtr\n42 A simple int variable. The current value is the integer 42. This variable also plays the role of pointee for the pointer below.\nA pointer variable. The current value is a reference to the pointee num above.\n4 Pointer Dereference The \"dereference\" operation follows a pointer's reference to get the value of its pointee.\nThe value of the dereference of numPtr above is 42. When the dereference operation is used correctly, it's simple. It just accesses the value of the pointee. The only restriction is that the pointer must have a pointee for the dereference to access. Almost all bugs in pointer code involve violating that one restriction. A pointer must be assigned a pointee before dereference operations will work.\nThe NULL Pointer The constant NULL is a special pointer value which encodes the idea of \"points to nothing.\" It turns out to be convenient to have a well defined pointer value which represents the idea that a pointer does not have a pointee. It is a runtime error to dereference a NULL pointer. In drawings, the value NULL is usually drawn as a diagonal line between the corners of the pointer variable's box...\nnumPtr The C language uses the symbol NULL for this purpose. NULL is equal to the integer constant 0, so NULL can play the role of a boolean false. Official C++ no longer uses the NULL symbolic constant use the integer constant 0 directly. Java uses the symbol null.\nPointer Assignment The assignment operation (=) between two pointers makes them point to the same pointee. It's a simple rule for a potentially complex situation, so it is worth repeating:\nassigning one pointer to another makes them point to the same thing. The example below adds a second pointer, second, assigned with the statement second = numPtr;.\nThe result is that second points to the same pointee as numPtr. In the drawing, this means that the second and numPtr boxes both contain arrows pointing to num.\nAssignment between pointers does not change or even touch the pointees. It just changes which pointee a pointer refers to.\nnum numPtr\nsecond 42\nA second pointer ptr initialized with the assignment second = numPtr;. This causes second to refer to the same pointeee as numPtr.\nAfter assignment, the == test comparing the two pointers will return true. For example\n(second==numPtr) above is true. The assignment operation also works with the NULL value. An assignment operation with a NULL pointer copies the NULL value from one pointer to another.\nMake A Drawing Memory drawings are the key to thinking about pointer code. When you are looking at code, thinking about how it will use memory at run time....make a quick drawing to work out your ideas. This article certainly uses drawings to show how pointers work. That's the way to do it.\n5 Sharing\nTwo pointers which both refer to a single pointee are said to be \"sharing\". That two or more entities can cooperatively share a single memory structure is a key advantage of pointers in all computer languages. Pointer manipulation is just technique sharing is often the real goal. In Section 3 we will see how sharing can be used to provide efficient communication between parts of a program.\nShallow and Deep Copying In particular, sharing can enable communication between two functions. One function passes a pointer to the value of interest to another function. Both functions can access the value of interest, but the value of interest itself is not copied. This communication is called \"shallow\" since instead of making and sending a (large) copy of the value of interest, a (small) pointer is sent and the value of interest is shared. The recipient needs to understand that they have a shallow copy, so they know not to change or delete it since it is shared. The alternative where a complete copy is made and sent is known as a \"deep\"\ncopy. Deep copies are simpler in a way, since each function can change their copy without interfering with the other copy, but deep copies run slower because of all the copying.\nThe drawing below shows shallow and deep copying between two functions, A() and B().\nIn the shallow case, the smiley face is shared by passing a pointer between the two. In the deep case, the smiley face is copied, and each function gets their own...\nShallow / Sharing Deep / Copying A()\nA()\nB()\nB()\nSection 2 will explain the above sharing technique in detail.\nBad Pointers When a pointer is first allocated, it does not have a pointee. The pointer is \"uninitialized\"\nor simply \"bad\". A dereference operation on a bad pointer is a serious runtime error. If you are lucky, the dereference operation will crash or halt immediately (Java behaves this way). If you are unlucky, the bad pointer dereference will corrupt a random area of memory, slightly altering the operation of the program so that it goes wrong some indefinite time later. Each pointer must be assigned a pointee before it can support dereference operations. Before that, the pointer is bad and must not be used. In our memory drawings, the bad pointer value is shown with an XXX value...\nnumPtr Bad pointers are very common. In fact, every pointer starts out with a bad value.\nCorrect code overwrites the bad value with a correct reference to a pointee, and thereafter the pointer works fine. There is nothing automatic that gives a pointer a valid pointee.\n6 Quite the opposite most languages make it easy to omit this important step. You just have to program carefully. If your code is crashing, a bad pointer should be your first suspicion.\nPointers in dynamic languages such as Perl, LISP, and Java work a little differently. The run-time system sets each pointer to NULL when it is allocated and checks it each time it is dereferenced. So code can still exhibit pointer bugs, but they will halt politely on the offending line instead of crashing haphazardly like C. As a result, it is much easier to locate and fix pointer bugs in dynamic languages. The run-time checks are also a reason why such languages always run at least a little slower than a compiled language like C or C++.\nTwo Levels One way to think about pointer code is that operates at two levels pointer level and pointee level. The trick is that both levels need to be initialized and connected for things to work. (1) the pointer must be allocated, (1) the pointee must be allocated, and (3) the pointer must be assigned to point to the pointee. It's rare to forget step (1). But forget (2)\nor (3), and the whole thing will blow up at the first dereference. Remember to account for both levels make a memory drawing during your design to make sure it's right.\nSyntax The above basic features of pointers, pointees, dereferencing, and assigning are the only concepts you need to build pointer code. However, in order to talk about pointer code, we need to use a known syntax which is about as interesting as....a syntax. We will use the C language syntax which has the advantage that it has influenced the syntaxes of several languages.\nPointer Type Syntax A pointer type in C is just the pointee type followed by a asterisk (*)...\nint*\ntype: pointer to int float*\ntype: pointer to float struct fraction*\ntype: pointer to struct fraction struct fraction**\ntype: pointer to struct fraction*\nPointer Variables Pointer variables are declared just like any other variable. The declaration gives the type and name of the new variable and reserves memory to hold its value. The declaration does not assign a pointee for the pointer the pointer starts out with a bad value.\nint* numPtr;\n// Declare the int* (pointer to int) variable \"numPtr\".\n// This allocates space for the pointer, but not the pointee.\n// The pointer starts out \"bad\".\n7 The & Operator Reference To There are several ways to compute a reference to a pointee suitable for storing in a pointer. The simplest way is the & operator. The & operator can go to the left of any variable, and it computes a reference to that variable. The code below uses a pointer and an & to produce the earlier num/numPtr example.\nnum 42\nnumPtr void NumPtrExample() {\nint num;\nint* numPtr;\nnum = 42;\nnumPtr = &num; // Compute a reference to \"num\", and store it in numPtr\n// At this point, memory looks like drawing above\n}\nIt is possible to use & in a way which compiles fine but which creates problems at run time the full discussion of how to correctly use & is in Section 2. For now we will just use & in a simple way.\nThe * Operator Dereference The star operator (*) dereferences a pointer. The * is a unary operator which goes to the left of the pointer it dereferences. The pointer must have a pointee, or it's a runtime error.\nExample Pointer Code With the syntax defined, we can now write some pointer code that demonstrates all the pointer rules...\nvoid PointerTest() {\n// allocate three integers and two pointers int a = 1;\nint b = 2;\nint c = 3;\nint* p;\nint* q;\n// Here is the state of memory at this point.\n// T1 -- Notice that the pointers start out bad...\np = &a;\na 1\np b\n2 q\nc 3\n// set p to refer to a\n8 q = &b;\n// set q to refer to b\n// T2 -- The pointers now have pointees a\n1 p\nb 2\nq c\n3\n// Now we mix things up a bit...\nc = *p; // retrieve p's pointee value (1) and put it in c p = q;\n// change p to share with q (p's pointee is now b)\n*p = 13; // dereference p to set its pointee (b) to 13 (*q is now 13)\n// T3 -- Dereferences and assignments mix things up a\n1 p\nb 13\nq c\n1\n}\nBad Pointer Example Code with the most common sort of pointer bug will look like the above correct code, but without the middle step where the pointers are assigned pointees. The bad code will compile fine, but at run-time, each dereference with a bad pointer will corrupt memory in some way. The program will crash sooner or later. It is up to the programmer to ensure that each pointer is assigned a pointee before it is used. The following example shows a simple example of the bad code and a drawing of how memory is likely to react...\nvoid BadPointer() {\nint* p;\n// allocate the pointer, but not the pointee\n*p = 42;\n// this dereference is a serious runtime error\n}\n// What happens at runtime when the bad pointer is dereferenced...\np Pow!\n9 Pointer Rules Summary No matter how complex a pointer structure gets, the list of rules remains short.\n A pointer stores a reference to its pointee. The pointee, in turn, stores something useful.\n The dereference operation on a pointer accesses its pointee. A pointer may only be dereferenced after it has been assigned to refer to a pointee. Most pointer bugs involve violating this one rule.\n Allocating a pointer does not automatically assign it to refer to a pointee.\nAssigning the pointer to refer to a specific pointee is a separate operation which is easy to forget.\n Assignment between two pointers makes them refer to the same pointee which introduces sharing.\nSection 1 Extra Optional Material Extra: How Do Pointers Work In Java Java has pointers, but they are not manipulated with explicit operators such as * and &. In Java, simple data types such as int and char operate just as in C. More complex types such as arrays and objects are automatically implemented using pointers. The language automatically uses pointers behind the scenes for such complex types, and no pointer specific syntax is required. The programmer just needs to realize that operations like a=b; will automatically be implemented with pointers if a and b are arrays or objects. Or put another way, the programmer needs to remember that assignments and parameters with arrays and objects are intrinsically shallow or shared see the Deep vs. Shallow material above. The following code shows some Java object references. Notice that there are no *'s or &'s in the code to create pointers. The code intrinsically uses pointers. Also,\nthe garbage collector (Section 4), takes care of the deallocation automatically at the end of the function.\npublic void JavaShallow() {\nFoo a = new Foo();\n// Create a Foo object (no * in the declaration)\nFoo b = new Foo();\n// Create another Foo object b=a;\n// This is automatically a shallow assignment -// a and b now refer to the same object.\na.Bar(); // This could just as well be written b.Bar();\n// There is no memory leak here -- the garbage collector\n// will automatically recycle the memory for the two objects.\n}\nThe Java approach has two main features...\nFewer bugs. Because the language implements the pointer manipulation accurately and automatically, the most common pointer bug are no longer possible, Yay! Also, the Java runtime system checks each pointer value every time it is used, so NULL pointer dereferences are caught immediately on the line where they occur. This can make a programmer much more productive.\n10\nSlower. Because the language takes responsibility for implementing so much pointer machinery at runtime, Java code runs slower than the equivalent C code. (There are other reasons for Java to run slowly as well.\nThere is active research in making Java faser in interesting ways the Sun \"Hot Spot\" project.) In any case, the appeal of increased programmer efficiency and fewer bugs makes the slowness worthwhile for some applications.\nExtra: How Are Pointers Implemented In The Machine?\nHow are pointers implemented? The short explanation is that every area of memory in the machine has a numeric address like 1000 or 20452. A pointer to an area of memory is really just an integer which is storing the address of that area of memory. The dereference operation looks at the address, and goes to that area of memory to retrieve the pointee stored there. Pointer assignment just copies the numeric address from one pointer to another. The NULL value is generally just the numeric address 0 the computer just never allocates a pointee at 0 so that address can be used to represent NULL. A bad pointer is really just a pointer which contains a random address just like an uninitialized int variable which starts out with a random int value. The pointer has not yet been assigned the specific address of a valid pointee. This is why dereference operations with bad pointers are so unpredictable. They operate on whatever random area of memory they happen to have the address of.\nExtra: The Term \"Reference\"\nThe word \"reference\" means almost the same thing as the word \"pointer\". The difference is that \"reference\" tends to be used in a discussion of pointer issues which is not specific to any particular language or implementation. The word \"pointer\" connotes the common C/C++ implementation of pointers as addresses. The word \"reference\" is also used in the phrase \"reference parameter\" which is a technique which uses pointer parameters for twoway communication between functions this technique is the subject of Section 3.\nExtra: Why Are Bad Pointer Bugs So Common?\nWhy is it so often the case that programmers will allocate a pointer, but forget to set it to refer to a pointee? The rules for pointers don't seem that complex, yet every programmer makes this error repeatedly. Why? The problem is that we are trained by the tools we use.\nSimple variables don't require any extra setup. You can allocate a simple variable, such as int, and use it immediately. All that int, char, struct fraction code you have written has trained you, quite reasonably, that a variable may be used once it is declared.\nUnfortunately, pointers look like simple variables but they require the extra initialization before use. It's unfortunate, in a way, that pointers happen look like other variables, since it makes it easy to forget that the rules for their use are very different. Oh well. Try to remember to assign your pointers to refer to pointees. Don't be surprised when you forget.\n11 Section 2\nLocal Memory Thanks For The Memory Local variables are the programming structure everyone uses but no one thinks about.\nYou think about them a little when first mastering the syntax. But after a few weeks, the variables are so automatic that you soon forget to think about how they work. This situation is a credit to modern programming languages most of the time variables appear automatically when you need them, and they disappear automatically when you are finished. For basic programming, this is a fine situation. However, for advanced programming, it's going to be useful to have an idea of how variables work...\nAllocation And Deallocation Variables represent storage space in the computer's memory. Each variable presents a convenient names like length or sum in the source code. Behind the scenes at runtime,\neach variable uses an area of the computer's memory to store its value. It is not the case that every variable in a program has a permanently assigned area of memory. Instead,\nmodern languages are smart about giving memory to a variable only when necessary. The terminology is that a variable is allocated when it is given an area of memory to store its value. While the variable is allocated, it can operate as a variable in the usual way to hold a value. A variable is deallocated when the system reclaims the memory from the variable, so it no longer has an area to store its value. For a variable, the period of time from its allocation until its deallocation is called its lifetime.\nThe most common memory related error is using a deallocated variable. For local variables, modern languages automatically protect against this error. With pointers, as we will see however, the programmer must make sure that allocation is handled correctly..\nLocal Memory The most common variables you use are \"local\" variables within functions such as the variables num and result in the following function. All of the local variables and parameters taken together are called its \"local storage\" or just its \"locals\", such as num and result in the following code...\n// Local storage example int Square(int num) {\nint result;\nresult = num * num;\nreturn result;\n}\nThe variables are called \"local\" to capture the idea that their lifetime is tied to the function where they are declared. Whenever the function runs, its local variables are allocated. When the function exits, its locals are deallocated. For the above example, that means that when the Square() function is called, local storage is allocated for num and result. Statements like result = num * num; in the function use the local storage. When the function finally exits, its local storage is deallocated.\n12 Here is a more detailed version of the rules of local storage...\n1. When a function is called, memory is allocated for all of its locals. In other words, when the flow of control hits the starting '{' for the function, all of its locals are allocated memory. Parameters such as num and local variables such as result in the above example both count as locals. The only difference between parameters and local variables is that parameters start out with a value copied from the caller while local variables start with random initial values. This article mostly uses simple int variables for its examples, however local allocation works for any type: structs, arrays...\nthese can all be allocated locally.\n2. The memory for the locals continues to be allocated so long as the thread of control is within the owning function. Locals continue to exist even if the function temporarily passes off the thread of control by calling another function. The locals exist undisturbed through all of this.\n3. Finally, when the function finishes and exits, its locals are deallocated.\nThis makes sense in a way suppose the locals were somehow to continue to exist how could the code even refer to them? The names like num and result only make sense within the body of Square()\nanyway. Once the flow of control leaves that body, there is no way to refer to the locals even if they were allocated. That locals are available\n(\"scoped\") only within their owning function is known as \"lexical scoping\" and pretty much all languages do it that way now.\nSmall Locals Example Here is a simple example of the lifetime of local storage...\nvoid Foo(int a) { // (1) Locals (a, b, i, scores) allocated when Foo runs int i;\nfloat scores[100];\n// This array of 100 floats is allocated locally.\na = a + 1; // (2) Local storage is used by the computation for (i=0; i Example Suppose functions A() and B() both do computations involving ' net worth measured in billions of dollars the value of interest for this problem. A() is the main function and its stores the initial value (about 55 as of 1998). A() calls B() which tries to add 1 to the value of interest.\nBill Gates By Value Here is the code and memory drawing for a simple, but incorrect implementation where A() and B() use pass by value. Three points in time, T1, T2, and T3 are marked in the code and the state of memory is shown for each state...\nvoid B(int worth) {\nworth = worth + 1;\n// T2\n}\nvoid A() {\nint netWorth;\nnetWorth = 55; // T1 B(netWorth);\n// T3 -- B() did not change netWorth\n}\nT1 -- The value of interest netWorth is local to A().\nT2 -- netWorth is copied to B()'s local worth. B()\nchanges its local worth from 55 to 56.\nB()\nA() netWorth 55 T3 -- B() exits and its local worth is deallocated. The value of interest has not been changed.\nworth 55 56 A() netWorth 55 A() netWorth 55\n18 B() adds 1 to its local worth copy, but when B() exits, worth is deallocated, so changing it was useless. The value of interest, netWorth, rests unchanged the whole time in A()'s local storage. A function can change its local copy of the value of interest,\nbut that change is not reflected back in the original value. This is really just the old\n\"independence\" property of local storage, but in this case it is not what is wanted.\nBy Reference The reference solution to the Bill Gates problem is to use a single netWorth variable for the value of interest and never copy it. Instead, each function can receives a pointer to netWorth. Each function can see the current value of netWorth by dereferencing its pointer. More importantly, each function can change the net worth just dereference the pointer to the centralized netWorth and change it directly. Everyone agrees what the current value of netWorth because it exists in only one place everyone has a pointer to the one master copy. The following memory drawing shows A() and B()\nfunctions changed to use \"reference\" parameters. As before, T1, T2, and T3 correspond to points in the code (below), but you can study the memory structure without looking at the code yet.\nT1 -- The value of interest, T2 -- Instead of a copy, B() T3 -- B() exits, and netWorth, is local to A() receives a pointer to netWorth has been as before.\nnetWorth. B()\nchanged.\ndereferences its pointer to access and change the real netWorth.\nB()\nA() netWorth 55 worth\nA() netWorth 55 56 A() netWorth 56 The reference parameter strategy: B() receives a pointer to the value of interest instead of a copy.\nPassing By Reference Here are the steps to use in the code to use the pass-by-reference strategy...\n Have a single copy of the value of interest. The single \"master\" copy.\n Pass pointers to that value to any function which wants to see or change the value.\n Functions can dereference their pointer to see or change the value of interest.\n Functions must remember that they do not have their own local copies. If they dereference their pointer and change the value, they really are changing the master value. If a function wants a local copy to change safely, the function must explicitly allocate and initialize such a local copy.\n19 Syntax\nThe syntax for by reference parameters in the C language just uses pointer operations on the parameters...\n1. Suppose a function wants to communicate about some value of interest\nint or float or struct fraction.\n2. The function takes as its parameter a pointer to the value of interest an int* or float* or struct fraction*. Some programmers will add the word \"ref\" to the name of a reference parameter as a reminder that it is a reference to the value of interest instead of a copy.\n3. At the time of the call, the caller computes a pointer to the value of interest and passes that pointer. The type of the pointer (pointer to the value of interest) will agree with the type in (2) above. If the value of interest is local to the caller, then this will often involve a use of the & operator\n(Section 1).\n4. When the callee is running, if it wishes to access the value of interest, it must dereference its pointer to access the actual value of interest.\nTypically, this equates to use of the dereference operator (*) in the function to see the value of interest.\nBill Gates By Reference Here is the Bill Gates example written to use reference parameters. This code now matches the by-reference memory drawing above.\n// B() now uses a reference parameter -- a pointer to\n// the value of interest. B() uses a dereference (*) on the\n// reference parameter to get at the value of interest.\nvoid B(int* worthRef) {\n// reference parameter\n*worthRef = *worthRef + 1; // use * to get at value of interest\n// T2\n}\nvoid A() {\nint netWorth;\nnetWorth = 55;\nB(&netWorth);\n// T1 -- the value of interest is local to A()\n// Pass a pointer to the value of interest.\n// In this case using &.\n// T3 -- B() has used its pointer to change the value of interest\n}\nDon't Make Copies Reference parameters enable communication between the callee and its caller. Another reason to use reference parameters is to avoid making copies. For efficiency, making copies may be undesirable if the value of interest is large, such as an array. Making the copy requires extra space for the copy itself and extra time to do the copying. From a design point of view, making copies may be undesirable because as soon as there are two copies, it is unclear which one is the \"correct\" one if either is changed. Proverb: \"A person with one watch always knows what time it is. A person with two watches is never sure.\" Avoid making copies.\n20 Simple Reference Parameter Example Swap()\nThe standard example of reference parameters is a Swap() function which exchanges the values of two ints. It's a simple function, but it does need to change the caller's memory which is the key feature of pass by reference.\nSwap() Function The values of interest for Swap() are two ints. Therefore, Swap() does not take ints as its parameters. It takes a pointers to int (int*)'s. In the body of Swap() the parameters, a and b, are dereferenced with * to get at the actual (int) values of interest.\nvoid Swap(int* a, int* b) {\nint temp;\ntemp = *a;\n*a = *b;\n*b = temp;\n}\nSwap() Caller To call Swap(), the caller must pass pointers to the values of interest...\nvoid SwapCaller() {\nint x = 1;\nint y = 2;\nSwap(&x, &y);\n// Use & to pass pointers to the int values of interest\n// (x and y).\n}\nSwap() a SwapCaller() x 1 2 b\ntemp 1 y2 1 The parameters to Swap() are pointers to values of interest which are back in the caller's locals. The Swap() code can dereference the pointers to get back to the caller's memory to exchange the values. In this case, Swap() follows the pointers to exchange the values in the variables x and y back in SwapCaller(). Swap() will exchange any two ints given pointers to those two ints.\nSwap() With Arrays Just to demonstrate that the value of interest does not need to be a simple variable, here's a call to Swap() to exchange the first and last ints in an array. Swap() takes int*'s, but the ints can be anywhere. An int inside an array is still an int.\nvoid SwapCaller2() {\nint scores[10];\nscores[0] = 1;\nscores[9[ = 2;\nSwap(&(scores[0]), &(scores[9]));// the ints of interest do not need to be\n// simple variables -- they can be any int. The caller is responsible\n// for computing a pointer to the int.\n21 The above call to Swap() can be written equivalently as Swap(scores, scores+9)\ndue to the array syntax in C. You can ignore this case if it is not familiar to you it's not an important area of the language and both forms compile to the exact same thing anyway.\nIs The & Always Necessary?\nWhen passing by reference, the caller does not always need to use & to compute a new pointer to the value of interest. Sometimes the caller already has a pointer to the value of interest, and so no new pointer computation is required. The pointer to the value of interest can be passed through unchanged.\nFor example, suppose B() is changed so it calls a C() function which adds 2 to the value of interest...\n// Takes the value of interest by reference and adds 2.\nvoid C(int* worthRef) {\n*worthRef = *worthRef + 2;\n}\n// Adds 1 to the value of interest, and calls C().\nvoid B(int* worthRef) {\n*worthRef = *worthRef + 1; // add 1 to value of interest as before C(worthRef);\n// NOTE no & required. We already have\n// a pointer to the value of interest, so\n// it can be passed through directly.\n}\nWhat About The & Bug TAB?\nAll this use of & might make you nervous are we committing the & bug from Section 2? No, it turns out the above uses of & are fine. The & bug happens when an & passes a pointer to local storage from the callee back to its caller. When the callee exits, its local memory is deallocated and so the pointer no longer has a pointee. In the above, correct cases, we use & to pass a pointer from the caller to the callee. The pointer remains valid for the callee to use because the caller locals continue to exist while the callee is running.\nThe pointees will remain valid due to the simple constraint that the caller can only exit sometime after its callee exits. Using & to pass a pointer to local storage from the caller to the callee is fine. The reverse case, from the callee to the caller, is the & bug.\nThe ** Case What if the value of interest to be shared and changed between the caller and callee is already a pointer, such as an int* or a struct fraction*? Does that change the rules for setting up reference parameters? No. In that case, there is no change in the rules.\nThey operate just as before. The reference parameter is still a pointer to the value of interest, even if the value of interest is itself a pointer. Suppose the value of interest is int*. This means there is an int* value which the caller and callee want to share and change. Then the reference parameter should be an int**. For a struct fraction* value of interest, the reference parameter is struct fraction**. A single dereference (*) operation on the reference parameter yields the value of interest as it did in the simple cases. Double pointer (**) parameters are common in linked list or other pointer manipulating code were the value of interest to share and change is itself a pointer, such as a linked list head pointer.\n22 Reference Parameter Summary Passing by value (copying) does not allow the callee to communicate back to its caller and has also has the usual disadvantages of making copies. Pass by reference uses pointers to avoid copying the value of interest, and allow the callee to communicate back to the caller.\nFor pass by reference, there is only one copy of the value of interest, and pointers to that one copy are passed. So if the value of interest is an int, its reference parameter is an int*.\nIf the value of interest is a struct fraction*, its reference parameters is a struct fraction**.\nFunctions use the dereference operator (*) on the reference parameter to see or change the value of interest.\nSection 3 Extra Optional Material Extra: Reference Parameters in Java Because Java has no */& operators, it is not possible to implement reference parameters in Java directly. Maybe this is ok in the OOP paradigm, you should change objects by sending them messages which makes the reference parameter concept unnecessary. The caller passes the callee a (shallow) reference to the value of interest (object of interest?),\nand the callee can send it a message to change it. Since all objects are intrinsically shallow, any change is communicated back to the caller automatically since the object of interest was never copied.\nExtra: Reference Parameters in C++\nReference parameters are such a common programming task that they have been added as an official feature to the C++ language. So programming reference parameters in C++ is simpler than in C. All the programmer needs to do is syntactically indicate that they wish for a particular parameter to be passed by reference, and the compiler takes care of it. The syntax is to append a single '&' to right hand side of the parameter type. So an int parameter passes an integer by value, but an int& parameter passes an integer value by reference. The key is that the compiler takes care of it. In the source code, there's no additional fiddling around with &'s or *'s. So Swap() and SwapCaller() written with C++\nlook simpler than in C, even though they accomplish the same thing...\n23 void Swap(int& a, int& b) {\nint temp;\ntemp = a;\na = b;\nb = temp;\n// The & declares pass by reference\n// No *'s required -- the compiler takes care of it\n}\nvoid SwapCaller() {\nint x = 1;\nint y = 2;\nSwap(x, y); // No &'s required -- the compiler takes care of it\n}\nThe types of the various variables and parameters operate simply as they are declared\n(int in this case). The complicating layer of pointers required to implement the reference parameters is hidden. The compiler takes care of it without allowing the complication to disturb the types in the source code.\n24 Section 4\nHeap Memory\n\"Heap\" memory, also known as \"dynamic\" memory, is an alternative to local stack memory. Local memory (Section 2) is quite automatic it is allocated automatically on function call and it is deallocated automatically when a function exits. Heap memory is different in every way. The programmer explicitly requests the allocation of a memory\n\"block\" of a particular size, and the block continues to be allocated until the programmer explicitly requests that it be deallocated. Nothing happens automatically. So the programmer has much greater control of memory, but with greater responsibility since the memory must now be actively managed. The advantages of heap memory are...\nLifetime. Because the programmer now controls exactly when memory is allocated and deallocated, it is possible to build a data structure in memory, and return that data structure to the caller. This was never possible with local memory which was automatically deallocated when the function exited.\nSize. The size of allocated memory can be controlled with more detail.\nFor example, a string buffer can be allocated at run-time which is exactly the right size to hold a particular string. With local memory, the code is more likely to declare a buffer size 1000 and hope for the best. (See the StringCopy() example below.)\nThe disadvantages of heap memory are...\nMore Work. Heap allocation needs to arranged explicitly in the code which is just more work.\nMore Bugs. Because it's now done explicitly in the code, realistically on occasion the allocation will be done incorrectly leading to memory bugs.\nLocal memory is constrained, but at least it's never wrong.\nNonetheless, there are many problems that can only be solved with heap memory, so that's that way it has to be. In languages with garbage collectors such as Perl, LISP, or Java, the above disadvantages are mostly eliminated. The garbage collector takes over most of the responsibility for heap management at the cost of a little extra time taken at run-time.\nWhat Does The Heap Look Like?\nBefore seeing the exact details, let's look at a rough example of allocation and deallocation in the heap...\nAllocation The heap is a large area of memory available for use by the program. The program can request areas, or \"blocks\", of memory for its use within the heap. In order to allocate a block of some size, the program makes an explicit request by calling the heap allocation function. The allocation function reserves a block of memory of the requested size in the heap and returns a pointer to it. Suppose a program makes three allocation requests to\n25 allocate memory to hold three separate GIF images in the heap each of which takes 1024 bytes of memory. After the three allocation requests, memory might look like...\nLocal Heap\n(Free)\n(Gif3)\n(Gif2)\n(Gif1)\n3 separate heap\nblocks\neach 1024 bytes in size.\nEach allocation request reserves a contiguous area of the requested size in the heap and returns a pointer to that new block to the program. Since each block is always referred to by a pointer, the block always plays the role of a \"pointee\" (Section 1) and the program always manipulates its heap blocks through pointers. The heap block pointers are sometimes known as \"base address\" pointers since by convention they point to the base\n(lowest address byte) of the block.\nIn this example, the three blocks have been allocated contiguously starting at the bottom of the heap, and each block is 1024 bytes in size as requested. In reality, the heap manager can allocate the blocks wherever it wants in the heap so long as the blocks do not overlap and they are at least the requested size. At any particular moment, some areas in the heap have been allocated to the program, and so are \"in use\". Other areas have yet to be committed and so are \"free\" and are available to satisfy allocation requests. The heap manager has its own, private data structures to record what areas of the heap are committed to what purpose at any moment The heap manager satisfies each allocation request from the pool of free memory and updates its private data structures to record which areas of the heap are in use.\nDeallocation When the program is finished using a block of memory, it makes an explicit deallocation request to indicate to the heap manager that the program is now finished with that block.\nThe heap manager updates its private data structures to show that the area of memory occupied by the block is free again and so may be re-used to satisfy future allocation requests. Here's what the heap would look like if the program deallocates the second of the three blocks...\n26 Local\nHeap\n(Free)\n(Gif3)\n(Free)\n(Gif1)\nAfter the deallocation, the pointer continues to point to the now deallocated block. The program must not access the deallocated pointee. This is why the pointer is drawn in gray\n the pointer is there, but it must not be used. Sometimes the code will set the pointer to NULL immediately after the deallocation to make explicit the fact that it is no longer valid.\nProgramming The Heap Programming the heap looks pretty much the same in most languages. The basic features are....\n The heap is an area of memory available to allocate areas (\"blocks\") of memory for the program.\n There is some \"heap manager\" library code which manages the heap for the program. The programmer makes requests to the heap manager, which in turn manages the internals of the heap. In C, the heap is managed by the ANSI library functions malloc(), free(), and realloc().\n The heap manager uses its own private data structures to keep track of which blocks in the heap are \"free\" (available for use) and which blocks are currently in use by the program and how large those blocks are.\nInitially, all of the heap is free.\n The heap may be of a fixed size (the usual conceptualization), or it may appear to be of a fixed but extremely large size backed by virtual memory.\nIn either case, it is possible for the heap to get \"full\" if all of its memory has been allocated and so it cannot satisfy an allocation request. The allocation function will communicate this run-time condition in some way to the program usually by returning a NULL pointer or raising a language specific run-time exception.\n The allocation function requests a block in the heap of a particular size.\nThe heap manager selects an area of memory to use to satisfy the request,\nmarks that area as \"in use\" in its private data structures, and returns a pointer to the heap block. The caller is now free to use that memory by dereferencing the pointer. The block is guaranteed to be reserved for the sole use of the caller the heap will not hand out that same area of memory to some other caller. The block does not move around inside the\n27 heap its location and size are fixed once it is allocated. Generally, when a block is allocated, its contents are random. The new owner is responsible for setting the memory to something meaningful. Sometimes there is variation on the memory allocation function which sets the block to all zeros (calloc() in C).\n The deallocation function is the opposite of the allocation function. The program makes a single deallocation call to return a block of memory to the heap free area for later re-use. Each block should only be deallocated once. The deallocation function takes as its argument a pointer to a heap block previously furnished by the allocation function. The pointer must be exactly the same pointer returned earlier by the allocation function, not just any pointer into the block. After the deallocation, the program must treat the pointer as bad and not access the deallocated pointee.\nC Specifics In the C language, the library functions which make heap requests are malloc() (\"memory allocate\") and free(). The prototypes for these functions are in the header file .\nAlthough the syntax varies between languages, the roles of malloc() and free() are nearly identical in all languages...\nvoid* malloc(unsigned long size); The malloc() function takes an unsigned integer which is the requested size of the block measured in bytes. Malloc() returns a pointer to a new heap block if the allocation is successful, and NULL if the request cannot be satisfied because the heap is full. The C operator sizeof() is a convenient way to compute the size in bytes of a type sizeof(int) for an int pointee,\nsizeof(struct fraction) for a struct fraction pointee.\nvoid free(void* heapBlockPointer); The free() function takes a pointer to a heap block and returns it to the free pool for later reuse. The pointer passed to free() must be exactly the pointer returned earlier by malloc(), not just a pointer to somewhere in the block. Calling free() with the wrong sort of pointer is famous for the particularly ugly sort of crashing which it causes. The call to free() does not need to give the size of the heap block the heap manager will have noted the size in its private data structures. The call to free() just needs to identify which block to deallocate by its pointer. If a program correctly deallocates all of the memory it allocates, then every call to malloc() will later be matched by exactly one call to free() As a practical matter however, it is not always necessary for a program to deallocate every block it allocates see\n\"Memory Leaks\" below.\nSimple Heap Example Here is a simple example which allocates an int block in the heap, stores the number 42 in the block, and then deallocates it. This is the simplest possible example of heap block allocation, use, and deallocation. The example shows the state of memory at three different times during the execution of the above code. The stack and heap are shown separately in the drawing a drawing for code which uses stack and heap memory needs to distinguish between the two areas to be accurate since the rules which govern the two areas are so different. In this case, the lifetime of the local variable intPtr is totally separate from the lifetime of the heap block, and the drawing needs to reflect that difference.\n28 void Heap1() {\nint* intPtr;\n// Allocates local pointer local variable (but not its pointee)\n// T1 Local\nHeap intPtr\n// Allocates heap block and stores its pointer in local variable.\n// Dereferences the pointer to set the pointee to 42.\nintPtr = malloc(sizeof(int));\n*intPtr = 42;\n// T2 Local\nintPtr Heap\n42\n// Deallocates heap block making the pointer bad.\n// The programmer must remember not to use the pointer\n// after the pointee has been deallocated (this is\n// why the pointer is shown in gray).\nfree(intPtr);\n// T3 Local\nHeap intPtr\n}\nSimple Heap Observations\n After the allocation call allocates the block in the heap. The program stores the pointer to the block in the local variable intPtr. The block is the\n\"pointee\" and intPtr is its pointer as shown at T2. In this state, the pointer may be dereferenced safely to manipulate the pointee. The pointer/pointee rules from Section 1 still apply, the only difference is how the pointee is initially allocated.\n29\n At T1 before the call to malloc(), intPtr is uninitialized does not have a pointee at this point intPtr \"bad\" in the same sense as discussed in Section 1. As before, dereferencing such an uninitialized pointer is a common, but catastrophic error. Sometimes this error will crash immediately (lucky). Other times it will just slightly corrupt a random data structure (unlucky).\n The call to free() deallocates the pointee as shown at T3. Dereferencing the pointer after the pointee has been deallocated is an error.\nUnfortunately, this error will almost never be flagged as an immediate run-time error. 99% of the time the dereference will produce reasonable results 1% of the time the dereference will produce slightly wrong results.\nIronically, such a rarely appearing bug is the most difficult type to track down.\n When the function exits, its local variable intPtr will be automatically deallocated following the usual rules for local variables (Section 2). So this function has tidy memory behavior all of the memory it allocates while running (its local variable, its one heap block) is deallocated by the time it exits.\nHeap Array In the C language, it's convenient to allocate an array in the heap, since C can treat any pointer as an array. The size of the array memory block is the size of each element (as computed by the sizeof() operator) multiplied by the number of elements (See CS Education Library/101 The C Language, for a complete discussion of C, and arrays and pointers in particular). So the following code heap allocates an array of 100 struct fraction's in the heap, sets them all to 22/7, and deallocates the heap array...\nvoid HeapArray() {\nstruct fraction* fracts;\nint i;\n// allocate the array fracts = malloc(sizeof(struct fraction) * 100);\n// use it like an array -- in this case set them all to 22/7 for (i=0; i<99; i++) {\nfracts[i].numerator = 22;\nfracts[i].denominator = 7;\n}\n// Deallocate the whole array free(fracts);\n}\n30 Heap String Example Here is a more useful heap array example. The StringCopy() function takes a C string,\nmakes a copy of that string in the heap, and returns a pointer to the new string. The caller takes over ownership of the new string and is responsible for freeing it.\n/*\nGiven a C string, return a heap allocated copy of the string.\nAllocate a block in the heap of the appropriate size,\ncopies the string into the block, and returns a pointer to the block.\nThe caller takes over ownership of the block and is responsible for freeing it.\n*/\nchar* StringCopy(const char* string) {\nchar* newString;\nint len;\nlen = strlen(string) + 1;\n// +1 to account for the '\\0'\nnewString = malloc(sizeof(char)*len); // elem-size * number-of-elements assert(newString != NULL); // simplistic error check (a good habit)\nstrcpy(newString, string); // copy the passed in string to the block return(newString);\n// return a ptr to the block\n}\nHeap String Observations StringCopy() takes advantage of both of the key features of heap memory...\nSize. StringCopy() specifies, at run-time, the exact size of the block needed to store the string in its call to malloc(). Local memory cannot do that since its size is specified at compile-time. The call to sizeof(char) is not really necessary, since the size of char is 1 by definition. In any case, the example demonstrates the correct formula for the size of an array block which is element-size * number-of-elements.\nLifetime. StringCopy() allocates the block, but then passes ownership of it to the caller. There is no call to free(), so the block continues to exist even after the function exits. Local memory cannot do that. The caller will need to take care of the deallocation when it is finished with the string.\nMemory Leaks What happens if some memory is heap allocated, but never deallocated? A program which forgets to deallocate a block is said to have a \"memory leak\" which may or may not be a serious problem. The result will be that the heap gradually fill up as there continue to be allocation requests, but no deallocation requests to return blocks for re-use.\nFor a program which runs, computes something, and exits immediately, memory leaks are not usually a concern. Such a \"one shot\" program could omit all of its deallocation requests and still mostly work. Memory leaks are more of a problem for a program which runs for an indeterminate amount of time. In that case, the memory leaks can gradually fill the heap until allocation requests cannot be satisfied, and the program stops working or crashes. Many commercial programs have memory leaks, so that when run for long enough, or with large data-sets, they fill their heaps and crash. Often the error detection and avoidance code for the heap-full error condition is not well tested, precisely because the case is rarely encountered with short runs of the program that's why filling the heap often results in a real crash instead of a polite error message. Most compilers have a\n31\n\"heap debugging\" utility which adds debugging code to a program to track every allocation and deallocation. When an allocation has no matching deallocation, that's a leak, and the heap debugger can help you find them.\nOwnership StringCopy() allocates the heap block, but it does not deallocate it. This is so the caller can use the new string. However, this introduces the problem that somebody does need to remember to deallocate the block, and it is not going to be StringCopy(). That is why the comment for StringCopy() mentions specifically that the caller is taking on ownership of the block. Every block of memory has exactly one \"owner\" who takes responsibility for deallocating it. Other entities can have pointers, but they are just sharing. There's only one owner, and the comment for StringCopy() makes it clear that ownership is being passed from StringCopy() to the caller. Good documentation always remembers to discuss the ownership rules which a function expects to apply to its parameters or return value. Or put the other way, a frequent error in documentation is that it forgets to mention, one way or the other, what the ownership rules are for a parameter or return value. That's one way that memory errors and leaks are created.\nOwnership Models The two common patterns for ownership are...\nCaller ownership. The caller owns its own memory. It may pass a pointer to the callee for sharing purposes, but the caller retains ownership. The callee can access things while it runs, and allocate and deallocate its own memory, but it should not disrupt the caller's memory.\nCallee allocated and returned. The callee allocates some memory and returns it to the caller. This happens because the result of the callee computation needs new memory to be stored or represented. The new memory is passed to the caller so they can see the result, and the caller must take over ownership of the memory. This is the pattern demonstrated in StringCopy().\nHeap Memory Summary Heap memory provides greater control for the programmer the blocks of memory can be requested in any size, and they remain allocated until they are deallocated explicitly.\nHeap memory can be passed back to the caller since it is not deallocated on exit, and it can be used to build linked structures such as linked lists and binary trees. The disadvantage of heap memory is that the program must make explicit allocation and deallocate calls to manage the heap memory. The heap memory does not operate automatically and conveniently the way local memory does."}}},{"rowIdx":464,"cells":{"project":{"kind":"string","value":"git-hash"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate git_hash\n===\n\nThis crate provides types for identifying git objects using a hash digest.\n\nThese are provided in borrowed versions as well as owned ones.\n\n### Feature Flags\n\n* **`serde1`** — Data structures implement `serde::Serialize` and `serde::Deserialize`.\n\nModules\n---\n\ndecodeprefixStructs\n---\n\nPrefixAn partial owned hash possibly identifying an object uniquely,\nwhose non-prefix bytes are zeroed.oidA borrowed reference to a hash identifying objects.Enums\n---\n\nKindDenotes the kind of function to produce a `Id`ObjectIdAn owned hash identifying objects, most commonly Sha1\n\nCrate git_hash\n===\n\nThis crate provides types for identifying git objects using a hash digest.\n\nThese are provided in borrowed versions as well as owned ones.\n\n### Feature Flags\n\n* **`serde1`** — Data structures implement `serde::Serialize` and `serde::Deserialize`.\n\nModules\n---\n\ndecodeprefixStructs\n---\n\nPrefixAn partial owned hash possibly identifying an object uniquely,\nwhose non-prefix bytes are zeroed.oidA borrowed reference to a hash identifying objects.Enums\n---\n\nKindDenotes the kind of function to produce a `Id`ObjectIdAn owned hash identifying objects, most commonly Sha1\n\nModule git_hash::prefix\n===\n\nModules\n---\n\nfrom_hexEnums\n---\n\nErrorThe error returned by Prefix::new().\n\nStruct git_hash::Prefix\n===\n\n\n```\npub struct Prefix { /* private fields */ }\n```\nAn partial owned hash possibly identifying an object uniquely,\nwhose non-prefix bytes are zeroed.\n\nImplementations\n---\n\n### impl Prefix\n\n#### pub const MIN_HEX_LEN: usize = 4usize\n\nThe smallest allowed prefix length below which chances for collisions are too high even in small repositories.\n\n#### pub fn new(id: impl AsRef, hex_len: usize) -> Result &oid\n\nReturns the prefix as object id.\n\nNote that it may be deceptive to use given that it looks like a full object id, even though its post-prefix bytes/bits are set to zero.\n\n#### pub fn hex_len(&self) -> usize\n\nReturn the amount of hexadecimal characters that are set in the prefix.\n\nThis gives the prefix a granularity of 4 bits.\n\n#### pub fn cmp_oid(&self, candidate: &oid) -> Ordering\n\nProvided with candidate id which is a full hash, determine how this prefix compares to it,\nonly looking at the prefix bytes, ignoring everything behind that.\n\n#### pub fn from_hex(value: &str) -> Result Prefix\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(oid: ObjectId) -> Self\n\nConverts to this type from the input type.### impl Hash for Prefix\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Prefix) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Prefix) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Prefix\n\n#### fn partial_cmp(&self, other: &Prefix) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\nCreate an instance from the given hexadecimal prefix, e.g. `35e77c16` would yield a `Prefix`\nwith `hex_len()` = 8.\n\n#### type Error = Error\n\nThe type returned in the event of a conversion error.#### fn try_from(value: &str) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct git_hash::oid\n===\n\n\n```\n#[repr(transparent)]pub struct oid { /* private fields */ }\n```\nA borrowed reference to a hash identifying objects.\n\nFuture Proofing\n---\n\nIn case we wish to support multiple hashes with the same length we cannot discriminate using the slice length anymore. To make that work, we will use the high bits of the internal `bytes` slice length (a fat pointer, pointing to data and its length in bytes)\nto encode additional information. Before accessing or returning the bytes, a new adjusted slice will be constructed, while the high bits will be used to help resolving the hash `[`kind()`][oid::kind()]`.\nWe expect to have quite a few bits available for such ‘conflict resolution’ as most hashes aren’t longer than 64 bytes.\n\nImplementations\n---\n\n### impl oid\n\nConversion\n\n#### pub fn try_from_bytes(digest: &[u8]) -> Result<&Self, ErrorTry to create a shared object id from a slice of bytes representing a hash `digest`\n\n#### pub fn from_bytes_unchecked(value: &[u8]) -> &Self\n\nCreate an OID from the input `value` slice without performing any safety check.\nUse only once sure that `value` is a hash of valid length.\n\n### impl oid\n\nAccess\n\n#### pub fn kind(&self) -> Kind\n\nThe kind of hash used for this Digest\n\n#### pub fn first_byte(&self) -> u8\n\nThe first byte of the hash, commonly used to partition a set of `Id`s\n\n#### pub fn as_bytes(&self) -> &[u8] \n\nInterpret this object id as raw byte slice.\n\n#### pub fn to_hex_with_len(&self, len: usize) -> HexDisplay<'_Return a type which can display itself in hexadecimal form with the `len` amount of characters.\n\n#### pub fn to_hex(&self) -> HexDisplay<'_Return a type which displays this oid as hex in full.\n\n### impl oid\n\nSha1 specific methods\n\n#### pub fn hex_to_buf(&self, buf: &mut [u8]) -> usize\n\nWrite ourselves to the `out` in hexadecimal notation, returning the amount of written bytes.\n\n**Panics** if the buffer isn’t big enough to hold twice as many bytes as the current binary size.\n\n#### pub fn write_hex_to(&self, out: impl Write) -> Result<()Write ourselves to `out` in hexadecimal notation\n\nTrait Implementations\n---\n\n### impl AsRef for &oid\n\n#### fn as_ref(&self) -> &oid\n\nConverts this type into a shared reference of the (usually inferred) input type.### impl AsRef for ObjectId\n\n#### fn as_ref(&self) -> &oid\n\nConverts this type into a shared reference of the (usually inferred) input type.### impl Borrow for ObjectId\n\n#### fn borrow(&self) -> &oid\n\nImmutably borrows from an owned value. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\nAvailable on **crate feature `serde1`** only.Manually created from a version that uses a slice, and we forcefully try to convert it into a borrowed array of the desired size Could be improved by fitting this into serde Unfortunately the serde::Deserialize derive wouldn’t work for borrowed arrays.\n\n#### fn deserialize(\n deserializer: D\n) -> Result>::Error>where\n D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(v: &'a [u8; 20]) -> Self\n\nConverts to this type from the input type.### impl From<&oid> for ObjectId\n\n#### fn from(v: &oid) -> Self\n\nConverts to this type from the input type.### impl Hash for oid\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. \n\n#### fn cmp(&self, other: &oid) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. \n\n#### fn eq(&self, other: &&oid) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for &oid\n\n#### fn eq(&self, other: &ObjectId) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for oid\n\n#### fn eq(&self, other: &oid) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for oid\n\n#### fn partial_cmp(&self, other: &oid) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Owned = ObjectId\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> Self::Owned\n\nCreates owned data from borrowed data, usually by cloning. Read more1.63.0 · source#### fn clone_into(&self, target: &mut Self::Owned)\n\nUses borrowed data to replace owned data, usually by cloning. \n\n### impl StructuralEq for oid\n\n### impl StructuralPartialEq for oid\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for oid\n\n### impl Send for oid\n\n### impl !Sized for oid\n\n### impl Sync for oid\n\n### impl Unpin for oid\n\n### impl UnwindSafe for oid\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. Read more{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]impl Write for &amp;mut [u8]\"}\n\nEnum git_hash::Kind\n===\n\n\n```\npub enum Kind {\n    Sha1,\n}\n```\nDenotes the kind of function to produce a `Id`\n\nVariants\n---\n\n### Sha1\n\nThe Sha1 hash with 160 bits.\n\nImplementations\n---\n\n### impl Kind\n\n#### pub const fn shortest() -> Self\n\nReturns the shortest hash we support\n\n#### pub const fn longest() -> Self\n\nReturns the longest hash we support\n\n#### pub const fn hex_buf() -> [u8; 40]\n\nReturns a buffer suitable to hold the longest possible hash in hex.\n\n#### pub const fn buf() -> [u8; 20]\n\nReturns a buffer suitable to hold the longest possible hash as raw bytes.\n\n#### pub const fn len_in_hex(&self) -> usize\n\nReturns the amount of ascii-characters needed to encode this has in hex\n\n#### pub const fn len_in_bytes(&self) -> usize\n\nReturns the amount of bytes taken up by the hash of the current kind\n\n#### pub const fn from_hex_len(hex_len: usize) -> Option &'static oid\n\nCreate a null-id of our hash kind.\n\n#### pub const fn null(&self) -> ObjectId\n\nCreate a null-id of our hash kind.\n\nTrait Implementations\n---\n\n### impl Clone for Kind\n\n#### fn clone(&self) -> Kind\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### type Err = String\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Kind) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Kind) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Kind\n\n#### fn partial_cmp(&self, other: &Kind) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n#### type Error = u8\n\nThe type returned in the event of a conversion error.#### fn try_from(value: u8) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nEnum git_hash::ObjectId\n===\n\n\n```\npub enum ObjectId {\n    Sha1([u8; 20]),\n}\n```\nAn owned hash identifying objects, most commonly Sha1\n\nVariants\n---\n\n### Sha1([u8; 20])\n\nA SHA 1 hash digest\n\nImplementations\n---\n\n### impl ObjectId\n\nHash decoding\n\n#### pub fn from_hex(buffer: &[u8]) -> Result Kind\n\nReturns the kind of hash used in this `Id`\n\n#### pub fn as_slice(&self) -> &[u8] \n\nReturn the raw byte slice representing this hash\n\n#### pub fn as_mut_slice(&mut self) -> &mut [u8] \n\nReturn the raw mutable byte slice representing this hash\n\n#### pub const fn empty_tree(hash: Kind) -> ObjectId\n\nThe hash of an empty tree\n\n#### pub fn is_null(&self) -> bool\n\nReturns true if this hash consists of all null bytes\n\n#### pub const fn null(kind: Kind) -> ObjectId\n\nReturns an Digest representing a hash with whose memory is zeroed.\n\nMethods from Deref\n---\n\n#### pub fn kind(&self) -> Kind\n\nThe kind of hash used for this Digest\n\n#### pub fn first_byte(&self) -> u8\n\nThe first byte of the hash, commonly used to partition a set of `Id`s\n\n#### pub fn as_bytes(&self) -> &[u8] \n\nInterpret this object id as raw byte slice.\n\n#### pub fn to_hex_with_len(&self, len: usize) -> HexDisplay<'_Return a type which can display itself in hexadecimal form with the `len` amount of characters.\n\n#### pub fn to_hex(&self) -> HexDisplay<'_Return a type which displays this oid as hex in full.\n\n#### pub fn hex_to_buf(&self, buf: &mut [u8]) -> usize\n\nWrite ourselves to the `out` in hexadecimal notation, returning the amount of written bytes.\n\n**Panics** if the buffer isn’t big enough to hold twice as many bytes as the current binary size.\n\n#### pub fn write_hex_to(&self, out: impl Write) -> Result<()Write ourselves to `out` in hexadecimal notation\n\nTrait Implementations\n---\n\n### impl AsRef for ObjectId\n\n#### fn as_ref(&self) -> &oid\n\nConverts this type into a shared reference of the (usually inferred) input type.### impl Borrow for ObjectId\n\n#### fn borrow(&self) -> &oid\n\nImmutably borrows from an owned value. \n\n#### fn clone(&self) -> ObjectId\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### type Target = oid\n\nThe resulting type after dereferencing.#### fn deref(&self) -> &Self::Target\n\nDereferences the value.### impl<'de> Deserialize<'de> for ObjectId\n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(v: &[u8]) -> Self\n\nConverts to this type from the input type.### impl From<&oid> for ObjectId\n\n#### fn from(v: &oid) -> Self\n\nConverts to this type from the input type.### impl From<[u8; 20]> for ObjectId\n\n#### fn from(v: [u8; 20]) -> Self\n\nConverts to this type from the input type.### impl From for Prefix\n\n#### fn from(oid: ObjectId) -> Self\n\nConverts to this type from the input type.### impl FromStr for ObjectId\n\n#### type Err = Error\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &ObjectId) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &&oid) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for &oid\n\n#### fn eq(&self, other: &ObjectId) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for ObjectId\n\n#### fn eq(&self, other: &ObjectId) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for ObjectId\n\n#### fn partial_cmp(&self, other: &ObjectId) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n### impl Eq for ObjectId\n\n### impl StructuralEq for ObjectId\n\n### impl StructuralPartialEq for ObjectId\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ObjectId\n\n### impl Send for ObjectId\n\n### impl Sync for ObjectId\n\n### impl Unpin for ObjectId\n\n### impl UnwindSafe for ObjectId\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\nconst: unstable · source#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\nconst: unstable · source#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\nconst: unstable · source#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.const: unstable · source#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\n{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]impl Write for &amp;mut [u8]\",\"&mut [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]impl Write for &amp;mut [u8]\"}"}}},{"rowIdx":465,"cells":{"project":{"kind":"string","value":"@aws-cdk/aws-codepipeline"},"source":{"kind":"string","value":"npm"},"language":{"kind":"string","value":"JavaScript"},"content":{"kind":"string","value":"AWS CodePipeline Construct Library\n===\n\n---\n\n> AWS CDK v1 has reached End-of-Support on 2023-06-01.\n> This package is no longer being updated, and users should migrate to AWS CDK v2.\n> For more information on how to migrate, see the [*Migrating to AWS CDK v2* guide](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html).\n---\n\nPipeline\n---\n\nTo construct an empty Pipeline:\n```\n// Construct an empty Pipeline const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline');\n```\nTo give the Pipeline a nice, human-readable name:\n```\n// Give the Pipeline a nice, human-readable name const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {\n  pipelineName: 'MyPipeline',\n});\n```\nBe aware that in the default configuration, the `Pipeline` construct creates an AWS Key Management Service (AWS KMS) Customer Master Key (CMK) for you to encrypt the artifacts in the artifact bucket, which incurs a cost of\n**$1/month**. This default configuration is necessary to allow cross-account actions.\n\nIf you do not intend to perform cross-account deployments, you can disable the creation of the Customer Master Keys by passing `crossAccountKeys: false`\nwhen defining the Pipeline:\n```\n// Don't create Customer Master Keys const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {\n  crossAccountKeys: false,\n});\n```\nIf you want to enable key rotation for the generated KMS keys,\nyou can configure it by passing `enableKeyRotation: true` when creating the pipeline.\nNote that key rotation will incur an additional cost of **$1/month**.\n```\n// Enable key rotation for the generated KMS key const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {\n  // ...\n  enableKeyRotation: true,\n});\n```\nStages\n---\n\nYou can provide Stages when creating the Pipeline:\n```\n// Provide a Stage when creating a pipeline const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {\n  stages: [\n    {\n      stageName: 'Source',\n      actions: [\n        // see below...\n      ],\n    },\n  ],\n});\n```\nOr append a Stage to an existing Pipeline:\n```\n// Append a Stage to an existing Pipeline declare const pipeline: codepipeline.Pipeline;\nconst sourceStage = pipeline.addStage({\n  stageName: 'Source',\n  actions: [ // optional property\n    // see below...\n  ],\n});\n```\nYou can insert the new Stage at an arbitrary point in the Pipeline:\n```\n// Insert a new Stage at an arbitrary point declare const pipeline: codepipeline.Pipeline;\ndeclare const anotherStage: codepipeline.IStage;\ndeclare const yetAnotherStage: codepipeline.IStage;\n\nconst someStage = pipeline.addStage({\n  stageName: 'SomeStage',\n  placement: {\n    // note: you can only specify one of the below properties\n    rightBefore: anotherStage,\n    justAfter: yetAnotherStage,\n  }\n});\n```\nYou can disable transition to a Stage:\n```\n// Disable transition to a stage declare const pipeline: codepipeline.Pipeline;\n\nconst someStage = pipeline.addStage({\n  stageName: 'SomeStage',\n  transitionToEnabled: false,\n  transitionDisabledReason: 'Manual transition only', // optional reason\n})\n```\nThis is useful if you don't want every executions of the pipeline to flow into this stage automatically. The transition can then be \"manually\" enabled later on.\n\nActions\n---\n\nActions live in a separate package, `@aws-cdk/aws-codepipeline-actions`.\n\nTo add an Action to a Stage, you can provide it when creating the Stage,\nin the `actions` property,\nor you can use the `IStage.addAction()` method to mutate an existing Stage:\n```\n// Use the `IStage.addAction()` method to mutate an existing Stage.\ndeclare const sourceStage: codepipeline.IStage;\ndeclare const someAction: codepipeline.Action;\nsourceStage.addAction(someAction);\n```\nCustom Action Registration\n---\n\nTo make your own custom CodePipeline Action requires registering the action provider. Look to the `JenkinsProvider` in `@aws-cdk/aws-codepipeline-actions` for an implementation example.\n```\n// Make a custom CodePipeline Action new codepipeline.CustomActionRegistration(this, 'GenericGitSourceProviderResource', {\n  category: codepipeline.ActionCategory.SOURCE,\n  artifactBounds: { minInputs: 0, maxInputs: 0, minOutputs: 1, maxOutputs: 1 },\n  provider: 'GenericGitSource',\n  version: '1',\n  entityUrl: 'https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-create-custom-action.html',\n  executionUrl: 'https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-create-custom-action.html',\n  actionProperties: [\n    {\n      name: 'Branch',\n      required: true,\n      key: false,\n      secret: false,\n      queryable: false,\n      description: 'Git branch to pull',\n      type: 'String',\n    },\n    {\n      name: 'GitUrl',\n      required: true,\n      key: false,\n      secret: false,\n      queryable: false,\n      description: 'SSH git clone URL',\n      type: 'String',\n    },\n  ],\n});\n```\nCross-account CodePipelines\n---\n\n> Cross-account Pipeline actions require that the Pipeline has *not* been\n> created with `crossAccountKeys: false`.\nMost pipeline Actions accept an AWS resource object to operate on. For example:\n\n* `S3DeployAction` accepts an `s3.IBucket`.\n* `CodeBuildAction` accepts a `codebuild.IProject`.\n* etc.\n\nThese resources can be either newly defined (`new s3.Bucket(...)`) or imported\n(`s3.Bucket.fromBucketAttributes(...)`) and identify the resource that should be changed.\n\nThese resources can be in different accounts than the pipeline itself. For example, the following action deploys to an imported S3 bucket from a different account:\n```\n// Deploy an imported S3 bucket from a different account declare const stage: codepipeline.IStage;\ndeclare const input: codepipeline.Artifact;\nstage.addAction(new codepipeline_actions.S3DeployAction({\n  bucket: s3.Bucket.fromBucketAttributes(this, 'Bucket', {\n    account: '123456789012',\n    // ...\n  }),\n  input: input,\n  actionName: 's3-deploy-action',\n  // ...\n}));\n```\nActions that don't accept a resource object accept an explicit `account` parameter:\n```\n// Actions that don't accept a resource objet accept an explicit `account` parameter declare const stage: codepipeline.IStage;\ndeclare const templatePath: codepipeline.ArtifactPath;\nstage.addAction(new codepipeline_actions.CloudFormationCreateUpdateStackAction({\n  account: '123456789012',\n  templatePath,\n  adminPermissions: false,\n  stackName: Stack.of(this).stackName,\n  actionName: 'cloudformation-create-update',\n  // ...\n}));\n```\nThe `Pipeline` construct automatically defines an **IAM Role** for you in the target account which the pipeline will assume to perform that action. This Role will be defined in a **support stack** named\n`-support-`, that will automatically be deployed before the stack containing the pipeline.\n\nIf you do not want to use the generated role, you can also explicitly pass a\n`role` when creating the action. In that case, the action will operate in the account the role belongs to:\n```\n// Explicitly pass in a `role` when creating an action.\ndeclare const stage: codepipeline.IStage;\ndeclare const templatePath: codepipeline.ArtifactPath;\nstage.addAction(new codepipeline_actions.CloudFormationCreateUpdateStackAction({\n  templatePath,\n  adminPermissions: false,\n  stackName: Stack.of(this).stackName,\n  actionName: 'cloudformation-create-update',\n  // ...\n  role: iam.Role.fromRoleArn(this, 'ActionRole', '...'),\n}));\n```\nCross-region CodePipelines\n---\n\nSimilar to how you set up a cross-account Action, the AWS resource object you pass to actions can also be in different *Regions*. For example, the following Action deploys to an imported S3 bucket from a different Region:\n```\n// Deploy to an imported S3 bucket from a different Region.\ndeclare const stage: codepipeline.IStage;\ndeclare const input: codepipeline.Artifact;\nstage.addAction(new codepipeline_actions.S3DeployAction({\n  bucket: s3.Bucket.fromBucketAttributes(this, 'Bucket', {\n    region: 'us-west-1',\n    // ...\n  }),\n  input: input,\n  actionName: 's3-deploy-action',\n  // ...\n}));\n```\nActions that don't take an AWS resource will accept an explicit `region`\nparameter:\n```\n// Actions that don't take an AWS resource will accept an explicit `region` parameter.\ndeclare const stage: codepipeline.IStage;\ndeclare const templatePath: codepipeline.ArtifactPath;\nstage.addAction(new codepipeline_actions.CloudFormationCreateUpdateStackAction({\n  templatePath,\n  adminPermissions: false,\n  stackName: Stack.of(this).stackName,\n  actionName: 'cloudformation-create-update',\n  // ...\n  region: 'us-west-1',\n}));\n```\nThe `Pipeline` construct automatically defines a **replication bucket** for you in the target region, which the pipeline will replicate artifacts to and from. This Bucket will be defined in a **support stack** named\n`-support-`, that will automatically be deployed before the stack containing the pipeline.\n\nIf you don't want to use these support stacks, and already have buckets in place to serve as replication buckets, you can supply these at Pipeline definition time using the `crossRegionReplicationBuckets` parameter. Example:\n```\n// Supply replication buckets for the Pipeline instead of using the generated support stack const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {\n  // ...\n\n  crossRegionReplicationBuckets: {\n    // note that a physical name of the replication Bucket must be known at synthesis time\n    'us-west-1': s3.Bucket.fromBucketAttributes(this, 'UsWest1ReplicationBucket', {\n      bucketName: 'my-us-west-1-replication-bucket',\n      // optional KMS key\n      encryptionKey: kms.Key.fromKeyArn(this, 'UsWest1ReplicationKey',\n        'arn:aws:kms:us-west-1:123456789012:key/1234-5678-9012'\n      ),\n    }),\n  },\n});\n```\nSee [the AWS docs here](https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-create-cross-region.html)\nfor more information on cross-region CodePipelines.\n\n### Creating an encrypted replication bucket\n\nIf you're passing a replication bucket created in a different stack,\nlike this:\n```\n// Passing a replication bucket created in a different stack.\nconst app = new App();\nconst replicationStack = new Stack(app, 'ReplicationStack', {\n  env: {\n    region: 'us-west-1',\n  },\n});\nconst key = new kms.Key(replicationStack, 'ReplicationKey');\nconst replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', {\n  // like was said above - replication buckets need a set physical name\n  bucketName: PhysicalName.GENERATE_IF_NEEDED,\n  encryptionKey: key, // does not work!\n});\n\n// later...\nnew codepipeline.Pipeline(replicationStack, 'Pipeline', {\n  crossRegionReplicationBuckets: {\n    'us-west-1': replicationBucket,\n  },\n});\n```\nWhen trying to encrypt it\n(and note that if any of the cross-region actions happen to be cross-account as well,\nthe bucket *has to* be encrypted - otherwise the pipeline will fail at runtime),\nyou cannot use a key directly - KMS keys don't have physical names,\nand so you can't reference them across environments.\n\nIn this case, you need to use an alias in place of the key when creating the bucket:\n```\n// Passing an encrypted replication bucket created in a different stack.\nconst app = new App();\nconst replicationStack = new Stack(app, 'ReplicationStack', {\n  env: {\n    region: 'us-west-1',\n  },\n});\nconst key = new kms.Key(replicationStack, 'ReplicationKey');\nconst alias = new kms.Alias(replicationStack, 'ReplicationAlias', {\n  // aliasName is required\n  aliasName: PhysicalName.GENERATE_IF_NEEDED,\n  targetKey: key,\n});\nconst replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', {\n  bucketName: PhysicalName.GENERATE_IF_NEEDED,\n  encryptionKey: alias,\n});\n```\nVariables\n---\n\nThe library supports the CodePipeline Variables feature.\nEach action class that emits variables has a separate variables interface,\naccessed as a property of the action instance called `variables`.\nYou instantiate the action class and assign it to a local variable;\nwhen you want to use a variable in the configuration of a different action,\nyou access the appropriate property of the interface returned from `variables`,\nwhich represents a single variable.\nExample:\n```\n// MyAction is some action type that produces variables, like EcrSourceAction const myAction = new MyAction({\n  // ...\n  actionName: 'myAction',\n});\nnew OtherAction({\n  // ...\n  config: myAction.variables.myVariable,\n  actionName: 'otherAction',\n});\n```\nThe namespace name that will be used will be automatically generated by the pipeline construct,\nbased on the stage and action name;\nyou can pass a custom name when creating the action instance:\n```\n// MyAction is some action type that produces variables, like EcrSourceAction const myAction = new MyAction({\n  // ...\n  variablesNamespace: 'MyNamespace',\n  actionName: 'myAction',\n});\n```\nThere are also global variables available,\nnot tied to any action;\nthese are accessed through static properties of the `GlobalVariables` class:\n```\n// OtherAction is some action type that produces variables, like EcrSourceAction new OtherAction({\n  // ...\n  config: codepipeline.GlobalVariables.executionId,\n  actionName: 'otherAction',\n});\n```\nCheck the documentation of the `@aws-cdk/aws-codepipeline-actions`\nfor details on how to use the variables for each action class.\n\nSee the [CodePipeline documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html)\nfor more details on how to use the variables feature.\n\nEvents\n---\n\n### Using a pipeline as an event target\n\nA pipeline can be used as a target for a CloudWatch event rule:\n```\n// A pipeline being used as a target for a CloudWatch event rule.\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as events from '@aws-cdk/aws-events';\n\n// kick off the pipeline every day const rule = new events.Rule(this, 'Daily', {\n  schedule: events.Schedule.rate(Duration.days(1)),\n});\n\ndeclare const pipeline: codepipeline.Pipeline;\nrule.addTarget(new targets.CodePipeline(pipeline));\n```\nWhen a pipeline is used as an event target, the\n\"codepipeline:StartPipelineExecution\" permission is granted to the AWS CloudWatch Events service.\n\n### Event sources\n\nPipelines emit CloudWatch events. To define event rules for events emitted by the pipeline, stages or action, use the `onXxx` methods on the respective construct:\n```\n// Define event rules for events emitted by the pipeline import * as events from '@aws-cdk/aws-events';\n\ndeclare const myPipeline: codepipeline.Pipeline;\ndeclare const myStage: codepipeline.IStage;\ndeclare const myAction: codepipeline.Action;\ndeclare const target: events.IRuleTarget;\nmyPipeline.onStateChange('MyPipelineStateChange', { target: target } );\nmyStage.onStateChange('MyStageStateChange', target);\nmyAction.onStateChange('MyActionStateChange', target);\n```\nCodeStar Notifications\n---\n\nTo define CodeStar Notification rules for Pipelines, use one of the `notifyOnXxx()` methods.\nThey are very similar to `onXxx()` methods for CloudWatch events:\n```\n// Define CodeStar Notification rules for Pipelines import * as chatbot from '@aws-cdk/aws-chatbot';\nconst target = new chatbot.SlackChannelConfiguration(this, 'MySlackChannel', {\n  slackChannelConfigurationName: 'YOUR_CHANNEL_NAME',\n  slackWorkspaceId: 'YOUR_SLACK_WORKSPACE_ID',\n  slackChannelId: 'YOUR_SLACK_CHANNEL_ID',\n});\n\ndeclare const pipeline: codepipeline.Pipeline;\nconst rule = pipeline.notifyOnExecutionStateChange('NotifyOnExecutionStateChange', target);\n```\nReadme\n---\n\n### Keywords\n\n* aws\n* cdk\n* constructs\n* codepipeline\n* pipeline"}}},{"rowIdx":466,"cells":{"project":{"kind":"string","value":"dbplot"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘dbplot’\n                                            October 13, 2022\nVersion 0.3.3\nTitle Simplifies Plotting Data Inside Databases\nDescription Leverages 'dplyr' to process the calculations of a plot inside a database.\n      This package provides helper functions that abstract the work at three levels:\n      outputs a 'ggplot', outputs the calculations, outputs the formula\n      needed to calculate bins.\nDepends R (>= 3.1)\nImports dplyr (>= 0.7), rlang (>= 0.3), ggplot2, purrr, magrittr\nSuggests dbplyr (>= 1.4.0), testthat, tidyr, covr\nLicense GPL-3\nURL https://github.com/edgararuiz/dbplot\nBugReports https://github.com/edgararuiz/dbplot/issues\nRoxygenNote 7.0.2\nEncoding UTF-8\nNeedsCompilation no\nAuthor  [aut, cre]\nMaintainer  <>\nRepository CRAN\nDate/Publication 2020-02-07 01:10:09 UTC\nR topics documented:\ndbplot_ba... 2\ndbplot_boxplo... 3\ndbplot_histogra... 3\ndbplot_lin... 4\ndbplot_raste... 5\ndb_bi... 6\ndb_compute_bin... 7\ndb_compute_boxplo... 8\ndb_compute_coun... 8\ndb_compute_raste... 9\n  dbplot_bar                   Bar plot\nDescription\n    Uses very generic dplyr code to aggregate data and then ‘ggplot2‘ to create the plot. Because of this\n    approach, the calculations automatically run inside the database if ‘data‘ has a database or sparklyr\n    connection. The ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\nUsage\n    dbplot_bar(data, x, ..., y = n())\nArguments\n    data               A table (tbl)\n    x                  A discrete variable\n    ...                A set of named or unamed aggregations\n    y                  The aggregation formula. Defaults to count (n)\nSee Also\n    dbplot_line , dbplot_histogram, dbplot_raster\nExamples\n    library(ggplot2)\n    library(dplyr)\n    # Returns a plot of the row count per am\n    mtcars %>%\n      dbplot_bar(am)\n    # Returns a plot of the average mpg per am\n    mtcars %>%\n      dbplot_bar(am, mean(mpg))\n    # Returns the average and sum of mpg per am\n    mtcars %>%\n      dbplot_bar(am, avg_mpg = mean(mpg), sum_mpg = sum(mpg))\n  dbplot_boxplot               Boxplot\nDescription\n    Uses very generic dplyr code to aggregate data and then ‘ggplot2‘ to create the boxplot Because\n    of this approach, the calculations automatically run inside the database if ‘data‘ has a database or\n    sparklyr connection. The ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\n    It currently only works with Spark and Hive connections.\nUsage\n    dbplot_boxplot(data, x, var, coef = 1.5)\nArguments\n    data                A table (tbl)\n    x                   A discrete variable in which to group the boxplots\n    var                 A continuous variable\n    coef                Length of the whiskers as multiple of IQR. Defaults to 1.5\nSee Also\n    dbplot_bar, dbplot_line , dbplot_raster, dbplot_histogram\n  dbplot_histogram             Histogram\nDescription\n    Uses very generic dplyr code to aggregate data and then ‘ggplot2‘ to create the histogram. Because\n    of this approach, the calculations automatically run inside the database if ‘data‘ has a database or\n    sparklyr connection. The ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\nUsage\n    dbplot_histogram(data, x, bins = 30, binwidth = NULL)\nArguments\n    data                A table (tbl)\n    x                   A continuous variable\n    bins                Number of bins. Defaults to 30.\n    binwidth            Single value that sets the side of the bins, it overrides bins\nSee Also\n    dbplot_bar, dbplot_line , dbplot_raster\nExamples\n    library(ggplot2)\n    library(dplyr)\n    # A ggplot histogram with 30 bins\n    mtcars %>%\n       dbplot_histogram(mpg)\n    # A ggplot histogram with bins of size 10\n    mtcars %>%\n       dbplot_histogram(mpg, binwidth = 10)\n  dbplot_line                   Bar plot\nDescription\n    Uses very generic dplyr code to aggregate data and then ‘ggplot2‘ to create a line plot. Because\n    of this approach, the calculations automatically run inside the database if ‘data‘ has a database or\n    sparklyr connection. The ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\n    If multiple named aggregations are passed, ‘dbplot‘ will only use one SQL query to perform all of\n    the operations. The purpose is to increase efficiency, and only make one \"trip\" to the database in\n    order to obtains multiple, related, plots.\nUsage\n    dbplot_line(data, x, ..., y = n())\nArguments\n    data                A table (tbl)\n    x                   A discrete variable\n    ...                 A set of named or unamed aggregations\n    y                   The aggregation formula. Defaults to count (n)\nSee Also\n    dbplot_bar, dbplot_histogram, dbplot_raster\nExamples\n    library(ggplot2)\n    library(dplyr)\n    # Returns a plot of the row count per cyl\n    mtcars %>%\n      dbplot_line(cyl)\n    # Returns a plot of the average mpg per cyl\n    mtcars %>%\n      dbplot_line(cyl, mean(mpg))\n    # Returns the average and sum of mpg per am\n    mtcars %>%\n      dbplot_line(am, avg_mpg = mean(mpg), sum_mpg = sum(mpg))\n  dbplot_raster                 Raster plot\nDescription\n    To visualize two continuous variables, we typically resort to a Scatter plot. However, this may\n    not be practical when visualizing millions or billions of dots representing the intersections of the\n    two variables. A Raster plot may be a better option, because it concentrates the intersections into\n    squares that are easier to parse visually.\n    Uses very generic dplyr code to aggregate data and ggplot2 to create a raster plot. Because of this\n    approach, the calculations automatically run inside the database if ‘data‘ has a database or sparklyr\n    connection. The ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\nUsage\n    dbplot_raster(data, x, y, fill = n(), resolution = 100, complete = FALSE)\nArguments\n    data                A table (tbl)\n    x                   A continuous variable\n    y                   A continuous variable\n    fill                The aggregation formula. Defaults to count (n)\n    resolution          The number of bins created by variable. The highest the number, the more\n                        records can be potentially imported from the sourd\n    complete            Uses tidyr::complete to include empty bins. Inserts value of 0.\nDetails\n    There are two considerations when using a Raster plot with a database. Both considerations are\n    related to the size of the results downloaded from the database:\n    - The number of bins requested: The higher the bins value is, the more data is downloaded from the\n    database.\n    - How concentrated the data is: This refers to how many intersections return a value. The more\n    intersections without a value, the less data is downloaded from the database.\nSee Also\n    dbplot_bar, dbplot_line , dbplot_histogram\nExamples\n    library(ggplot2)\n    library(dplyr)\n    # Returns a 100x100 raster plot of record count of intersections of eruptions and waiting\n    faithful %>%\n       dbplot_raster(eruptions, waiting)\n    # Returns a 50x50 raster plot of eruption averages of intersections of eruptions and waiting\n    faithful %>%\n       dbplot_raster(eruptions, waiting, fill = mean(eruptions), resolution = 50)\n  db_bin                         Bin formula\nDescription\n    Uses the rlang package to build the formula needed to create the bins of a numeric variable in an\n    unevaluated fashion. This way, the formula can be then passed inside a dplyr verb.\nUsage\n    db_bin(var, bins = 30, binwidth = NULL)\nArguments\n    var                  Variable name or formula\n    bins                 Number of bins. Defaults to 30.\n    binwidth             Single value that sets the side of the bins, it overrides bins\nExamples\n    library(dplyr)\n    # Important: Always name the field and\n    # prefix the function with `!!`` (See Details)\n    # Uses the default 30 bins\n    mtcars %>%\n      group_by(x = !!db_bin(mpg)) %>%\n      tally()\n    # Uses binwidth which overrides bins\n    mtcars %>%\n      group_by(x = !!db_bin(mpg, binwidth = 10)) %>%\n      tally()\n  db_compute_bins               Calculates a histogram bins\nDescription\n    Uses very generic dplyr code to create histogram bins. Because of this approach, the calculations\n    automatically run inside the database if ‘data‘ has a database or sparklyr connection. The ‘class()‘\n    of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\nUsage\n    db_compute_bins(data, x, bins = 30, binwidth = NULL)\nArguments\n    data                A table (tbl)\n    x                   A continuous variable\n    bins                Number of bins. Defaults to 30.\n    binwidth            Single value that sets the side of the bins, it overrides bins\nSee Also\n    db_bin,\nExamples\n    # Returns record count for 30 bins in mpg\n    mtcars %>%\n      db_compute_bins(mpg)\n    # Returns record count for bins of size 10\n    mtcars %>%\n       db_compute_bins(mpg, binwidth = 10)\n  db_compute_boxplot             Returns a dataframe with boxplot calculations\nDescription\n    Uses very generic dplyr code to create boxplot calculations. Because of this approach, the calcu-\n    lations automatically run inside the database if ‘data‘ has a database or sparklyr connection. The\n    ‘class()‘ of such tables in R are: tbl_sql, tbl_dbi, tbl_spark\n    It currently only works with Spark, Hive, and SQL Server connections.\n    Note that this function supports input tbl that already contains grouping variables. This can be\n    useful when creating faceted boxplots.\nUsage\n    db_compute_boxplot(data, x, var, coef = 1.5)\nArguments\n    data                 A table (tbl), can already contain additional grouping vars specified\n    x                    A discrete variable in which to group the boxplots\n    var                  A continuous variable\n    coef                 Length of the whiskers as multiple of IQR. Defaults to 1.5\nExamples\n    mtcars %>%\n       db_compute_boxplot(am, mpg)\n  db_compute_count               Aggregates over a discrete field\nDescription\n    Uses very generic dplyr code to aggregate data. Because of this approach, the calculations automat-\n    ically run inside the database if ‘data‘ has a database or sparklyr connection. The ‘class()‘ of such\n    tables in R are: tbl_sql, tbl_dbi, tbl_sql\nUsage\n    db_compute_count(data, x, ..., y = n())\nArguments\n    data                 A table (tbl)\n    x                    A discrete variable\n    ...                  A set of named or unamed aggregations\n    y                    The aggregation formula. Defaults to count (n)\nExamples\n    # Returns the row count per am\n    mtcars %>%\n      db_compute_count(am)\n    # Returns the average mpg per am\n    mtcars %>%\n      db_compute_count(am, mean(mpg))\n    # Returns the average and sum of mpg per am\n    mtcars %>%\n      db_compute_count(am, mean(mpg), sum(mpg))\n  db_compute_raster              Aggregates intersections of two variables\nDescription\n    To visualize two continuous variables, we typically resort to a Scatter plot. However, this may\n    not be practical when visualizing millions or billions of dots representing the intersections of the\n    two variables. A Raster plot may be a better option, because it concentrates the intersections into\n    squares that are easier to parse visually.\n    Uses very generic dplyr code to aggregate data. Because of this approach, the calculations automat-\n    ically run inside the database if ‘data‘ has a database or sparklyr connection. The ‘class()‘ of such\n    tables in R are: tbl_sql, tbl_dbi, tbl_sql\nUsage\n    db_compute_raster(data, x, y, fill = n(), resolution = 100, complete = FALSE)\n    db_compute_raster2(data, x, y, fill = n(), resolution = 100, complete = FALSE)\nArguments\n    data                 A table (tbl)\n    x                    A continuous variable\n    y                    A continuous variable\n    fill                 The aggregation formula. Defaults to count (n)\n    resolution           The number of bins created by variable. The highest the number, the more\n                         records can be potentially imported from the source\n    complete             Uses tidyr::complete to include empty bins. Inserts value of 0.\nDetails\n    There are two considerations when using a Raster plot with a database. Both considerations are\n    related to the size of the results downloaded from the database:\n    - The number of bins requested: The higher the bins value is, the more data is downloaded from the\n    database.\n    - How concentrated the data is: This refers to how many intersections return a value. The more\n    intersections without a value, the less data is downloaded from the database.\nExamples\n    # Returns a 100x100 grid of record count of intersections of eruptions and waiting\n    faithful %>%\n       db_compute_raster(eruptions, waiting)\n    # Returns a 50x50 grid of eruption averages of intersections of eruptions and waiting\n    faithful %>%\n       db_compute_raster(eruptions, waiting, fill = mean(eruptions), resolution = 50)"}}},{"rowIdx":467,"cells":{"project":{"kind":"string","value":"yandex_translator"},"source":{"kind":"string","value":"hex"},"language":{"kind":"string","value":"Erlang"},"content":{"kind":"string","value":"Toggle Theme\n\nyandex_translator v0.9.6\n API Reference\n===\n\n Modules\n---\n\n[YandexTranslator](YandexTranslator.html)\n\nElixir client for Yandex.Translate API\n\n[YandexTranslator.Client](YandexTranslator.Client.html)\n\nClient requests for old version of api, v1.5\n\n[YandexTranslator.Cloud](YandexTranslator.Cloud.html)\n\nClient requests for new version of cloud api\n\nToggle Theme\n\nyandex_translator v0.9.6 YandexTranslator \n \n===\n\nElixir client for Yandex.Translate API\n\n Configuration (new API)\n---\n\nAn API key and folder id can be set in your application’s config.\nFor getting api key and folder is check readme.\n```\nconfig :yandex_translator, cloud_api_key: \"API_KEY\"\nconfig :yandex_translator, cloud_folder_id: \"FOLDER_ID\"\n```\n Configuration (old API)\n---\n\nAn API key can be set in your application’s config.\nFor getting api key check readme.\n```\nconfig :yandex_translator, api_key: \"API_KEY\"\n```\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[detect(options)](#detect/1)\n\nDetect language for text For using cloud api options must contain iam_token param\n\n[get_iam_token()](#get_iam_token/0)\n\nGet IAM-token for using it in requests to Yandex.Cloud Valid 12 hours\n\n[get_iam_token(options)](#get_iam_token/1)\n\nGet IAM-token for using it in requests to Yandex.Cloud Valid 12 hours\n\n[langs()](#langs/0)\n\nGet available languages for translation\n\n[langs(options)](#langs/1)\n\nGet available languages for translation For using cloud api options must contain iam_token param\n\n[translate(options)](#translate/1)\n\nTranslate word or phrase For using cloud api options must contain iam_token param\n\n[Link to this section](#functions)\n Functions\n===\n\n[Link to this function](#detect/1 \"Link to this function\")\ndetect(options)\n\n```\ndetect([keyword](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{}}\n```\nDetect language for text For using cloud api options must contain iam_token param.\n\n Example (cloud API)\n---\n```\niex> YandexTranslator.detect([iam_token: \"\", text: \"Hello\"])\n{:ok, %{\"language\" => \"en\"}}\n```\n### \n\n Options (cloud API)\n```\niam_token - IAM-token, required folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\ntext - text for detection, required hint - list of possible languages, optional, example - \"en,ru\"\n```\n Example (old API)\n---\n```\niex> YandexTranslator.detect([text: \"Hello\", format: \"json\"])\n{:ok, %{\"code\" => 200, \"lang\" => \"en\"}}\n```\n Options (old API)\n---\n```\nkey - API KEY, required or optional (if presented in config)\nformat - one of the [xml|json], optional, default - xml text - text for detection, required hint - list of possible languages, optional, example - \"en,ru\"\n```\n[Link to this function](#get_iam_token/0 \"Link to this function\")\nget_iam_token()\n\n```\nget_iam_token() :: {:ok, %{iamToken: [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()}}\n```\nGet IAM-token for using it in requests to Yandex.Cloud Valid 12 hours.\n\n Example\n---\n```\niex> YandexTranslator.get_iam_token\n{:ok, %{\"iamToken\" => \"\"}}\n```\n[Link to this function](#get_iam_token/1 \"Link to this function\")\nget_iam_token(options)\n\n```\nget_iam_token([keyword](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{iamToken: [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()}}\n```\nGet IAM-token for using it in requests to Yandex.Cloud Valid 12 hours.\n\n Example\n---\n```\niex> YandexTranslator.get_iam_token([])\n{:ok, %{\"iamToken\" => \"\"}}\n```\n### \n\n Options\n```\nkey - API KEY, required or optional (if presented in configuration)\n```\n[Link to this function](#langs/0 \"Link to this function\")\nlangs()\n\n```\nlangs() :: {:ok, %{}}\n```\nGet available languages for translation\n\n Example\n---\n```\niex> YandexTranslator.langs\n```\n[Link to this function](#langs/1 \"Link to this function\")\nlangs(options)\n\n```\nlangs([keyword](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{}}\n```\nGet available languages for translation For using cloud api options must contain iam_token param.\n\n Example (cloud API)\n---\n```\niex> YandexTranslator.langs([iam_token: \"\"])\n{:ok, %{\"languages\" => [%{\"language\" => \"az\"}, %{...}, ...]}}\n```\n### \n\n Options (cloud API)\n```\niam_token - IAM-token, required folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\n```\n Example (old API)\n---\n```\niex> YandexTranslator.langs([format: \"json\"])\n{:ok, %{\"dirs\" => [\"az-ru\", ...]}}\n```\n### \n\n Options (old API)\n```\nkey - API KEY, required or optional (if presented in configuration)\nformat - one of the [xml|json], optional, default - xml ui - language code for getting language translations, optional, example - \"en\"\n```\n[Link to this function](#translate/1 \"Link to this function\")\ntranslate(options)\n\n```\ntranslate([keyword](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{}}\n```\nTranslate word or phrase For using cloud api options must contain iam_token param.\n\n Example (cloud API)\n---\n```\niex> YandexTranslator.translate([iam_token: iam_token, text: \"hello world\", source: \"en\", target: \"es\"])\n{:ok, %{\"translations\" => [%{\"text\" => \"hola mundo\"}]}}\n```\n### \n\n Options (cloud API)\n```\niam_token - IAM-token, required folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\ntext - text for detection, required source - source language, ISO 639-1 format (like \"en\"), optional target - target language, ISO 639-1 format (like \"ru\"), required format - text format, one of the [plain|html], default - plain, optional\n```\n Example (old API)\n---\n```\niex> YandexTranslator.translate([format: \"json\", text: \"Hello\", lang: \"en-es\"])\n{:ok, %{\"code\" => 200, \"lang\" => \"en-es\", \"text\" => [\"Hola\"]}}\n```\n Options (old API)\n---\n```\nkey - API KEY, required or optional (if presented in config)\nformat - one of the [xml|json], optional, default - xml text - text, required lang - direction of translation, optional, example - \"from-to\" or \"to\"\n```\n\nToggle Theme\n\nyandex_translator v0.9.6 YandexTranslator.Client \n \n===\n\nClient requests for old version of api, v1.5\n\n[Link to this section](#summary)\n Summary\n===\n\n[Types](#types)\n---\n\n[api_key()](#t:api_key/0)\n\n[path()](#t:path/0)\n\n[Functions](#functions)\n---\n\n[call(type, args)](#call/2)\n\nPerforms a request\n\n[Link to this section](#types)\n Types\n===\n\n[Link to this type](#t:api_key/0 \"Link to this type\")\napi_key()\n\n```\napi_key() :: {:api_key, [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()}\n```\n[Link to this type](#t:path/0 \"Link to this type\")\npath()\n\n```\npath() :: [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()\n```\n[Link to this section](#functions)\n Functions\n===\n\n[Link to this function](#call/2 \"Link to this function\")\ncall(type, args)\n\n```\ncall([String.t](https://hexdocs.pm/elixir/String.html#t:t/0)(), [list](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {}\n```\nPerforms a request\n\n Examples\n---\n```\niex> YandexTranslator.Client.call(\"langs\", args)\n```\n\nToggle Theme\n\nyandex_translator v0.9.6 YandexTranslator.Cloud \n \n===\n\nClient requests for new version of cloud api\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[call(type, args)](#call/2)\n\nPerforms a request\n\n[get_iam_token(args)](#get_iam_token/1)\n\nGet IAM-token\n\n[Link to this section](#functions)\n Functions\n===\n\n[Link to this function](#call/2 \"Link to this function\")\ncall(type, args)\n\n```\ncall([String.t](https://hexdocs.pm/elixir/String.html#t:t/0)(), [list](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{}}\n```\nPerforms a request\n\n Examples\n---\n```\niex> YandexTranslator.Cloud.call(\"languages\", args)\n```\n[Link to this function](#get_iam_token/1 \"Link to this function\")\nget_iam_token(args)\n\n```\nget_iam_token([keyword](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: {:ok, %{iamToken: [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()}}\n```\nGet IAM-token\n\n Examples\n---\n```\niex> YandexTranslator.Cloud.get_iam_token([])\n{:ok, %{\"iamToken\" => \"\"}}\n```"}}},{"rowIdx":468,"cells":{"project":{"kind":"string","value":"github.com/fortytw2/leaktest"},"source":{"kind":"string","value":"go"},"language":{"kind":"string","value":"Go"},"content":{"kind":"string","value":"README\n [¶](#section-readme)\n---\n\n### Leaktest [Build Status](https://travis-ci.org/fortytw2/leaktest) [codecov](https://codecov.io/gh/fortytw2/leaktest) [Sourcegraph](https://sourcegraph.com/github.com/fortytw2/leaktest?badge) [Documentation](http://godoc.org/github.com/fortytw2/leaktest)\n\nRefactored, tested variant of the goroutine leak detector found in both\n`net/http` tests and the `cockroachdb` source tree.\n\nTakes a snapshot of running goroutines at the start of a test, and at the end -\ncompares the two and *voila*. Ignores runtime/sys goroutines. Doesn't play nice with `t.Parallel()` right now, but there are plans to do so.\n\n#### Installation\n\nGo 1.7+\n```\ngo get -u github.com/fortytw2/leaktest\n```\nGo 1.5/1.6 need to use the tag `v1.0.0`, as newer versions depend on\n`context.Context`.\n\n#### Example\n\nThese tests fail, because they leak a goroutine\n```\n// Default \"Check\" will poll for 5 seconds to check that all\n// goroutines are cleaned up func TestPool(t *testing.T) {\n    defer leaktest.Check(t)()\n\n    go func() {\n        for {\n            time.Sleep(time.Second)\n        }\n    }()\n}\n\n// Helper function to timeout after X duration func TestPoolTimeout(t *testing.T) {\n    defer leaktest.CheckTimeout(t, time.Second)()\n\n    go func() {\n        for {\n            time.Sleep(time.Second)\n        }\n    }()\n}\n\n// Use Go 1.7+ context.Context for cancellation func TestPoolContext(t *testing.T) {\n    ctx, _ := context.WithTimeout(context.Background(), time.Second)\n    defer leaktest.CheckContext(ctx, t)()\n\n    go func() {\n        for {\n            time.Sleep(time.Second)\n        }\n    }()\n}\n```\n### LICENSE\n\nSame BSD-style as Go, see LICENSE\n\nDocumentation\n [¶](#section-documentation)\n---\n\n \n### Overview [¶](#pkg-overview)\n\nPackage leaktest provides tools to detect leaked goroutines in tests.\nTo use it, call \"defer leaktest.Check(t)()\" at the beginning of each test that may use goroutines.\ncopied out of the cockroachdb source tree with slight modifications to be more re-useable\n\n### Index [¶](#pkg-index)\n\n* [func Check(t ErrorReporter) func()](#Check)\n* [func CheckContext(ctx context.Context, t ErrorReporter) func()](#CheckContext)\n* [func CheckTimeout(t ErrorReporter, dur time.Duration) func()](#CheckTimeout)\n* [type ErrorReporter](#ErrorReporter)\n\n### Constants [¶](#pkg-constants)\n\nThis section is empty.\n\n### Variables [¶](#pkg-variables)\n\nThis section is empty.\n\n### Functions [¶](#pkg-functions)\n\n#### \nfunc [Check](https://github.com/fortytw2/leaktest/blob/v1.3.0/leaktest.go#L103) [¶](#Check)\n```\nfunc Check(t [ErrorReporter](#ErrorReporter)) func()\n```\nCheck snapshots the currently-running goroutines and returns a function to be run at the end of tests to see whether any goroutines leaked, waiting up to 5 seconds in error conditions\n\n#### \nfunc [CheckContext](https://github.com/fortytw2/leaktest/blob/v1.3.0/leaktest.go#L122) [¶](#CheckContext)\n\nadded in v1.1.0\n```\nfunc CheckContext(ctx [context](/context).[Context](/context#Context), t [ErrorReporter](#ErrorReporter)) func()\n```\nCheckContext is the same as Check, but uses a context.Context for cancellation and timeout control\n\n#### \nfunc [CheckTimeout](https://github.com/fortytw2/leaktest/blob/v1.3.0/leaktest.go#L108) [¶](#CheckTimeout)\n\nadded in v1.1.0\n```\nfunc CheckTimeout(t [ErrorReporter](#ErrorReporter), dur [time](/time).[Duration](/time#Duration)) func()\n```\nCheckTimeout is the same as Check, but with a configurable timeout\n\n### Types [¶](#pkg-types)\n\n#### \ntype [ErrorReporter](https://github.com/fortytw2/leaktest/blob/v1.3.0/leaktest.go#L96) [¶](#ErrorReporter)\n```\ntype ErrorReporter interface {\n Errorf(format [string](/builtin#string), args ...interface{})\n}\n```\nErrorReporter is a tiny subset of a testing.TB to make testing not such a massive pain"}}},{"rowIdx":469,"cells":{"project":{"kind":"string","value":"wasmer-types"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate wasmer_types\n===\n\nThis are the common types and utility tools for using WebAssembly in a Rust environment.\n\nThis crate provides common structures such as `Type` or `Value`, type indexes and native function wrappers with `Func`.\n\nRe-exports\n---\n\n* `pub use crate::compilation::target::CpuFeature;`\n* `pub use crate::compilation::target::Target;`\n* `pub use error::CompileError;`\n* `pub use error::DeserializeError;`\n* `pub use error::ImportError;`\n* `pub use error::MemoryError;`\n* `pub use error::MiddlewareError;`\n* `pub use error::ParseCpuFeatureError;`\n* `pub use error::PreInstantiationError;`\n* `pub use error::SerializeError;`\n* `pub use error::WasmError;`\n* `pub use error::WasmResult;`\n* `pub use crate::compilation::relocation::ArchivedRelocation;`\n* `pub use crate::compilation::relocation::Relocation;`\n* `pub use crate::compilation::relocation::RelocationKind;`\n* `pub use crate::compilation::relocation::RelocationLike;`\n* `pub use crate::compilation::relocation::RelocationTarget;`\n* `pub use crate::compilation::relocation::Relocations;`\n* `pub use crate::compilation::section::ArchivedCustomSection;`\n* `pub use crate::compilation::section::CustomSection;`\n* `pub use crate::compilation::section::CustomSectionLike;`\n* `pub use crate::compilation::section::CustomSectionProtection;`\n* `pub use crate::compilation::section::SectionBody;`\n* `pub use crate::compilation::section::SectionIndex;`\n* `pub use crate::compilation::address_map::FunctionAddressMap;`\n* `pub use crate::compilation::address_map::InstructionAddressMap;`\n* `pub use crate::compilation::function::ArchivedFunctionBody;`\n* `pub use crate::compilation::function::Compilation;`\n* `pub use crate::compilation::function::CompiledFunction;`\n* `pub use crate::compilation::function::CompiledFunctionFrameInfo;`\n* `pub use crate::compilation::function::CustomSections;`\n* `pub use crate::compilation::function::Dwarf;`\n* `pub use crate::compilation::function::FunctionBody;`\n* `pub use crate::compilation::function::FunctionBodyLike;`\n* `pub use crate::compilation::function::Functions;`\n* `pub use crate::compilation::module::CompileModuleInfo;`\n* `pub use crate::compilation::symbols::Symbol;`\n* `pub use crate::compilation::symbols::SymbolRegistry;`\n* `pub use crate::compilation::unwind::ArchivedCompiledFunctionUnwindInfo;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfo;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfoLike;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfoReference;`\n\nModules\n---\n\n* compilationTypes for compilation.\n* entityThe entity module, with common helpers for Rust structures\n* errorThe WebAssembly possible errors\n* libThe `lib` module defines a `std` module that is identical whether the `core` or the `std` feature is enabled.\n\nMacros\n---\n\n* entity_implMacro which provides the common implementation of a 32-bit entity reference.\n\nStructs\n---\n\n* ArchivedDataInitializerLocationAn archived `DataInitializerLocation`\n* ArchivedOwnedDataInitializerAn archived `OwnedDataInitializer`\n* ArchivedSerializableCompilationAn archived `SerializableCompilation`\n* ArchivedSerializableModuleAn archived `SerializableModule`\n* BytesUnits of WebAssembly memory in terms of 8-bit bytes.\n* CustomSectionIndexIndex type of a custom section inside a WebAssembly module.\n* DataIndexIndex type of a passive data segment inside the WebAssembly module.\n* DataInitializerA data initializer for linear memory.\n* DataInitializerLocationA memory index and offset within that memory where a data initialization should be performed.\n* ElemIndexIndex type of a passive element segment inside the WebAssembly module.\n* ExportTypeA descriptor for an exported WebAssembly value.\n* ExportsIteratorThis iterator allows us to iterate over the exports and offer nice API ergonomics over it.\n* FeaturesControls which experimental features will be enabled.\nFeatures usually have a corresponding WebAssembly proposal.\n* FrameInfoDescription of a frame in a backtrace.\n* FunctionIndexIndex type of a function (imported or local) inside the WebAssembly module.\n* FunctionTypeThe signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.\n* GlobalIndexIndex type of a global variable (imported or local) inside the WebAssembly module.\n* GlobalTypeWebAssembly global.\n* ImportKeyHash key of an import\n* ImportTypeA descriptor for an imported value into a wasm module.\n* ImportsIteratorThis iterator allows us to iterate over the imports and offer nice API ergonomics over it.\n* LocalFunctionIndexIndex type of a function defined locally inside the WebAssembly module.\n* LocalGlobalIndexIndex type of a global defined locally inside the WebAssembly module.\n* LocalMemoryIndexIndex type of a memory defined locally inside the WebAssembly module.\n* LocalTableIndexIndex type of a table defined locally inside the WebAssembly module.\n* Memory32Marker trait for 32-bit memories.\n* Memory64Marker trait for 64-bit memories.\n* MemoryIndexIndex type of a linear memory (imported or local) inside the WebAssembly module.\n* MemoryTypeA descriptor for a WebAssembly memory type.\n* MetadataHeaderMetadata header which holds an ABI version and the length of the remaining metadata.\n* ModuleInfoA translated WebAssembly module, excluding the function bodies and memory initializers.\n* OwnedDataInitializerAs `DataInitializer` but owning the data rather than holding a reference to it\n* PageCountOutOfRangeThe only error that can happen when converting `Bytes` to `Pages`\n* PagesUnits of WebAssembly pages (as specified to be 65,536 bytes).\n* SerializableCompilationThe compilation related data for a serialized modules\n* SerializableModuleSerializable struct that is able to serialize from and to a `ArtifactInfo`.\n* SignatureIndexIndex type of a signature (imported or local) inside the WebAssembly module.\n* SourceLocA source location.\n* StoreIdUnique ID to identify a context.\n* TableIndexIndex type of a table (imported or local) inside the WebAssembly module.\n* TableInitializerA WebAssembly table initializer.\n* TableTypeA descriptor for a table in a WebAssembly module.\n* TargetSharedSignatureIndexTarget specific type for shared signature index.\n* TrapInformationInformation about trap.\n* TripleA target “triple”. Historically such things had three fields, though they’ve added additional fields over time.\n* V128The WebAssembly V128 type\n* VMBuiltinFunctionIndexAn index type for builtin functions.\n* VMOffsetsThis class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.\n\nEnums\n---\n\n* Aarch64Architecture\n* ArchitectureThe “architecture” field, which in some cases also specifies a specific subarchitecture.\n* BinaryFormatThe “binary format” field, which is usually omitted, and the binary format is implied by the other fields.\n* CallingConventionThe calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.\n* EndiannessThe target memory endianness.\n* EnvironmentThe “environment” field, which specifies an ABI environment on top of the operating system. In many configurations, this field is omitted, and the environment is implied by the operating system.\n* ExportIndexAn entity to export.\n* ExternTypeA list of all possible types which can be externally referenced from a WebAssembly module.\n* GlobalInitGlobals are initialized via the `const` operators or by referring to another import.\n* ImportIndexAn entity to import.\n* LibCallThe name of a runtime library routine.\n* MemoryStyleImplementation styles for WebAssembly linear memory.\n* MutabilityIndicator of whether a global is mutable or not\n* OnCalledActionAfter the stack is unwound via asyncify what should the call loop do next\n* OperatingSystemThe “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.\n* PointerWidthThe width of a pointer (in the default address space).\n* TableStyleImplementation styles for WebAssembly tables.\n* TrapCodeA trap code describing the reason for a trap.\n* TypeA list of all possible value types in WebAssembly.\n* VendorThe “vendor” field, which in practice is little more than an arbitrary modifier.\n\nConstants\n---\n\n* VERSIONVersion number of this crate.\n* WASM_MAX_PAGESThe number of pages we can have before we run out of byte index space.\n* WASM_MIN_PAGESThe minimum number of pages allowed.\n* WASM_PAGE_SIZEWebAssembly page sizes are fixed to be 64KiB.\nNote: large page support may be added in an opt-in manner in the future.\n\nTraits\n---\n\n* DataInitializerLikeAny struct that acts like a `DataInitializer`.\n* DataInitializerLocationLikeAny struct that acts like a `DataInitializerLocation`.\n* MemorySizeTrait for the `Memory32` and `Memory64` marker types.\n* NativeWasmType`NativeWasmType` represents a Wasm type that has a direct representation on the host (hence the “native” term).\n* ValueTypeTrait for a Value type. A Value type is a type that is always valid and may be safely copied.\n\nFunctions\n---\n\n* is_wasmCheck if the provided bytes are wasm-like\n\nType Aliases\n---\n\n* AddendAddend to add to the symbol value.\n* CodeOffsetOffset in bytes from the beginning of the function.\n\nUnions\n---\n\n* RawValueRaw representation of a WebAssembly value.\n\nCrate wasmer_types\n===\n\nThis are the common types and utility tools for using WebAssembly in a Rust environment.\n\nThis crate provides common structures such as `Type` or `Value`, type indexes and native function wrappers with `Func`.\n\nRe-exports\n---\n\n* `pub use crate::compilation::target::CpuFeature;`\n* `pub use crate::compilation::target::Target;`\n* `pub use error::CompileError;`\n* `pub use error::DeserializeError;`\n* `pub use error::ImportError;`\n* `pub use error::MemoryError;`\n* `pub use error::MiddlewareError;`\n* `pub use error::ParseCpuFeatureError;`\n* `pub use error::PreInstantiationError;`\n* `pub use error::SerializeError;`\n* `pub use error::WasmError;`\n* `pub use error::WasmResult;`\n* `pub use crate::compilation::relocation::ArchivedRelocation;`\n* `pub use crate::compilation::relocation::Relocation;`\n* `pub use crate::compilation::relocation::RelocationKind;`\n* `pub use crate::compilation::relocation::RelocationLike;`\n* `pub use crate::compilation::relocation::RelocationTarget;`\n* `pub use crate::compilation::relocation::Relocations;`\n* `pub use crate::compilation::section::ArchivedCustomSection;`\n* `pub use crate::compilation::section::CustomSection;`\n* `pub use crate::compilation::section::CustomSectionLike;`\n* `pub use crate::compilation::section::CustomSectionProtection;`\n* `pub use crate::compilation::section::SectionBody;`\n* `pub use crate::compilation::section::SectionIndex;`\n* `pub use crate::compilation::address_map::FunctionAddressMap;`\n* `pub use crate::compilation::address_map::InstructionAddressMap;`\n* `pub use crate::compilation::function::ArchivedFunctionBody;`\n* `pub use crate::compilation::function::Compilation;`\n* `pub use crate::compilation::function::CompiledFunction;`\n* `pub use crate::compilation::function::CompiledFunctionFrameInfo;`\n* `pub use crate::compilation::function::CustomSections;`\n* `pub use crate::compilation::function::Dwarf;`\n* `pub use crate::compilation::function::FunctionBody;`\n* `pub use crate::compilation::function::FunctionBodyLike;`\n* `pub use crate::compilation::function::Functions;`\n* `pub use crate::compilation::module::CompileModuleInfo;`\n* `pub use crate::compilation::symbols::Symbol;`\n* `pub use crate::compilation::symbols::SymbolRegistry;`\n* `pub use crate::compilation::unwind::ArchivedCompiledFunctionUnwindInfo;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfo;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfoLike;`\n* `pub use crate::compilation::unwind::CompiledFunctionUnwindInfoReference;`\n\nModules\n---\n\n* compilationTypes for compilation.\n* entityThe entity module, with common helpers for Rust structures\n* errorThe WebAssembly possible errors\n* libThe `lib` module defines a `std` module that is identical whether the `core` or the `std` feature is enabled.\n\nMacros\n---\n\n* entity_implMacro which provides the common implementation of a 32-bit entity reference.\n\nStructs\n---\n\n* ArchivedDataInitializerLocationAn archived `DataInitializerLocation`\n* ArchivedOwnedDataInitializerAn archived `OwnedDataInitializer`\n* ArchivedSerializableCompilationAn archived `SerializableCompilation`\n* ArchivedSerializableModuleAn archived `SerializableModule`\n* BytesUnits of WebAssembly memory in terms of 8-bit bytes.\n* CustomSectionIndexIndex type of a custom section inside a WebAssembly module.\n* DataIndexIndex type of a passive data segment inside the WebAssembly module.\n* DataInitializerA data initializer for linear memory.\n* DataInitializerLocationA memory index and offset within that memory where a data initialization should be performed.\n* ElemIndexIndex type of a passive element segment inside the WebAssembly module.\n* ExportTypeA descriptor for an exported WebAssembly value.\n* ExportsIteratorThis iterator allows us to iterate over the exports and offer nice API ergonomics over it.\n* FeaturesControls which experimental features will be enabled.\nFeatures usually have a corresponding WebAssembly proposal.\n* FrameInfoDescription of a frame in a backtrace.\n* FunctionIndexIndex type of a function (imported or local) inside the WebAssembly module.\n* FunctionTypeThe signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.\n* GlobalIndexIndex type of a global variable (imported or local) inside the WebAssembly module.\n* GlobalTypeWebAssembly global.\n* ImportKeyHash key of an import\n* ImportTypeA descriptor for an imported value into a wasm module.\n* ImportsIteratorThis iterator allows us to iterate over the imports and offer nice API ergonomics over it.\n* LocalFunctionIndexIndex type of a function defined locally inside the WebAssembly module.\n* LocalGlobalIndexIndex type of a global defined locally inside the WebAssembly module.\n* LocalMemoryIndexIndex type of a memory defined locally inside the WebAssembly module.\n* LocalTableIndexIndex type of a table defined locally inside the WebAssembly module.\n* Memory32Marker trait for 32-bit memories.\n* Memory64Marker trait for 64-bit memories.\n* MemoryIndexIndex type of a linear memory (imported or local) inside the WebAssembly module.\n* MemoryTypeA descriptor for a WebAssembly memory type.\n* MetadataHeaderMetadata header which holds an ABI version and the length of the remaining metadata.\n* ModuleInfoA translated WebAssembly module, excluding the function bodies and memory initializers.\n* OwnedDataInitializerAs `DataInitializer` but owning the data rather than holding a reference to it\n* PageCountOutOfRangeThe only error that can happen when converting `Bytes` to `Pages`\n* PagesUnits of WebAssembly pages (as specified to be 65,536 bytes).\n* SerializableCompilationThe compilation related data for a serialized modules\n* SerializableModuleSerializable struct that is able to serialize from and to a `ArtifactInfo`.\n* SignatureIndexIndex type of a signature (imported or local) inside the WebAssembly module.\n* SourceLocA source location.\n* StoreIdUnique ID to identify a context.\n* TableIndexIndex type of a table (imported or local) inside the WebAssembly module.\n* TableInitializerA WebAssembly table initializer.\n* TableTypeA descriptor for a table in a WebAssembly module.\n* TargetSharedSignatureIndexTarget specific type for shared signature index.\n* TrapInformationInformation about trap.\n* TripleA target “triple”. Historically such things had three fields, though they’ve added additional fields over time.\n* V128The WebAssembly V128 type\n* VMBuiltinFunctionIndexAn index type for builtin functions.\n* VMOffsetsThis class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.\n\nEnums\n---\n\n* Aarch64Architecture\n* ArchitectureThe “architecture” field, which in some cases also specifies a specific subarchitecture.\n* BinaryFormatThe “binary format” field, which is usually omitted, and the binary format is implied by the other fields.\n* CallingConventionThe calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.\n* EndiannessThe target memory endianness.\n* EnvironmentThe “environment” field, which specifies an ABI environment on top of the operating system. In many configurations, this field is omitted, and the environment is implied by the operating system.\n* ExportIndexAn entity to export.\n* ExternTypeA list of all possible types which can be externally referenced from a WebAssembly module.\n* GlobalInitGlobals are initialized via the `const` operators or by referring to another import.\n* ImportIndexAn entity to import.\n* LibCallThe name of a runtime library routine.\n* MemoryStyleImplementation styles for WebAssembly linear memory.\n* MutabilityIndicator of whether a global is mutable or not\n* OnCalledActionAfter the stack is unwound via asyncify what should the call loop do next\n* OperatingSystemThe “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.\n* PointerWidthThe width of a pointer (in the default address space).\n* TableStyleImplementation styles for WebAssembly tables.\n* TrapCodeA trap code describing the reason for a trap.\n* TypeA list of all possible value types in WebAssembly.\n* VendorThe “vendor” field, which in practice is little more than an arbitrary modifier.\n\nConstants\n---\n\n* VERSIONVersion number of this crate.\n* WASM_MAX_PAGESThe number of pages we can have before we run out of byte index space.\n* WASM_MIN_PAGESThe minimum number of pages allowed.\n* WASM_PAGE_SIZEWebAssembly page sizes are fixed to be 64KiB.\nNote: large page support may be added in an opt-in manner in the future.\n\nTraits\n---\n\n* DataInitializerLikeAny struct that acts like a `DataInitializer`.\n* DataInitializerLocationLikeAny struct that acts like a `DataInitializerLocation`.\n* MemorySizeTrait for the `Memory32` and `Memory64` marker types.\n* NativeWasmType`NativeWasmType` represents a Wasm type that has a direct representation on the host (hence the “native” term).\n* ValueTypeTrait for a Value type. A Value type is a type that is always valid and may be safely copied.\n\nFunctions\n---\n\n* is_wasmCheck if the provided bytes are wasm-like\n\nType Aliases\n---\n\n* AddendAddend to add to the symbol value.\n* CodeOffsetOffset in bytes from the beginning of the function.\n\nUnions\n---\n\n* RawValueRaw representation of a WebAssembly value.\n\nEnum wasmer_types::compilation::target::CpuFeature\n===\n\n\n```\npub enum CpuFeature {\n SSE2,\n SSE3,\n SSSE3,\n SSE41,\n SSE42,\n POPCNT,\n AVX,\n BMI1,\n BMI2,\n AVX2,\n AVX512DQ,\n AVX512VL,\n AVX512F,\n LZCNT,\n}\n```\nThe nomenclature is inspired by the `cpuid` crate.\nThe list of supported features was initially retrieved from\n`cranelift-native`.\n\nThe `CpuFeature` enum values are likely to grow closer to the original `cpuid`. However, we prefer to start small and grow from there.\n\nIf you would like to use a flag that doesn’t exist yet here, please open a PR.\n\nVariants\n---\n\n### SSE2\n\n### SSE3\n\n### SSSE3\n\n### SSE41\n\n### SSE42\n\n### POPCNT\n\n### AVX\n\n### BMI1\n\n### BMI2\n\n### AVX2\n\n### AVX512DQ\n\n### AVX512VL\n\n### AVX512F\n\n### LZCNT\n\nImplementations\n---\n\n### impl CpuFeature\n\n#### pub fn for_host() -> EnumSet EnumSet>> BitAnd for CpuFeature\n\n#### type Output = EnumSet Self::Output\n\nPerforms the `&` operation. \n\n#### type Output = EnumSet Self::Output\n\nPerforms the `|` operation. \n\n#### type Output = EnumSet Self::Output\n\nPerforms the `^` operation. \n\n#### fn clone(&self) -> Self\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### type Repr = u16\n\nThe underlying type used to store the bitset.#### const ALL_BITS: Self::Repr = {transmute(0x3fff): ::Repr}\n\nA mask of bits that are valid in the bitset.#### const BIT_WIDTH: u32 = 14u32\n\nThe largest bit used in the bitset.#### const VARIANT_COUNT: u32 = 14u32\n\nThe number of variants in the bitset.#### fn enum_into_u32(self) -> u32\n\nConverts an enum of this type into its bit position.#### unsafe fn enum_from_u32(val: u32) -> Self\n\nConverts a bit position into an enum value.### impl FromStr for CpuFeature\n\n#### type Err = ParseCpuFeatureError\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### type Output = EnumSet Self::Output\n\nPerforms the unary `!` operation. \n\n#### fn eq(&self, other: &Self) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq> for CpuFeature\n\n#### fn eq(&self, other: &EnumSet) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl>> Sub for CpuFeature\n\n#### type Output = EnumSet Self::Output\n\nPerforms the `-` operation. \n\n#### fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n\n### impl EnumSetType for CpuFeature\n\n### impl Eq for CpuFeature\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for CpuFeature\n\n### impl Send for CpuFeature\n\n### impl Sync for CpuFeature\n\n### impl Unpin for CpuFeature\n\n### impl UnwindSafe for CpuFeature\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::target::Target\n===\n\n\n```\npub struct Target { /* private fields */ }\n```\nThis is the target that we will use for compiling the WebAssembly ModuleInfo, and then run it.\n\nImplementations\n---\n\n### impl Target\n\n#### pub fn new(triple: Triple, cpu_features: EnumSet) -> Self\n\nCreates a new target given a triple\n\n#### pub fn triple(&self) -> &Triple\n\nThe triple associated for the target.\n\n#### pub fn cpu_features(&self) -> &EnumSet bool\n\nCheck if target is a native (eq to host) or not\n\nTrait Implementations\n---\n\n### impl Clone for Target\n\n#### fn clone(&self) -> Target\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\nThe default for the Target will use the HOST as the triple\n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Target) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for Target\n\n### impl StructuralEq for Target\n\n### impl StructuralPartialEq for Target\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Target\n\n### impl Send for Target\n\n### impl Sync for Target\n\n### impl Unpin for Target\n\n### impl UnwindSafe for Target\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::CompileError\n===\n\n\n```\npub enum CompileError {\n    Wasm(WasmError),\n    Codegen(String),\n    Validate(String),\n    UnsupportedFeature(String),\n    UnsupportedTarget(String),\n    Resource(String),\n}\n```\nThe WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.\n\nThis is based on the [Wasm Compile Error][compile-error] API.\n\nVariants\n---\n\n### Wasm(WasmError)\n\nA Wasm translation error occured.\n\n### Codegen(String)\n\nA compilation error occured.\n\n### Validate(String)\n\nThe module did not pass validation.\n\n### UnsupportedFeature(String)\n\nThe compiler doesn’t support a Wasm feature\n\n### UnsupportedTarget(String)\n\nThe compiler cannot compile for the given target.\nThis can refer to the OS, the chipset or any other aspect of the target system.\n\n### Resource(String)\n\nInsufficient resources available for execution.\n\nTrait Implementations\n---\n\n### impl Debug for CompileError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(source: CompileError) -> Self\n\nConverts to this type from the input type.### impl From for CompileError\n\n#### fn from(original: WasmError) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for CompileError\n\n### impl Send for CompileError\n\n### impl Sync for CompileError\n\n### impl Unpin for CompileError\n\n### impl UnwindSafe for CompileError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::DeserializeError\n===\n\n\n```\npub enum DeserializeError {\n    Io(Error),\n    Generic(String),\n    Incompatible(String),\n    CorruptedBinary(String),\n    Compiler(CompileError),\n    InvalidByteLength {\n        expected: usize,\n        got: usize,\n    },\n}\n```\nThe Deserialize error can occur when loading a compiled Module from a binary.\n\nVariants\n---\n\n### Io(Error)\n\nAn IO error\n\n### Generic(String)\n\nA generic deserialization error\n\n### Incompatible(String)\n\nIncompatible serialized binary\n\n### CorruptedBinary(String)\n\nThe provided binary is corrupted\n\n### Compiler(CompileError)\n\nThe binary was valid, but we got an error when trying to allocate the required resources.\n\n### InvalidByteLength\n\n#### Fields\n\n`expected: usize`How many bytes were expected\n\n`got: usize`How many bytes the artifact contained\n\nInput artifact bytes have an invalid length\n\nTrait Implementations\n---\n\n### impl Debug for DeserializeError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(source: CompileError) -> Self\n\nConverts to this type from the input type.### impl From for DeserializeError\n\n#### fn from(source: Error) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl !RefUnwindSafe for DeserializeError\n\n### impl Send for DeserializeError\n\n### impl Sync for DeserializeError\n\n### impl Unpin for DeserializeError\n\n### impl !UnwindSafe for DeserializeError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::ImportError\n===\n\n\n```\npub enum ImportError {\n    IncompatibleType(ExternType, ExternType),\n    UnknownImport(ExternType),\n    MemoryError(String),\n}\n```\nAn ImportError.\n\nNote: this error is not standard to WebAssembly, but it’s useful to determine the import issue on the API side.\n\nVariants\n---\n\n### IncompatibleType(ExternType, ExternType)\n\nIncompatible Import Type.\nThis error occurs when the import types mismatch.\n\n### UnknownImport(ExternType)\n\nUnknown Import.\nThis error occurs when an import was expected but not provided.\n\n### MemoryError(String)\n\nMemory Error\n\nTrait Implementations\n---\n\n### impl Debug for ImportError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ImportError\n\n### impl Send for ImportError\n\n### impl Sync for ImportError\n\n### impl Unpin for ImportError\n\n### impl UnwindSafe for ImportError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::MemoryError\n===\n\n\n```\n#[non_exhaustive]pub enum MemoryError {\n    Region(String),\n    CouldNotGrow {\n        current: Pages,\n        attempted_delta: Pages,\n    },\n    InvalidMemory {\n        reason: String,\n    },\n    MinimumMemoryTooLarge {\n        min_requested: Pages,\n        max_allowed: Pages,\n    },\n    MaximumMemoryTooLarge {\n        max_requested: Pages,\n        max_allowed: Pages,\n    },\n    MemoryNotShared,\n    Generic(String),\n}\n```\nError type describing things that can go wrong when operating on Wasm Memories.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Region(String)\n\nLow level error with mmap.\n\n### CouldNotGrow\n\n#### Fields\n\n`current: Pages`The current size in pages.\n\n`attempted_delta: Pages`The attempted amount to grow by in pages.\n\nThe operation would cause the size of the memory to exceed the maximum or would cause an overflow leading to unindexable memory.\n\n### InvalidMemory\n\n#### Fields\n\n`reason: String`The reason why the provided memory is invalid.\n\nInvalid memory was provided.\n\n### MinimumMemoryTooLarge\n\n#### Fields\n\n`min_requested: Pages`The number of pages requested as the minimum amount of memory.\n\n`max_allowed: Pages`The maximum amount of memory we can allocate.\n\nCaller asked for more minimum memory than we can give them.\n\n### MaximumMemoryTooLarge\n\n#### Fields\n\n`max_requested: Pages`The number of pages requested as the maximum amount of memory.\n\n`max_allowed: Pages`The number of pages requested as the maximum amount of memory.\n\nCaller asked for a maximum memory greater than we can give them.\n\n### MemoryNotShared\n\nReturned when a shared memory is required, but the given memory is not shared.\n\n### Generic(String)\n\nA user defined error value, used for error cases not listed above.\n\nTrait Implementations\n---\n\n### impl Clone for MemoryError\n\n#### fn clone(&self) -> MemoryError\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &MemoryError) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for MemoryError\n\n### impl StructuralEq for MemoryError\n\n### impl StructuralPartialEq for MemoryError\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for MemoryError\n\n### impl Send for MemoryError\n\n### impl Sync for MemoryError\n\n### impl Unpin for MemoryError\n\n### impl UnwindSafe for MemoryError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::error::MiddlewareError\n===\n\n\n```\npub struct MiddlewareError {\n    pub name: String,\n    pub message: String,\n}\n```\nA error in the middleware.\n\nFields\n---\n\n`name: String`The name of the middleware where the error was created\n\n`message: String`The error message\n\nImplementations\n---\n\n### impl MiddlewareError\n\n#### pub fn new, B: Into>(name: A, message: B) -> Self\n\nCreate a new `MiddlewareError`\n\nTrait Implementations\n---\n\n### impl Debug for MiddlewareError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(original: MiddlewareError) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for MiddlewareError\n\n### impl Send for MiddlewareError\n\n### impl Sync for MiddlewareError\n\n### impl Unpin for MiddlewareError\n\n### impl UnwindSafe for MiddlewareError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::ParseCpuFeatureError\n===\n\n\n```\npub enum ParseCpuFeatureError {\n    Missing(String),\n}\n```\nThe error that can happen while parsing a `str`\nto retrieve a `CpuFeature`.\n\nVariants\n---\n\n### Missing(String)\n\nThe provided string feature doesn’t exist\n\nTrait Implementations\n---\n\n### impl Debug for ParseCpuFeatureError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ParseCpuFeatureError\n\n### impl Send for ParseCpuFeatureError\n\n### impl Sync for ParseCpuFeatureError\n\n### impl Unpin for ParseCpuFeatureError\n\n### impl UnwindSafe for ParseCpuFeatureError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::PreInstantiationError\n===\n\n\n```\npub enum PreInstantiationError {\n    CpuFeature(String),\n}\n```\nAn error while preinstantiating a module.\n\nVariants\n---\n\n### CpuFeature(String)\n\nThe module was compiled with a CPU feature that is not available on the current host.\n\nTrait Implementations\n---\n\n### impl Debug for PreInstantiationError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for PreInstantiationError\n\n### impl Send for PreInstantiationError\n\n### impl Sync for PreInstantiationError\n\n### impl Unpin for PreInstantiationError\n\n### impl UnwindSafe for PreInstantiationError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::SerializeError\n===\n\n\n```\npub enum SerializeError {\n    Io(Error),\n    Generic(String),\n}\n```\nThe Serialize error can occur when serializing a compiled Module into a binary.\n\nVariants\n---\n\n### Io(Error)\n\nAn IO error\n\n### Generic(String)\n\nA generic serialization error\n\nTrait Implementations\n---\n\n### impl Debug for SerializeError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(source: Error) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl !RefUnwindSafe for SerializeError\n\n### impl Send for SerializeError\n\n### impl Sync for SerializeError\n\n### impl Unpin for SerializeError\n\n### impl !UnwindSafe for SerializeError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::error::WasmError\n===\n\n\n```\npub enum WasmError {\n    InvalidWebAssembly {\n        message: String,\n        offset: usize,\n    },\n    Unsupported(String),\n    ImplLimitExceeded,\n    Middleware(MiddlewareError),\n    Generic(String),\n}\n```\nA WebAssembly translation error.\n\nWhen a WebAssembly function can’t be translated, one of these error codes will be returned to describe the failure.\n\nVariants\n---\n\n### InvalidWebAssembly\n\n#### Fields\n\n`message: String`A string describing the validation error.\n\n`offset: usize`The bytecode offset where the error occurred.\n\nThe input WebAssembly code is invalid.\n\nThis error code is used by a WebAssembly translator when it encounters invalid WebAssembly code. This should never happen for validated WebAssembly code.\n\n### Unsupported(String)\n\nA feature used by the WebAssembly code is not supported by the embedding environment.\n\nEmbedding environments may have their own limitations and feature restrictions.\n\n### ImplLimitExceeded\n\nAn implementation limit was exceeded.\n\n### Middleware(MiddlewareError)\n\nAn error from the middleware error.\n\n### Generic(String)\n\nA generic error.\n\nTrait Implementations\n---\n\n### impl Debug for WasmError\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(original: MiddlewareError) -> Self\n\nConverts to this type from the input type.### impl From for CompileError\n\n#### fn from(original: WasmError) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for WasmError\n\n### impl Send for WasmError\n\n### impl Sync for WasmError\n\n### impl Unpin for WasmError\n\n### impl UnwindSafe for WasmError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToString for Twhere\n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nType Alias wasmer_types::error::WasmResult\n===\n\n\n```\npub type WasmResult = Result;\n```\nA convenient alias for a `Result` that uses `WasmError` as the error type.\n\nAliased Type\n---\n```\nenum WasmResult {\n    Ok(T),\n    Err(WasmError),\n}\n```\nVariants\n---\n\n1.0.0### Ok(T)\n\nContains the success value\n\n1.0.0### Err(WasmError)\n\nContains the error value\n\nTrait Implementations\n---\n\n1.0.0 · source### impl Debug for Resultwhere\n T: Debug,\n E: Debug,\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. Read more1.0.0 · source### impl FromIterator> for Resultwhere\n V: FromIterator,\n\n#### fn from_iter(iter: I) -> Resultwhere\n I: IntoIterator>,\n\nTakes each element in the `Iterator`: if it is an `Err`, no further elements are taken, and the `Err` is returned. Should no `Err` occur, a container with the values of each `Result` is returned.\n\nHere is an example which increments every integer in a vector,\nchecking for overflow:\n```\nlet v = vec![1, 2];\nlet res: Result, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));\n```\nHere is another example that tries to subtract one from another list of integers, this time checking for underflow:\n```\nlet v = vec![1, 2, 0];\nlet res: Result, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));\n```\nHere is a variation on the previous example, showing that no further elements are taken from `iter` after the first `Err`.\n```\nlet v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);\n```\nSince the third element caused an underflow, no further elements were taken,\nso the final value of `shared` is 6 (= `3 + 2 + 1`), not 16.\n\n### impl FromResidual> for Resultwhere\n F: From,\n\n#### fn from_residual(residual: Result) -> Result,\n\n#### fn from_residual(_: Yeet) -> Result Hash for Resultwhere\n T: Hash,\n E: Hash,\n\n#### fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. Read more1.0.0 · source### impl IntoIterator for Result IntoIter = Ok(5);\nlet v: Vec = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result = Err(\"nothing!\");\nlet v: Vec = x.into_iter().collect();\nassert_eq!(v, []);\n```\n#### type Item = T\n\nThe type of the elements being iterated over.#### type IntoIter = IntoIter Ord for Resultwhere\n T: Ord,\n E: Ord,\n\n#### fn cmp(&self, other: &Result) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n T: PartialEq,\n E: PartialEq,\n\n#### fn eq(&self, other: &ArchivedResult) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialEq> for Resultwhere\n T: PartialEq,\n E: PartialEq,\n\n#### fn eq(&self, other: &Result) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialOrd> for Resultwhere\n T: PartialOrd,\n E: PartialOrd,\n\n#### fn partial_cmp(&self, other: &Result) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. Read more1.16.0 · source### impl Product> for Resultwhere\n T: Product,\n\n#### fn product(iter: I) -> Resultwhere\n I: Iterator>,\n\nTakes each element in the `Iterator`: if it is an `Err`, no further elements are taken, and the `Err` is returned. Should no `Err`\noccur, the product of all elements is returned.\n\n##### Examples\n\nThis multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns `Err`:\n```\nlet nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result = nums.iter().map(|w| w.parse::()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result = nums.iter().map(|w| w.parse::()).product();\nassert!(total.is_err());\n```\n### impl Residual for Result Sum> for Resultwhere\n T: Sum,\n\n#### fn sum(iter: I) -> Resultwhere\n I: Iterator>,\n\nTakes each element in the `Iterator`: if it is an `Err`, no further elements are taken, and the `Err` is returned. Should no `Err`\noccur, the sum of all elements is returned.\n\n##### Examples\n\nThis sums up every integer in a vector, rejecting the sum if a negative element is encountered:\n```\nlet f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));\n```\n### impl Try for Result ControlFlow< as Try>::Residual,  as Try>::Output🔬This is a nightly-only experimental API. (`try_trait_v2`)Used in `?` to decide whether the operator should produce a value\n(because this returned `ControlFlow::Continue`)\nor propagate a value back to the caller\n(because this returned `ControlFlow::Break`). Read more1.0.0 · source### impl Copy for Resultwhere\n T: Copy,\n E: Copy,\n\n1.0.0 · source### impl Eq for Resultwhere\n T: Eq,\n E: Eq,\n\n1.0.0 · source### impl StructuralEq for Result StructuralPartialEq for Result\":\"
impl&lt;T&gt; Iterator for IntoIter&lt;T&gt; type Item = T;\"}\n\nStruct wasmer_types::compilation::relocation::ArchivedRelocation\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedRelocationwhere\n RelocationKind: Archive,\n RelocationTarget: Archive,\n CodeOffset: Archive,\n Addend: Archive,{\n    pub kind: Archived,\n    pub reloc_target: Archived,\n    pub offset: Archived,\n    pub addend: Archived,\n}\n```\nAn archived `Relocation`\n\nFields\n---\n\n`kind: Archived`The archived counterpart of `Relocation::kind`\n\n`reloc_target: Archived`The archived counterpart of `Relocation::reloc_target`\n\n`offset: Archived`The archived counterpart of `Relocation::offset`\n\n`addend: Archived`The archived counterpart of `Relocation::addend`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedRelocationwhere\n RelocationKind: Archive,\n RelocationTarget: Archive,\n CodeOffset: Archive,\n Addend: Archive,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn kind(&self) -> RelocationKind\n\n#### fn reloc_target(&self) -> RelocationTarget\n\n#### fn offset(&self) -> CodeOffset\n\n#### fn addend(&self) -> Addend\n\n#### fn for_address(&self, start: usize, target_func_address: u64) -> (usize, u64)\n\nGiven a function start address, provide the relocation relative to that address. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedRelocation\n\n### impl Send for ArchivedRelocation\n\n### impl Sync for ArchivedRelocation\n\n### impl Unpin for ArchivedRelocation\n\n### impl UnwindSafe for ArchivedRelocation\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::relocation::Relocation\n===\n\n\n```\npub struct Relocation {\n    pub kind: RelocationKind,\n    pub reloc_target: RelocationTarget,\n    pub offset: CodeOffset,\n    pub addend: Addend,\n}\n```\nA record of a relocation to perform.\n\nFields\n---\n\n`kind: RelocationKind`The relocation kind.\n\n`reloc_target: RelocationTarget`Relocation target.\n\n`offset: CodeOffset`The offset where to apply the relocation.\n\n`addend: Addend`The addend to add to the relocation value.\n\nTrait Implementations\n---\n\n### impl Archive for Relocationwhere\n RelocationKind: Archive,\n RelocationTarget: Archive,\n CodeOffset: Archive,\n Addend: Archive,\n\n#### type Archived = ArchivedRelocation\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> Relocation\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n RelocationKind: Archive,\n Archived: Deserialize,\n RelocationTarget: Archive,\n Archived: Deserialize,\n CodeOffset: Archive,\n Archived: Deserialize,\n Addend: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for Relocation\n\n#### fn eq(&self, other: &Relocation) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl RelocationLike for Relocation\n\n#### fn kind(&self) -> RelocationKind\n\n#### fn reloc_target(&self) -> RelocationTarget\n\n#### fn offset(&self) -> CodeOffset\n\n#### fn addend(&self) -> Addend\n\n#### fn for_address(&self, start: usize, target_func_address: u64) -> (usize, u64)\n\nGiven a function start address, provide the relocation relative to that address. \n RelocationKind: Serialize<__S>,\n RelocationTarget: Serialize<__S>,\n CodeOffset: Serialize<__S>,\n Addend: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::compilation::relocation::RelocationKind\n===\n\n\n```\n#[repr(u8)]pub enum RelocationKind {\n Abs4,\n Abs8,\n X86PCRel4,\n X86PCRel8,\n X86CallPCRel4,\n X86CallPLTRel4,\n X86GOTPCRel4,\n Arm32Call,\n Arm64Call,\n Arm64Movw0,\n Arm64Movw1,\n Arm64Movw2,\n Arm64Movw3,\n RiscvPCRelHi20,\n RiscvPCRelLo12I,\n RiscvCall,\n ElfX86_64TlsGd,\n}\n```\nRelocation kinds for every ISA.\n\nVariants\n---\n\n### Abs4\n\nabsolute 4-byte\n\n### Abs8\n\nabsolute 8-byte\n\n### X86PCRel4\n\nx86 PC-relative 4-byte\n\n### X86PCRel8\n\nx86 PC-relative 8-byte\n\n### X86CallPCRel4\n\nx86 call to PC-relative 4-byte\n\n### X86CallPLTRel4\n\nx86 call to PLT-relative 4-byte\n\n### X86GOTPCRel4\n\nx86 GOT PC-relative 4-byte\n\n### Arm32Call\n\nArm32 call target\n\n### Arm64Call\n\nArm64 call target\n\n### Arm64Movw0\n\nArm64 movk/z part 0\n\n### Arm64Movw1\n\nArm64 movk/z part 1\n\n### Arm64Movw2\n\nArm64 movk/z part 2\n\n### Arm64Movw3\n\nArm64 movk/z part 3\n\n### RiscvPCRelHi20\n\nRISC-V PC-relative high 20bit\n\n### RiscvPCRelLo12I\n\nRISC-V PC-relative low 12bit, I-type\n\n### RiscvCall\n\nRISC-V call target\n\n### ElfX86_64TlsGd\n\nElf x86_64 32 bit signed PC relative offset to two GOT entries for GD symbol.\n\nTrait Implementations\n---\n\n### impl Archive for RelocationKind\n\n#### type Archived = RelocationKind\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> RelocationKind\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n &self,\n deserializer: &mut __D\n) -> Result) -> Result\n\nDisplay trait implementation drops the arch, since its used in contexts where the arch is already unambiguous, e.g. clif syntax with isa specified. In other contexts, use Debug.\n\n### impl PartialEq for RelocationKind\n\n#### fn eq(&self, other: &RelocationKind) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for RelocationKind\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for RelocationKind\n\n### impl Eq for RelocationKind\n\n### impl StructuralEq for RelocationKind\n\n### impl StructuralPartialEq for RelocationKind\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for RelocationKind\n\n### impl Send for RelocationKind\n\n### impl Sync for RelocationKind\n\n### impl Unpin for RelocationKind\n\n### impl UnwindSafe for RelocationKind\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nTrait wasmer_types::compilation::relocation::RelocationLike\n===\n\n\n```\npub trait RelocationLike {\n    // Required methods\n    fn kind(&self) -> RelocationKind;\n    fn reloc_target(&self) -> RelocationTarget;\n    fn offset(&self) -> CodeOffset;\n    fn addend(&self) -> Addend;\n\n    // Provided method\n    fn for_address(\n        &self,\n        start: usize,\n        target_func_address: u64\n    ) -> (usize, u64) { ... }\n}\n```\nAny struct that acts like a `Relocation`.\n\nRequired Methods\n---\n\n#### fn kind(&self) -> RelocationKind\n\n#### fn reloc_target(&self) -> RelocationTarget\n\n#### fn offset(&self) -> CodeOffset\n\n#### fn addend(&self) -> Addend\n\nProvided Methods\n---\n\n#### fn for_address(&self, start: usize, target_func_address: u64) -> (usize, u64)\n\nGiven a function start address, provide the relocation relative to that address.\n\nThe function returns the relocation address and the delta.\n\nImplementors\n---\n\n### impl RelocationLike for ArchivedRelocation\n\n### impl RelocationLike for Relocation\n\nEnum wasmer_types::compilation::relocation::RelocationTarget\n===\n\n\n```\n#[repr(u8)]pub enum RelocationTarget {\n    LocalFunc(LocalFunctionIndex),\n    LibCall(LibCall),\n    CustomSection(SectionIndex),\n}\n```\nDestination function. Can be either user function or some special one, like `memory.grow`.\n\nVariants\n---\n\n### LocalFunc(LocalFunctionIndex)\n\nA relocation to a function defined locally in the wasm (not an imported one).\n\n### LibCall(LibCall)\n\nA compiler-generated libcall.\n\n### CustomSection(SectionIndex)\n\nCustom sections generated by the compiler\n\nTrait Implementations\n---\n\n### impl Archive for RelocationTargetwhere\n LocalFunctionIndex: Archive,\n LibCall: Archive,\n SectionIndex: Archive,\n\n#### type Archived = RelocationTarget\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n LocalFunctionIndex: CheckBytes<__C>,\n LibCall: CheckBytes<__C>,\n SectionIndex: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> RelocationTarget\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n LocalFunctionIndex: Archive,\n Archived: Deserialize,\n LibCall: Archive,\n Archived: Deserialize,\n SectionIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for RelocationTarget\n\n#### fn eq(&self, other: &RelocationTarget) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for RelocationTargetwhere\n LocalFunctionIndex: Serialize<__S>,\n LibCall: Serialize<__S>,\n SectionIndex: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for RelocationTarget\n\n### impl Eq for RelocationTarget\n\n### impl StructuralEq for RelocationTarget\n\n### impl StructuralPartialEq for RelocationTarget\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for RelocationTarget\n\n### impl Send for RelocationTarget\n\n### impl Sync for RelocationTarget\n\n### impl Unpin for RelocationTarget\n\n### impl UnwindSafe for RelocationTarget\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nType Alias wasmer_types::compilation::relocation::Relocations\n===\n\n\n```\npub type Relocations = PrimaryMap>;\n```\nRelocations to apply to function bodies.\n\nAliased Type\n---\n```\nstruct Relocations { /* private fields */ }\n```\nImplementations\n---\n\n### impl PrimaryMapwhere\n K: EntityRef,\n\n#### pub fn new() -> Self\n\nCreate a new empty map.\n\n#### pub fn with_capacity(capacity: usize) -> Self\n\nCreate a new empty map with the given capacity.\n\n#### pub fn is_valid(&self, k: K) -> bool\n\nCheck if `k` is a valid key in the map.\n\n#### pub fn get(&self, k: K) -> Option<&VGet the element at `k` if it exists.\n\n#### pub fn get_mut(&mut self, k: K) -> Option<&mut VGet the element at `k` if it exists, mutable version.\n\n#### pub fn is_empty(&self) -> bool\n\nIs this map completely empty?\n\n#### pub fn len(&self) -> usize\n\nGet the total number of entity references created.\n\n#### pub fn keys(&self) -> Keys Iter<'_, VIterate over all the values in this map.\n\n#### pub fn values_mut(&mut self) -> IterMut<'_, VIterate over all the values in this map, mutable edition.\n\n#### pub fn iter(&self) -> Iter<'_, K, VIterate over all the keys and values in this map.\n\n#### pub fn iter_mut(&mut self) -> IterMut<'_, K, VIterate over all the keys and values in this map, mutable edition.\n\n#### pub fn clear(&mut self)\n\nRemove all entries from this map.\n\n#### pub fn next_key(&self) -> K\n\nGet the key that will be assigned to the next pushed value.\n\n#### pub fn push(&mut self, v: V) -> K\n\nAppend `v` to the mapping, assigning a new key which is returned.\n\n#### pub fn last(&self) -> Option<&VReturns the last element that was inserted in the map.\n\n#### pub fn reserve(&mut self, additional: usize)\n\nReserves capacity for at least `additional` more elements to be inserted.\n\n#### pub fn reserve_exact(&mut self, additional: usize)\n\nReserves the minimum capacity for exactly `additional` more elements to be inserted.\n\n#### pub fn shrink_to_fit(&mut self)\n\nShrinks the capacity of the `PrimaryMap` as much as possible.\n\n#### pub fn into_boxed_slice(self) -> BoxedSlice Archive for PrimaryMapwhere\n K: EntityRef,\n Vec: Archive,\n PhantomData: Archive,\n\n#### type Archived = ArchivedPrimaryMap PrimaryMap) -> Result\n\nFormats the value using the given formatter. \n K: EntityRef,\n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n K: EntityRef,\n Vec: Archive,\n Archived>: Deserialize, __D>,\n PhantomData: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result, __D::ErrorDeserializes using the given deserializer### impl FromIterator for PrimaryMapwhere\n K: EntityRef,\n\n#### fn from_iter(iter: T) -> Selfwhere\n T: IntoIterator,\n\nCreates a value from an iterator. \n K: EntityRef + Hash,\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n K: EntityRef,\n\nImmutable indexing into an `PrimaryMap`.\nThe indexed value must be in the map.\n\n#### type Output = V\n\nThe returned type after indexing.#### fn index(&self, k: K) -> &V\n\nPerforms the indexing (`container[index]`) operation. \n K: EntityRef,\n\nMutable indexing into an `PrimaryMap`.\n\n#### fn index_mut(&mut self, k: K) -> &mut V\n\nPerforms the mutable indexing (`container[index]`) operation. \n K: EntityRef,\n\n#### type Item = (K, V)\n\nThe type of the elements being iterated over.#### type IntoIter = IntoIter Self::IntoIter\n\nCreates an iterator from a value. \n K: EntityRef + PartialEq,\n\n#### fn eq(&self, other: &PrimaryMap) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized, K, V> Serialize<__S> for PrimaryMapwhere\n K: EntityRef,\n Vec: Serialize<__S>,\n PhantomData: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Eq for PrimaryMapwhere\n K: EntityRef + Eq,\n\n### impl StructuralEq for PrimaryMapwhere\n K: EntityRef,\n\n### impl StructuralPartialEq for PrimaryMapwhere\n K: EntityRef,\n\n{\"Iter<'_, K, V>\":\"

Notable traits for Iter&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for Iter&lt;'a, K, V&gt; type Item = (K, &amp;'a V);\",\"Iter<'_, V>\":\"

Notable traits for Iter&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for Iter&lt;'a, T&gt; type Item = &amp;'a T;\",\"IterMut<'_, K, V>\":\"

Notable traits for IterMut&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for IterMut&lt;'a, K, V&gt; type Item = (K, &amp;'a mut V);\",\"IterMut<'_, V>\":\"

Notable traits for IterMut&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for IterMut&lt;'a, T&gt; type Item = &amp;'a mut T;\",\"Keys\":\"

Notable traits for Keys&lt;K&gt;

impl&lt;K: EntityRef&gt; Iterator for Keys&lt;K&gt; type Item = K;\"}\n\nStruct wasmer_types::compilation::section::ArchivedCustomSection\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedCustomSectionwhere\n CustomSectionProtection: Archive,\n SectionBody: Archive,\n Vec: Archive,{\n    pub protection: Archived,\n    pub bytes: Archived,\n    pub relocations: Archived>,\n}\n```\nAn archived `CustomSection`\n\nFields\n---\n\n`protection: Archived`The archived counterpart of `CustomSection::protection`\n\n`bytes: Archived`The archived counterpart of `CustomSection::bytes`\n\n`relocations: Archived>`The archived counterpart of `CustomSection::relocations`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedCustomSectionwhere\n CustomSectionProtection: Archive,\n SectionBody: Archive,\n Vec: Archive,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### type Relocations = ArchivedRelocation\n\n#### fn protection(&self) -> &CustomSectionProtection\n\n#### fn bytes(&self) -> &[u8] \n\n#### fn relocations(&'a self) -> &[Self::Relocations]\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedCustomSection\n\n### impl Send for ArchivedCustomSection\n\n### impl Sync for ArchivedCustomSection\n\n### impl !Unpin for ArchivedCustomSection\n\n### impl UnwindSafe for ArchivedCustomSection\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nStruct wasmer_types::compilation::section::CustomSection\n===\n\n\n```\npub struct CustomSection {\n    pub protection: CustomSectionProtection,\n    pub bytes: SectionBody,\n    pub relocations: Vec,\n}\n```\nA Section for a `Compilation`.\n\nThis is used so compilers can store arbitrary information in the emitted module.\n\nFields\n---\n\n`protection: CustomSectionProtection`Memory protection that applies to this section.\n\n`bytes: SectionBody`The bytes corresponding to this section.\n\n> Note: These bytes have to be at-least 8-byte aligned\n> (the start of the memory pointer).\n> We might need to create another field for alignment in case it’s\n> needed in the future.\n`relocations: Vec`Relocations that apply to this custom section.\n\nTrait Implementations\n---\n\n### impl Archive for CustomSectionwhere\n CustomSectionProtection: Archive,\n SectionBody: Archive,\n Vec: Archive,\n\n#### type Archived = ArchivedCustomSection\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> CustomSection\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### type Relocations = Relocation\n\n#### fn protection(&self) -> &CustomSectionProtection\n\n#### fn bytes(&self) -> &[u8] \n\n#### fn relocations(&'a self) -> &[Self::Relocations]\n\n### impl Debug for CustomSection\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n CustomSectionProtection: Archive,\n Archived: Deserialize,\n SectionBody: Archive,\n Archived: Deserialize,\n Vec: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for CustomSection\n\n#### fn eq(&self, other: &CustomSection) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CustomSectionwhere\n CustomSectionProtection: Serialize<__S>,\n SectionBody: Serialize<__S>,\n Vec: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nTrait wasmer_types::compilation::section::CustomSectionLike\n===\n\n\n```\npub trait CustomSectionLike<'a> {\n    type Relocations: RelocationLike;\n\n    // Required methods\n    fn protection(&self) -> &CustomSectionProtection;\n    fn bytes(&self) -> &[u8] ;\n    fn relocations(&'a self) -> &[Self::Relocations];\n}\n```\nAny struct that acts like a `CustomSection`.\n\nRequired Associated Types\n---\n\n#### type Relocations: RelocationLike\n\nRequired Methods\n---\n\n#### fn protection(&self) -> &CustomSectionProtection\n\n#### fn bytes(&self) -> &[u8] \n\n#### fn relocations(&'a self) -> &[Self::Relocations]\n\nImplementors\n---\n\n### impl<'a> CustomSectionLike<'a> for ArchivedCustomSection\n\n#### type Relocations = ArchivedRelocation\n\n### impl<'a> CustomSectionLike<'a> for CustomSection\n\n#### type Relocations = Relocation\n\n{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nEnum wasmer_types::compilation::section::CustomSectionProtection\n===\n\n\n```\n#[repr(u8)]pub enum CustomSectionProtection {\n    Read,\n    ReadExecute,\n}\n```\nCustom section Protection.\n\nDetermines how a custom section may be used.\n\nVariants\n---\n\n### Read\n\nA custom section with read permission.\n\n### ReadExecute\n\nA custom section with read and execute permissions.\n\nTrait Implementations\n---\n\n### impl Archive for CustomSectionProtection\n\n#### type Archived = CustomSectionProtection\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> CustomSectionProtection\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n &self,\n deserializer: &mut __D\n) -> Result for CustomSectionProtection\n\n#### fn eq(&self, other: &CustomSectionProtection) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CustomSectionProtection\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Eq for CustomSectionProtection\n\n### impl StructuralEq for CustomSectionProtection\n\n### impl StructuralPartialEq for CustomSectionProtection\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for CustomSectionProtection\n\n### impl Send for CustomSectionProtection\n\n### impl Sync for CustomSectionProtection\n\n### impl Unpin for CustomSectionProtection\n\n### impl UnwindSafe for CustomSectionProtection\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::section::SectionBody\n===\n\n\n```\npub struct SectionBody(/* private fields */);\n```\nThe bytes in the section.\n\nImplementations\n---\n\n### impl SectionBody\n\n#### pub fn new_with_vec(contents: Vec) -> Self\n\nCreate a new section body with the given contents.\n\n#### pub fn as_ptr(&self) -> *constu8\n\nReturns a raw pointer to the section’s buffer.\n\n#### pub fn len(&self) -> usize\n\nReturns the length of this section in bytes.\n\n#### pub fn as_slice(&self) -> &[u8] \n\nDereferences into the section’s buffer.\n\n#### pub fn is_empty(&self) -> bool\n\nReturns whether or not the section body is empty.\n\nTrait Implementations\n---\n\n### impl Archive for SectionBodywhere\n Vec: Archive,\n\n#### type Archived = ArchivedSectionBody\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> SectionBody\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> SectionBody\n\nReturns the “default value” for a type. \n Vec: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for SectionBody\n\n#### fn eq(&self, other: &SectionBody) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for SectionBodywhere\n Vec: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nStruct wasmer_types::compilation::section::SectionIndex\n===\n\n\n```\npub struct SectionIndex(/* private fields */);\n```\nIndex type of a Section defined inside a WebAssembly `Compilation`.\n\nImplementations\n---\n\n### impl SectionIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for SectionIndexwhere\n u32: Archive,\n\n#### type Archived = SectionIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> SectionIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> SectionIndex\n\nReturns the “default value” for a type. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for SectionIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &SectionIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &SectionIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for SectionIndex\n\n#### fn partial_cmp(&self, other: &SectionIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> SectionIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for SectionIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::address_map::FunctionAddressMap\n===\n\n\n```\npub struct FunctionAddressMap {\n    pub instructions: Vec,\n    pub start_srcloc: SourceLoc,\n    pub end_srcloc: SourceLoc,\n    pub body_offset: usize,\n    pub body_len: usize,\n}\n```\nFunction and its instructions addresses mappings.\n\nFields\n---\n\n`instructions: Vec`Instructions maps.\nThe array is sorted by the InstructionAddressMap::code_offset field.\n\n`start_srcloc: SourceLoc`Function start source location (normally declaration).\n\n`end_srcloc: SourceLoc`Function end source location.\n\n`body_offset: usize`Generated function body offset if applicable, otherwise 0.\n\n`body_len: usize`Generated function body length.\n\nTrait Implementations\n---\n\n### impl Archive for FunctionAddressMapwhere\n Vec: Archive,\n SourceLoc: Archive,\n usize: Archive,\n\n#### type Archived = ArchivedFunctionAddressMap\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> FunctionAddressMap\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> FunctionAddressMap\n\nReturns the “default value” for a type. \n Vec: Archive,\n Archived>: Deserialize, __D>,\n SourceLoc: Archive,\n Archived: Deserialize,\n usize: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for FunctionAddressMap\n\n#### fn eq(&self, other: &FunctionAddressMap) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for FunctionAddressMapwhere\n Vec: Serialize<__S>,\n SourceLoc: Serialize<__S>,\n usize: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::address_map::InstructionAddressMap\n===\n\n\n```\npub struct InstructionAddressMap {\n    pub srcloc: SourceLoc,\n    pub code_offset: usize,\n    pub code_len: usize,\n}\n```\nSingle source location to generated address mapping.\n\nFields\n---\n\n`srcloc: SourceLoc`Original source location.\n\n`code_offset: usize`Generated instructions offset.\n\n`code_len: usize`Generated instructions length.\n\nTrait Implementations\n---\n\n### impl Archive for InstructionAddressMapwhere\n SourceLoc: Archive,\n usize: Archive,\n\n#### type Archived = ArchivedInstructionAddressMap\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> InstructionAddressMap\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n SourceLoc: Archive,\n Archived: Deserialize,\n usize: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for InstructionAddressMap\n\n#### fn eq(&self, other: &InstructionAddressMap) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for InstructionAddressMapwhere\n SourceLoc: Serialize<__S>,\n usize: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::function::ArchivedFunctionBody\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedFunctionBodywhere\n Vec: Archive,\n Option: Archive,{\n    pub body: Archived>,\n    pub unwind_info: Archived>,\n}\n```\nAn archived `FunctionBody`\n\nFields\n---\n\n`body: Archived>`The archived counterpart of `FunctionBody::body`\n\n`unwind_info: Archived>`The archived counterpart of `FunctionBody::unwind_info`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedFunctionBodywhere\n Vec: Archive,\n Option: Archive,\n Archived>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### type UnwindInfo = ArchivedCompiledFunctionUnwindInfo\n\n#### fn body(&'a self) -> &'a [u8] \n\n#### fn unwind_info(&'a self) -> Option<&Self::UnwindInfoAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedFunctionBody\n\n### impl Send for ArchivedFunctionBody\n\n### impl Sync for ArchivedFunctionBody\n\n### impl !Unpin for ArchivedFunctionBody\n\n### impl UnwindSafe for ArchivedFunctionBody\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nStruct wasmer_types::compilation::function::Compilation\n===\n\n\n```\npub struct Compilation {\n    pub functions: Functions,\n    pub custom_sections: CustomSections,\n    pub function_call_trampolines: PrimaryMap,\n    pub dynamic_function_trampolines: PrimaryMap,\n    pub debug: Option,\n}\n```\nThe result of compiling a WebAssembly module’s functions.\n\nFields\n---\n\n`functions: Functions`Compiled code for the function bodies.\n\n`custom_sections: CustomSections`Custom sections for the module.\nIt will hold the data, for example, for constants used in a function, global variables, rodata_64, hot/cold function partitioning, …\n\n`function_call_trampolines: PrimaryMap`Trampolines to call a function defined locally in the wasm via a provided `Vec` of values.\n\nThis allows us to call easily Wasm functions, such as:\n\n```\nlet func = instance.exports.get_function(\"my_func\");\nfunc.call(&[Value::I32(1)]);\n```\n`dynamic_function_trampolines: PrimaryMap`Trampolines to call a dynamic function defined in a host, from a Wasm module.\n\nThis allows us to create dynamic Wasm functions, such as:\n\n```\nfn my_func(values: &[Val]) -> Result, RuntimeError> {\n    // do something\n}\n\nlet my_func_type = FunctionType::new(vec![Type::I32], vec![Type::I32]);\nlet imports = imports!{\n    \"namespace\" => {\n        \"my_func\" => Function::new(&store, my_func_type, my_func),\n    }\n}\n```\nNote: Dynamic function trampolines are only compiled for imported function types.\n\n`debug: Option`Section ids corresponding to the Dwarf debug info\n\nTrait Implementations\n---\n\n### impl Debug for Compilation\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn eq(&self, other: &Compilation) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for Compilation\n\n### impl StructuralEq for Compilation\n\n### impl StructuralPartialEq for Compilation\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Compilation\n\n### impl Send for Compilation\n\n### impl Sync for Compilation\n\n### impl Unpin for Compilation\n\n### impl UnwindSafe for Compilation\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::function::CompiledFunction\n===\n\n\n```\npub struct CompiledFunction {\n    pub body: FunctionBody,\n    pub relocations: Vec,\n    pub frame_info: CompiledFunctionFrameInfo,\n}\n```\nThe result of compiling a WebAssembly function.\n\nThis structure only have the compiled information data\n(function bytecode body, relocations, traps, jump tables and unwind information).\n\nFields\n---\n\n`body: FunctionBody`The function body.\n\n`relocations: Vec`The relocations (in the body)\n\n`frame_info: CompiledFunctionFrameInfo`The frame information.\n\nTrait Implementations\n---\n\n### impl Archive for CompiledFunctionwhere\n FunctionBody: Archive,\n Vec: Archive,\n CompiledFunctionFrameInfo: Archive,\n\n#### type Archived = ArchivedCompiledFunction\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> CompiledFunction\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n FunctionBody: Archive,\n Archived: Deserialize,\n Vec: Archive,\n Archived>: Deserialize, __D>,\n CompiledFunctionFrameInfo: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for CompiledFunction\n\n#### fn eq(&self, other: &CompiledFunction) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CompiledFunctionwhere\n FunctionBody: Serialize<__S>,\n Vec: Serialize<__S>,\n CompiledFunctionFrameInfo: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::function::CompiledFunctionFrameInfo\n===\n\n\n```\npub struct CompiledFunctionFrameInfo {\n    pub traps: Vec,\n    pub address_map: FunctionAddressMap,\n}\n```\nThe frame info for a Compiled function.\n\nThis structure is only used for reconstructing the frame information after a `Trap`.\n\nFields\n---\n\n`traps: Vec`The traps (in the function body).\n\nCode offsets of the traps MUST be in ascending order.\n\n`address_map: FunctionAddressMap`The address map.\n\nTrait Implementations\n---\n\n### impl Archive for CompiledFunctionFrameInfowhere\n Vec: Archive,\n FunctionAddressMap: Archive,\n\n#### type Archived = ArchivedCompiledFunctionFrameInfo\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> CompiledFunctionFrameInfo\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> CompiledFunctionFrameInfo\n\nReturns the “default value” for a type. \n Vec: Archive,\n Archived>: Deserialize, __D>,\n FunctionAddressMap: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for CompiledFunctionFrameInfo\n\n#### fn eq(&self, other: &CompiledFunctionFrameInfo) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CompiledFunctionFrameInfowhere\n Vec: Serialize<__S>,\n FunctionAddressMap: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nType Alias wasmer_types::compilation::function::CustomSections\n===\n\n\n```\npub type CustomSections = PrimaryMap;\n```\nThe custom sections for a Compilation.\n\nAliased Type\n---\n```\nstruct CustomSections { /* private fields */ }\n```\nImplementations\n---\n\n### impl PrimaryMapwhere\n K: EntityRef,\n\n#### pub fn new() -> Self\n\nCreate a new empty map.\n\n#### pub fn with_capacity(capacity: usize) -> Self\n\nCreate a new empty map with the given capacity.\n\n#### pub fn is_valid(&self, k: K) -> bool\n\nCheck if `k` is a valid key in the map.\n\n#### pub fn get(&self, k: K) -> Option<&VGet the element at `k` if it exists.\n\n#### pub fn get_mut(&mut self, k: K) -> Option<&mut VGet the element at `k` if it exists, mutable version.\n\n#### pub fn is_empty(&self) -> bool\n\nIs this map completely empty?\n\n#### pub fn len(&self) -> usize\n\nGet the total number of entity references created.\n\n#### pub fn keys(&self) -> Keys Iter<'_, VIterate over all the values in this map.\n\n#### pub fn values_mut(&mut self) -> IterMut<'_, VIterate over all the values in this map, mutable edition.\n\n#### pub fn iter(&self) -> Iter<'_, K, VIterate over all the keys and values in this map.\n\n#### pub fn iter_mut(&mut self) -> IterMut<'_, K, VIterate over all the keys and values in this map, mutable edition.\n\n#### pub fn clear(&mut self)\n\nRemove all entries from this map.\n\n#### pub fn next_key(&self) -> K\n\nGet the key that will be assigned to the next pushed value.\n\n#### pub fn push(&mut self, v: V) -> K\n\nAppend `v` to the mapping, assigning a new key which is returned.\n\n#### pub fn last(&self) -> Option<&VReturns the last element that was inserted in the map.\n\n#### pub fn reserve(&mut self, additional: usize)\n\nReserves capacity for at least `additional` more elements to be inserted.\n\n#### pub fn reserve_exact(&mut self, additional: usize)\n\nReserves the minimum capacity for exactly `additional` more elements to be inserted.\n\n#### pub fn shrink_to_fit(&mut self)\n\nShrinks the capacity of the `PrimaryMap` as much as possible.\n\n#### pub fn into_boxed_slice(self) -> BoxedSlice Archive for PrimaryMapwhere\n K: EntityRef,\n Vec: Archive,\n PhantomData: Archive,\n\n#### type Archived = ArchivedPrimaryMap PrimaryMap) -> Result\n\nFormats the value using the given formatter. \n K: EntityRef,\n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n K: EntityRef,\n Vec: Archive,\n Archived>: Deserialize, __D>,\n PhantomData: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result, __D::ErrorDeserializes using the given deserializer### impl FromIterator for PrimaryMapwhere\n K: EntityRef,\n\n#### fn from_iter(iter: T) -> Selfwhere\n T: IntoIterator,\n\nCreates a value from an iterator. \n K: EntityRef + Hash,\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n K: EntityRef,\n\nImmutable indexing into an `PrimaryMap`.\nThe indexed value must be in the map.\n\n#### type Output = V\n\nThe returned type after indexing.#### fn index(&self, k: K) -> &V\n\nPerforms the indexing (`container[index]`) operation. \n K: EntityRef,\n\nMutable indexing into an `PrimaryMap`.\n\n#### fn index_mut(&mut self, k: K) -> &mut V\n\nPerforms the mutable indexing (`container[index]`) operation. \n K: EntityRef,\n\n#### type Item = (K, V)\n\nThe type of the elements being iterated over.#### type IntoIter = IntoIter Self::IntoIter\n\nCreates an iterator from a value. \n K: EntityRef + PartialEq,\n\n#### fn eq(&self, other: &PrimaryMap) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized, K, V> Serialize<__S> for PrimaryMapwhere\n K: EntityRef,\n Vec: Serialize<__S>,\n PhantomData: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Eq for PrimaryMapwhere\n K: EntityRef + Eq,\n\n### impl StructuralEq for PrimaryMapwhere\n K: EntityRef,\n\n### impl StructuralPartialEq for PrimaryMapwhere\n K: EntityRef,\n\n{\"Iter<'_, K, V>\":\"

Notable traits for Iter&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for Iter&lt;'a, K, V&gt; type Item = (K, &amp;'a V);\",\"Iter<'_, V>\":\"

Notable traits for Iter&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for Iter&lt;'a, T&gt; type Item = &amp;'a T;\",\"IterMut<'_, K, V>\":\"

Notable traits for IterMut&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for IterMut&lt;'a, K, V&gt; type Item = (K, &amp;'a mut V);\",\"IterMut<'_, V>\":\"

Notable traits for IterMut&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for IterMut&lt;'a, T&gt; type Item = &amp;'a mut T;\",\"Keys\":\"

Notable traits for Keys&lt;K&gt;

impl&lt;K: EntityRef&gt; Iterator for Keys&lt;K&gt; type Item = K;\"}\n\nStruct wasmer_types::compilation::function::Dwarf\n===\n\n\n```\npub struct Dwarf {\n    pub eh_frame: SectionIndex,\n}\n```\nThe DWARF information for this Compilation.\n\nIt is used for retrieving the unwind information once an exception happens.\nIn the future this structure may also hold other information useful for debugging.\n\nFields\n---\n\n`eh_frame: SectionIndex`The section index in the `Compilation` that corresponds to the exception frames.\nLearn more.\n\nImplementations\n---\n\n### impl Dwarf\n\n#### pub fn new(eh_frame: SectionIndex) -> Self\n\nCreates a `Dwarf` struct with the corresponding indices for its sections\n\nTrait Implementations\n---\n\n### impl Archive for Dwarfwhere\n SectionIndex: Archive,\n\n#### type Archived = Dwarf\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n SectionIndex: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> Dwarf\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n SectionIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for Dwarf\n\n#### fn eq(&self, other: &Dwarf) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for Dwarfwhere\n SectionIndex: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::compilation::function::FunctionBody\n===\n\n\n```\npub struct FunctionBody {\n    pub body: Vec,\n    pub unwind_info: Option,\n}\n```\nThe function body.\n\nFields\n---\n\n`body: Vec`The function body bytes.\n\n`unwind_info: Option`The function unwind info\n\nTrait Implementations\n---\n\n### impl Archive for FunctionBodywhere\n Vec: Archive,\n Option: Archive,\n\n#### type Archived = ArchivedFunctionBody\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> FunctionBody\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Vec: Archive,\n Archived>: Deserialize, __D>,\n Option: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result FunctionBodyLike<'a> for FunctionBody\n\n#### type UnwindInfo = CompiledFunctionUnwindInfo\n\n#### fn body(&'a self) -> &'a [u8] \n\n#### fn unwind_info(&'a self) -> Option<&Self::UnwindInfo### impl PartialEq for FunctionBody\n\n#### fn eq(&self, other: &FunctionBody) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for FunctionBodywhere\n Vec: Serialize<__S>,\n Option: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nTrait wasmer_types::compilation::function::FunctionBodyLike\n===\n\n\n```\npub trait FunctionBodyLike<'a> {\n    type UnwindInfo: CompiledFunctionUnwindInfoLike<'a>;\n\n    // Required methods\n    fn body(&'a self) -> &'a [u8] ;\n    fn unwind_info(&'a self) -> Option<&Self::UnwindInfo>;\n}\n```\nAny struct that acts like a `FunctionBody`.\n\nRequired Associated Types\n---\n\n#### type UnwindInfo: CompiledFunctionUnwindInfoLike<'aRequired Methods\n---\n\n#### fn body(&'a self) -> &'a [u8] \n\n#### fn unwind_info(&'a self) -> Option<&Self::UnwindInfoImplementors\n---\n\n### impl<'a> FunctionBodyLike<'a> for ArchivedFunctionBody\n\n#### type UnwindInfo = ArchivedCompiledFunctionUnwindInfo\n\n### impl<'a> FunctionBodyLike<'a> for FunctionBody\n\n#### type UnwindInfo = CompiledFunctionUnwindInfo\n\n{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nType Alias wasmer_types::compilation::function::Functions\n===\n\n\n```\npub type Functions = PrimaryMap;\n```\nThe compiled functions map (index in the Wasm -> function)\n\nAliased Type\n---\n```\nstruct Functions { /* private fields */ }\n```\nImplementations\n---\n\n### impl PrimaryMapwhere\n K: EntityRef,\n\n#### pub fn new() -> Self\n\nCreate a new empty map.\n\n#### pub fn with_capacity(capacity: usize) -> Self\n\nCreate a new empty map with the given capacity.\n\n#### pub fn is_valid(&self, k: K) -> bool\n\nCheck if `k` is a valid key in the map.\n\n#### pub fn get(&self, k: K) -> Option<&VGet the element at `k` if it exists.\n\n#### pub fn get_mut(&mut self, k: K) -> Option<&mut VGet the element at `k` if it exists, mutable version.\n\n#### pub fn is_empty(&self) -> bool\n\nIs this map completely empty?\n\n#### pub fn len(&self) -> usize\n\nGet the total number of entity references created.\n\n#### pub fn keys(&self) -> Keys Iter<'_, VIterate over all the values in this map.\n\n#### pub fn values_mut(&mut self) -> IterMut<'_, VIterate over all the values in this map, mutable edition.\n\n#### pub fn iter(&self) -> Iter<'_, K, VIterate over all the keys and values in this map.\n\n#### pub fn iter_mut(&mut self) -> IterMut<'_, K, VIterate over all the keys and values in this map, mutable edition.\n\n#### pub fn clear(&mut self)\n\nRemove all entries from this map.\n\n#### pub fn next_key(&self) -> K\n\nGet the key that will be assigned to the next pushed value.\n\n#### pub fn push(&mut self, v: V) -> K\n\nAppend `v` to the mapping, assigning a new key which is returned.\n\n#### pub fn last(&self) -> Option<&VReturns the last element that was inserted in the map.\n\n#### pub fn reserve(&mut self, additional: usize)\n\nReserves capacity for at least `additional` more elements to be inserted.\n\n#### pub fn reserve_exact(&mut self, additional: usize)\n\nReserves the minimum capacity for exactly `additional` more elements to be inserted.\n\n#### pub fn shrink_to_fit(&mut self)\n\nShrinks the capacity of the `PrimaryMap` as much as possible.\n\n#### pub fn into_boxed_slice(self) -> BoxedSlice Archive for PrimaryMapwhere\n K: EntityRef,\n Vec: Archive,\n PhantomData: Archive,\n\n#### type Archived = ArchivedPrimaryMap PrimaryMap) -> Result\n\nFormats the value using the given formatter. \n K: EntityRef,\n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n K: EntityRef,\n Vec: Archive,\n Archived>: Deserialize, __D>,\n PhantomData: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result, __D::ErrorDeserializes using the given deserializer### impl FromIterator for PrimaryMapwhere\n K: EntityRef,\n\n#### fn from_iter(iter: T) -> Selfwhere\n T: IntoIterator,\n\nCreates a value from an iterator. \n K: EntityRef + Hash,\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n K: EntityRef,\n\nImmutable indexing into an `PrimaryMap`.\nThe indexed value must be in the map.\n\n#### type Output = V\n\nThe returned type after indexing.#### fn index(&self, k: K) -> &V\n\nPerforms the indexing (`container[index]`) operation. \n K: EntityRef,\n\nMutable indexing into an `PrimaryMap`.\n\n#### fn index_mut(&mut self, k: K) -> &mut V\n\nPerforms the mutable indexing (`container[index]`) operation. \n K: EntityRef,\n\n#### type Item = (K, V)\n\nThe type of the elements being iterated over.#### type IntoIter = IntoIter Self::IntoIter\n\nCreates an iterator from a value. \n K: EntityRef + PartialEq,\n\n#### fn eq(&self, other: &PrimaryMap) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized, K, V> Serialize<__S> for PrimaryMapwhere\n K: EntityRef,\n Vec: Serialize<__S>,\n PhantomData: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Eq for PrimaryMapwhere\n K: EntityRef + Eq,\n\n### impl StructuralEq for PrimaryMapwhere\n K: EntityRef,\n\n### impl StructuralPartialEq for PrimaryMapwhere\n K: EntityRef,\n\n{\"Iter<'_, K, V>\":\"

Notable traits for Iter&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for Iter&lt;'a, K, V&gt; type Item = (K, &amp;'a V);\",\"Iter<'_, V>\":\"

Notable traits for Iter&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for Iter&lt;'a, T&gt; type Item = &amp;'a T;\",\"IterMut<'_, K, V>\":\"

Notable traits for IterMut&lt;'a, K, V&gt;

impl&lt;'a, K: EntityRef, V&gt; Iterator for IterMut&lt;'a, K, V&gt; type Item = (K, &amp;'a mut V);\",\"IterMut<'_, V>\":\"

Notable traits for IterMut&lt;'a, T&gt;

impl&lt;'a, T&gt; Iterator for IterMut&lt;'a, T&gt; type Item = &amp;'a mut T;\",\"Keys\":\"

Notable traits for Keys&lt;K&gt;

impl&lt;K: EntityRef&gt; Iterator for Keys&lt;K&gt; type Item = K;\"}\n\nStruct wasmer_types::compilation::module::CompileModuleInfo\n===\n\n\n```\npub struct CompileModuleInfo {\n    pub features: Features,\n    pub module: Arc,\n    pub memory_styles: PrimaryMap,\n    pub table_styles: PrimaryMap,\n}\n```\nThe required info for compiling a module.\n\nThis differs from `ModuleInfo` because it have extra info only possible after translation (such as the features used for compiling,\nor the `MemoryStyle` and `TableStyle`).\n\nFields\n---\n\n`features: Features`The features used for compiling the module\n\n`module: Arc`The module information\n\n`memory_styles: PrimaryMap`The memory styles used for compiling.\n\nThe compiler will emit the most optimal code based on the memory style (static or dynamic) chosen.\n\n`table_styles: PrimaryMap`The table plans used for compiling.\n\nTrait Implementations\n---\n\n### impl Archive for CompileModuleInfowhere\n Features: Archive,\n Arc: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n\n#### type Archived = ArchivedCompileModuleInfo\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> CompileModuleInfo\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Features: Archive,\n Archived: Deserialize,\n Arc: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for CompileModuleInfo\n\n#### fn eq(&self, other: &CompileModuleInfo) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CompileModuleInfowhere\n Features: Serialize<__S>,\n Arc: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::compilation::symbols::Symbol\n===\n\n\n```\npub enum Symbol {\n    Metadata,\n    LocalFunction(LocalFunctionIndex),\n    Section(SectionIndex),\n    FunctionCallTrampoline(SignatureIndex),\n    DynamicFunctionTrampoline(FunctionIndex),\n}\n```\nThe kinds of wasmer_types objects that might be found in a native object file.\n\nVariants\n---\n\n### Metadata\n\nA metadata section, indexed by a unique prefix\n(usually the wasm file SHA256 hash)\n\n### LocalFunction(LocalFunctionIndex)\n\nA function defined in the wasm.\n\n### Section(SectionIndex)\n\nA wasm section.\n\n### FunctionCallTrampoline(SignatureIndex)\n\nThe function call trampoline for a given signature.\n\n### DynamicFunctionTrampoline(FunctionIndex)\n\nThe dynamic function trampoline for a given function.\n\nTrait Implementations\n---\n\n### impl Archive for Symbolwhere\n LocalFunctionIndex: Archive,\n SectionIndex: Archive,\n SignatureIndex: Archive,\n FunctionIndex: Archive,\n\n#### type Archived = Symbol\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> Symbol\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n LocalFunctionIndex: Archive,\n Archived: Deserialize,\n SectionIndex: Archive,\n Archived: Deserialize,\n SignatureIndex: Archive,\n Archived: Deserialize,\n FunctionIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Symbol) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Symbol) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Symbol\n\n#### fn partial_cmp(&self, other: &Symbol) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n LocalFunctionIndex: Serialize<__S>,\n SectionIndex: Serialize<__S>,\n SignatureIndex: Serialize<__S>,\n FunctionIndex: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Eq for Symbol\n\n### impl StructuralEq for Symbol\n\n### impl StructuralPartialEq for Symbol\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Symbol\n\n### impl Send for Symbol\n\n### impl Sync for Symbol\n\n### impl Unpin for Symbol\n\n### impl UnwindSafe for Symbol\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nTrait wasmer_types::compilation::symbols::SymbolRegistry\n===\n\n\n```\npub trait SymbolRegistry: Send + Sync {\n    // Required methods\n    fn symbol_to_name(&self, symbol: Symbol) -> String;\n    fn name_to_symbol(&self, name: &str) -> Option;\n}\n```\nThis trait facilitates symbol name lookups in a native object file.\n\nRequired Methods\n---\n\n#### fn symbol_to_name(&self, symbol: Symbol) -> String\n\nGiven a `Symbol` it returns the name for that symbol in the object file\n\n#### fn name_to_symbol(&self, name: &str) -> Option: Archive,{\n    WindowsX64(Archived>),\n    Dwarf,\n}\n```\nAn archived `CompiledFunctionUnwindInfo`\n\nVariants\n---\n\n### WindowsX64(Archived>)\n\n#### Tuple Fields\n\n`0: Archived>`The archived counterpart of `CompiledFunctionUnwindInfo::WindowsX64::0`\n\nThe archived counterpart of `CompiledFunctionUnwindInfo::WindowsX64`\n\n### Dwarf\n\nThe archived counterpart of `CompiledFunctionUnwindInfo::Dwarf`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedCompiledFunctionUnwindInfowhere\n Vec: Archive,\n Archived>: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn get(&'a self) -> CompiledFunctionUnwindInfoReference<'aAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedCompiledFunctionUnwindInfo\n\n### impl Send for ArchivedCompiledFunctionUnwindInfo\n\n### impl Sync for ArchivedCompiledFunctionUnwindInfo\n\n### impl !Unpin for ArchivedCompiledFunctionUnwindInfo\n\n### impl UnwindSafe for ArchivedCompiledFunctionUnwindInfo\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::compilation::unwind::CompiledFunctionUnwindInfo\n===\n\n\n```\npub enum CompiledFunctionUnwindInfo {\n    WindowsX64(Vec),\n    Dwarf,\n}\n```\nCompiled function unwind information.\n\n> Note: Windows OS have a different way of representing the unwind info,\n> That’s why we keep the Windows data and the Unix frame layout in different\n> fields.\nVariants\n---\n\n### WindowsX64(Vec)\n\nWindows UNWIND_INFO.\n\n### Dwarf\n\nThe unwind info is added to the Dwarf section in `Compilation`.\n\nTrait Implementations\n---\n\n### impl Archive for CompiledFunctionUnwindInfowhere\n Vec: Archive,\n\n#### type Archived = ArchivedCompiledFunctionUnwindInfo\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> CompiledFunctionUnwindInfo\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn get(&'a self) -> CompiledFunctionUnwindInfoReference<'a### impl Debug for CompiledFunctionUnwindInfo\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Vec: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for CompiledFunctionUnwindInfo\n\n#### fn eq(&self, other: &CompiledFunctionUnwindInfo) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for CompiledFunctionUnwindInfowhere\n Vec: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Eq for CompiledFunctionUnwindInfo\n\n### impl StructuralEq for CompiledFunctionUnwindInfo\n\n### impl StructuralPartialEq for CompiledFunctionUnwindInfo\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for CompiledFunctionUnwindInfo\n\n### impl Send for CompiledFunctionUnwindInfo\n\n### impl Sync for CompiledFunctionUnwindInfo\n\n### impl Unpin for CompiledFunctionUnwindInfo\n\n### impl UnwindSafe for CompiledFunctionUnwindInfo\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nTrait wasmer_types::compilation::unwind::CompiledFunctionUnwindInfoLike\n===\n\n\n```\npub trait CompiledFunctionUnwindInfoLike<'a> {\n    // Required method\n    fn get(&'a self) -> CompiledFunctionUnwindInfoReference<'a>;\n}\n```\nAny struct that acts like a `CompiledFunctionUnwindInfo`.\n\nRequired Methods\n---\n\n#### fn get(&'a self) -> CompiledFunctionUnwindInfoReference<'aImplementors\n---\n\n### impl<'a> CompiledFunctionUnwindInfoLike<'a> for ArchivedCompiledFunctionUnwindInfo\n\n### impl<'a> CompiledFunctionUnwindInfoLike<'a> for CompiledFunctionUnwindInfo\n\nEnum wasmer_types::compilation::unwind::CompiledFunctionUnwindInfoReference\n===\n\n\n```\npub enum CompiledFunctionUnwindInfoReference<'a> {\n    WindowsX64(&'a [u8]),\n    Dwarf,\n}\n```\nGeneric reference to data in a `CompiledFunctionUnwindInfo`\n\nVariants\n---\n\n### WindowsX64(&'a [u8])\n\n### Dwarf\n\nTrait Implementations\n---\n\n### impl<'a> Clone for CompiledFunctionUnwindInfoReference<'a#### fn clone(&self) -> CompiledFunctionUnwindInfoReference<'aReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nFormats the value using the given formatter. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<'a> Eq for CompiledFunctionUnwindInfoReference<'a### impl<'a> StructuralEq for CompiledFunctionUnwindInfoReference<'a### impl<'a> StructuralPartialEq for CompiledFunctionUnwindInfoReference<'aAuto Trait Implementations\n---\n\n### impl<'a> RefUnwindSafe for CompiledFunctionUnwindInfoReference<'a### impl<'a> Send for CompiledFunctionUnwindInfoReference<'a### impl<'a> Sync for CompiledFunctionUnwindInfoReference<'a### impl<'a> Unpin for CompiledFunctionUnwindInfoReference<'a### impl<'a> UnwindSafe for CompiledFunctionUnwindInfoReference<'aBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nModule wasmer_types::compilation\n===\n\nTypes for compilation.\n\nModules\n---\n\n* address_mapData structures to provide transformation of the source\n* functionA `Compilation` contains the compiled function bodies for a WebAssembly module (`CompiledFunction`).\n* moduleTypes for modules.\n* relocationRelocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses.\n* sectionThis module define the required structures to emit custom Sections in a `Compilation`.\n* symbolsThis module define the required structures for compilation symbols.\n* targetTarget configuration\n* unwindA `CompiledFunctionUnwindInfo` contains the function unwind information.\n\nModule wasmer_types::entity\n===\n\nThe entity module, with common helpers for Rust structures\n\nModules\n---\n\n* packed_optionCompact representation of `Option` for types with a reserved value.\n\nMacros\n---\n\n* entity_implMacro which provides the common implementation of a 32-bit entity reference.\n\nStructs\n---\n\n* ArchivedPrimaryMapAn archived `PrimaryMap`\n* BoxedSliceA slice mapping `K -> V` allocating dense entity references.\n* IterIterate over all keys in order.\n* IterMutIterate over all keys in order.\n* KeysIterate over all keys in order.\n* PrimaryMapA primary mapping `K -> V` allocating dense entity references.\n* SecondaryMapA mapping `K -> V` for densely indexed entity references.\n\nTraits\n---\n\n* EntityRefA type wrapping a small integer index should implement `EntityRef` so it can be used as the key of an `SecondaryMap` or `SparseMap`.\n\nModule wasmer_types::error\n===\n\nThe WebAssembly possible errors\n\nStructs\n---\n\n* MiddlewareErrorA error in the middleware.\n\nEnums\n---\n\n* CompileErrorThe WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.\n* DeserializeErrorThe Deserialize error can occur when loading a compiled Module from a binary.\n* ImportErrorAn ImportError.\n* MemoryErrorError type describing things that can go wrong when operating on Wasm Memories.\n* ParseCpuFeatureErrorThe error that can happen while parsing a `str`\nto retrieve a `CpuFeature`.\n* PreInstantiationErrorAn error while preinstantiating a module.\n* SerializeErrorThe Serialize error can occur when serializing a compiled Module into a binary.\n* WasmErrorA WebAssembly translation error.\n\nType Aliases\n---\n\n* WasmResultA convenient alias for a `Result` that uses `WasmError` as the error type.\n\nModule wasmer_types::lib\n===\n\nThe `lib` module defines a `std` module that is identical whether the `core` or the `std` feature is enabled.\n\nModules\n---\n\n* stdCustom `std` module.\n\nMacro wasmer_types::entity_impl\n===\n\n\n```\nmacro_rules! entity_impl {\n    ($entity:ident) => { ... };\n    ($entity:ident, $display_prefix:expr) => { ... };\n}\n```\nMacro which provides the common implementation of a 32-bit entity reference.\n\nStruct wasmer_types::ArchivedDataInitializerLocation\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedDataInitializerLocationwhere\n MemoryIndex: Archive,\n Option: Archive,\n usize: Archive,{\n    pub memory_index: Archived,\n    pub base: Archived>,\n    pub offset: Archived,\n}\n```\nAn archived `DataInitializerLocation`\n\nFields\n---\n\n`memory_index: Archived`The archived counterpart of `DataInitializerLocation::memory_index`\n\n`base: Archived>`The archived counterpart of `DataInitializerLocation::base`\n\n`offset: Archived`The archived counterpart of `DataInitializerLocation::offset`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedDataInitializerLocationwhere\n MemoryIndex: Archive,\n Option: Archive,\n usize: Archive,\n Archived: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn memory_index(&self) -> MemoryIndex\n\n#### fn base(&self) -> Option usize\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedDataInitializerLocation\n\n### impl Send for ArchivedDataInitializerLocation\n\n### impl Sync for ArchivedDataInitializerLocation\n\n### impl Unpin for ArchivedDataInitializerLocation\n\n### impl UnwindSafe for ArchivedDataInitializerLocation\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::DataInitializerLocation\n===\n\n\n```\npub struct DataInitializerLocation {\n    pub memory_index: MemoryIndex,\n    pub base: Option,\n    pub offset: usize,\n}\n```\nA memory index and offset within that memory where a data initialization should be performed.\n\nFields\n---\n\n`memory_index: MemoryIndex`The index of the memory to initialize.\n\n`base: Option`Optionally a Global variable base to initialize at.\n\n`offset: usize`A constant offset to initialize at.\n\nTrait Implementations\n---\n\n### impl Archive for DataInitializerLocationwhere\n MemoryIndex: Archive,\n Option: Archive,\n usize: Archive,\n\n#### type Archived = ArchivedDataInitializerLocation\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> DataInitializerLocation\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn memory_index(&self) -> MemoryIndex\n\n#### fn base(&self) -> Option usize\n\n### impl Debug for DataInitializerLocation\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n MemoryIndex: Archive,\n Archived: Deserialize,\n Option: Archive,\n Archived>: Deserialize, __D>,\n usize: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for DataInitializerLocation\n\n#### fn eq(&self, other: &DataInitializerLocation) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for DataInitializerLocationwhere\n MemoryIndex: Serialize<__S>,\n Option: Serialize<__S>,\n usize: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ArchivedOwnedDataInitializer\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedOwnedDataInitializerwhere\n DataInitializerLocation: Archive,\n Box<[u8]>: Archive,{\n    pub location: Archived,\n    pub data: Archived>,\n}\n```\nAn archived `OwnedDataInitializer`\n\nFields\n---\n\n`location: Archived`The archived counterpart of `OwnedDataInitializer::location`\n\n`data: Archived>`The archived counterpart of `OwnedDataInitializer::data`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedOwnedDataInitializerwhere\n DataInitializerLocation: Archive,\n Box<[u8]>: Archive,\n Archived: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### type Location = &'a ArchivedDataInitializerLocation\n\n#### fn location(&self) -> Self::Location\n\n#### fn data(&self) -> &'a [u8] \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedOwnedDataInitializer\n\n### impl Send for ArchivedOwnedDataInitializer\n\n### impl Sync for ArchivedOwnedDataInitializer\n\n### impl !Unpin for ArchivedOwnedDataInitializer\n\n### impl UnwindSafe for ArchivedOwnedDataInitializer\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nStruct wasmer_types::OwnedDataInitializer\n===\n\n\n```\npub struct OwnedDataInitializer {\n    pub location: DataInitializerLocation,\n    pub data: Box<[u8]>,\n}\n```\nAs `DataInitializer` but owning the data rather than holding a reference to it\n\nFields\n---\n\n`location: DataInitializerLocation`The location where the initialization is to be performed.\n\n`data: Box<[u8]>`The initialization owned data.\n\nImplementations\n---\n\n### impl OwnedDataInitializer\n\n#### pub fn new(borrowed: &DataInitializer<'_>) -> Self\n\nCreates a new `OwnedDataInitializer` from a `DataInitializer`.\n\nTrait Implementations\n---\n\n### impl Archive for OwnedDataInitializerwhere\n DataInitializerLocation: Archive,\n Box<[u8]>: Archive,\n\n#### type Archived = ArchivedOwnedDataInitializer\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> OwnedDataInitializer\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### type Location = &'a DataInitializerLocation\n\n#### fn location(&self) -> Self::Location\n\n#### fn data(&self) -> &'a [u8] \n\n### impl Debug for OwnedDataInitializer\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n DataInitializerLocation: Archive,\n Archived: Deserialize,\n Box<[u8]>: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for OwnedDataInitializer\n\n#### fn eq(&self, other: &OwnedDataInitializer) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for OwnedDataInitializerwhere\n DataInitializerLocation: Serialize<__S>,\n Box<[u8]>: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nStruct wasmer_types::ArchivedSerializableCompilation\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedSerializableCompilationwhere\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n Option: Archive,\n SectionIndex: Archive,\n u32: Archive,{\n    pub function_bodies: Archived>,\n    pub function_relocations: Archived>>,\n    pub function_frame_info: Archived>,\n    pub function_call_trampolines: Archived>,\n    pub dynamic_function_trampolines: Archived>,\n    pub custom_sections: Archived>,\n    pub custom_section_relocations: Archived>>,\n    pub debug: Archived>,\n    pub libcall_trampolines: Archived,\n    pub libcall_trampoline_len: Archived,\n}\n```\nAn archived `SerializableCompilation`\n\nFields\n---\n\n`function_bodies: Archived>`The archived counterpart of `SerializableCompilation::function_bodies`\n\n`function_relocations: Archived>>`The archived counterpart of `SerializableCompilation::function_relocations`\n\n`function_frame_info: Archived>`The archived counterpart of `SerializableCompilation::function_frame_info`\n\n`function_call_trampolines: Archived>`The archived counterpart of `SerializableCompilation::function_call_trampolines`\n\n`dynamic_function_trampolines: Archived>`The archived counterpart of `SerializableCompilation::dynamic_function_trampolines`\n\n`custom_sections: Archived>`The archived counterpart of `SerializableCompilation::custom_sections`\n\n`custom_section_relocations: Archived>>`The archived counterpart of `SerializableCompilation::custom_section_relocations`\n\n`debug: Archived>`The archived counterpart of `SerializableCompilation::debug`\n\n`libcall_trampolines: Archived`The archived counterpart of `SerializableCompilation::libcall_trampolines`\n\n`libcall_trampoline_len: Archived`The archived counterpart of `SerializableCompilation::libcall_trampoline_len`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedSerializableCompilationwhere\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n Option: Archive,\n SectionIndex: Archive,\n u32: Archive,\n Archived>: CheckBytes<__C>,\n Archived>>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived>>: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedSerializableCompilation\n\n### impl Send for ArchivedSerializableCompilation\n\n### impl Sync for ArchivedSerializableCompilation\n\n### impl !Unpin for ArchivedSerializableCompilation\n\n### impl UnwindSafe for ArchivedSerializableCompilation\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::SerializableCompilation\n===\n\n\n```\npub struct SerializableCompilation {\n    pub function_bodies: PrimaryMap,\n    pub function_relocations: PrimaryMap>,\n    pub function_frame_info: PrimaryMap,\n    pub function_call_trampolines: PrimaryMap,\n    pub dynamic_function_trampolines: PrimaryMap,\n    pub custom_sections: PrimaryMap,\n    pub custom_section_relocations: PrimaryMap>,\n    pub debug: Option,\n    pub libcall_trampolines: SectionIndex,\n    pub libcall_trampoline_len: u32,\n}\n```\nThe compilation related data for a serialized modules\n\nFields\n---\n\n`function_bodies: PrimaryMap``function_relocations: PrimaryMap>``function_frame_info: PrimaryMap``function_call_trampolines: PrimaryMap``dynamic_function_trampolines: PrimaryMap``custom_sections: PrimaryMap``custom_section_relocations: PrimaryMap>``debug: Option``libcall_trampolines: SectionIndex``libcall_trampoline_len: u32`Implementations\n---\n\n### impl SerializableCompilation\n\n#### pub fn serialize(&self) -> Result, SerializeErrorSerialize a Compilation into bytes The bytes will have the following format:\nRKYV serialization (any length) + POS (8 bytes)\n\nTrait Implementations\n---\n\n### impl Archive for SerializableCompilationwhere\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap: Archive,\n PrimaryMap>: Archive,\n Option: Archive,\n SectionIndex: Archive,\n u32: Archive,\n\n#### type Archived = ArchivedSerializableCompilation\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn default() -> SerializableCompilation\n\nReturns the “default value” for a type. \n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap>: Archive,\n Archived>>: Deserialize>, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap: Archive,\n Archived>: Deserialize, __D>,\n PrimaryMap>: Archive,\n Archived>>: Deserialize>, __D>,\n Option: Archive,\n Archived>: Deserialize, __D>,\n SectionIndex: Archive,\n Archived: Deserialize,\n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Serialize<__S> for SerializableCompilationwhere\n PrimaryMap: Serialize<__S>,\n PrimaryMap>: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n PrimaryMap: Serialize<__S>,\n PrimaryMap>: Serialize<__S>,\n Option: Serialize<__S>,\n SectionIndex: Serialize<__S>,\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ArchivedSerializableModule\n===\n\n\n```\n#[repr(C,)]pub struct ArchivedSerializableModulewhere\n SerializableCompilation: Archive,\n CompileModuleInfo: Archive,\n Box<[OwnedDataInitializer]>: Archive,\n u64: Archive,{\n    pub compilation: Archived,\n    pub compile_info: Archived,\n    pub data_initializers: Archived>,\n    pub cpu_features: Archived,\n}\n```\nAn archived `SerializableModule`\n\nFields\n---\n\n`compilation: Archived`The archived counterpart of `SerializableModule::compilation`\n\n`compile_info: Archived`The archived counterpart of `SerializableModule::compile_info`\n\n`data_initializers: Archived>`The archived counterpart of `SerializableModule::data_initializers`\n\n`cpu_features: Archived`The archived counterpart of `SerializableModule::cpu_features`\n\nTrait Implementations\n---\n\n### impl<__C: ?Sized> CheckBytes<__C> for ArchivedSerializableModulewhere\n SerializableCompilation: Archive,\n CompileModuleInfo: Archive,\n Box<[OwnedDataInitializer]>: Archive,\n u64: Archive,\n Archived: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n Archived>: CheckBytes<__C>,\n Archived: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ArchivedSerializableModule\n\n### impl Send for ArchivedSerializableModule\n\n### impl Sync for ArchivedSerializableModule\n\n### impl !Unpin for ArchivedSerializableModule\n\n### impl UnwindSafe for ArchivedSerializableModule\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::SerializableModule\n===\n\n\n```\npub struct SerializableModule {\n    pub compilation: SerializableCompilation,\n    pub compile_info: CompileModuleInfo,\n    pub data_initializers: Box<[OwnedDataInitializer]>,\n    pub cpu_features: u64,\n}\n```\nSerializable struct that is able to serialize from and to a `ArtifactInfo`.\n\nFields\n---\n\n`compilation: SerializableCompilation`The main serializable compilation object\n\n`compile_info: CompileModuleInfo`Compilation informations\n\n`data_initializers: Box<[OwnedDataInitializer]>`Datas initializers\n\n`cpu_features: u64`CPU Feature flags for this compilation\n\nImplementations\n---\n\n### impl SerializableModule\n\n#### pub fn serialize(&self) -> Result, SerializeErrorSerialize a Module into bytes The bytes will have the following format:\nRKYV serialization (any length) + POS (8 bytes)\n\n#### pub unsafe fn deserialize_unchecked(\n metadata_slice: &[u8]\n) -> Result Result Result<&ArchivedSerializableModule, DeserializeError##### Safety\n\nThis method is unsafe.\nPlease check `SerializableModule::deserialize` for more details.\n\n#### pub fn archive_from_slice_checked(\n metadata_slice: &[u8]\n) -> Result<&ArchivedSerializableModule, DeserializeErrorDeserialize an archived module.\n\nIn contrast to `Self::deserialize`, this method performs validation and is not unsafe.\n\n#### pub fn deserialize_from_archive(\n archived: &ArchivedSerializableModule\n) -> Result ModuleInfo\n\nCreate a `ModuleInfo` for instantiation\n\n#### pub fn module_info(&self) -> &ModuleInfo\n\nReturns the `ModuleInfo` for instantiation\n\n#### pub fn features(&self) -> &Features\n\nReturns the features for this Artifact\n\n#### pub fn cpu_features(&self) -> EnumSet &[OwnedDataInitializer]\n\nReturns data initializers to pass to `VMInstance::initialize`\n\n#### pub fn memory_styles(&self) -> &PrimaryMap &PrimaryMap: Archive,\n u64: Archive,\n\n#### type Archived = ArchivedSerializableModule\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n SerializableCompilation: Archive,\n Archived: Deserialize,\n CompileModuleInfo: Archive,\n Archived: Deserialize,\n Box<[OwnedDataInitializer]>: Archive,\n Archived>: Deserialize, __D>,\n u64: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Serialize<__S> for SerializableModulewhere\n SerializableCompilation: Serialize<__S>,\n CompileModuleInfo: Serialize<__S>,\n Box<[OwnedDataInitializer]>: Serialize<__S>,\n u64: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::Bytes\n===\n\n\n```\npub struct Bytes(pub usize);\n```\nUnits of WebAssembly memory in terms of 8-bit bytes.\n\nTuple Fields\n---\n\n`0: usize`Trait Implementations\n---\n\n### impl Add for Byteswhere\n T: Into,\n\n#### type Output = Bytes\n\nThe resulting type after applying the `+` operator.#### fn add(self, rhs: T) -> Self\n\nPerforms the `+` operation. \n\n#### fn clone(&self) -> Bytes\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(pages: Pages) -> Self\n\nConverts to this type from the input type.### impl From for Bytes\n\n#### fn from(other: u32) -> Self\n\nConverts to this type from the input type.### impl From for Bytes\n\n#### fn from(other: usize) -> Self\n\nConverts to this type from the input type.### impl Hash for Bytes\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Bytes) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Bytes) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Bytes\n\n#### fn partial_cmp(&self, other: &Bytes) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n T: Into,\n\n#### type Output = Bytes\n\nThe resulting type after applying the `-` operator.#### fn sub(self, rhs: T) -> Self\n\nPerforms the `-` operation. \n\n#### type Error = PageCountOutOfRange\n\nThe type returned in the event of a conversion error.#### fn try_from(bytes: Bytes) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::CustomSectionIndex\n===\n\n\n```\npub struct CustomSectionIndex(/* private fields */);\n```\nIndex type of a custom section inside a WebAssembly module.\n\nImplementations\n---\n\n### impl CustomSectionIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for CustomSectionIndexwhere\n u32: Archive,\n\n#### type Archived = CustomSectionIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> CustomSectionIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for CustomSectionIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &CustomSectionIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &CustomSectionIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for CustomSectionIndex\n\n#### fn partial_cmp(&self, other: &CustomSectionIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> CustomSectionIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for CustomSectionIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::DataIndex\n===\n\n\n```\npub struct DataIndex(/* private fields */);\n```\nIndex type of a passive data segment inside the WebAssembly module.\n\nImplementations\n---\n\n### impl DataIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for DataIndexwhere\n u32: Archive,\n\n#### type Archived = DataIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> DataIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for DataIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &DataIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &DataIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for DataIndex\n\n#### fn partial_cmp(&self, other: &DataIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> DataIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for DataIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::DataInitializer\n===\n\n\n```\npub struct DataInitializer<'data> {\n    pub location: DataInitializerLocation,\n    pub data: &'data [u8],\n}\n```\nA data initializer for linear memory.\n\nFields\n---\n\n`location: DataInitializerLocation`The location where the initialization is to be performed.\n\n`data: &'data [u8]`The initialization data.\n\nTrait Implementations\n---\n\n### impl<'data> Debug for DataInitializer<'data#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl<'data> RefUnwindSafe for DataInitializer<'data### impl<'data> Send for DataInitializer<'data### impl<'data> Sync for DataInitializer<'data### impl<'data> Unpin for DataInitializer<'data### impl<'data> UnwindSafe for DataInitializer<'dataBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ElemIndex\n===\n\n\n```\npub struct ElemIndex(/* private fields */);\n```\nIndex type of a passive element segment inside the WebAssembly module.\n\nImplementations\n---\n\n### impl ElemIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for ElemIndexwhere\n u32: Archive,\n\n#### type Archived = ElemIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> ElemIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for ElemIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &ElemIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &ElemIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for ElemIndex\n\n#### fn partial_cmp(&self, other: &ElemIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> ElemIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for ElemIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ExportType\n===\n\n\n```\npub struct ExportType { /* private fields */ }\n```\nA descriptor for an exported WebAssembly value.\n\nThis type is primarily accessed from the `Module::exports`\naccessor and describes what names are exported from a wasm module and the type of the item that is exported.\n\nThe `` refefers to `ExternType`, however it can also refer to use\n`MemoryType`, `TableType`, `FunctionType` and `GlobalType` for ease of use.\n\nImplementations\n---\n\n### impl ExportType Self\n\nCreates a new export which is exported with the given `name` and has the given `ty`.\n\n#### pub fn name(&self) -> &str\n\nReturns the name by which this export is known by.\n\n#### pub fn ty(&self) -> &T\n\nReturns the type of this export.\n\nTrait Implementations\n---\n\n### impl Clone for ExportType ExportType(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for ExportType StructuralEq for ExportType StructuralPartialEq for ExportType RefUnwindSafe for ExportTypewhere\n T: RefUnwindSafe,\n\n### impl Send for ExportTypewhere\n T: Send,\n\n### impl Sync for ExportTypewhere\n T: Sync,\n\n### impl Unpin for ExportTypewhere\n T: Unpin,\n\n### impl UnwindSafe for ExportTypewhere\n T: UnwindSafe,\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ExportsIterator\n===\n\n\n```\npub struct ExportsIterator + Sized> { /* private fields */ }\n```\nThis iterator allows us to iterate over the exports and offer nice API ergonomics over it.\n\nImplementations\n---\n\n### impl + Sized> ExportsIterator Self\n\nCreate a new `ExportsIterator` for a given iterator and size\n\n### impl + Sized> ExportsIterator impl Iterator> + Sized\n\nGet only the functions\n\n#### pub fn memories(self) -> impl Iterator> + Sized\n\nGet only the memories\n\n#### pub fn tables(self) -> impl Iterator> + Sized\n\nGet only the tables\n\n#### pub fn globals(self) -> impl Iterator> + Sized\n\nGet only the globals\n\nTrait Implementations\n---\n\n### impl + Sized> ExactSizeIterator for ExportsIterator usize\n\nReturns the exact remaining length of the iterator. \n\n🔬This is a nightly-only experimental API. (`exact_size_is_empty`)Returns `true` if the iterator is empty. \n &mut self\n) -> Result<[Self::Item; N], IntoIter>where\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_next_chunk`)Advances the iterator and returns an array containing the next `N` values. Read more1.0.0 · source#### fn size_hint(&self) -> (usize, Option)\n\nReturns the bounds on the remaining length of the iterator. Read more1.0.0 · source#### fn count(self) -> usizewhere\n Self: Sized,\n\nConsumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · source#### fn last(self) -> Optionwhere\n Self: Sized,\n\nConsumes the iterator, returning the last element. \n Self: Sized,\n\nCreates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more1.0.0 · source#### fn chain(self, other: U) -> Chain::IntoIter> where\n Self: Sized,\n U: IntoIterator,\n\nTakes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · source#### fn zip(self, other: U) -> Zip::IntoIter> where\n Self: Sized,\n U: IntoIterator,\n\n‘Zips up’ two iterators into a single iterator of pairs. \n Self: Sized,\n G: FnMut() -> Self::Item,\n\n🔬This is a nightly-only experimental API. (`iter_intersperse`)Creates a new iterator which places an item generated by `separator`\nbetween adjacent items of the original iterator. Read more1.0.0 · source#### fn map(self, f: F) -> Map where\n Self: Sized,\n F: FnMut(Self::Item) -> B,\n\nTakes a closure and creates an iterator which calls that closure on each element. Read more1.21.0 · source#### fn for_each(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),\n\nCalls a closure on each element of an iterator. Read more1.0.0 · source#### fn filter

(self, predicate: P) -> Filter where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator which uses a closure to determine if an element should be yielded. Read more1.0.0 · source#### fn filter_map(self, f: F) -> FilterMap where\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both filters and maps. Read more1.0.0 · source#### fn enumerate(self) -> Enumerate where\n Self: Sized,\n\nCreates an iterator which gives the current iteration count as well as the next value. Read more1.0.0 · source#### fn peekable(self) -> Peekable where\n Self: Sized,\n\nCreates an iterator which can use the `peek` and `peek_mut` methods to look at the next element of the iterator without consuming it. See their documentation for more information. Read more1.0.0 · source#### fn skip_while

(self, predicate: P) -> SkipWhile where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that `skip`s elements based on a predicate. Read more1.0.0 · source#### fn take_while

(self, predicate: P) -> TakeWhile where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that yields elements based on a predicate. Read more1.57.0 · source#### fn map_while(self, predicate: P) -> MapWhile where\n Self: Sized,\n P: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · source#### fn skip(self, n: usize) -> Skip where\n Self: Sized,\n\nCreates an iterator that skips the first `n` elements. Read more1.0.0 · source#### fn take(self, n: usize) -> Take where\n Self: Sized,\n\nCreates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. Read more1.0.0 · source#### fn scan(self, initial_state: St, f: F) -> Scan where\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option,\n\nAn iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. Read more1.0.0 · source#### fn flat_map(self, f: F) -> FlatMap where\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,\n\nCreates an iterator that works like map, but flattens nested structure. \n Self: Sized,\n F: FnMut(&[Self::Item; N]) -> R,\n\n🔬This is a nightly-only experimental API. (`iter_map_windows`)Calls the given function `f` for each contiguous window of size `N` over\n`self` and returns an iterator over the outputs of `f`. Like `slice::windows()`,\nthe windows during mapping overlap as well. Read more1.0.0 · source#### fn fuse(self) -> Fuse where\n Self: Sized,\n\nCreates an iterator which ends after the first `None`. Read more1.0.0 · source#### fn inspect(self, f: F) -> Inspect where\n Self: Sized,\n F: FnMut(&Self::Item),\n\nDoes something with each element of an iterator, passing the value on. Read more1.0.0 · source#### fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,\n\nBorrows an iterator, rather than consuming it. Read more1.0.0 · source#### fn collect(self) -> Bwhere\n B: FromIterator,\n Self: Sized,\n\nTransforms an iterator into a collection. \n E: Extend,\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_collect_into`)Collects all the items from an iterator into a collection. Read more1.0.0 · source#### fn partition(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend,\n F: FnMut(&Self::Item) -> bool,\n\nConsumes an iterator, creating two collections from it. \n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_is_partitioned`)Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return `true` precede all those that return `false`. Read more1.27.0 · source#### fn try_fold(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more1.27.0 · source#### fn try_for_each(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more1.0.0 · source#### fn fold(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,\n\nFolds every element into an accumulator by applying an operation,\nreturning the final result. Read more1.51.0 · source#### fn reduce(self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,\n\nReduces the elements to a single one, by repeatedly applying a reducing operation. \n &mut self,\n f: F\n) -> <::Residual as Residual::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`iterator_try_reduce`)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · source#### fn all(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if every element of the iterator matches a predicate. Read more1.0.0 · source#### fn any(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if any element of the iterator matches a predicate. Read more1.0.0 · source#### fn find

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nSearches for an element of an iterator that satisfies a predicate. Read more1.30.0 · source#### fn find_map(&mut self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nApplies function to the elements of iterator and returns the first non-none result. \n &mut self,\n f: F\n) -> <::Residual as Residual>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`try_find`)Applies function to the elements of iterator and returns the first true result or the first error. Read more1.0.0 · source#### fn position

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\nSearches for an element in an iterator, returning its index. Read more1.6.0 · source#### fn max_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the maximum value from the specified function. Read more1.15.0 · source#### fn max_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the maximum value with respect to the specified comparison function. Read more1.6.0 · source#### fn min_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the minimum value from the specified function. Read more1.15.0 · source#### fn min_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the minimum value with respect to the specified comparison function. Read more1.0.0 · source#### fn unzip(self) -> (FromA, FromB)where\n FromA: Default + Extend,\n FromB: Default + Extend,\n Self: Sized + Iterator,\n\nConverts an iterator of pairs into a pair of containers. Read more1.36.0 · source#### fn copied<'a, T>(self) -> Copied where\n T: 'a + Copy,\n Self: Sized + Iterator,\n\nCreates an iterator which copies all of its elements. Read more1.0.0 · source#### fn cloned<'a, T>(self) -> Cloned where\n T: 'a + Clone,\n Self: Sized + Iterator,\n\nCreates an iterator which `clone`s all of its elements. \n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_array_chunks`)Returns an iterator over `N` elements of the iterator at a time. Read more1.11.0 · source#### fn sum(self) -> Swhere\n Self: Sized,\n S: Sum,\n\nSums the elements of an iterator. Read more1.11.0 · source#### fn product

(self) -> Pwhere\n Self: Sized,\n P: Product,\n\nIterates over the entire iterator, multiplying all the elements \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Ordering,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn partial_cmp(self, other: I) -> Optionwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nLexicographically compares the `PartialOrd` elements of this `Iterator` with those of another. The comparison works like short-circuit evaluation, returning a result without comparing the remaining elements.\nAs soon as an order can be determined, the evaluation stops and a result is returned. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn eq(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are equal to those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Determines if the elements of this `Iterator` are equal to those of another with respect to the specified equality function. Read more1.5.0 · source#### fn ne(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are not equal to those of another. Read more1.5.0 · source#### fn lt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less than those of another. Read more1.5.0 · source#### fn le(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less or equal to those of another. Read more1.5.0 · source#### fn gt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than those of another. Read more1.5.0 · source#### fn ge(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than or equal to those of another. \n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given comparator function. \n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given key extraction function. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ExportsIteratorwhere\n I: RefUnwindSafe,\n\n### impl Send for ExportsIteratorwhere\n I: Send,\n\n### impl Sync for ExportsIteratorwhere\n I: Sync,\n\n### impl Unpin for ExportsIteratorwhere\n I: Unpin,\n\n### impl UnwindSafe for ExportsIteratorwhere\n I: UnwindSafe,\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl IntoIterator for Iwhere\n I: Iterator,\n\n#### type Item = ::Item\n\nThe type of the elements being iterated over.#### type IntoIter = I\n\nWhich kind of iterator are we turning this into?const: unstable · source#### fn into_iter(self) -> I\n\nCreates an iterator from a value. \n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"ArrayChunks\":\"

Notable traits for ArrayChunks&lt;I, N&gt;

impl&lt;I, const N: usize&gt; Iterator for ArrayChunks&lt;I, N&gt;where\\n I: Iterator, type Item = [&lt;I as Iterator&gt;::Item; N];\",\"Chain::IntoIter>\":\"

Notable traits for Chain&lt;A, B&gt;

impl&lt;A, B&gt; Iterator for Chain&lt;A, B&gt;where\\n A: Iterator,\\n B: Iterator&lt;Item = &lt;A as Iterator&gt;::Item&gt;, type Item = &lt;A as Iterator&gt;::Item;\",\"Cloned\":\"

Notable traits for Cloned&lt;I&gt;

impl&lt;'a, I, T&gt; Iterator for Cloned&lt;I&gt;where\\n T: 'a + Clone,\\n I: Iterator&lt;Item = &amp;'a T&gt;, type Item = T;\",\"Copied\":\"

Notable traits for Copied&lt;I&gt;

impl&lt;'a, I, T&gt; Iterator for Copied&lt;I&gt;where\\n T: 'a + Copy,\\n I: Iterator&lt;Item = &amp;'a T&gt;, type Item = T;\",\"Enumerate\":\"

Notable traits for Enumerate&lt;I&gt;

impl&lt;I&gt; Iterator for Enumerate&lt;I&gt;where\\n I: Iterator, type Item = (usize, &lt;I as Iterator&gt;::Item);\",\"Filter\":\"

Notable traits for Filter&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for Filter&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"FilterMap\":\"

Notable traits for FilterMap&lt;I, F&gt;

impl&lt;B, I, F&gt; Iterator for FilterMap&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"FlatMap\":\"

Notable traits for FlatMap&lt;I, U, F&gt;

impl&lt;I, U, F&gt; Iterator for FlatMap&lt;I, U, F&gt;where\\n I: Iterator,\\n U: IntoIterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; U, type Item = &lt;U as IntoIterator&gt;::Item;\",\"Fuse\":\"

Notable traits for Fuse&lt;I&gt;

impl&lt;I&gt; Iterator for Fuse&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Inspect\":\"

Notable traits for Inspect&lt;I, F&gt;

impl&lt;I, F&gt; Iterator for Inspect&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&amp;&lt;I as Iterator&gt;::Item), type Item = &lt;I as Iterator&gt;::Item;\",\"IntersperseWith\":\"

Notable traits for IntersperseWith&lt;I, G&gt;

impl&lt;I, G&gt; Iterator for IntersperseWith&lt;I, G&gt;where\\n I: Iterator,\\n G: FnMut() -&gt; &lt;I as Iterator&gt;::Item, type Item = &lt;I as Iterator&gt;::Item;\",\"Map\":\"

Notable traits for Map&lt;I, F&gt;

impl&lt;B, I, F&gt; Iterator for Map&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; B, type Item = B;\",\"MapWhile\":\"

Notable traits for MapWhile&lt;I, P&gt;

impl&lt;B, I, P&gt; Iterator for MapWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"MapWindows\":\"

Notable traits for MapWindows&lt;I, F, N&gt;

impl&lt;I, F, R, const N: usize&gt; Iterator for MapWindows&lt;I, F, N&gt;where\\n I: Iterator,\\n F: FnMut(&amp;[&lt;I as Iterator&gt;::Item; N]) -&gt; R, type Item = R;\",\"Peekable\":\"

Notable traits for Peekable&lt;I&gt;

impl&lt;I&gt; Iterator for Peekable&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Scan\":\"

Notable traits for Scan&lt;I, St, F&gt;

impl&lt;B, I, St, F&gt; Iterator for Scan&lt;I, St, F&gt;where\\n I: Iterator,\\n F: FnMut(&amp;mut St, &lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"Skip\":\"

Notable traits for Skip&lt;I&gt;

impl&lt;I&gt; Iterator for Skip&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"SkipWhile\":\"

Notable traits for SkipWhile&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for SkipWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"StepBy\":\"

Notable traits for StepBy&lt;I&gt;

impl&lt;I&gt; Iterator for StepBy&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Take\":\"

Notable traits for Take&lt;I&gt;

impl&lt;I&gt; Iterator for Take&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"TakeWhile\":\"

Notable traits for TakeWhile&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for TakeWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"Zip::IntoIter>\":\"

Notable traits for Zip&lt;A, B&gt;

impl&lt;A, B&gt; Iterator for Zip&lt;A, B&gt;where\\n A: Iterator,\\n B: Iterator, type Item = (&lt;A as Iterator&gt;::Item, &lt;B as Iterator&gt;::Item);\"}\n\nStruct wasmer_types::Features\n===\n\n\n```\npub struct Features {\n    pub threads: bool,\n    pub reference_types: bool,\n    pub simd: bool,\n    pub bulk_memory: bool,\n    pub multi_value: bool,\n    pub tail_call: bool,\n    pub module_linking: bool,\n    pub multi_memory: bool,\n    pub memory64: bool,\n    pub exceptions: bool,\n    pub relaxed_simd: bool,\n    pub extended_const: bool,\n}\n```\nControls which experimental features will be enabled.\nFeatures usually have a corresponding WebAssembly proposal.\n\nFields\n---\n\n`threads: bool`Threads proposal should be enabled\n\n`reference_types: bool`Reference Types proposal should be enabled\n\n`simd: bool`SIMD proposal should be enabled\n\n`bulk_memory: bool`Bulk Memory proposal should be enabled\n\n`multi_value: bool`Multi Value proposal should be enabled\n\n`tail_call: bool`Tail call proposal should be enabled\n\n`module_linking: bool`Module Linking proposal should be enabled\n\n`multi_memory: bool`Multi Memory proposal should be enabled\n\n`memory64: bool`64-bit Memory proposal should be enabled\n\n`exceptions: bool`Wasm exceptions proposal should be enabled\n\n`relaxed_simd: bool`Relaxed SIMD proposal should be enabled\n\n`extended_const: bool`Extended constant expressions proposal should be enabled\n\nImplementations\n---\n\n### impl Features\n\n#### pub fn new() -> Self\n\nCreate a new feature\n\n#### pub fn threads(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly threads proposal will be enabled.\n\nThe WebAssembly threads proposal is not currently fully standardized and is undergoing development. Support for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature gates items such as shared memories and atomic instructions.\n\nThis is `false` by default.\n\n#### pub fn reference_types(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly reference types proposal will be enabled.\n\nThe WebAssembly reference types proposal is now fully standardized and enabled by default.\n\nThis feature gates items such as the `externref` type and multiple tables being in a module. Note that enabling the reference types feature will also enable the bulk memory feature.\n\nThis is `true` by default.\n\n#### pub fn simd(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly SIMD proposal will be enabled.\n\nThe WebAssembly SIMD proposal is not currently fully standardized and is undergoing development. Support for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature gates items such as the `v128` type and all of its operators being in a module.\n\nThis is `false` by default.\n\n#### pub fn bulk_memory(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly bulk memory operations proposal will be enabled.\n\nThe WebAssembly bulk memory operations proposal is now fully standardized and enabled by default.\n\nThis feature gates items such as the `memory.copy` instruction, passive data/table segments, etc, being in a module.\n\nThis is `true` by default.\n\n#### pub fn multi_value(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly multi-value proposal will be enabled.\n\nThe WebAssembly multi-value proposal is now fully standardized and enabled by default, except with the singlepass compiler which does not support it.\n\nThis feature gates functions and blocks returning multiple values in a module, for example.\n\nThis is `true` by default.\n\n#### pub fn tail_call(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly tail-call proposal will be enabled.\n\nThe WebAssembly tail-call proposal is not currently fully standardized and is undergoing development.\nSupport for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature gates tail-call functions in WebAssembly.\n\nThis is `false` by default.\n\n#### pub fn module_linking(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly module linking proposal will be enabled.\n\nThe WebAssembly module linking proposal is not currently fully standardized and is undergoing development.\nSupport for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature allows WebAssembly modules to define, import and export modules and instances.\n\nThis is `false` by default.\n\n#### pub fn multi_memory(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly multi-memory proposal will be enabled.\n\nThe WebAssembly multi-memory proposal is not currently fully standardized and is undergoing development.\nSupport for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature adds the ability to use multiple memories within a single Wasm module.\n\nThis is `false` by default.\n\n#### pub fn memory64(&mut self, enable: bool) -> &mut Self\n\nConfigures whether the WebAssembly 64-bit memory proposal will be enabled.\n\nThe WebAssembly 64-bit memory proposal is not currently fully standardized and is undergoing development.\nSupport for this feature can be enabled through this method for appropriate WebAssembly modules.\n\nThis feature gates support for linear memory of sizes larger than 2^32 bits.\n\nThis is `false` by default.\n\nTrait Implementations\n---\n\n### impl Archive for Featureswhere\n bool: Archive,\n\n#### type Archived = Features\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n bool: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> Features\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n bool: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for Features\n\n#### fn eq(&self, other: &Features) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for Featureswhere\n bool: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::FrameInfo\n===\n\n\n```\npub struct FrameInfo { /* private fields */ }\n```\nDescription of a frame in a backtrace.\n\nEach runtime error includes a backtrace of the WebAssembly frames that led to the trap, and each frame is described by this structure.\n\nImplementations\n---\n\n### impl FrameInfo\n\n#### pub fn new(\n module_name: String,\n func_index: u32,\n function_name: Option,\n func_start: SourceLoc,\n instr: SourceLoc\n) -> Self\n\nCreates a new FrameInfo, useful for testing.\n\n#### pub fn func_index(&self) -> u32\n\nReturns the WebAssembly function index for this frame.\n\nThis function index is the index in the function index space of the WebAssembly module that this frame comes from.\n\n#### pub fn module_name(&self) -> &str\n\nReturns the identifer of the module that this frame is for.\n\nModuleInfo identifiers are present in the `name` section of a WebAssembly binary, but this may not return the exact item in the `name` section.\nModuleInfo names can be overwritten at construction time or perhaps inferred from file names. The primary purpose of this function is to assist in debugging and therefore may be tweaked over time.\n\nThis function returns `None` when no name can be found or inferred.\n\n#### pub fn function_name(&self) -> Option<&strReturns a descriptive name of the function for this frame, if one is available.\n\nThe name of this function may come from the `name` section of the WebAssembly binary, or wasmer may try to infer a better name for it if not available, for example the name of the export if it’s exported.\n\nThis return value is primarily used for debugging and human-readable purposes for things like traps. Note that the exact return value may be tweaked over time here and isn’t guaranteed to be something in particular about a wasm module due to its primary purpose of assisting in debugging.\n\nThis function returns `None` when no name could be inferred.\n\n#### pub fn module_offset(&self) -> usize\n\nReturns the offset within the original wasm module this frame’s program counter was at.\n\nThe offset here is the offset from the beginning of the original wasm module to the instruction that this frame points to.\n\n#### pub fn func_offset(&self) -> usize\n\nReturns the offset from the original wasm module’s function to this frame’s program counter.\n\nThe offset here is the offset from the beginning of the defining function of this frame (within the wasm module) to the instruction this frame points to.\n\nTrait Implementations\n---\n\n### impl Clone for FrameInfo\n\n#### fn clone(&self) -> FrameInfo\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for FrameInfo\n\n### impl Send for FrameInfo\n\n### impl Sync for FrameInfo\n\n### impl Unpin for FrameInfo\n\n### impl UnwindSafe for FrameInfo\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::FunctionIndex\n===\n\n\n```\npub struct FunctionIndex(/* private fields */);\n```\nIndex type of a function (imported or local) inside the WebAssembly module.\n\nImplementations\n---\n\n### impl FunctionIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for FunctionIndexwhere\n u32: Archive,\n\n#### type Archived = FunctionIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> FunctionIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for FunctionIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &FunctionIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &FunctionIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for FunctionIndex\n\n#### fn partial_cmp(&self, other: &FunctionIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> FunctionIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for FunctionIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::FunctionType\n===\n\n\n```\npub struct FunctionType { /* private fields */ }\n```\nThe signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.\n\nWebAssembly functions can have 0 or more parameters and results.\n\nImplementations\n---\n\n### impl FunctionType\n\n#### pub fn new(params: Params, returns: Returns) -> Selfwhere\n Params: Into>,\n Returns: Into>,\n\nCreates a new Function Type with the given parameter and return types.\n\n#### pub fn params(&self) -> &[Type]\n\nParameter types.\n\n#### pub fn results(&self) -> &[Type]\n\nReturn types.\n\nTrait Implementations\n---\n\n### impl Archive for FunctionTypewhere\n Box<[Type]>: Archive,\n\n#### type Archived = ArchivedFunctionType\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> FunctionType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Box<[Type]>: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(as_ref: &Self) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 0], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 0], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 1], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 1], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 2], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 2], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 3], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 3], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 4], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 4], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 5], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 5], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 6], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 6], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 7], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 7], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 8], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 8], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 0])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 0])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 1])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 1])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 2])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 2])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 3])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 3])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 4])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 4])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 5])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 5])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 6])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 6])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 7])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 7])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 8])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 8])) -> Self\n\nConverts to this type from the input type.### impl From<([Type; 9], [Type; 9])> for FunctionType\n\n#### fn from(pair: ([Type; 9], [Type; 9])) -> Self\n\nConverts to this type from the input type.### impl Hash for FunctionType\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &FunctionType) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for FunctionTypewhere\n Box<[Type]>: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::GlobalIndex\n===\n\n\n```\npub struct GlobalIndex(/* private fields */);\n```\nIndex type of a global variable (imported or local) inside the WebAssembly module.\n\nImplementations\n---\n\n### impl GlobalIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for GlobalIndexwhere\n u32: Archive,\n\n#### type Archived = GlobalIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> GlobalIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for GlobalIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &GlobalIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &GlobalIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for GlobalIndex\n\n#### fn partial_cmp(&self, other: &GlobalIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> GlobalIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for GlobalIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::GlobalType\n===\n\n\n```\npub struct GlobalType {\n    pub ty: Type,\n    pub mutability: Mutability,\n}\n```\nWebAssembly global.\n\nFields\n---\n\n`ty: Type`The type of the value stored in the global.\n\n`mutability: Mutability`A flag indicating whether the value may change at runtime.\n\nImplementations\n---\n\n### impl GlobalType\n\nA WebAssembly global descriptor.\n\nThis type describes an instance of a global in a WebAssembly module. Globals are local to an `Instance` and are either immutable or mutable.\n\n#### pub fn new(ty: Type, mutability: Mutability) -> Self\n\nCreate a new Global variable\n\n##### Usage:\n```\nuse wasmer_types::{GlobalType, Type, Mutability};\n\n// An I32 constant global let global = GlobalType::new(Type::I32, Mutability::Const);\n// An I64 mutable global let global = GlobalType::new(Type::I64, Mutability::Var);\n```\nTrait Implementations\n---\n\n### impl Archive for GlobalTypewhere\n Type: Archive,\n Mutability: Archive,\n\n#### type Archived = GlobalType\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n Type: CheckBytes<__C>,\n Mutability: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> GlobalType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Type: Archive,\n Archived: Deserialize,\n Mutability: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &GlobalType) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for GlobalTypewhere\n Type: Serialize<__S>,\n Mutability: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ImportKey\n===\n\n\n```\npub struct ImportKey {\n    pub module: String,\n    pub field: String,\n    pub import_idx: u32,\n}\n```\nHash key of an import\n\nFields\n---\n\n`module: String`Module name\n\n`field: String`Field name\n\n`import_idx: u32`Import index\n\nTrait Implementations\n---\n\n### impl Archive for ImportKeywhere\n String: Archive,\n u32: Archive,\n\n#### type Archived = ArchivedImportKey\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> ImportKey\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> ImportKey\n\nReturns the “default value” for a type. \n String: Archive,\n Archived: Deserialize,\n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for ImportKey\n\n#### fn from((module, field, import_idx): (String, String, u32)) -> Self\n\nConverts to this type from the input type.### impl Hash for ImportKey\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &ImportKey) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for ImportKeywhere\n String: Serialize<__S>,\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ImportType\n===\n\n\n```\npub struct ImportType { /* private fields */ }\n```\nA descriptor for an imported value into a wasm module.\n\nThis type is primarily accessed from the `Module::imports`\nAPI. Each `ImportType` describes an import into the wasm module with the module/name that it’s imported from as well as the type of item that’s being imported.\n\nImplementations\n---\n\n### impl ImportType Self\n\nCreates a new import descriptor which comes from `module` and `name` and is of type `ty`.\n\n#### pub fn module(&self) -> &str\n\nReturns the module name that this import is expected to come from.\n\n#### pub fn name(&self) -> &str\n\nReturns the field name of the module that this import is expected to come from.\n\n#### pub fn ty(&self) -> &T\n\nReturns the expected type of this import.\n\nTrait Implementations\n---\n\n### impl Clone for ImportType ImportType(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for ImportType StructuralEq for ImportType StructuralPartialEq for ImportType RefUnwindSafe for ImportTypewhere\n T: RefUnwindSafe,\n\n### impl Send for ImportTypewhere\n T: Send,\n\n### impl Sync for ImportTypewhere\n T: Sync,\n\n### impl Unpin for ImportTypewhere\n T: Unpin,\n\n### impl UnwindSafe for ImportTypewhere\n T: UnwindSafe,\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ImportsIterator\n===\n\n\n```\npub struct ImportsIterator + Sized> { /* private fields */ }\n```\nThis iterator allows us to iterate over the imports and offer nice API ergonomics over it.\n\nImplementations\n---\n\n### impl + Sized> ImportsIterator Self\n\nCreate a new `ImportsIterator` for a given iterator and size\n\n### impl + Sized> ImportsIterator impl Iterator> + Sized\n\nGet only the functions\n\n#### pub fn memories(self) -> impl Iterator> + Sized\n\nGet only the memories\n\n#### pub fn tables(self) -> impl Iterator> + Sized\n\nGet only the tables\n\n#### pub fn globals(self) -> impl Iterator> + Sized\n\nGet only the globals\n\nTrait Implementations\n---\n\n### impl + Sized> ExactSizeIterator for ImportsIterator usize\n\nReturns the exact remaining length of the iterator. \n\n🔬This is a nightly-only experimental API. (`exact_size_is_empty`)Returns `true` if the iterator is empty. \n &mut self\n) -> Result<[Self::Item; N], IntoIter>where\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_next_chunk`)Advances the iterator and returns an array containing the next `N` values. Read more1.0.0 · source#### fn size_hint(&self) -> (usize, Option)\n\nReturns the bounds on the remaining length of the iterator. Read more1.0.0 · source#### fn count(self) -> usizewhere\n Self: Sized,\n\nConsumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · source#### fn last(self) -> Optionwhere\n Self: Sized,\n\nConsumes the iterator, returning the last element. \n Self: Sized,\n\nCreates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more1.0.0 · source#### fn chain(self, other: U) -> Chain::IntoIter> where\n Self: Sized,\n U: IntoIterator,\n\nTakes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · source#### fn zip(self, other: U) -> Zip::IntoIter> where\n Self: Sized,\n U: IntoIterator,\n\n‘Zips up’ two iterators into a single iterator of pairs. \n Self: Sized,\n G: FnMut() -> Self::Item,\n\n🔬This is a nightly-only experimental API. (`iter_intersperse`)Creates a new iterator which places an item generated by `separator`\nbetween adjacent items of the original iterator. Read more1.0.0 · source#### fn map(self, f: F) -> Map where\n Self: Sized,\n F: FnMut(Self::Item) -> B,\n\nTakes a closure and creates an iterator which calls that closure on each element. Read more1.21.0 · source#### fn for_each(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),\n\nCalls a closure on each element of an iterator. Read more1.0.0 · source#### fn filter

(self, predicate: P) -> Filter where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator which uses a closure to determine if an element should be yielded. Read more1.0.0 · source#### fn filter_map(self, f: F) -> FilterMap where\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both filters and maps. Read more1.0.0 · source#### fn enumerate(self) -> Enumerate where\n Self: Sized,\n\nCreates an iterator which gives the current iteration count as well as the next value. Read more1.0.0 · source#### fn peekable(self) -> Peekable where\n Self: Sized,\n\nCreates an iterator which can use the `peek` and `peek_mut` methods to look at the next element of the iterator without consuming it. See their documentation for more information. Read more1.0.0 · source#### fn skip_while

(self, predicate: P) -> SkipWhile where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that `skip`s elements based on a predicate. Read more1.0.0 · source#### fn take_while

(self, predicate: P) -> TakeWhile where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nCreates an iterator that yields elements based on a predicate. Read more1.57.0 · source#### fn map_while(self, predicate: P) -> MapWhile where\n Self: Sized,\n P: FnMut(Self::Item) -> Option,\n\nCreates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · source#### fn skip(self, n: usize) -> Skip where\n Self: Sized,\n\nCreates an iterator that skips the first `n` elements. Read more1.0.0 · source#### fn take(self, n: usize) -> Take where\n Self: Sized,\n\nCreates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. Read more1.0.0 · source#### fn scan(self, initial_state: St, f: F) -> Scan where\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option,\n\nAn iterator adapter which, like `fold`, holds internal state, but unlike `fold`, produces a new iterator. Read more1.0.0 · source#### fn flat_map(self, f: F) -> FlatMap where\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,\n\nCreates an iterator that works like map, but flattens nested structure. \n Self: Sized,\n F: FnMut(&[Self::Item; N]) -> R,\n\n🔬This is a nightly-only experimental API. (`iter_map_windows`)Calls the given function `f` for each contiguous window of size `N` over\n`self` and returns an iterator over the outputs of `f`. Like `slice::windows()`,\nthe windows during mapping overlap as well. Read more1.0.0 · source#### fn fuse(self) -> Fuse where\n Self: Sized,\n\nCreates an iterator which ends after the first `None`. Read more1.0.0 · source#### fn inspect(self, f: F) -> Inspect where\n Self: Sized,\n F: FnMut(&Self::Item),\n\nDoes something with each element of an iterator, passing the value on. Read more1.0.0 · source#### fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,\n\nBorrows an iterator, rather than consuming it. Read more1.0.0 · source#### fn collect(self) -> Bwhere\n B: FromIterator,\n Self: Sized,\n\nTransforms an iterator into a collection. \n E: Extend,\n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_collect_into`)Collects all the items from an iterator into a collection. Read more1.0.0 · source#### fn partition(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend,\n F: FnMut(&Self::Item) -> bool,\n\nConsumes an iterator, creating two collections from it. \n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_is_partitioned`)Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return `true` precede all those that return `false`. Read more1.27.0 · source#### fn try_fold(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more1.27.0 · source#### fn try_for_each(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try,\n\nAn iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more1.0.0 · source#### fn fold(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,\n\nFolds every element into an accumulator by applying an operation,\nreturning the final result. Read more1.51.0 · source#### fn reduce(self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,\n\nReduces the elements to a single one, by repeatedly applying a reducing operation. \n &mut self,\n f: F\n) -> <::Residual as Residual::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`iterator_try_reduce`)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · source#### fn all(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if every element of the iterator matches a predicate. Read more1.0.0 · source#### fn any(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,\n\nTests if any element of the iterator matches a predicate. Read more1.0.0 · source#### fn find

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,\n\nSearches for an element of an iterator that satisfies a predicate. Read more1.30.0 · source#### fn find_map(&mut self, f: F) -> Optionwhere\n Self: Sized,\n F: FnMut(Self::Item) -> Option,\n\nApplies function to the elements of iterator and returns the first non-none result. \n &mut self,\n f: F\n) -> <::Residual as Residual>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try,\n ::Residual: Residual>,\n\n🔬This is a nightly-only experimental API. (`try_find`)Applies function to the elements of iterator and returns the first true result or the first error. Read more1.0.0 · source#### fn position

(&mut self, predicate: P) -> Optionwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,\n\nSearches for an element in an iterator, returning its index. Read more1.6.0 · source#### fn max_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the maximum value from the specified function. Read more1.15.0 · source#### fn max_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the maximum value with respect to the specified comparison function. Read more1.6.0 · source#### fn min_by_key(self, f: F) -> Optionwhere\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,\n\nReturns the element that gives the minimum value from the specified function. Read more1.15.0 · source#### fn min_by(self, compare: F) -> Optionwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,\n\nReturns the element that gives the minimum value with respect to the specified comparison function. Read more1.0.0 · source#### fn unzip(self) -> (FromA, FromB)where\n FromA: Default + Extend,\n FromB: Default + Extend,\n Self: Sized + Iterator,\n\nConverts an iterator of pairs into a pair of containers. Read more1.36.0 · source#### fn copied<'a, T>(self) -> Copied where\n T: 'a + Copy,\n Self: Sized + Iterator,\n\nCreates an iterator which copies all of its elements. Read more1.0.0 · source#### fn cloned<'a, T>(self) -> Cloned where\n T: 'a + Clone,\n Self: Sized + Iterator,\n\nCreates an iterator which `clone`s all of its elements. \n Self: Sized,\n\n🔬This is a nightly-only experimental API. (`iter_array_chunks`)Returns an iterator over `N` elements of the iterator at a time. Read more1.11.0 · source#### fn sum(self) -> Swhere\n Self: Sized,\n S: Sum,\n\nSums the elements of an iterator. Read more1.11.0 · source#### fn product

(self) -> Pwhere\n Self: Sized,\n P: Product,\n\nIterates over the entire iterator, multiplying all the elements \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Ordering,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn partial_cmp(self, other: I) -> Optionwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nLexicographically compares the `PartialOrd` elements of this `Iterator` with those of another. The comparison works like short-circuit evaluation, returning a result without comparing the remaining elements.\nAs soon as an order can be determined, the evaluation stops and a result is returned. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Lexicographically compares the elements of this `Iterator` with those of another with respect to the specified comparison function. Read more1.5.0 · source#### fn eq(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are equal to those of another. \n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, ::Item) -> bool,\n\n🔬This is a nightly-only experimental API. (`iter_order_by`)Determines if the elements of this `Iterator` are equal to those of another with respect to the specified equality function. Read more1.5.0 · source#### fn ne(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are not equal to those of another. Read more1.5.0 · source#### fn lt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less than those of another. Read more1.5.0 · source#### fn le(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically less or equal to those of another. Read more1.5.0 · source#### fn gt(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than those of another. Read more1.5.0 · source#### fn ge(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<::Item>,\n Self: Sized,\n\nDetermines if the elements of this `Iterator` are lexicographically greater than or equal to those of another. \n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given comparator function. \n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,\n\n🔬This is a nightly-only experimental API. (`is_sorted`)Checks if the elements of this iterator are sorted using the given key extraction function. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ImportsIteratorwhere\n I: RefUnwindSafe,\n\n### impl Send for ImportsIteratorwhere\n I: Send,\n\n### impl Sync for ImportsIteratorwhere\n I: Sync,\n\n### impl Unpin for ImportsIteratorwhere\n I: Unpin,\n\n### impl UnwindSafe for ImportsIteratorwhere\n I: UnwindSafe,\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl IntoIterator for Iwhere\n I: Iterator,\n\n#### type Item = ::Item\n\nThe type of the elements being iterated over.#### type IntoIter = I\n\nWhich kind of iterator are we turning this into?const: unstable · source#### fn into_iter(self) -> I\n\nCreates an iterator from a value. \n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"ArrayChunks\":\"

Notable traits for ArrayChunks&lt;I, N&gt;

impl&lt;I, const N: usize&gt; Iterator for ArrayChunks&lt;I, N&gt;where\\n I: Iterator, type Item = [&lt;I as Iterator&gt;::Item; N];\",\"Chain::IntoIter>\":\"

Notable traits for Chain&lt;A, B&gt;

impl&lt;A, B&gt; Iterator for Chain&lt;A, B&gt;where\\n A: Iterator,\\n B: Iterator&lt;Item = &lt;A as Iterator&gt;::Item&gt;, type Item = &lt;A as Iterator&gt;::Item;\",\"Cloned\":\"

Notable traits for Cloned&lt;I&gt;

impl&lt;'a, I, T&gt; Iterator for Cloned&lt;I&gt;where\\n T: 'a + Clone,\\n I: Iterator&lt;Item = &amp;'a T&gt;, type Item = T;\",\"Copied\":\"

Notable traits for Copied&lt;I&gt;

impl&lt;'a, I, T&gt; Iterator for Copied&lt;I&gt;where\\n T: 'a + Copy,\\n I: Iterator&lt;Item = &amp;'a T&gt;, type Item = T;\",\"Enumerate\":\"

Notable traits for Enumerate&lt;I&gt;

impl&lt;I&gt; Iterator for Enumerate&lt;I&gt;where\\n I: Iterator, type Item = (usize, &lt;I as Iterator&gt;::Item);\",\"Filter\":\"

Notable traits for Filter&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for Filter&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"FilterMap\":\"

Notable traits for FilterMap&lt;I, F&gt;

impl&lt;B, I, F&gt; Iterator for FilterMap&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"FlatMap\":\"

Notable traits for FlatMap&lt;I, U, F&gt;

impl&lt;I, U, F&gt; Iterator for FlatMap&lt;I, U, F&gt;where\\n I: Iterator,\\n U: IntoIterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; U, type Item = &lt;U as IntoIterator&gt;::Item;\",\"Fuse\":\"

Notable traits for Fuse&lt;I&gt;

impl&lt;I&gt; Iterator for Fuse&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Inspect\":\"

Notable traits for Inspect&lt;I, F&gt;

impl&lt;I, F&gt; Iterator for Inspect&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&amp;&lt;I as Iterator&gt;::Item), type Item = &lt;I as Iterator&gt;::Item;\",\"IntersperseWith\":\"

Notable traits for IntersperseWith&lt;I, G&gt;

impl&lt;I, G&gt; Iterator for IntersperseWith&lt;I, G&gt;where\\n I: Iterator,\\n G: FnMut() -&gt; &lt;I as Iterator&gt;::Item, type Item = &lt;I as Iterator&gt;::Item;\",\"Map\":\"

Notable traits for Map&lt;I, F&gt;

impl&lt;B, I, F&gt; Iterator for Map&lt;I, F&gt;where\\n I: Iterator,\\n F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; B, type Item = B;\",\"MapWhile\":\"

Notable traits for MapWhile&lt;I, P&gt;

impl&lt;B, I, P&gt; Iterator for MapWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"MapWindows\":\"

Notable traits for MapWindows&lt;I, F, N&gt;

impl&lt;I, F, R, const N: usize&gt; Iterator for MapWindows&lt;I, F, N&gt;where\\n I: Iterator,\\n F: FnMut(&amp;[&lt;I as Iterator&gt;::Item; N]) -&gt; R, type Item = R;\",\"Peekable\":\"

Notable traits for Peekable&lt;I&gt;

impl&lt;I&gt; Iterator for Peekable&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Scan\":\"

Notable traits for Scan&lt;I, St, F&gt;

impl&lt;B, I, St, F&gt; Iterator for Scan&lt;I, St, F&gt;where\\n I: Iterator,\\n F: FnMut(&amp;mut St, &lt;I as Iterator&gt;::Item) -&gt; Option&lt;B&gt;, type Item = B;\",\"Skip\":\"

Notable traits for Skip&lt;I&gt;

impl&lt;I&gt; Iterator for Skip&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"SkipWhile\":\"

Notable traits for SkipWhile&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for SkipWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"StepBy\":\"

Notable traits for StepBy&lt;I&gt;

impl&lt;I&gt; Iterator for StepBy&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"Take\":\"

Notable traits for Take&lt;I&gt;

impl&lt;I&gt; Iterator for Take&lt;I&gt;where\\n I: Iterator, type Item = &lt;I as Iterator&gt;::Item;\",\"TakeWhile\":\"

Notable traits for TakeWhile&lt;I, P&gt;

impl&lt;I, P&gt; Iterator for TakeWhile&lt;I, P&gt;where\\n I: Iterator,\\n P: FnMut(&amp;&lt;I as Iterator&gt;::Item) -&gt; bool, type Item = &lt;I as Iterator&gt;::Item;\",\"Zip::IntoIter>\":\"

Notable traits for Zip&lt;A, B&gt;

impl&lt;A, B&gt; Iterator for Zip&lt;A, B&gt;where\\n A: Iterator,\\n B: Iterator, type Item = (&lt;A as Iterator&gt;::Item, &lt;B as Iterator&gt;::Item);\"}\n\nStruct wasmer_types::LocalFunctionIndex\n===\n\n\n```\npub struct LocalFunctionIndex(/* private fields */);\n```\nIndex type of a function defined locally inside the WebAssembly module.\n\nImplementations\n---\n\n### impl LocalFunctionIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for LocalFunctionIndexwhere\n u32: Archive,\n\n#### type Archived = LocalFunctionIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> LocalFunctionIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for LocalFunctionIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &LocalFunctionIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &LocalFunctionIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for LocalFunctionIndex\n\n#### fn partial_cmp(&self, other: &LocalFunctionIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> LocalFunctionIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for LocalFunctionIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::LocalGlobalIndex\n===\n\n\n```\npub struct LocalGlobalIndex(/* private fields */);\n```\nIndex type of a global defined locally inside the WebAssembly module.\n\nImplementations\n---\n\n### impl LocalGlobalIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for LocalGlobalIndexwhere\n u32: Archive,\n\n#### type Archived = LocalGlobalIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> LocalGlobalIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for LocalGlobalIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &LocalGlobalIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &LocalGlobalIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for LocalGlobalIndex\n\n#### fn partial_cmp(&self, other: &LocalGlobalIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> LocalGlobalIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for LocalGlobalIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::LocalMemoryIndex\n===\n\n\n```\npub struct LocalMemoryIndex(/* private fields */);\n```\nIndex type of a memory defined locally inside the WebAssembly module.\n\nImplementations\n---\n\n### impl LocalMemoryIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Clone for LocalMemoryIndex\n\n#### fn clone(&self) -> LocalMemoryIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn new(index: usize) -> Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for LocalMemoryIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &LocalMemoryIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &LocalMemoryIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for LocalMemoryIndex\n\n#### fn partial_cmp(&self, other: &LocalMemoryIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> LocalMemoryIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl Copy for LocalMemoryIndex\n\n### impl Eq for LocalMemoryIndex\n\n### impl StructuralEq for LocalMemoryIndex\n\n### impl StructuralPartialEq for LocalMemoryIndex\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for LocalMemoryIndex\n\n### impl Send for LocalMemoryIndex\n\n### impl Sync for LocalMemoryIndex\n\n### impl Unpin for LocalMemoryIndex\n\n### impl UnwindSafe for LocalMemoryIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::LocalTableIndex\n===\n\n\n```\npub struct LocalTableIndex(/* private fields */);\n```\nIndex type of a table defined locally inside the WebAssembly module.\n\nImplementations\n---\n\n### impl LocalTableIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Clone for LocalTableIndex\n\n#### fn clone(&self) -> LocalTableIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn new(index: usize) -> Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for LocalTableIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &LocalTableIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &LocalTableIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for LocalTableIndex\n\n#### fn partial_cmp(&self, other: &LocalTableIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> LocalTableIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl Copy for LocalTableIndex\n\n### impl Eq for LocalTableIndex\n\n### impl StructuralEq for LocalTableIndex\n\n### impl StructuralPartialEq for LocalTableIndex\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for LocalTableIndex\n\n### impl Send for LocalTableIndex\n\n### impl Sync for LocalTableIndex\n\n### impl Unpin for LocalTableIndex\n\n### impl UnwindSafe for LocalTableIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::Memory32\n===\n\n\n```\npub struct Memory32;\n```\nMarker trait for 32-bit memories.\n\nTrait Implementations\n---\n\n### impl Clone for Memory32\n\n#### fn clone(&self) -> Memory32\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### type Offset = u32\n\nType used to represent an offset into a memory. This is `u32` or `u64`.#### type Native = i32\n\nType used to pass this value as an argument or return value for a Wasm function.#### const ZERO: Self::Offset = {transmute(0x00000000): ::Offset}\n\nZero value used for `WasmPtr::is_null`.#### const ONE: Self::Offset = {transmute(0x00000001): ::Offset}\n\nOne value used for counting.#### fn offset_to_native(offset: Self::Offset) -> Self::Native\n\nConvert an `Offset` to a `Native`.#### fn native_to_offset(native: Self::Native) -> Self::Offset\n\nConvert a `Native` to an `Offset`.#### fn is_64bit() -> bool\n\nTrue if the memory is 64-bit### impl NativeWasmType for Memory32\n\n#### const WASM_TYPE: Type = <::Native as NativeWasmType>::WASM_TYPE\n\nType for this `NativeWasmType`.#### type Abi = <::Native as NativeWasmType>::Abi\n\nThe ABI for this type (i32, i64, f32, f64)### impl Copy for Memory32\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Memory32\n\n### impl Send for Memory32\n\n### impl Sync for Memory32\n\n### impl Unpin for Memory32\n\n### impl UnwindSafe for Memory32\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::Memory64\n===\n\n\n```\npub struct Memory64;\n```\nMarker trait for 64-bit memories.\n\nTrait Implementations\n---\n\n### impl Clone for Memory64\n\n#### fn clone(&self) -> Memory64\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### type Offset = u64\n\nType used to represent an offset into a memory. This is `u32` or `u64`.#### type Native = i64\n\nType used to pass this value as an argument or return value for a Wasm function.#### const ZERO: Self::Offset = {transmute(0x0000000000000000): ::Offset}\n\nZero value used for `WasmPtr::is_null`.#### const ONE: Self::Offset = {transmute(0x0000000000000001): ::Offset}\n\nOne value used for counting.#### fn offset_to_native(offset: Self::Offset) -> Self::Native\n\nConvert an `Offset` to a `Native`.#### fn native_to_offset(native: Self::Native) -> Self::Offset\n\nConvert a `Native` to an `Offset`.#### fn is_64bit() -> bool\n\nTrue if the memory is 64-bit### impl NativeWasmType for Memory64\n\n#### const WASM_TYPE: Type = <::Native as NativeWasmType>::WASM_TYPE\n\nType for this `NativeWasmType`.#### type Abi = <::Native as NativeWasmType>::Abi\n\nThe ABI for this type (i32, i64, f32, f64)### impl Copy for Memory64\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Memory64\n\n### impl Send for Memory64\n\n### impl Sync for Memory64\n\n### impl Unpin for Memory64\n\n### impl UnwindSafe for Memory64\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::MemoryIndex\n===\n\n\n```\npub struct MemoryIndex(/* private fields */);\n```\nIndex type of a linear memory (imported or local) inside the WebAssembly module.\n\nImplementations\n---\n\n### impl MemoryIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for MemoryIndexwhere\n u32: Archive,\n\n#### type Archived = MemoryIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> MemoryIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for MemoryIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &MemoryIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &MemoryIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for MemoryIndex\n\n#### fn partial_cmp(&self, other: &MemoryIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> MemoryIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for MemoryIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::MemoryType\n===\n\n\n```\npub struct MemoryType {\n    pub minimum: Pages,\n    pub maximum: Option,\n    pub shared: bool,\n}\n```\nA descriptor for a WebAssembly memory type.\n\nMemories are described in units of pages (64KB) and represent contiguous chunks of addressable memory.\n\nFields\n---\n\n`minimum: Pages`The minimum number of pages in the memory.\n\n`maximum: Option`The maximum number of pages in the memory.\n\n`shared: bool`Whether the memory may be shared between multiple threads.\n\nImplementations\n---\n\n### impl MemoryType\n\n#### pub fn new(\n minimum: IntoPages,\n maximum: Option,\n shared: bool\n) -> Selfwhere\n IntoPages: Into,\n\nCreates a new descriptor for a WebAssembly memory given the specified limits of the memory.\n\nTrait Implementations\n---\n\n### impl Archive for MemoryTypewhere\n Pages: Archive,\n Option: Archive,\n bool: Archive,\n\n#### type Archived = ArchivedMemoryType\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> MemoryType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Pages: Archive,\n Archived: Deserialize,\n Option: Archive,\n Archived>: Deserialize, __D>,\n bool: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &MemoryType) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for MemoryTypewhere\n Pages: Serialize<__S>,\n Option: Serialize<__S>,\n bool: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::MetadataHeader\n===\n\n\n```\n#[repr(C)]pub struct MetadataHeader { /* private fields */ }\n```\nMetadata header which holds an ABI version and the length of the remaining metadata.\n\nImplementations\n---\n\n### impl MetadataHeader\n\n#### pub const CURRENT_VERSION: u32 = 5u32\n\nCurrent ABI version. Increment this any time breaking changes are made to the format of the serialized data.\n\n#### pub const LEN: usize = 16usize\n\nLength of the metadata header.\n\n#### pub const ALIGN: usize = 16usize\n\nAlignment of the metadata.\n\n#### pub fn new(len: usize) -> Self\n\nCreates a new header for metadata of the given length.\n\n#### pub fn into_bytes(self) -> [u8; 16]\n\nConvert the header into its bytes representation.\n\n#### pub fn parse(bytes: &[u8]) -> Result MetadataHeader\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for MetadataHeader\n\n### impl Send for MetadataHeader\n\n### impl Sync for MetadataHeader\n\n### impl Unpin for MetadataHeader\n\n### impl UnwindSafe for MetadataHeader\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::ModuleInfo\n===\n\n\n```\npub struct ModuleInfo {\n pub id: ModuleId,\n pub name: Option,\n pub imports: IndexMap,\n pub exports: IndexMap,\n pub start_function: Option,\n pub table_initializers: Vec,\n pub passive_elements: HashMap>,\n pub passive_data: HashMap>,\n pub global_initializers: PrimaryMap,\n pub function_names: HashMap,\n pub signatures: PrimaryMap,\n pub functions: PrimaryMap,\n pub tables: PrimaryMap,\n pub memories: PrimaryMap,\n pub globals: PrimaryMap,\n pub custom_sections: IndexMap,\n pub custom_sections_data: PrimaryMap>,\n pub num_imported_functions: usize,\n pub num_imported_tables: usize,\n pub num_imported_memories: usize,\n pub num_imported_globals: usize,\n}\n```\nA translated WebAssembly module, excluding the function bodies and memory initializers.\n\nFields\n---\n\n`id: ModuleId`A unique identifier (within this process) for this module.\n\nWe skip serialization/deserialization of this field, as it should be computed by the process.\nIt’s not skipped in rkyv, but that is okay, because even though it’s skipped in bincode/serde it’s still deserialized back as a garbage number, and later override from computed by the process\n\n`name: Option`The name of this wasm module, often found in the wasm file.\n\n`imports: IndexMap`Imported entities with the (module, field, index_of_the_import)\n\nKeeping the `index_of_the_import` is important, as there can be two same references to the same import, and we don’t want to confuse them.\n\n`exports: IndexMap`Exported entities.\n\n`start_function: Option`The module “start” function, if present.\n\n`table_initializers: Vec`WebAssembly table initializers.\n\n`passive_elements: HashMap>`WebAssembly passive elements.\n\n`passive_data: HashMap>`WebAssembly passive data segments.\n\n`global_initializers: PrimaryMap`WebAssembly global initializers.\n\n`function_names: HashMap`WebAssembly function names.\n\n`signatures: PrimaryMap`WebAssembly function signatures.\n\n`functions: PrimaryMap`WebAssembly functions (imported and local).\n\n`tables: PrimaryMap`WebAssembly tables (imported and local).\n\n`memories: PrimaryMap`WebAssembly linear memories (imported and local).\n\n`globals: PrimaryMap`WebAssembly global variables (imported and local).\n\n`custom_sections: IndexMap`Custom sections in the module.\n\n`custom_sections_data: PrimaryMap>`The data for each CustomSection in the module.\n\n`num_imported_functions: usize`Number of imported functions in the module.\n\n`num_imported_tables: usize`Number of imported tables in the module.\n\n`num_imported_memories: usize`Number of imported memories in the module.\n\n`num_imported_globals: usize`Number of imported globals in the module.\n\nImplementations\n---\n\n### impl ModuleInfo\n\n#### pub fn new() -> Self\n\nAllocates the module data structures.\n\n#### pub fn get_passive_element(&self, index: ElemIndex) -> Option<&[FunctionIndex]Get the given passive element, if it exists.\n\n#### pub fn exported_signatures(&self) -> Vec ExportsIterator + '_Get the export types of the module\n\n#### pub fn imports(&self) -> ImportsIterator + '_Get the import types of the module\n\n#### pub fn custom_sections<'a>(\n &'a self,\n name: &'a str\n) -> impl Iterator> + 'a\n\nGet the custom sections of the module given a `name`.\n\n#### pub fn func_index(&self, local_func: LocalFunctionIndex) -> FunctionIndex\n\nConvert a `LocalFunctionIndex` into a `FunctionIndex`.\n\n#### pub fn local_func_index(\n &self,\n func: FunctionIndex\n) -> Option bool\n\nTest whether the given function index is for an imported function.\n\n#### pub fn table_index(&self, local_table: LocalTableIndex) -> TableIndex\n\nConvert a `LocalTableIndex` into a `TableIndex`.\n\n#### pub fn local_table_index(&self, table: TableIndex) -> Option bool\n\nTest whether the given table index is for an imported table.\n\n#### pub fn memory_index(&self, local_memory: LocalMemoryIndex) -> MemoryIndex\n\nConvert a `LocalMemoryIndex` into a `MemoryIndex`.\n\n#### pub fn local_memory_index(\n &self,\n memory: MemoryIndex\n) -> Option bool\n\nTest whether the given memory index is for an imported memory.\n\n#### pub fn global_index(&self, local_global: LocalGlobalIndex) -> GlobalIndex\n\nConvert a `LocalGlobalIndex` into a `GlobalIndex`.\n\n#### pub fn local_global_index(\n &self,\n global: GlobalIndex\n) -> Option bool\n\nTest whether the given global index is for an imported global.\n\n#### pub fn name(&self) -> String\n\nGet the Module name\n\n#### pub fn imported_function_types(&self) -> impl Iterator + '_\n\nGet the imported function types of the module.\n\nTrait Implementations\n---\n\n### impl Archive for ModuleInfo\n\n#### type Archived = ::Archived\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> ModuleInfo\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> ModuleInfo\n\nReturns the “default value” for a type. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn eq(&self, other: &Self) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Serialize for ModuleInfo\n\n#### fn serialize(&self, serializer: &mut S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"ExportsIterator + '_>\":\"

Notable traits for ExportsIterator&lt;I&gt;

impl&lt;I: Iterator&lt;Item = ExportType&gt; + Sized&gt; Iterator for ExportsIterator&lt;I&gt; type Item = ExportType;\",\"ImportsIterator + '_>\":\"

Notable traits for ImportsIterator&lt;I&gt;

impl&lt;I: Iterator&lt;Item = ImportType&gt; + Sized&gt; Iterator for ImportsIterator&lt;I&gt; type Item = ImportType;\"}\n\nStruct wasmer_types::PageCountOutOfRange\n===\n\n\n```\npub struct PageCountOutOfRange;\n```\nThe only error that can happen when converting `Bytes` to `Pages`\n\nTrait Implementations\n---\n\n### impl Clone for PageCountOutOfRange\n\n#### fn clone(&self) -> PageCountOutOfRange\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn eq(&self, other: &PageCountOutOfRange) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for PageCountOutOfRange\n\n### impl Eq for PageCountOutOfRange\n\n### impl StructuralEq for PageCountOutOfRange\n\n### impl StructuralPartialEq for PageCountOutOfRange\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for PageCountOutOfRange\n\n### impl Send for PageCountOutOfRange\n\n### impl Sync for PageCountOutOfRange\n\n### impl Unpin for PageCountOutOfRange\n\n### impl UnwindSafe for PageCountOutOfRange\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::Pages\n===\n\n\n```\npub struct Pages(pub u32);\n```\nUnits of WebAssembly pages (as specified to be 65,536 bytes).\n\nTuple Fields\n---\n\n`0: u32`Implementations\n---\n\n### impl Pages\n\n#### pub const fn max_value() -> Self\n\nReturns the largest value that can be represented by the Pages type.\n\nThis is defined by the WebAssembly standard as 65,536 pages.\n\n#### pub fn checked_add(self, rhs: Self) -> Option Bytes\n\nCalculate number of bytes from pages.\n\nTrait Implementations\n---\n\n### impl Add for Pageswhere\n T: Into,\n\n#### type Output = Pages\n\nThe resulting type after applying the `+` operator.#### fn add(self, rhs: T) -> Self\n\nPerforms the `+` operation. \n u32: Archive,\n\n#### type Archived = Pages\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> Pages\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for Bytes\n\n#### fn from(pages: Pages) -> Self\n\nConverts to this type from the input type.### impl From for Pages\n\n#### fn from(other: u32) -> Self\n\nConverts to this type from the input type.### impl Hash for Pages\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &Pages) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &Pages) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for Pages\n\n#### fn partial_cmp(&self, other: &Pages) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Sub for Pageswhere\n T: Into,\n\n#### type Output = Pages\n\nThe resulting type after applying the `-` operator.#### fn sub(self, rhs: T) -> Self\n\nPerforms the `-` operation. \n\n#### type Error = PageCountOutOfRange\n\nThe type returned in the event of a conversion error.#### fn try_from(bytes: Bytes) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::SignatureIndex\n===\n\n\n```\npub struct SignatureIndex(/* private fields */);\n```\nIndex type of a signature (imported or local) inside the WebAssembly module.\n\nImplementations\n---\n\n### impl SignatureIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for SignatureIndexwhere\n u32: Archive,\n\n#### type Archived = SignatureIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> SignatureIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for SignatureIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &SignatureIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &SignatureIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for SignatureIndex\n\n#### fn partial_cmp(&self, other: &SignatureIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> SignatureIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for SignatureIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::SourceLoc\n===\n\n\n```\n#[repr(transparent)]pub struct SourceLoc(/* private fields */);\n```\nA source location.\n\nThe default source location uses the all-ones bit pattern `!0`. It is used for instructions that can’t be given a real source location.\n\nImplementations\n---\n\n### impl SourceLoc\n\n#### pub fn new(bits: u32) -> Self\n\nCreate a new source location with the given bits.\n\n#### pub fn is_default(self) -> bool\n\nIs this the default source location?\n\n#### pub fn bits(self) -> u32\n\nRead the bits of this source location.\n\nTrait Implementations\n---\n\n### impl Archive for SourceLocwhere\n u32: Archive,\n\n#### type Archived = SourceLoc\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> SourceLoc\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result) -> Result\n\nFormats the value using the given formatter. \n\n#### fn eq(&self, other: &SourceLoc) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for SourceLocwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::StoreId\n===\n\n\n```\npub struct StoreId(/* private fields */);\n```\nUnique ID to identify a context.\n\nEvery handle to an object managed by a context also contains the ID of the context. This is used to check that a handle is always used with the correct context.\n\nTrait Implementations\n---\n\n### impl Clone for StoreId\n\n#### fn clone(&self) -> StoreId\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &StoreId) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for StoreId\n\n### impl Eq for StoreId\n\n### impl StructuralEq for StoreId\n\n### impl StructuralPartialEq for StoreId\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for StoreId\n\n### impl Send for StoreId\n\n### impl Sync for StoreId\n\n### impl Unpin for StoreId\n\n### impl UnwindSafe for StoreId\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::TableIndex\n===\n\n\n```\npub struct TableIndex(/* private fields */);\n```\nIndex type of a table (imported or local) inside the WebAssembly module.\n\nImplementations\n---\n\n### impl TableIndex\n\n#### pub fn from_u32(x: u32) -> Self\n\nCreate a new instance from a `u32`.\n\n#### pub fn as_u32(self) -> u32\n\nReturn the underlying index value as a `u32`.\n\nTrait Implementations\n---\n\n### impl Archive for TableIndexwhere\n u32: Archive,\n\n#### type Archived = TableIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u32: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> TableIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u32: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result Self\n\nCreate a new entity reference from a small integer.\nThis should crash if the requested index is not representable.#### fn index(self) -> usize\n\nGet the index that was used to create this entity reference.### impl Hash for TableIndex\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &TableIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &TableIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for TableIndex\n\n#### fn partial_cmp(&self, other: &TableIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n\n#### fn reserved_value() -> TableIndex\n\nCreate an instance of the reserved value.#### fn is_reserved_value(&self) -> bool\n\nChecks whether value is the reserved one.### impl<__S: Fallible + ?Sized> Serialize<__S> for TableIndexwhere\n u32: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::TableInitializer\n===\n\n\n```\npub struct TableInitializer {\n    pub table_index: TableIndex,\n    pub base: Option,\n    pub offset: usize,\n    pub elements: Box<[FunctionIndex]>,\n}\n```\nA WebAssembly table initializer.\n\nFields\n---\n\n`table_index: TableIndex`The index of a table to initialize.\n\n`base: Option`Optionally, a global variable giving a base index.\n\n`offset: usize`The offset to add to the base.\n\n`elements: Box<[FunctionIndex]>`The values to write into the table elements.\n\nTrait Implementations\n---\n\n### impl Archive for TableInitializerwhere\n TableIndex: Archive,\n Option: Archive,\n usize: Archive,\n Box<[FunctionIndex]>: Archive,\n\n#### type Archived = ArchivedTableInitializer\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> TableInitializer\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n TableIndex: Archive,\n Archived: Deserialize,\n Option: Archive,\n Archived>: Deserialize, __D>,\n usize: Archive,\n Archived: Deserialize,\n Box<[FunctionIndex]>: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &TableInitializer) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for TableInitializerwhere\n TableIndex: Serialize<__S>,\n Option: Serialize<__S>,\n usize: Serialize<__S>,\n Box<[FunctionIndex]>: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::TableType\n===\n\n\n```\npub struct TableType {\n    pub ty: Type,\n    pub minimum: u32,\n    pub maximum: Option,\n}\n```\nA descriptor for a table in a WebAssembly module.\n\nTables are contiguous chunks of a specific element, typically a `funcref` or an `externref`. The most common use for tables is a function table through which `call_indirect` can invoke other functions.\n\nFields\n---\n\n`ty: Type`The type of data stored in elements of the table.\n\n`minimum: u32`The minimum number of elements in the table.\n\n`maximum: Option`The maximum number of elements in the table.\n\nImplementations\n---\n\n### impl TableType\n\n#### pub fn new(ty: Type, minimum: u32, maximum: Option) -> Self\n\nCreates a new table descriptor which will contain the specified\n`element` and have the `limits` applied to its length.\n\nTrait Implementations\n---\n\n### impl Archive for TableTypewhere\n Type: Archive,\n u32: Archive,\n Option: Archive,\n\n#### type Archived = ArchivedTableType\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### fn clone(&self) -> TableType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n Type: Archive,\n Archived: Deserialize,\n u32: Archive,\n Archived: Deserialize,\n Option: Archive,\n Archived>: Deserialize, __D>,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &TableType) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for TableTypewhere\n Type: Serialize<__S>,\n u32: Serialize<__S>,\n Option: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::TargetSharedSignatureIndex\n===\n\n\n```\npub struct TargetSharedSignatureIndex(/* private fields */);\n```\nTarget specific type for shared signature index.\n\nImplementations\n---\n\n### impl TargetSharedSignatureIndex\n\n#### pub const fn new(value: u32) -> Self\n\nConstructs `TargetSharedSignatureIndex`.\n\n#### pub const fn index(self) -> u32\n\nReturns index value.\n\nTrait Implementations\n---\n\n### impl Clone for TargetSharedSignatureIndex\n\n#### fn clone(&self) -> TargetSharedSignatureIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for TargetSharedSignatureIndex\n\n### impl Send for TargetSharedSignatureIndex\n\n### impl Sync for TargetSharedSignatureIndex\n\n### impl Unpin for TargetSharedSignatureIndex\n\n### impl UnwindSafe for TargetSharedSignatureIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::TrapInformation\n===\n\n\n```\npub struct TrapInformation {\n    pub code_offset: CodeOffset,\n    pub trap_code: TrapCode,\n}\n```\nInformation about trap.\n\nFields\n---\n\n`code_offset: CodeOffset`The offset of the trapping instruction in native code. It is relative to the beginning of the function.\n\n`trap_code: TrapCode`Code of the trap.\n\nTrait Implementations\n---\n\n### impl Archive for TrapInformationwhere\n CodeOffset: Archive,\n TrapCode: Archive,\n\n#### type Archived = TrapInformation\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n CodeOffset: CheckBytes<__C>,\n TrapCode: CheckBytes<__C>,\n\n#### type Error = StructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, StructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> TrapInformation\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n CodeOffset: Archive,\n Archived: Deserialize,\n TrapCode: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(\n &self,\n deserializer: &mut __D\n) -> Result for TrapInformation\n\n#### fn eq(&self, other: &TrapInformation) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for TrapInformationwhere\n CodeOffset: Serialize<__S>,\n TrapCode: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::Triple\n===\n\n\n```\npub struct Triple {\n    pub architecture: Architecture,\n    pub vendor: Vendor,\n    pub operating_system: OperatingSystem,\n    pub environment: Environment,\n    pub binary_format: BinaryFormat,\n}\n```\nA target “triple”. Historically such things had three fields, though they’ve added additional fields over time.\n\nNote that `Triple` doesn’t implement `Default` itself. If you want a type which defaults to the host triple, or defaults to unknown-unknown-unknown,\nuse `DefaultToHost` or `DefaultToUnknown`, respectively.\n\nFields\n---\n\n`architecture: Architecture`The “architecture” (and sometimes the subarchitecture).\n\n`vendor: Vendor`The “vendor” (whatever that means).\n\n`operating_system: OperatingSystem`The “operating system” (sometimes also the environment).\n\n`environment: Environment`The “environment” on top of the operating system (often omitted for operating systems with a single predominant environment).\n\n`binary_format: BinaryFormat`The “binary format” (rarely used).\n\nImplementations\n---\n\n### impl Triple\n\n#### pub const fn host() -> Triple\n\nReturn the triple for the current host.\n\n### impl Triple\n\n#### pub fn endianness(&self) -> Result Result Result Result Triple\n\nReturn a `Triple` with all unknown fields.\n\nTrait Implementations\n---\n\n### impl Clone for Triple\n\n#### fn clone(&self) -> Triple\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ParseError\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result::ErrParses a string `s` to return a value of this type. \n\n#### fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Triple) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for Triple\n\n### impl StructuralEq for Triple\n\n### impl StructuralPartialEq for Triple\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Triple\n\n### impl Send for Triple\n\n### impl Sync for Triple\n\n### impl Unpin for Triple\n\n### impl UnwindSafe for Triple\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::V128\n===\n\n\n```\npub struct V128(/* private fields */);\n```\nThe WebAssembly V128 type\n\nImplementations\n---\n\n### impl V128\n\n#### pub fn bytes(&self) -> &[u8; 16]\n\nGet the bytes corresponding to the V128 value\n\n#### pub fn iter(&self) -> impl Iterator Vec &[u8] \n\nConvert the immediate into a slice.\n\nTrait Implementations\n---\n\n### impl Archive for V128where\n [u8; 16]: Archive,\n\n#### type Archived = V128\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: Self::Resolver,\n out: *mutSelf::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n [u8; 16]: CheckBytes<__C>,\n\n#### type Error = TupleStructCheckError\n\nThe error that may result from checking the type.#### unsafe fn check_bytes<'__bytecheck>(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, TupleStructCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> V128\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n [u8; 16]: Archive,\n Archived<[u8; 16]>: Deserialize<[u8; 16], __D>,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for V128\n\n#### fn from(slice: &[u8]) -> Self\n\nConverts to this type from the input type.### impl From<[u8; 16]> for V128\n\n#### fn from(array: [u8; 16]) -> Self\n\nConverts to this type from the input type.### impl Hash for V128\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &V128) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for V128where\n [u8; 16]: Serialize<__S>,\n\n#### fn serialize(&self, serializer: &mut __S) -> Result Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.{\"&[u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\",\"Vec\":\"

Notable traits for Vec&lt;u8, A&gt;

impl&lt;A&gt; Write for Vec&lt;u8, A&gt;where\\n A: Allocator,\"}\n\nStruct wasmer_types::VMBuiltinFunctionIndex\n===\n\n\n```\npub struct VMBuiltinFunctionIndex(/* private fields */);\n```\nAn index type for builtin functions.\n\nImplementations\n---\n\n### impl VMBuiltinFunctionIndex\n\n#### pub const fn get_memory32_grow_index() -> Self\n\nReturns an index for wasm’s `memory.grow` builtin function.\n\n#### pub const fn get_imported_memory32_grow_index() -> Self\n\nReturns an index for wasm’s imported `memory.grow` builtin function.\n\n#### pub const fn get_memory32_size_index() -> Self\n\nReturns an index for wasm’s `memory.size` builtin function.\n\n#### pub const fn get_imported_memory32_size_index() -> Self\n\nReturns an index for wasm’s imported `memory.size` builtin function.\n\n#### pub const fn get_table_copy_index() -> Self\n\nReturns an index for wasm’s `table.copy` when both tables are locally defined.\n\n#### pub const fn get_table_init_index() -> Self\n\nReturns an index for wasm’s `table.init`.\n\n#### pub const fn get_elem_drop_index() -> Self\n\nReturns an index for wasm’s `elem.drop`.\n\n#### pub const fn get_memory_copy_index() -> Self\n\nReturns an index for wasm’s `memory.copy` for locally defined memories.\n\n#### pub const fn get_imported_memory_copy_index() -> Self\n\nReturns an index for wasm’s `memory.copy` for imported memories.\n\n#### pub const fn get_memory_fill_index() -> Self\n\nReturns an index for wasm’s `memory.fill` for locally defined memories.\n\n#### pub const fn get_imported_memory_fill_index() -> Self\n\nReturns an index for wasm’s `memory.fill` for imported memories.\n\n#### pub const fn get_memory_init_index() -> Self\n\nReturns an index for wasm’s `memory.init` instruction.\n\n#### pub const fn get_data_drop_index() -> Self\n\nReturns an index for wasm’s `data.drop` instruction.\n\n#### pub const fn get_raise_trap_index() -> Self\n\nReturns an index for wasm’s `raise_trap` instruction.\n\n#### pub const fn get_table_size_index() -> Self\n\nReturns an index for wasm’s `table.size` instruction for local tables.\n\n#### pub const fn get_imported_table_size_index() -> Self\n\nReturns an index for wasm’s `table.size` instruction for imported tables.\n\n#### pub const fn get_table_grow_index() -> Self\n\nReturns an index for wasm’s `table.grow` instruction for local tables.\n\n#### pub const fn get_imported_table_grow_index() -> Self\n\nReturns an index for wasm’s `table.grow` instruction for imported tables.\n\n#### pub const fn get_table_get_index() -> Self\n\nReturns an index for wasm’s `table.get` instruction for local tables.\n\n#### pub const fn get_imported_table_get_index() -> Self\n\nReturns an index for wasm’s `table.get` instruction for imported tables.\n\n#### pub const fn get_table_set_index() -> Self\n\nReturns an index for wasm’s `table.set` instruction for local tables.\n\n#### pub const fn get_imported_table_set_index() -> Self\n\nReturns an index for wasm’s `table.set` instruction for imported tables.\n\n#### pub const fn get_func_ref_index() -> Self\n\nReturns an index for wasm’s `func.ref` instruction.\n\n#### pub const fn get_table_fill_index() -> Self\n\nReturns an index for wasm’s `table.fill` instruction for local tables.\n\n#### pub const fn get_memory_atomic_wait32_index() -> Self\n\nReturns an index for wasm’s local `memory.atomic.wait32` builtin function.\n\n#### pub const fn get_imported_memory_atomic_wait32_index() -> Self\n\nReturns an index for wasm’s imported `memory.atomic.wait32` builtin function.\n\n#### pub const fn get_memory_atomic_wait64_index() -> Self\n\nReturns an index for wasm’s local `memory.atomic.wait64` builtin function.\n\n#### pub const fn get_imported_memory_atomic_wait64_index() -> Self\n\nReturns an index for wasm’s imported `memory.atomic.wait64` builtin function.\n\n#### pub const fn get_memory_atomic_notify_index() -> Self\n\nReturns an index for wasm’s local `memory.atomic.notify` builtin function.\n\n#### pub const fn get_imported_memory_atomic_notify_index() -> Self\n\nReturns an index for wasm’s imported `memory.atomic.notify` builtin function.\n\n#### pub const fn builtin_functions_total_number() -> u32\n\nReturns the total number of builtin functions.\n\n#### pub const fn index(self) -> u32\n\nReturn the index as an u32 number.\n\nTrait Implementations\n---\n\n### impl Clone for VMBuiltinFunctionIndex\n\n#### fn clone(&self) -> VMBuiltinFunctionIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for VMBuiltinFunctionIndex\n\n### impl Send for VMBuiltinFunctionIndex\n\n### impl Sync for VMBuiltinFunctionIndex\n\n### impl Unpin for VMBuiltinFunctionIndex\n\n### impl UnwindSafe for VMBuiltinFunctionIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nStruct wasmer_types::VMOffsets\n===\n\n\n```\npub struct VMOffsets { /* private fields */ }\n```\nThis class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.\n\nImplementations\n---\n\n### impl VMOffsets\n\n#### pub fn new(pointer_size: u8, module: &ModuleInfo) -> Self\n\nReturn a new `VMOffsets` instance, for a given pointer size.\n\n#### pub fn new_for_trampolines(pointer_size: u8) -> Self\n\nReturn a new `VMOffsets` instance, for a given pointer size skipping the `ModuleInfo`.\n\nNote: This should only when generating code for trampolines.\n\n#### pub fn num_local_tables(&self) -> u32\n\nNumber of local tables defined in the module\n\n#### pub fn num_local_memories(&self) -> u32\n\nNumber of local memories defined in the module\n\n### impl VMOffsets\n\nOffsets for `VMFunctionImport`.\n\n#### pub const fn vmfunction_import_body(&self) -> u8\n\nThe offset of the `body` field.\n\n#### pub const fn vmfunction_import_vmctx(&self) -> u8\n\nThe offset of the `vmctx` field.\n\n#### pub const fn vmfunction_import_handle(&self) -> u8\n\nThe offset of the `handle` field.\n\n#### pub const fn size_of_vmfunction_import(&self) -> u8\n\nReturn the size of `VMFunctionImport`.\n\n### impl VMOffsets\n\nOffsets for `VMDynamicFunctionContext`.\n\n#### pub const fn vmdynamicfunction_import_context_address(&self) -> u8\n\nThe offset of the `address` field.\n\n#### pub const fn vmdynamicfunction_import_context_ctx(&self) -> u8\n\nThe offset of the `ctx` field.\n\n#### pub const fn size_of_vmdynamicfunction_import_context(&self) -> u8\n\nReturn the size of `VMDynamicFunctionContext`.\n\n### impl VMOffsets\n\nOffsets for `*const VMFunctionBody`.\n\n#### pub const fn size_of_vmfunction_body_ptr(&self) -> u8\n\nThe size of the `current_elements` field.\n\n### impl VMOffsets\n\nOffsets for `VMTableImport`.\n\n#### pub const fn vmtable_import_definition(&self) -> u8\n\nThe offset of the `definition` field.\n\n#### pub const fn vmtable_import_handle(&self) -> u8\n\nThe offset of the `handle` field.\n\n#### pub const fn size_of_vmtable_import(&self) -> u8\n\nReturn the size of `VMTableImport`.\n\n### impl VMOffsets\n\nOffsets for `VMTableDefinition`.\n\n#### pub const fn vmtable_definition_base(&self) -> u8\n\nThe offset of the `base` field.\n\n#### pub const fn vmtable_definition_current_elements(&self) -> u8\n\nThe offset of the `current_elements` field.\n\n#### pub const fn size_of_vmtable_definition_current_elements(&self) -> u8\n\nThe size of the `current_elements` field.\n\n#### pub const fn size_of_vmtable_definition(&self) -> u8\n\nReturn the size of `VMTableDefinition`.\n\n### impl VMOffsets\n\nOffsets for `VMMemoryImport`.\n\n#### pub const fn vmmemory_import_definition(&self) -> u8\n\nThe offset of the `from` field.\n\n#### pub const fn vmmemory_import_handle(&self) -> u8\n\nThe offset of the `handle` field.\n\n#### pub const fn size_of_vmmemory_import(&self) -> u8\n\nReturn the size of `VMMemoryImport`.\n\n### impl VMOffsets\n\nOffsets for `VMMemoryDefinition`.\n\n#### pub const fn vmmemory_definition_base(&self) -> u8\n\nThe offset of the `base` field.\n\n#### pub const fn vmmemory_definition_current_length(&self) -> u8\n\nThe offset of the `current_length` field.\n\n#### pub const fn size_of_vmmemory_definition_current_length(&self) -> u8\n\nThe size of the `current_length` field.\n\n#### pub const fn size_of_vmmemory_definition(&self) -> u8\n\nReturn the size of `VMMemoryDefinition`.\n\n### impl VMOffsets\n\nOffsets for `VMGlobalImport`.\n\n#### pub const fn vmglobal_import_definition(&self) -> u8\n\nThe offset of the `definition` field.\n\n#### pub const fn vmglobal_import_handle(&self) -> u8\n\nThe offset of the `handle` field.\n\n#### pub const fn size_of_vmglobal_import(&self) -> u8\n\nReturn the size of `VMGlobalImport`.\n\n### impl VMOffsets\n\nOffsets for a non-null pointer to a `VMGlobalDefinition` used as a local global.\n\n#### pub const fn size_of_vmglobal_local(&self) -> u8\n\nReturn the size of a pointer to a `VMGlobalDefinition`;\n\nThe underlying global itself is the size of the largest value type (i.e. a V128),\nhowever the size of this type is just the size of a pointer.\n\n### impl VMOffsets\n\nOffsets for `VMSharedSignatureIndex`.\n\n#### pub const fn size_of_vmshared_signature_index(&self) -> u8\n\nReturn the size of `VMSharedSignatureIndex`.\n\n### impl VMOffsets\n\nOffsets for `VMCallerCheckedAnyfunc`.\n\n#### pub const fn vmcaller_checked_anyfunc_func_ptr(&self) -> u8\n\nThe offset of the `func_ptr` field.\n\n#### pub const fn vmcaller_checked_anyfunc_type_index(&self) -> u8\n\nThe offset of the `type_index` field.\n\n#### pub const fn vmcaller_checked_anyfunc_vmctx(&self) -> u8\n\nThe offset of the `vmctx` field.\n\n#### pub const fn vmcaller_checked_anyfunc_call_trampoline(&self) -> u8\n\nThe offset of the `call_trampoline` field.\n\n#### pub const fn size_of_vmcaller_checked_anyfunc(&self) -> u8\n\nReturn the size of `VMCallerCheckedAnyfunc`.\n\n### impl VMOffsets\n\nOffsets for `VMFuncRef`.\n\n#### pub const fn vm_funcref_anyfunc_ptr(&self) -> u8\n\nThe offset to the pointer to the anyfunc inside the ref.\n\n#### pub const fn size_of_vm_funcref(&self) -> u8\n\nReturn the size of `VMFuncRef`.\n\n### impl VMOffsets\n\nOffsets for `VMContext`.\n\n#### pub fn vmctx_signature_ids_begin(&self) -> u32\n\nThe offset of the `signature_ids` array.\n\n#### pub fn vmctx_imported_functions_begin(&self) -> u32\n\nThe offset of the `tables` array.\n\n#### pub fn vmctx_imported_tables_begin(&self) -> u32\n\nThe offset of the `tables` array.\n\n#### pub fn vmctx_imported_memories_begin(&self) -> u32\n\nThe offset of the `memories` array.\n\n#### pub fn vmctx_imported_globals_begin(&self) -> u32\n\nThe offset of the `globals` array.\n\n#### pub fn vmctx_tables_begin(&self) -> u32\n\nThe offset of the `tables` array.\n\n#### pub fn vmctx_memories_begin(&self) -> u32\n\nThe offset of the `memories` array.\n\n#### pub fn vmctx_globals_begin(&self) -> u32\n\nThe offset of the `globals` array.\n\n#### pub fn vmctx_builtin_functions_begin(&self) -> u32\n\nThe offset of the builtin functions array.\n\n#### pub fn size_of_vmctx(&self) -> u32\n\nReturn the size of the `VMContext` allocation.\n\n#### pub fn vmctx_vmshared_signature_id(&self, index: SignatureIndex) -> u32\n\nReturn the offset to `VMSharedSignatureIndex` index `index`.\n\n#### pub fn vmctx_vmfunction_import(&self, index: FunctionIndex) -> u32\n\nReturn the offset to `VMFunctionImport` index `index`.\n\n#### pub fn vmctx_vmtable_import(&self, index: TableIndex) -> u32\n\nReturn the offset to `VMTableImport` index `index`.\n\n#### pub fn vmctx_vmmemory_import(&self, index: MemoryIndex) -> u32\n\nReturn the offset to `VMMemoryImport` index `index`.\n\n#### pub fn vmctx_vmglobal_import(&self, index: GlobalIndex) -> u32\n\nReturn the offset to `VMGlobalImport` index `index`.\n\n#### pub fn vmctx_vmtable_definition(&self, index: LocalTableIndex) -> u32\n\nReturn the offset to `VMTableDefinition` index `index`.\n\n#### pub fn vmctx_vmmemory_definition(&self, index: LocalMemoryIndex) -> u32\n\nReturn the offset to `VMMemoryDefinition` index `index`.\n\n#### pub fn vmctx_vmglobal_definition(&self, index: LocalGlobalIndex) -> u32\n\nReturn the offset to the `VMGlobalDefinition` index `index`.\n\n#### pub fn vmctx_vmfunction_import_body(&self, index: FunctionIndex) -> u32\n\nReturn the offset to the `body` field in `*const VMFunctionBody` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmfunction_import_vmctx(&self, index: FunctionIndex) -> u32\n\nReturn the offset to the `vmctx` field in `*const VMFunctionBody` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmtable_import_definition(&self, index: TableIndex) -> u32\n\nReturn the offset to the `definition` field in `VMTableImport` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmtable_definition_base(&self, index: LocalTableIndex) -> u32\n\nReturn the offset to the `base` field in `VMTableDefinition` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmtable_definition_current_elements(\n &self,\n index: LocalTableIndex\n) -> u32\n\nReturn the offset to the `current_elements` field in `VMTableDefinition` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmmemory_import_definition(&self, index: MemoryIndex) -> u32\n\nReturn the offset to the `from` field in `VMMemoryImport` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmmemory_import_handle(&self, index: MemoryIndex) -> u32\n\nReturn the offset to the `vmctx` field in `VMMemoryImport` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmmemory_definition_base(&self, index: LocalMemoryIndex) -> u32\n\nReturn the offset to the `base` field in `VMMemoryDefinition` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmmemory_definition_current_length(\n &self,\n index: LocalMemoryIndex\n) -> u32\n\nReturn the offset to the `current_length` field in `VMMemoryDefinition` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_vmglobal_import_definition(&self, index: GlobalIndex) -> u32\n\nReturn the offset to the `from` field in `VMGlobalImport` index `index`.\nRemember updating precompute upon changes\n\n#### pub fn vmctx_builtin_function(&self, index: VMBuiltinFunctionIndex) -> u32\n\nReturn the offset to builtin function in `VMBuiltinFunctionsArray` index `index`.\nRemember updating precompute upon changes\n\nTrait Implementations\n---\n\n### impl Clone for VMOffsets\n\n#### fn clone(&self) -> VMOffsets\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for VMOffsets\n\n### impl Send for VMOffsets\n\n### impl Sync for VMOffsets\n\n### impl Unpin for VMOffsets\n\n### impl UnwindSafe for VMOffsets\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Aarch64Architecture\n===\n\n\n```\npub enum Aarch64Architecture {\n    Aarch64,\n    Aarch64be,\n}\n```\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Aarch64\n\n### Aarch64be\n\nImplementations\n---\n\n### impl Aarch64Architecture\n\n#### pub fn is_thumb(self) -> bool\n\nTest if this architecture uses the Thumb instruction set.\n\n#### pub fn pointer_width(self) -> PointerWidth\n\nReturn the pointer bit width of this target’s architecture.\n\n#### pub fn endianness(self) -> Endianness\n\nReturn the endianness of this architecture.\n\n#### pub fn into_str(self) -> Cow<'static, strConvert into a string\n\nTrait Implementations\n---\n\n### impl Clone for Aarch64Architecture\n\n#### fn clone(&self) -> Aarch64Architecture\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Aarch64Architecture) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for Aarch64Architecture\n\n### impl Eq for Aarch64Architecture\n\n### impl StructuralEq for Aarch64Architecture\n\n### impl StructuralPartialEq for Aarch64Architecture\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Aarch64Architecture\n\n### impl Send for Aarch64Architecture\n\n### impl Sync for Aarch64Architecture\n\n### impl Unpin for Aarch64Architecture\n\n### impl UnwindSafe for Aarch64Architecture\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Architecture\n===\n\n\n```\npub enum Architecture {\n Unknown,\n Arm(ArmArchitecture),\n AmdGcn,\n Aarch64(Aarch64Architecture),\n Asmjs,\n Avr,\n Bpfeb,\n Bpfel,\n Hexagon,\n X86_32(X86_32Architecture),\n M68k,\n LoongArch64,\n Mips32(Mips32Architecture),\n Mips64(Mips64Architecture),\n Msp430,\n Nvptx64,\n Powerpc,\n Powerpc64,\n Powerpc64le,\n Riscv32(Riscv32Architecture),\n Riscv64(Riscv64Architecture),\n S390x,\n Sparc,\n Sparc64,\n Sparcv9,\n Wasm32,\n Wasm64,\n X86_64,\n X86_64h,\n XTensa,\n Clever(CleverArchitecture),\n}\n```\nThe “architecture” field, which in some cases also specifies a specific subarchitecture.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Unknown\n\n### Arm(ArmArchitecture)\n\n### AmdGcn\n\n### Aarch64(Aarch64Architecture)\n\n### Asmjs\n\n### Avr\n\n### Bpfeb\n\n### Bpfel\n\n### Hexagon\n\n### X86_32(X86_32Architecture)\n\n### M68k\n\n### LoongArch64\n\n### Mips32(Mips32Architecture)\n\n### Mips64(Mips64Architecture)\n\n### Msp430\n\n### Nvptx64\n\n### Powerpc\n\n### Powerpc64\n\n### Powerpc64le\n\n### Riscv32(Riscv32Architecture)\n\n### Riscv64(Riscv64Architecture)\n\n### S390x\n\n### Sparc\n\n### Sparc64\n\n### Sparcv9\n\n### Wasm32\n\n### Wasm64\n\n### X86_64\n\n### X86_64h\n\nx86_64 target that only supports Haswell-compatible Intel chips.\n\n### XTensa\n\n### Clever(CleverArchitecture)\n\nImplementations\n---\n\n### impl Architecture\n\n#### pub const fn host() -> Architecture\n\nReturn the architecture for the current host.\n\n### impl Architecture\n\n#### pub fn endianness(self) -> Result Result bool\n\nChecks if this Architecture is some variant of Clever-ISA\n\n#### pub fn into_str(self) -> Cow<'static, strConvert into a string\n\nTrait Implementations\n---\n\n### impl Clone for Architecture\n\n#### fn clone(&self) -> Architecture\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Architecture) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for Architecture\n\n### impl Eq for Architecture\n\n### impl StructuralEq for Architecture\n\n### impl StructuralPartialEq for Architecture\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Architecture\n\n### impl Send for Architecture\n\n### impl Sync for Architecture\n\n### impl Unpin for Architecture\n\n### impl UnwindSafe for Architecture\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::BinaryFormat\n===\n\n\n```\npub enum BinaryFormat {\n    Unknown,\n    Elf,\n    Coff,\n    Macho,\n    Wasm,\n    Xcoff,\n}\n```\nThe “binary format” field, which is usually omitted, and the binary format is implied by the other fields.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Unknown\n\n### Elf\n\n### Coff\n\n### Macho\n\n### Wasm\n\n### Xcoff\n\nImplementations\n---\n\n### impl BinaryFormat\n\n#### pub const fn host() -> BinaryFormat\n\nReturn the binary format for the current host.\n\n### impl BinaryFormat\n\n#### pub fn into_str(self) -> Cow<'static, strConvert into a string\n\nTrait Implementations\n---\n\n### impl Clone for BinaryFormat\n\n#### fn clone(&self) -> BinaryFormat\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &BinaryFormat) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for BinaryFormat\n\n### impl Eq for BinaryFormat\n\n### impl StructuralEq for BinaryFormat\n\n### impl StructuralPartialEq for BinaryFormat\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for BinaryFormat\n\n### impl Send for BinaryFormat\n\n### impl Sync for BinaryFormat\n\n### impl Unpin for BinaryFormat\n\n### impl UnwindSafe for BinaryFormat\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::CallingConvention\n===\n\n\n```\npub enum CallingConvention {\n    SystemV,\n    WasmBasicCAbi,\n    WindowsFastcall,\n    AppleAarch64,\n}\n```\nThe calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### SystemV\n\n“System V”, which is used on most Unix-like platfoms. Note that the specific conventions vary between hardware architectures; for example,\nx86-32’s “System V” is entirely different from x86-64’s “System V”.\n\n### WasmBasicCAbi\n\nThe WebAssembly C ABI.\nhttps://github.com/WebAssembly/tool-conventions/blob/master/BasicCABI.md\n\n### WindowsFastcall\n\n“Windows Fastcall”, which is used on Windows. Note that like “System V”,\nthis varies between hardware architectures. On x86-32 it describes what Windows documentation calls “fastcall”, and on x86-64 it describes what Windows documentation often just calls the Windows x64 calling convention\n(though the compiler still recognizes “fastcall” as an alias for it).\n\n### AppleAarch64\n\nApple Aarch64 platforms use their own variant of the common Aarch64 calling convention.\n\nhttps://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms\n\nTrait Implementations\n---\n\n### impl Clone for CallingConvention\n\n#### fn clone(&self) -> CallingConvention\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &CallingConvention) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for CallingConvention\n\n### impl Eq for CallingConvention\n\n### impl StructuralEq for CallingConvention\n\n### impl StructuralPartialEq for CallingConvention\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for CallingConvention\n\n### impl Send for CallingConvention\n\n### impl Sync for CallingConvention\n\n### impl Unpin for CallingConvention\n\n### impl UnwindSafe for CallingConvention\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Endianness\n===\n\n\n```\npub enum Endianness {\n    Little,\n    Big,\n}\n```\nThe target memory endianness.\n\nVariants\n---\n\n### Little\n\n### Big\n\nTrait Implementations\n---\n\n### impl Clone for Endianness\n\n#### fn clone(&self) -> Endianness\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Endianness) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for Endianness\n\n### impl Eq for Endianness\n\n### impl StructuralEq for Endianness\n\n### impl StructuralPartialEq for Endianness\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Endianness\n\n### impl Send for Endianness\n\n### impl Sync for Endianness\n\n### impl Unpin for Endianness\n\n### impl UnwindSafe for Endianness\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Environment\n===\n\n\n```\npub enum Environment {\n Unknown,\n AmdGiz,\n Android,\n Androideabi,\n Eabi,\n Eabihf,\n Gnu,\n Gnuabi64,\n Gnueabi,\n Gnueabihf,\n Gnuspe,\n Gnux32,\n GnuIlp32,\n GnuLlvm,\n HermitKernel,\n LinuxKernel,\n Macabi,\n Musl,\n Musleabi,\n Musleabihf,\n Muslabi64,\n Msvc,\n Newlib,\n Kernel,\n Uclibc,\n Uclibceabi,\n Uclibceabihf,\n Sgx,\n Sim,\n Softfloat,\n Spe,\n}\n```\nThe “environment” field, which specifies an ABI environment on top of the operating system. In many configurations, this field is omitted, and the environment is implied by the operating system.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Unknown\n\n### AmdGiz\n\n### Android\n\n### Androideabi\n\n### Eabi\n\n### Eabihf\n\n### Gnu\n\n### Gnuabi64\n\n### Gnueabi\n\n### Gnueabihf\n\n### Gnuspe\n\n### Gnux32\n\n### GnuIlp32\n\n### GnuLlvm\n\n### HermitKernel\n\n### LinuxKernel\n\n### Macabi\n\n### Musl\n\n### Musleabi\n\n### Musleabihf\n\n### Muslabi64\n\n### Msvc\n\n### Newlib\n\n### Kernel\n\n### Uclibc\n\n### Uclibceabi\n\n### Uclibceabihf\n\n### Sgx\n\n### Sim\n\n### Softfloat\n\n### Spe\n\nImplementations\n---\n\n### impl Environment\n\n#### pub const fn host() -> Environment\n\nReturn the environment for the current host.\n\n### impl Environment\n\n#### pub fn into_str(self) -> Cow<'static, strConvert into a string\n\nTrait Implementations\n---\n\n### impl Clone for Environment\n\n#### fn clone(&self) -> Environment\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Environment) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for Environment\n\n### impl Eq for Environment\n\n### impl StructuralEq for Environment\n\n### impl StructuralPartialEq for Environment\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Environment\n\n### impl Send for Environment\n\n### impl Sync for Environment\n\n### impl Unpin for Environment\n\n### impl UnwindSafe for Environment\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::ExportIndex\n===\n\n\n```\n#[repr(u8)]pub enum ExportIndex {\n    Function(FunctionIndex),\n    Table(TableIndex),\n    Memory(MemoryIndex),\n    Global(GlobalIndex),\n}\n```\nAn entity to export.\n\nVariants\n---\n\n### Function(FunctionIndex)\n\nFunction export.\n\n### Table(TableIndex)\n\nTable export.\n\n### Memory(MemoryIndex)\n\nMemory export.\n\n### Global(GlobalIndex)\n\nGlobal export.\n\nTrait Implementations\n---\n\n### impl Archive for ExportIndexwhere\n FunctionIndex: Archive,\n TableIndex: Archive,\n MemoryIndex: Archive,\n GlobalIndex: Archive,\n\n#### type Archived = ExportIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n FunctionIndex: CheckBytes<__C>,\n TableIndex: CheckBytes<__C>,\n MemoryIndex: CheckBytes<__C>,\n GlobalIndex: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> ExportIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n FunctionIndex: Archive,\n Archived: Deserialize,\n TableIndex: Archive,\n Archived: Deserialize,\n MemoryIndex: Archive,\n Archived: Deserialize,\n GlobalIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &ExportIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &ExportIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for ExportIndex\n\n#### fn partial_cmp(&self, other: &ExportIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n FunctionIndex: Serialize<__S>,\n TableIndex: Serialize<__S>,\n MemoryIndex: Serialize<__S>,\n GlobalIndex: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for ExportIndex\n\n### impl Eq for ExportIndex\n\n### impl StructuralEq for ExportIndex\n\n### impl StructuralPartialEq for ExportIndex\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ExportIndex\n\n### impl Send for ExportIndex\n\n### impl Sync for ExportIndex\n\n### impl Unpin for ExportIndex\n\n### impl UnwindSafe for ExportIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::ExternType\n===\n\n\n```\npub enum ExternType {\n    Function(FunctionType),\n    Global(GlobalType),\n    Table(TableType),\n    Memory(MemoryType),\n}\n```\nA list of all possible types which can be externally referenced from a WebAssembly module.\n\nThis list can be found in `ImportType` or `ExportType`, so these types can either be imported or exported.\n\nVariants\n---\n\n### Function(FunctionType)\n\nThis external type is the type of a WebAssembly function.\n\n### Global(GlobalType)\n\nThis external type is the type of a WebAssembly global.\n\n### Table(TableType)\n\nThis external type is the type of a WebAssembly table.\n\n### Memory(MemoryType)\n\nThis external type is the type of a WebAssembly memory.\n\nImplementations\n---\n\n### impl ExternType\n\n#### pub fn func(&self) -> Option<&FunctionTypeAttempt to return the underlying type of this external type,\nreturning `None` if it is a different type.\n\n#### pub fn unwrap_func(&self) -> &FunctionType\n\nReturns the underlying descriptor of this `ExternType`, panicking if it is a different type.\n\n##### Panics\n\nPanics if `self` is not of the right type.\n\n#### pub fn global(&self) -> Option<&GlobalTypeAttempt to return the underlying type of this external type,\nreturning `None` if it is a different type.\n\n#### pub fn unwrap_global(&self) -> &GlobalType\n\nReturns the underlying descriptor of this `ExternType`, panicking if it is a different type.\n\n##### Panics\n\nPanics if `self` is not of the right type.\n\n#### pub fn table(&self) -> Option<&TableTypeAttempt to return the underlying type of this external type,\nreturning `None` if it is a different type.\n\n#### pub fn unwrap_table(&self) -> &TableType\n\nReturns the underlying descriptor of this `ExternType`, panicking if it is a different type.\n\n##### Panics\n\nPanics if `self` is not of the right type.\n\n#### pub fn memory(&self) -> Option<&MemoryTypeAttempt to return the underlying type of this external type,\nreturning `None` if it is a different type.\n\n#### pub fn unwrap_memory(&self) -> &MemoryType\n\nReturns the underlying descriptor of this `ExternType`, panicking if it is a different type.\n\n##### Panics\n\nPanics if `self` is not of the right type.\n\n#### pub fn is_compatible_with(\n &self,\n other: &Self,\n runtime_size: Option\n) -> bool\n\nCheck if two externs are compatible\n\nTrait Implementations\n---\n\n### impl Clone for ExternType\n\n#### fn clone(&self) -> ExternType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &ExternType) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for ExternType\n\n### impl StructuralEq for ExternType\n\n### impl StructuralPartialEq for ExternType\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ExternType\n\n### impl Send for ExternType\n\n### impl Sync for ExternType\n\n### impl Unpin for ExternType\n\n### impl UnwindSafe for ExternType\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::GlobalInit\n===\n\n\n```\n#[repr(u8)]pub enum GlobalInit {\n    I32Const(i32),\n    I64Const(i64),\n    F32Const(f32),\n    F64Const(f64),\n    V128Const(V128),\n    GetGlobal(GlobalIndex),\n    RefNullConst,\n    RefFunc(FunctionIndex),\n}\n```\nGlobals are initialized via the `const` operators or by referring to another import.\n\nVariants\n---\n\n### I32Const(i32)\n\nAn `i32.const`.\n\n### I64Const(i64)\n\nAn `i64.const`.\n\n### F32Const(f32)\n\nAn `f32.const`.\n\n### F64Const(f64)\n\nAn `f64.const`.\n\n### V128Const(V128)\n\nA `v128.const`.\n\n### GetGlobal(GlobalIndex)\n\nA `global.get` of another global.\n\n### RefNullConst\n\nA `ref.null`.\n\n### RefFunc(FunctionIndex)\n\nA `ref.func `.\n\nTrait Implementations\n---\n\n### impl Archive for GlobalInitwhere\n i32: Archive,\n i64: Archive,\n f32: Archive,\n f64: Archive,\n V128: Archive,\n GlobalIndex: Archive,\n FunctionIndex: Archive,\n\n#### type Archived = GlobalInit\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n i32: CheckBytes<__C>,\n i64: CheckBytes<__C>,\n f32: CheckBytes<__C>,\n f64: CheckBytes<__C>,\n V128: CheckBytes<__C>,\n GlobalIndex: CheckBytes<__C>,\n FunctionIndex: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> GlobalInit\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n i32: Archive,\n Archived: Deserialize,\n i64: Archive,\n Archived: Deserialize,\n f32: Archive,\n Archived: Deserialize,\n f64: Archive,\n Archived: Deserialize,\n V128: Archive,\n Archived: Deserialize,\n GlobalIndex: Archive,\n Archived: Deserialize,\n FunctionIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result for GlobalInit\n\n#### fn eq(&self, other: &GlobalInit) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for GlobalInitwhere\n i32: Serialize<__S>,\n i64: Serialize<__S>,\n f32: Serialize<__S>,\n f64: Serialize<__S>,\n V128: Serialize<__S>,\n GlobalIndex: Serialize<__S>,\n FunctionIndex: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for GlobalInit\n\n### impl StructuralPartialEq for GlobalInit\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for GlobalInit\n\n### impl Send for GlobalInit\n\n### impl Sync for GlobalInit\n\n### impl Unpin for GlobalInit\n\n### impl UnwindSafe for GlobalInit\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::ImportIndex\n===\n\n\n```\n#[repr(u8)]pub enum ImportIndex {\n    Function(FunctionIndex),\n    Table(TableIndex),\n    Memory(MemoryIndex),\n    Global(GlobalIndex),\n}\n```\nAn entity to import.\n\nVariants\n---\n\n### Function(FunctionIndex)\n\nFunction import.\n\n### Table(TableIndex)\n\nTable import.\n\n### Memory(MemoryIndex)\n\nMemory import.\n\n### Global(GlobalIndex)\n\nGlobal import.\n\nTrait Implementations\n---\n\n### impl Archive for ImportIndexwhere\n FunctionIndex: Archive,\n TableIndex: Archive,\n MemoryIndex: Archive,\n GlobalIndex: Archive,\n\n#### type Archived = ImportIndex\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n FunctionIndex: CheckBytes<__C>,\n TableIndex: CheckBytes<__C>,\n MemoryIndex: CheckBytes<__C>,\n GlobalIndex: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> ImportIndex\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n FunctionIndex: Archive,\n Archived: Deserialize,\n TableIndex: Archive,\n Archived: Deserialize,\n MemoryIndex: Archive,\n Archived: Deserialize,\n GlobalIndex: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn cmp(&self, other: &ImportIndex) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &ImportIndex) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialOrd for ImportIndex\n\n#### fn partial_cmp(&self, other: &ImportIndex) -> Option bool\n\nThis method tests less than (for `self` and `other`) and is used by the `<` operator. Read more1.0.0 · source#### fn le(&self, other: &Rhs) -> bool\n\nThis method tests less than or equal to (for `self` and `other`) and is used by the `<=`\noperator. Read more1.0.0 · source#### fn gt(&self, other: &Rhs) -> bool\n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.0.0 · source#### fn ge(&self, other: &Rhs) -> bool\n\nThis method tests greater than or equal to (for `self` and `other`) and is used by the `>=`\noperator. \n FunctionIndex: Serialize<__S>,\n TableIndex: Serialize<__S>,\n MemoryIndex: Serialize<__S>,\n GlobalIndex: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Eq for ImportIndex\n\n### impl StructuralEq for ImportIndex\n\n### impl StructuralPartialEq for ImportIndex\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for ImportIndex\n\n### impl Send for ImportIndex\n\n### impl Sync for ImportIndex\n\n### impl Unpin for ImportIndex\n\n### impl UnwindSafe for ImportIndex\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::LibCall\n===\n\n\n```\n#[repr(u16)]pub enum LibCall {\n CeilF32,\n CeilF64,\n FloorF32,\n FloorF64,\n NearestF32,\n NearestF64,\n TruncF32,\n TruncF64,\n Memory32Size,\n ImportedMemory32Size,\n TableCopy,\n TableInit,\n TableFill,\n TableSize,\n ImportedTableSize,\n TableGet,\n ImportedTableGet,\n TableSet,\n ImportedTableSet,\n TableGrow,\n ImportedTableGrow,\n FuncRef,\n ElemDrop,\n Memory32Copy,\n ImportedMemory32Copy,\n Memory32Fill,\n ImportedMemory32Fill,\n Memory32Init,\n DataDrop,\n RaiseTrap,\n Probestack,\n Memory32AtomicWait32,\n ImportedMemory32AtomicWait32,\n Memory32AtomicWait64,\n ImportedMemory32AtomicWait64,\n Memory32AtomicNotify,\n ImportedMemory32AtomicNotify,\n}\n```\nThe name of a runtime library routine.\n\nThis list is likely to grow over time.\n\nVariants\n---\n\n### CeilF32\n\nceil.f32\n\n### CeilF64\n\nceil.f64\n\n### FloorF32\n\nfloor.f32\n\n### FloorF64\n\nfloor.f64\n\n### NearestF32\n\nnearest.f32\n\n### NearestF64\n\nnearest.f64\n\n### TruncF32\n\ntrunc.f32\n\n### TruncF64\n\ntrunc.f64\n\n### Memory32Size\n\nmemory.size for local functions\n\n### ImportedMemory32Size\n\nmemory.size for imported functions\n\n### TableCopy\n\ntable.copy\n\n### TableInit\n\ntable.init\n\n### TableFill\n\ntable.fill\n\n### TableSize\n\ntable.size for local tables\n\n### ImportedTableSize\n\ntable.size for imported tables\n\n### TableGet\n\ntable.get for local tables\n\n### ImportedTableGet\n\ntable.get for imported tables\n\n### TableSet\n\ntable.set for local tables\n\n### ImportedTableSet\n\ntable.set for imported tables\n\n### TableGrow\n\ntable.grow for local tables\n\n### ImportedTableGrow\n\ntable.grow for imported tables\n\n### FuncRef\n\nref.func\n\n### ElemDrop\n\nelem.drop\n\n### Memory32Copy\n\nmemory.copy for local memories\n\n### ImportedMemory32Copy\n\nmemory.copy for imported memories\n\n### Memory32Fill\n\nmemory.fill for local memories\n\n### ImportedMemory32Fill\n\nmemory.fill for imported memories\n\n### Memory32Init\n\nmemory.init\n\n### DataDrop\n\ndata.drop\n\n### RaiseTrap\n\nA custom trap\n\n### Probestack\n\nprobe for stack overflow. These are emitted for functions which need when the `enable_probestack` setting is true.\n\n### Memory32AtomicWait32\n\nmemory.atomic.wait32 for local memories\n\n### ImportedMemory32AtomicWait32\n\nmemory.atomic.wait32 for imported memories\n\n### Memory32AtomicWait64\n\nmemory.atomic.wait64 for local memories\n\n### ImportedMemory32AtomicWait64\n\nmemory.atomic.wait64 for imported memories\n\n### Memory32AtomicNotify\n\nmemory.atomic.notify for local memories\n\n### ImportedMemory32AtomicNotify\n\nmemory.atomic.botify for imported memories\n\nImplementations\n---\n\n### impl LibCall\n\n#### pub fn to_function_name(&self) -> &str\n\nReturn the function name associated to the libcall.\n\nTrait Implementations\n---\n\n### impl Archive for LibCall\n\n#### type Archived = LibCall\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> LibCall\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### type Iterator = LibCallEnumIterator\n\nType of the iterator over the variants.#### const VARIANT_COUNT: usize = 37usize\n\nNumber of variants.#### fn into_enum_iter() -> Self::Iterator\n\nReturns an iterator over the variants. \n\n#### fn eq(&self, other: &LibCall) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for LibCall\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for LibCall\n\n### impl Eq for LibCall\n\n### impl StructuralEq for LibCall\n\n### impl StructuralPartialEq for LibCall\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for LibCall\n\n### impl Send for LibCall\n\n### impl Sync for LibCall\n\n### impl Unpin for LibCall\n\n### impl UnwindSafe for LibCall\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::MemoryStyle\n===\n\n\n```\n#[repr(u8)]pub enum MemoryStyle {\n    Dynamic {\n        offset_guard_size: u64,\n    },\n    Static {\n        bound: Pages,\n        offset_guard_size: u64,\n    },\n}\n```\nImplementation styles for WebAssembly linear memory.\n\nVariants\n---\n\n### Dynamic\n\n#### Fields\n\n`offset_guard_size: u64`Our chosen offset-guard size.\n\nIt represents the size in bytes of extra guard pages after the end to optimize loads and stores with constant offsets.\n\nThe actual memory can be resized and moved.\n\n### Static\n\n#### Fields\n\n`bound: Pages`The number of mapped and unmapped pages.\n\n`offset_guard_size: u64`Our chosen offset-guard size.\n\nIt represents the size in bytes of extra guard pages after the end to optimize loads and stores with constant offsets.\n\nAddress space is allocated up front.\n\nImplementations\n---\n\n### impl MemoryStyle\n\n#### pub fn offset_guard_size(&self) -> u64\n\nReturns the offset-guard size\n\nTrait Implementations\n---\n\n### impl Archive for MemoryStylewhere\n u64: Archive,\n Pages: Archive,\n\n#### type Archived = MemoryStyle\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n u64: CheckBytes<__C>,\n Pages: CheckBytes<__C>,\n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> MemoryStyle\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n u64: Archive,\n Archived: Deserialize,\n Pages: Archive,\n Archived: Deserialize,\n\n#### fn deserialize(&self, deserializer: &mut __D) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &MemoryStyle) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for MemoryStylewhere\n u64: Serialize<__S>,\n Pages: Serialize<__S>,\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for MemoryStyle\n\n### impl Eq for MemoryStyle\n\n### impl StructuralEq for MemoryStyle\n\n### impl StructuralPartialEq for MemoryStyle\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for MemoryStyle\n\n### impl Send for MemoryStyle\n\n### impl Sync for MemoryStyle\n\n### impl Unpin for MemoryStyle\n\n### impl UnwindSafe for MemoryStyle\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Mutability\n===\n\n\n```\n#[repr(u8)]pub enum Mutability {\n    Const,\n    Var,\n}\n```\nIndicator of whether a global is mutable or not\n\nVariants\n---\n\n### Const\n\nThe global is constant and its value does not change\n\n### Var\n\nThe value of the global can change over time\n\nImplementations\n---\n\n### impl Mutability\n\n#### pub fn is_mutable(self) -> bool\n\nReturns a boolean indicating if the enum is set to mutable.\n\nTrait Implementations\n---\n\n### impl Archive for Mutability\n\n#### type Archived = Mutability\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> Mutability\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(value: Mutability) -> Self\n\nConverts to this type from the input type.### impl From for Mutability\n\n#### fn from(value: bool) -> Self\n\nConverts to this type from the input type.### impl Hash for Mutability\n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Mutability) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for Mutability\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for Mutability\n\n### impl Eq for Mutability\n\n### impl StructuralEq for Mutability\n\n### impl StructuralPartialEq for Mutability\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Mutability\n\n### impl Send for Mutability\n\n### impl Sync for Mutability\n\n### impl Unpin for Mutability\n\n### impl UnwindSafe for Mutability\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::OnCalledAction\n===\n\n\n```\npub enum OnCalledAction {\n    InvokeAgain,\n    Finish,\n    Trap(Box),\n}\n```\nAfter the stack is unwound via asyncify what should the call loop do next\n\nVariants\n---\n\n### InvokeAgain\n\nWill call the function again\n\n### Finish\n\nWill return the result of the invocation\n\n### Trap(Box)\n\nTraps with an error\n\nTrait Implementations\n---\n\n### impl Debug for OnCalledAction\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl !RefUnwindSafe for OnCalledAction\n\n### impl Send for OnCalledAction\n\n### impl Sync for OnCalledAction\n\n### impl Unpin for OnCalledAction\n\n### impl !UnwindSafe for OnCalledAction\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::OperatingSystem\n===\n\n\n```\npub enum OperatingSystem {\n Unknown,\n Aix,\n AmdHsa,\n Bitrig,\n Cloudabi,\n Cuda,\n Darwin,\n Dragonfly,\n Emscripten,\n Espidf,\n Freebsd,\n Fuchsia,\n Haiku,\n Hermit,\n Horizon,\n Illumos,\n Ios,\n L4re,\n Linux,\n MacOSX {\n major: u16,\n minor: u16,\n patch: u16,\n },\n Nebulet,\n Netbsd,\n None_,\n Openbsd,\n Psp,\n Redox,\n Solaris,\n SolidAsp3,\n Tvos,\n Uefi,\n VxWorks,\n Wasi,\n Watchos,\n Windows,\n}\n```\nThe “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Unknown\n\n### Aix\n\n### AmdHsa\n\n### Bitrig\n\n### Cloudabi\n\n### Cuda\n\n### Darwin\n\n### Dragonfly\n\n### Emscripten\n\n### Espidf\n\n### Freebsd\n\n### Fuchsia\n\n### Haiku\n\n### Hermit\n\n### Horizon\n\n### Illumos\n\n### Ios\n\n### L4re\n\n### Linux\n\n### MacOSX\n\n#### Fields\n\n`major: u16``minor: u16``patch: u16`### Nebulet\n\n### Netbsd\n\n### None_\n\n### Openbsd\n\n### Psp\n\n### Redox\n\n### Solaris\n\n### SolidAsp3\n\n### Tvos\n\n### Uefi\n\n### VxWorks\n\n### Wasi\n\n### Watchos\n\n### Windows\n\nImplementations\n---\n\n### impl OperatingSystem\n\n#### pub const fn host() -> OperatingSystem\n\nReturn the operating system for the current host.\n\n### impl OperatingSystem\n\n#### pub fn into_str(self) -> Cow<'static, strConvert into a string\n\nTrait Implementations\n---\n\n### impl Clone for OperatingSystem\n\n#### fn clone(&self) -> OperatingSystem\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &OperatingSystem) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for OperatingSystem\n\n### impl Eq for OperatingSystem\n\n### impl StructuralEq for OperatingSystem\n\n### impl StructuralPartialEq for OperatingSystem\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for OperatingSystem\n\n### impl Send for OperatingSystem\n\n### impl Sync for OperatingSystem\n\n### impl Unpin for OperatingSystem\n\n### impl UnwindSafe for OperatingSystem\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::PointerWidth\n===\n\n\n```\npub enum PointerWidth {\n    U16,\n    U32,\n    U64,\n}\n```\nThe width of a pointer (in the default address space).\n\nVariants\n---\n\n### U16\n\n### U32\n\n### U64\n\nImplementations\n---\n\n### impl PointerWidth\n\n#### pub fn bits(self) -> u8\n\nReturn the number of bits in a pointer.\n\n#### pub fn bytes(self) -> u8\n\nReturn the number of bytes in a pointer.\n\nFor these purposes, there are 8 bits in a byte.\n\nTrait Implementations\n---\n\n### impl Clone for PointerWidth\n\n#### fn clone(&self) -> PointerWidth\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &PointerWidth) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for PointerWidth\n\n### impl Eq for PointerWidth\n\n### impl StructuralEq for PointerWidth\n\n### impl StructuralPartialEq for PointerWidth\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for PointerWidth\n\n### impl Send for PointerWidth\n\n### impl Sync for PointerWidth\n\n### impl Unpin for PointerWidth\n\n### impl UnwindSafe for PointerWidth\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::TableStyle\n===\n\n\n```\n#[repr(u8)]pub enum TableStyle {\n    CallerChecksSignature,\n}\n```\nImplementation styles for WebAssembly tables.\n\nVariants\n---\n\n### CallerChecksSignature\n\nSignatures are stored in the table and checked in the caller.\n\nTrait Implementations\n---\n\n### impl Archive for TableStyle\n\n#### type Archived = TableStyle\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> TableStyle\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &TableStyle) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for TableStyle\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Eq for TableStyle\n\n### impl StructuralEq for TableStyle\n\n### impl StructuralPartialEq for TableStyle\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for TableStyle\n\n### impl Send for TableStyle\n\n### impl Sync for TableStyle\n\n### impl Unpin for TableStyle\n\n### impl UnwindSafe for TableStyle\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::TrapCode\n===\n\n\n```\n#[repr(u32)]pub enum TrapCode {\n    StackOverflow,\n    HeapAccessOutOfBounds,\n    HeapMisaligned,\n    TableAccessOutOfBounds,\n    IndirectCallToNull,\n    BadSignature,\n    IntegerOverflow,\n    IntegerDivisionByZero,\n    BadConversionToInteger,\n    UnreachableCodeReached,\n    UnalignedAtomic,\n}\n```\nA trap code describing the reason for a trap.\n\nAll trap instructions have an explicit trap code.\n\nVariants\n---\n\n### StackOverflow\n\nThe current stack space was exhausted.\n\nOn some platforms, a stack overflow may also be indicated by a segmentation fault from the stack guard page.\n\n### HeapAccessOutOfBounds\n\nA `heap_addr` instruction detected an out-of-bounds error.\n\nNote that not all out-of-bounds heap accesses are reported this way;\nsome are detected by a segmentation fault on the heap unmapped or offset-guard pages.\n\n### HeapMisaligned\n\nA `heap_addr` instruction was misaligned.\n\n### TableAccessOutOfBounds\n\nA `table_addr` instruction detected an out-of-bounds error.\n\n### IndirectCallToNull\n\nIndirect call to a null table entry.\n\n### BadSignature\n\nSignature mismatch on indirect call.\n\n### IntegerOverflow\n\nAn integer arithmetic operation caused an overflow.\n\n### IntegerDivisionByZero\n\nAn integer division by zero.\n\n### BadConversionToInteger\n\nFailed float-to-int conversion.\n\n### UnreachableCodeReached\n\nCode that was supposed to have been unreachable was reached.\n\n### UnalignedAtomic\n\nAn atomic memory access was attempted with an unaligned pointer.\n\nImplementations\n---\n\n### impl TrapCode\n\n#### pub fn message(&self) -> &str\n\nGets the message for this trap code\n\nTrait Implementations\n---\n\n### impl Archive for TrapCode\n\n#### type Archived = TrapCode\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> TrapCode\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, request: &mut Request<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &TrapCode) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for TrapCode\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for TrapCode\n\n### impl Eq for TrapCode\n\n### impl StructuralEq for TrapCode\n\n### impl StructuralPartialEq for TrapCode\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for TrapCode\n\n### impl Send for TrapCode\n\n### impl Sync for TrapCode\n\n### impl Unpin for TrapCode\n\n### impl UnwindSafe for TrapCode\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl Error for Twhere\n T: Error + 'static,\n\n#### fn as_error(&self) -> &(dyn Error + 'static)\n\nGets this error as an `std::error::Error`.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Type\n===\n\n\n```\n#[repr(u8)]pub enum Type {\n    I32,\n    I64,\n    F32,\n    F64,\n    V128,\n    ExternRef,\n    FuncRef,\n}\n```\nA list of all possible value types in WebAssembly.\n\nVariants\n---\n\n### I32\n\nSigned 32 bit integer.\n\n### I64\n\nSigned 64 bit integer.\n\n### F32\n\nFloating point 32 bit integer.\n\n### F64\n\nFloating point 64 bit integer.\n\n### V128\n\nA 128 bit number.\n\n### ExternRef\n\nA reference to opaque data in the Wasm instance.\n\n### FuncRef\n\nA reference to a Wasm function.\n\nImplementations\n---\n\n### impl Type\n\n#### pub fn is_num(self) -> bool\n\nReturns true if `Type` matches any of the numeric types. (e.g. `I32`,\n`I64`, `F32`, `F64`, `V128`).\n\n#### pub fn is_ref(self) -> bool\n\nReturns true if `Type` matches either of the reference types.\n\nTrait Implementations\n---\n\n### impl Archive for Type\n\n#### type Archived = Type\n\nThe archived representation of this type. \n\nThe resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.#### unsafe fn resolve(\n &self,\n pos: usize,\n resolver: ::Resolver,\n out: *mut::Archived\n)\n\nCreates the archived version of this value at the given position and writes it to the given output. \n\n#### type Error = EnumCheckError(\n value: *const Self,\n context: &mut __C\n) -> Result<&'__bytecheck Self, EnumCheckErrorChecks whether the given pointer points to a valid value within the given context. \n\n#### fn clone(&self) -> Type\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn hash<__H: Hasher>(&self, state: &mut __H)\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Type) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl<__S: Fallible + ?Sized> Serialize<__S> for Type\n\n#### fn serialize(\n &self,\n serializer: &mut __S\n) -> Result<::Resolver, __S::ErrorWrites the dependencies for the object and returns a resolver that can create the archived type.### impl Copy for Type\n\n### impl Eq for Type\n\n### impl StructuralEq for Type\n\n### impl StructuralPartialEq for Type\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Type\n\n### impl Send for Type\n\n### impl Sync for Type\n\n### impl Unpin for Type\n\n### impl UnwindSafe for Type\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl ArchiveUnsized for Twhere\n T: Archive,\n\n#### type Archived = ::Archived\n\nThe archived counterpart of this type. Unlike `Archive`, it may be unsized. \n\nThe resolver for the metadata of this type. \n &self,\n _: usize,\n _: ::MetadataResolver,\n _: *mut<::Archived as ArchivePointee>::ArchivedMetadata\n)\n\nCreates the archived version of the metadata for this value at the given position and writes it to the given output. \n &self,\n from: usize,\n to: usize,\n resolver: Self::MetadataResolver,\n out: *mutRelPtr::Archived>\n)\n\nResolves a relative pointer to this value with the given `from` and `to` and writes it to the given output. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl SerializeUnsized for Twhere\n T: Serialize,\n S: Serializer + ?Sized,\n\n#### fn serialize_unsized(\n &self,\n serializer: &mut S\n) -> Result::ErrorWrites the object and returns the position of the archived type.#### fn serialize_metadata(&self, _: &mut S) -> Result<(), ::ErrorSerializes the metadata for the given type.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nEnum wasmer_types::Vendor\n===\n\n\n```\npub enum Vendor {\n Unknown,\n Amd,\n Apple,\n Espressif,\n Experimental,\n Fortanix,\n Ibm,\n Kmc,\n Nintendo,\n Nvidia,\n Pc,\n Rumprun,\n Sun,\n Uwp,\n Wrs,\n Custom(CustomVendor),\n}\n```\nThe “vendor” field, which in practice is little more than an arbitrary modifier.\n\nVariants (Non-exhaustive)\n---\n\nNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### Unknown\n\n### Amd\n\n### Apple\n\n### Espressif\n\n### Experimental\n\n### Fortanix\n\n### Ibm\n\n### Kmc\n\n### Nintendo\n\n### Nvidia\n\n### Pc\n\n### Rumprun\n\n### Sun\n\n### Uwp\n\n### Wrs\n\n### Custom(CustomVendor)\n\nA custom vendor. “Custom” in this context means that the vendor is not specifically recognized by upstream Autotools, LLVM, Rust, or other relevant authorities on triple naming. It’s useful for people building and using locally patched toolchains.\n\nOutside of such patched environments, users of `target-lexicon` should treat `Custom` the same as `Unknown` and ignore the string.\n\nImplementations\n---\n\n### impl Vendor\n\n#### pub const fn host() -> Vendor\n\nReturn the vendor for the current host.\n\n### impl Vendor\n\n#### pub fn as_str(&self) -> &str\n\nExtracts a string slice.\n\nTrait Implementations\n---\n\n### impl Clone for Vendor\n\n#### fn clone(&self) -> Vendor\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Err = ()\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result(&self, state: &mut __H)where\n __H: Hasher,\n\nFeeds this value into the given `Hasher`. Read more1.3.0 · source#### fn hash_slice(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,\n\nFeeds a slice of this type into the given `Hasher`. \n\n#### fn eq(&self, other: &Vendor) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Eq for Vendor\n\n### impl StructuralEq for Vendor\n\n### impl StructuralPartialEq for Vendor\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Vendor\n\n### impl Send for Vendor\n\n### impl Sync for Vendor\n\n### impl Unpin for Vendor\n\n### impl UnwindSafe for Vendor\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n T: Hash + ?Sized,\n\n#### default fn get_hash(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,\n\n### impl Deserialize, D> for Fwhere\n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl Equivalent for Qwhere\n Q: Eq + ?Sized,\n K: Borrow + ?Sized,\n\n#### fn equivalent(&self, key: &K) -> bool\n\nCompare self to `key` and return `true` if they are equal.### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.\n\nConstant wasmer_types::VERSION\n===\n\n\n```\npub const VERSION: &str = env!(\"CARGO_PKG_VERSION\");\n```\nVersion number of this crate.\n\nConstant wasmer_types::WASM_MAX_PAGES\n===\n\n\n```\npub const WASM_MAX_PAGES: u32 = 0x10000;\n```\nThe number of pages we can have before we run out of byte index space.\n\nConstant wasmer_types::WASM_MIN_PAGES\n===\n\n\n```\npub const WASM_MIN_PAGES: u32 = 0x100;\n```\nThe minimum number of pages allowed.\n\nConstant wasmer_types::WASM_PAGE_SIZE\n===\n\n\n```\npub const WASM_PAGE_SIZE: usize = 0x10000;\n```\nWebAssembly page sizes are fixed to be 64KiB.\nNote: large page support may be added in an opt-in manner in the future.\n\nTrait wasmer_types::DataInitializerLike\n===\n\n\n```\npub trait DataInitializerLike<'a> {\n    type Location: DataInitializerLocationLike + Copy + 'a;\n\n    // Required methods\n    fn location(&self) -> Self::Location;\n    fn data(&self) -> &'a [u8] ;\n}\n```\nAny struct that acts like a `DataInitializer`.\n\nRequired Associated Types\n---\n\n#### type Location: DataInitializerLocationLike + Copy + 'a\n\nRequired Methods\n---\n\n#### fn location(&self) -> Self::Location\n\n#### fn data(&self) -> &'a [u8] \n\nImplementors\n---\n\n### impl<'a> DataInitializerLike<'a> for &'a ArchivedOwnedDataInitializer\n\n#### type Location = &'a ArchivedDataInitializerLocation\n\n### impl<'a> DataInitializerLike<'a> for &'a OwnedDataInitializer\n\n#### type Location = &'a DataInitializerLocation\n\n{\"&'a [u8]\":\"

Notable traits for &amp;[u8]

impl Read for &amp;[u8]\"}\n\nTrait wasmer_types::DataInitializerLocationLike\n===\n\n\n```\npub trait DataInitializerLocationLike {\n    // Required methods\n    fn memory_index(&self) -> MemoryIndex;\n    fn base(&self) -> Option;\n    fn offset(&self) -> usize;\n}\n```\nAny struct that acts like a `DataInitializerLocation`.\n\nRequired Methods\n---\n\n#### fn memory_index(&self) -> MemoryIndex\n\n#### fn base(&self) -> Option usize\n\nImplementors\n---\n\n### impl DataInitializerLocationLike for &ArchivedDataInitializerLocation\n\n### impl DataInitializerLocationLike for &DataInitializerLocation\n\nTrait wasmer_types::MemorySize\n===\n\n\n```\npub unsafe trait MemorySize: Copy {\n    type Offset: Default + Debug + Display + Eq + Ord + PartialEq + PartialOrd + Clone + Copy + Sync + Send + ValueType + Into + From + From + From + TryFrom + TryFrom + TryFrom + TryFrom + TryFrom + TryInto + TryInto + TryInto + TryInto + TryInto + TryInto + TryFrom + Add + Sum + AddAssign + 'static;\n    type Native: NativeWasmType;\n\n    const ZERO: Self::Offset;\n    const ONE: Self::Offset;\n\n    // Required methods\n    fn offset_to_native(offset: Self::Offset) -> Self::Native;\n    fn native_to_offset(native: Self::Native) -> Self::Offset;\n    fn is_64bit() -> bool;\n}\n```\nTrait for the `Memory32` and `Memory64` marker types.\n\nThis allows code to be generic over 32-bit and 64-bit memories.\n\nSafety\n---\n\nDirect memory access is unsafe\n\nRequired Associated Types\n---\n\n#### type Offset: Default + Debug + Display + Eq + Ord + PartialEq + PartialOrd + Clone + Copy + Sync + Send + ValueType + Into + From + From + From + TryFrom + TryFrom + TryFrom + TryFrom + TryFrom + TryInto + TryInto + TryInto + TryInto + TryInto + TryInto + TryFrom + Add + Sum + AddAssign + 'static\n\nType used to represent an offset into a memory. This is `u32` or `u64`.\n\n#### type Native: NativeWasmType\n\nType used to pass this value as an argument or return value for a Wasm function.\n\nRequired Associated Constants\n---\n\n#### const ZERO: Self::Offset\n\nZero value used for `WasmPtr::is_null`.\n\n#### const ONE: Self::Offset\n\nOne value used for counting.\n\nRequired Methods\n---\n\n#### fn offset_to_native(offset: Self::Offset) -> Self::Native\n\nConvert an `Offset` to a `Native`.\n\n#### fn native_to_offset(native: Self::Native) -> Self::Offset\n\nConvert a `Native` to an `Offset`.\n\n#### fn is_64bit() -> bool\n\nTrue if the memory is 64-bit\n\nImplementors\n---\n\n### impl MemorySize for Memory32\n\n#### type Offset = u32\n\n#### type Native = i32\n\n#### const ZERO: Self::Offset = {transmute(0x00000000): ::Offset}\n\n#### const ONE: Self::Offset = {transmute(0x00000001): ::Offset}\n\n### impl MemorySize for Memory64\n\n#### type Offset = u64\n\n#### type Native = i64\n\n#### const ZERO: Self::Offset = {transmute(0x0000000000000000): ::Offset}\n\n#### const ONE: Self::Offset = {transmute(0x0000000000000001): ::Offset}\n\nTrait wasmer_types::NativeWasmType\n===\n\n\n```\npub trait NativeWasmType: Sized {\n    type Abi: Copy + Debug;\n\n    const WASM_TYPE: Type;\n}\n```\n`NativeWasmType` represents a Wasm type that has a direct representation on the host (hence the “native” term).\n\nIt uses the Rust Type system to automatically detect the Wasm type associated with a native Rust type.\n```\nuse wasmer_types::{NativeWasmType, Type};\n\nlet wasm_type = i32::WASM_TYPE;\nassert_eq!(wasm_type, Type::I32);\n```\n> Note: This strategy will be needed later to\n> automatically detect the signature of a Rust function.\nRequired Associated Types\n---\n\n#### type Abi: Copy + Debug\n\nThe ABI for this type (i32, i64, f32, f64)\n\nRequired Associated Constants\n---\n\n#### const WASM_TYPE: Type\n\nType for this `NativeWasmType`.\n\nImplementations on Foreign Types\n---\n\n### impl NativeWasmType for u128\n\n#### const WASM_TYPE: Type = Type::V128\n\n#### type Abi = u128\n\n### impl NativeWasmType for f32\n\n#### const WASM_TYPE: Type = Type::F32\n\n#### type Abi = f32\n\n### impl NativeWasmType for u32\n\n#### const WASM_TYPE: Type = Type::I32\n\n#### type Abi = u32\n\n### impl NativeWasmType for i64\n\n#### const WASM_TYPE: Type = Type::I64\n\n#### type Abi = i64\n\n### impl NativeWasmType for u64\n\n#### const WASM_TYPE: Type = Type::I64\n\n#### type Abi = u64\n\n### impl NativeWasmType for f64\n\n#### const WASM_TYPE: Type = Type::F64\n\n#### type Abi = f64\n\n### impl NativeWasmType for Option::Abi\n\n### impl NativeWasmType for i32\n\n#### const WASM_TYPE: Type = Type::I32\n\n#### type Abi = i32\n\nImplementors\n---\n\n### impl NativeWasmType for Memory32\n\n#### const WASM_TYPE: Type = <::Native as NativeWasmType>::WASM_TYPE\n\n#### type Abi = <::Native as NativeWasmType>::Abi\n\n### impl NativeWasmType for Memory64\n\n#### const WASM_TYPE: Type = <::Native as NativeWasmType>::WASM_TYPE\n\n#### type Abi = <::Native as NativeWasmType>::Abi\n\nTrait wasmer_types::ValueType\n===\n\n\n```\npub unsafe trait ValueType: Copy {\n    // Required method\n    fn zero_padding_bytes(&self, bytes: &mut [MaybeUninit]);\n}\n```\nTrait for a Value type. A Value type is a type that is always valid and may be safely copied.\n\nSafety\n---\n\nTo maintain safety, types which implement this trait must be valid for all bit patterns. This means that it cannot contain enums, `bool`, references,\netc.\n\nConcretely a `u32` is a Value type because every combination of 32 bits is a valid `u32`. However a `bool` is *not* a Value type because any bit patterns other than `0` and `1` are invalid in Rust and may cause undefined behavior if a `bool` is constructed from those bytes.\n\nAdditionally this trait has a method which zeros out any uninitializes bytes prior to writing them to Wasm memory, which prevents information leaks into the sandbox.\n\nRequired Methods\n---\n\n#### fn zero_padding_bytes(&self, bytes: &mut [MaybeUninit])\n\nThis method is passed a byte slice which contains the byte representation of `self`. It must zero out any bytes which are uninitialized (e.g. padding bytes).\n\nImplementations on Foreign Types\n---\n\n### impl ValueType for u8\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [i16; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [i128; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [i32; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [f64; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for f32\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for u64\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [u8; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for isize\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for u32\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [u32; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [bool; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for bool\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [i8; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [i64; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [u64; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [f32; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [u128; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for i64\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for i16\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for usize\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for f64\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for u16\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for i32\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [isize; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for i128\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for u128\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for i8\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [usize; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\n### impl ValueType for [u16; N]\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\nImplementors\n---\n\n### impl ValueType for PhantomData) -> bool\n```\nCheck if the provided bytes are wasm-like\n\nType Alias wasmer_types::Addend\n===\n\n\n```\npub type Addend = i64;\n```\nAddend to add to the symbol value.\n\nTrait Implementations\n---\n\n### impl Add<&BigEndian> for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: &BigEndian) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `+` operation. Read more1.0.0 · source### impl Add<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: &i64) -> >::Output\n\nPerforms the `+` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: BigEndian) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `+` operation. Read more1.0.0 · source### impl Add for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: i64) -> i64\n\nPerforms the `+` operation. Read more1.22.0 · source### impl AddAssign<&i64> for i64\n\n#### fn add_assign(&mut self, other: &i64)\n\nPerforms the `+=` operation. Read more1.8.0 · source### impl AddAssign for i64\n\n#### fn add_assign(&mut self, other: i64)\n\nPerforms the `+=` operation. Read more1.0.0 · source### impl Binary for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl BitAnd<&BigEndian> for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `&` operation. Read more1.0.0 · source### impl BitAnd<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `&` operator.#### fn bitand(self, other: &i64) -> >::Output\n\nPerforms the `&` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: BigEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `&` operation. Read more1.0.0 · source### impl BitAnd for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `&` operator.#### fn bitand(self, rhs: i64) -> i64\n\nPerforms the `&` operation. Read more1.22.0 · source### impl BitAndAssign<&i64> for i64\n\n#### fn bitand_assign(&mut self, other: &i64)\n\nPerforms the `&=` operation. Read more1.8.0 · source### impl BitAndAssign for i64\n\n#### fn bitand_assign(&mut self, other: i64)\n\nPerforms the `&=` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `|` operation. Read more1.0.0 · source### impl BitOr<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, other: &i64) -> >::Output\n\nPerforms the `|` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, other: BigEndian) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `|` operation. Read more1.45.0 · source### impl BitOr for i64\n\n#### type Output = NonZeroI64\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, rhs: NonZeroI64) -> >::Output\n\nPerforms the `|` operation. Read more1.0.0 · source### impl BitOr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, rhs: i64) -> i64\n\nPerforms the `|` operation. Read more1.22.0 · source### impl BitOrAssign<&i64> for i64\n\n#### fn bitor_assign(&mut self, other: &i64)\n\nPerforms the `|=` operation. Read more1.8.0 · source### impl BitOrAssign for i64\n\n#### fn bitor_assign(&mut self, other: i64)\n\nPerforms the `|=` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `^` operation. Read more1.0.0 · source### impl BitXor<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `^` operator.#### fn bitxor(self, other: &i64) -> >::Output\n\nPerforms the `^` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: BigEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `^` operation. Read more1.0.0 · source### impl BitXor for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `^` operator.#### fn bitxor(self, other: i64) -> i64\n\nPerforms the `^` operation. Read more1.22.0 · source### impl BitXorAssign<&i64> for i64\n\n#### fn bitxor_assign(&mut self, other: &i64)\n\nPerforms the `^=` operation. Read more1.8.0 · source### impl BitXorAssign for i64\n\n#### fn bitxor_assign(&mut self, other: i64)\n\nPerforms the `^=` operation. Read more1.0.0 · source### impl Debug for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. Read more1.0.0 · source### impl Display for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: &BigEndian) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `/` operation. Read more1.0.0 · source### impl Div<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: &i64) -> >::Output\n\nPerforms the `/` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: BigEndian) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `/` operation. Read more1.0.0 · source### impl Div for i64\n\nThis operation rounds towards zero, truncating any fractional part of the exact result.\n\n#### Panics\n\nThis operation will panic if `other == 0` or the division results in overflow.\n\n#### type Output = i64\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: i64) -> i64\n\nPerforms the `/` operation. Read more1.22.0 · source### impl DivAssign<&i64> for i64\n\n#### fn div_assign(&mut self, other: &i64)\n\nPerforms the `/=` operation. Read more1.8.0 · source### impl DivAssign for i64\n\n#### fn div_assign(&mut self, other: i64)\n\nPerforms the `/=` operation. \n\n#### fn from(value: &'a BigEndian) -> i64\n\nConverts to this type from the input type.### impl<'a> From<&'a LittleEndian> for i64\n\n#### fn from(value: &'a LittleEndian) -> i64\n\nConverts to this type from the input type.### impl<'a> From<&'a NativeEndian> for i64\n\n#### fn from(value: &'a NativeEndian) -> i64\n\nConverts to this type from the input type.### impl From> for i64\n\n#### fn from(value: BigEndian) -> i64\n\nConverts to this type from the input type.### impl From> for i64\n\n#### fn from(value: LittleEndian) -> i64\n\nConverts to this type from the input type.### impl From> for i64\n\n#### fn from(value: NativeEndian) -> i64\n\nConverts to this type from the input type.1.31.0 · source### impl From for i64\n\n#### fn from(nonzero: NonZeroI64) -> i64\n\nConverts a `NonZeroI64` into an `i64`\n\n1.28.0 · source### impl From for i64\n\n#### fn from(small: bool) -> i64\n\nConverts a `bool` to a `i64`. The resulting value is `0` for `false` and `1` for `true`\nvalues.\n\n##### Examples\n```\nassert_eq!(i64::from(true), 1);\nassert_eq!(i64::from(false), 0);\n```\n1.5.0 · source### impl From for i64\n\n#### fn from(small: i16) -> i64\n\nConverts `i16` to `i64` losslessly.\n\n1.5.0 · source### impl From for i64\n\n#### fn from(small: i32) -> i64\n\nConverts `i32` to `i64` losslessly.\n\n1.5.0 · source### impl From for i64\n\n#### fn from(small: i8) -> i64\n\nConverts `i8` to `i64` losslessly.\n\n1.5.0 · source### impl From for i64\n\n#### fn from(small: u16) -> i64\n\nConverts `u16` to `i64` losslessly.\n\n1.5.0 · source### impl From for i64\n\n#### fn from(small: u32) -> i64\n\nConverts `u32` to `i64` losslessly.\n\n1.5.0 · source### impl From for i64\n\n#### fn from(small: u8) -> i64\n\nConverts `u8` to `i64` losslessly.\n\n1.0.0 · source### impl Hash for i64\n\n#### fn hash(&self, state: &mut H)where\n H: Hasher,\n\nFeeds this value into the given `Hasher`. \n H: Hasher,\n\nFeeds a slice of this type into the given `Hasher`. Read more1.42.0 · source### impl LowerExp for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl LowerHex for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl Mul<&BigEndian> for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: &BigEndian) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `*` operation. Read more1.0.0 · source### impl Mul<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: &i64) -> >::Output\n\nPerforms the `*` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: BigEndian) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `*` operation. Read more1.0.0 · source### impl Mul for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: i64) -> i64\n\nPerforms the `*` operation. Read more1.22.0 · source### impl MulAssign<&i64> for i64\n\n#### fn mul_assign(&mut self, other: &i64)\n\nPerforms the `*=` operation. Read more1.8.0 · source### impl MulAssign for i64\n\n#### fn mul_assign(&mut self, other: i64)\n\nPerforms the `*=` operation. \n\n#### const WASM_TYPE: Type = Type::I64\n\nType for this `NativeWasmType`.#### type Abi = i64\n\nThe ABI for this type (i32, i64, f32, f64)1.0.0 · source### impl Neg for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn neg(self) -> i64\n\nPerforms the unary `-` operation. Read more1.0.0 · source### impl Not for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `!` operator.#### fn not(self) -> i64\n\nPerforms the unary `!` operation. Read more1.0.0 · source### impl Octal for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl Ord for i64\n\n#### fn cmp(&self, other: &i64) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &BigEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq> for i64\n\n#### fn eq(&self, other: &LittleEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq> for i64\n\n#### fn eq(&self, other: &NativeEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialEq for i64\n\n#### fn eq(&self, other: &i64) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.#### fn ne(&self, other: &i64) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialOrd for i64\n\n#### fn partial_cmp(&self, other: &i64) -> Option=`\noperator. \n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.12.0 · source### impl<'a> Product<&'a i64> for i64\n\n#### fn product(iter: I) -> i64where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by multiplying the items.1.12.0 · source### impl Product for i64\n\n#### fn product(iter: I) -> i64where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by multiplying the items.### impl Rem<&BigEndian> for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: &BigEndian) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `%` operation. Read more1.0.0 · source### impl Rem<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: &i64) -> >::Output\n\nPerforms the `%` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: BigEndian) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `%` operation. Read more1.0.0 · source### impl Rem for i64\n\nThis operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand.\n\n#### Panics\n\nThis operation will panic if `other == 0` or if `self / other` results in overflow.\n\n#### type Output = i64\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: i64) -> i64\n\nPerforms the `%` operation. Read more1.22.0 · source### impl RemAssign<&i64> for i64\n\n#### fn rem_assign(&mut self, other: &i64)\n\nPerforms the `%=` operation. Read more1.8.0 · source### impl RemAssign for i64\n\n#### fn rem_assign(&mut self, other: i64)\n\nPerforms the `%=` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &BigEndian) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i128> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i128) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i16> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i16) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i32> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i32) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i64) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i8> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i8) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&isize> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &isize) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u128> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u128) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u16> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u16) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u32> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u32) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u64) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u8> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u8) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&usize> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &usize) -> >::Output\n\nPerforms the `<<` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: BigEndian) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i128) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i16) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i32) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i64) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i8) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: isize) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u128) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u16) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u32) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u64) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u8) -> i64\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: usize) -> i64\n\nPerforms the `<<` operation. Read more1.22.0 · source### impl ShlAssign<&i128> for i64\n\n#### fn shl_assign(&mut self, other: &i128)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i16> for i64\n\n#### fn shl_assign(&mut self, other: &i16)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i32> for i64\n\n#### fn shl_assign(&mut self, other: &i32)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i64> for i64\n\n#### fn shl_assign(&mut self, other: &i64)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i8> for i64\n\n#### fn shl_assign(&mut self, other: &i8)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&isize> for i64\n\n#### fn shl_assign(&mut self, other: &isize)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u128> for i64\n\n#### fn shl_assign(&mut self, other: &u128)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u16> for i64\n\n#### fn shl_assign(&mut self, other: &u16)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u32> for i64\n\n#### fn shl_assign(&mut self, other: &u32)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u64> for i64\n\n#### fn shl_assign(&mut self, other: &u64)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u8> for i64\n\n#### fn shl_assign(&mut self, other: &u8)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&usize> for i64\n\n#### fn shl_assign(&mut self, other: &usize)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: i128)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: i16)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: i32)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: i64)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: i8)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: isize)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: u128)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: u16)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: u32)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: u64)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: u8)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for i64\n\n#### fn shl_assign(&mut self, other: usize)\n\nPerforms the `<<=` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &BigEndian) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i128> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i128) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i16> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i16) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i32> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i32) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i64) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i8> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i8) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&isize> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &isize) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u128> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u128) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u16> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u16) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u32> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u32) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u64) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u8> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u8) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&usize> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &usize) -> >::Output\n\nPerforms the `>>` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: BigEndian) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i128) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i16) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i32) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i64) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i8) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: isize) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u128) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u16) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u32) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u64) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u8) -> i64\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: usize) -> i64\n\nPerforms the `>>` operation. Read more1.22.0 · source### impl ShrAssign<&i128> for i64\n\n#### fn shr_assign(&mut self, other: &i128)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i16> for i64\n\n#### fn shr_assign(&mut self, other: &i16)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i32> for i64\n\n#### fn shr_assign(&mut self, other: &i32)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i64> for i64\n\n#### fn shr_assign(&mut self, other: &i64)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i8> for i64\n\n#### fn shr_assign(&mut self, other: &i8)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&isize> for i64\n\n#### fn shr_assign(&mut self, other: &isize)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u128> for i64\n\n#### fn shr_assign(&mut self, other: &u128)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u16> for i64\n\n#### fn shr_assign(&mut self, other: &u16)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u32> for i64\n\n#### fn shr_assign(&mut self, other: &u32)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u64> for i64\n\n#### fn shr_assign(&mut self, other: &u64)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u8> for i64\n\n#### fn shr_assign(&mut self, other: &u8)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&usize> for i64\n\n#### fn shr_assign(&mut self, other: &usize)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: i128)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: i16)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: i32)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: i64)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: i8)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: isize)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: u128)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: u16)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: u32)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: u64)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: u8)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for i64\n\n#### fn shr_assign(&mut self, other: usize)\n\nPerforms the `>>=` operation. \n\n#### unsafe fn forward_unchecked(start: i64, n: usize) -> i64\n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *successor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *predecessor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *successor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *predecessor*\nof `self` `count` times. \nof `self` `count` times. \nof `self` `count` times. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: &BigEndian) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `-` operation. Read more1.0.0 · source### impl Sub<&i64> for i64\n\n#### type Output = >::Output\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: &i64) -> >::Output\n\nPerforms the `-` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: BigEndian) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `-` operation. Read more1.0.0 · source### impl Sub for i64\n\n#### type Output = i64\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: i64) -> i64\n\nPerforms the `-` operation. Read more1.22.0 · source### impl SubAssign<&i64> for i64\n\n#### fn sub_assign(&mut self, other: &i64)\n\nPerforms the `-=` operation. Read more1.8.0 · source### impl SubAssign for i64\n\n#### fn sub_assign(&mut self, other: i64)\n\nPerforms the `-=` operation. Read more1.12.0 · source### impl<'a> Sum<&'a i64> for i64\n\n#### fn sum(iter: I) -> i64where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by\n“summing up” the items.1.12.0 · source### impl Sum for i64\n\n#### fn sum(iter: I) -> i64where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by\n“summing up” the items.1.34.0 · source### impl TryFrom for i64\n\n#### fn try_from(u: i128) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for i64\n\n#### fn try_from(value: isize) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for i64\n\n#### fn try_from(u: u128) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for i64\n\n#### fn try_from(u: u64) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for i64\n\n#### fn try_from(u: usize) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.42.0 · source### impl UpperExp for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl UpperHex for i64\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl ValueType for i64\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\nThis method is passed a byte slice which contains the byte representation of `self`. It must zero out any bytes which are uninitialized (e.g. padding bytes).### impl ConstParamTy for i64\n\n1.0.0 · source### impl Copy for i64\n\n1.0.0 · source### impl Eq for i64\n\n### impl StructuralEq for i64\n\n### impl StructuralPartialEq for i64\n\n### impl TrustedStep for i64\n\nType Alias wasmer_types::CodeOffset\n===\n\n\n```\npub type CodeOffset = u32;\n```\nOffset in bytes from the beginning of the function.\n\nTrait Implementations\n---\n\n### impl Add<&BigEndian> for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: &BigEndian) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `+` operation. Read more1.0.0 · source### impl Add<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: &u32) -> >::Output\n\nPerforms the `+` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: BigEndian) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `+` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `+` operation. Read more1.0.0 · source### impl Add for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `+` operator.#### fn add(self, other: u32) -> u32\n\nPerforms the `+` operation. Read more1.22.0 · source### impl AddAssign<&u32> for u32\n\n#### fn add_assign(&mut self, other: &u32)\n\nPerforms the `+=` operation. Read more1.8.0 · source### impl AddAssign for u32\n\n#### fn add_assign(&mut self, other: u32)\n\nPerforms the `+=` operation. Read more1.0.0 · source### impl Binary for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl BitAnd<&BigEndian> for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `&` operation. Read more1.0.0 · source### impl BitAnd<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `&` operator.#### fn bitand(self, other: &u32) -> >::Output\n\nPerforms the `&` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: BigEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `&` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `&` operation. Read more1.0.0 · source### impl BitAnd for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `&` operator.#### fn bitand(self, rhs: u32) -> u32\n\nPerforms the `&` operation. Read more1.22.0 · source### impl BitAndAssign<&u32> for u32\n\n#### fn bitand_assign(&mut self, other: &u32)\n\nPerforms the `&=` operation. Read more1.8.0 · source### impl BitAndAssign for u32\n\n#### fn bitand_assign(&mut self, other: u32)\n\nPerforms the `&=` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `|` operation. Read more1.0.0 · source### impl BitOr<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, other: &u32) -> >::Output\n\nPerforms the `|` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, other: BigEndian) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `|` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `|` operation. Read more1.45.0 · source### impl BitOr for u32\n\n#### type Output = NonZeroU32\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, rhs: NonZeroU32) -> >::Output\n\nPerforms the `|` operation. Read more1.0.0 · source### impl BitOr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `|` operator.#### fn bitor(self, rhs: u32) -> u32\n\nPerforms the `|` operation. Read more1.22.0 · source### impl BitOrAssign<&u32> for u32\n\n#### fn bitor_assign(&mut self, other: &u32)\n\nPerforms the `|=` operation. Read more1.8.0 · source### impl BitOrAssign for u32\n\n#### fn bitor_assign(&mut self, other: u32)\n\nPerforms the `|=` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &BigEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `^` operation. Read more1.0.0 · source### impl BitXor<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `^` operator.#### fn bitxor(self, other: &u32) -> >::Output\n\nPerforms the `^` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: BigEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `^` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `^` operation. Read more1.0.0 · source### impl BitXor for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `^` operator.#### fn bitxor(self, other: u32) -> u32\n\nPerforms the `^` operation. Read more1.22.0 · source### impl BitXorAssign<&u32> for u32\n\n#### fn bitxor_assign(&mut self, other: &u32)\n\nPerforms the `^=` operation. Read more1.8.0 · source### impl BitXorAssign for u32\n\n#### fn bitxor_assign(&mut self, other: u32)\n\nPerforms the `^=` operation. Read more1.0.0 · source### impl Debug for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. Read more1.0.0 · source### impl Display for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: &BigEndian) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `/` operation. Read more1.0.0 · source### impl Div<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: &u32) -> >::Output\n\nPerforms the `/` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: BigEndian) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `/` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `/` operation. Read more1.51.0 · source### impl Div for u32\n\n#### fn div(self, other: NonZeroU32) -> u32\n\nThis operation rounds towards zero,\ntruncating any fractional part of the exact result, and cannot panic.\n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.1.0.0 · source### impl Div for u32\n\nThis operation rounds towards zero, truncating any fractional part of the exact result.\n\n#### Panics\n\nThis operation will panic if `other == 0`.\n\n#### type Output = u32\n\nThe resulting type after applying the `/` operator.#### fn div(self, other: u32) -> u32\n\nPerforms the `/` operation. Read more1.22.0 · source### impl DivAssign<&u32> for u32\n\n#### fn div_assign(&mut self, other: &u32)\n\nPerforms the `/=` operation. Read more1.8.0 · source### impl DivAssign for u32\n\n#### fn div_assign(&mut self, other: u32)\n\nPerforms the `/=` operation. \n\n#### fn from(value: &'a BigEndian) -> u32\n\nConverts to this type from the input type.### impl<'a> From<&'a LittleEndian> for u32\n\n#### fn from(value: &'a LittleEndian) -> u32\n\nConverts to this type from the input type.### impl<'a> From<&'a NativeEndian> for u32\n\n#### fn from(value: &'a NativeEndian) -> u32\n\nConverts to this type from the input type.### impl From> for u32\n\n#### fn from(value: BigEndian) -> u32\n\nConverts to this type from the input type.1.1.0 · source### impl From for u32\n\n#### fn from(ip: Ipv4Addr) -> u32\n\nUses `Ipv4Addr::to_bits` to convert an IPv4 address to a host byte order `u32`.\n\n### impl From> for u32\n\n#### fn from(value: LittleEndian) -> u32\n\nConverts to this type from the input type.### impl From> for u32\n\n#### fn from(value: NativeEndian) -> u32\n\nConverts to this type from the input type.1.31.0 · source### impl From for u32\n\n#### fn from(nonzero: NonZeroU32) -> u32\n\nConverts a `NonZeroU32` into an `u32`\n\n1.28.0 · source### impl From for u32\n\n#### fn from(small: bool) -> u32\n\nConverts a `bool` to a `u32`. The resulting value is `0` for `false` and `1` for `true`\nvalues.\n\n##### Examples\n```\nassert_eq!(u32::from(true), 1);\nassert_eq!(u32::from(false), 0);\n```\n1.13.0 · source### impl From for u32\n\n#### fn from(c: char) -> u32\n\nConverts a `char` into a `u32`.\n\n##### Examples\n```\nuse std::mem;\n\nlet c = 'c';\nlet u = u32::from(c);\nassert!(4 == mem::size_of_val(&u))\n```\n1.5.0 · source### impl From for u32\n\n#### fn from(small: u16) -> u32\n\nConverts `u16` to `u32` losslessly.\n\n1.5.0 · source### impl From for u32\n\n#### fn from(small: u8) -> u32\n\nConverts `u8` to `u32` losslessly.\n\n1.0.0 · source### impl Hash for u32\n\n#### fn hash(&self, state: &mut H)where\n H: Hasher,\n\nFeeds this value into the given `Hasher`. \n H: Hasher,\n\nFeeds a slice of this type into the given `Hasher`. Read more1.42.0 · source### impl LowerExp for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl LowerHex for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl Mul<&BigEndian> for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: &BigEndian) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `*` operation. Read more1.0.0 · source### impl Mul<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: &u32) -> >::Output\n\nPerforms the `*` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: BigEndian) -> >>::Output\n\nPerforms the `*` operation. Read more1.31.0 · source### impl Mul for u32\n\n#### type Output = Duration\n\nThe resulting type after applying the `*` operator.#### fn mul(self, rhs: Duration) -> Duration\n\nPerforms the `*` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `*` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `*` operation. Read more1.0.0 · source### impl Mul for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `*` operator.#### fn mul(self, other: u32) -> u32\n\nPerforms the `*` operation. Read more1.22.0 · source### impl MulAssign<&u32> for u32\n\n#### fn mul_assign(&mut self, other: &u32)\n\nPerforms the `*=` operation. Read more1.8.0 · source### impl MulAssign for u32\n\n#### fn mul_assign(&mut self, other: u32)\n\nPerforms the `*=` operation. \n\n#### const WASM_TYPE: Type = Type::I32\n\nType for this `NativeWasmType`.#### type Abi = u32\n\nThe ABI for this type (i32, i64, f32, f64)1.0.0 · source### impl Not for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `!` operator.#### fn not(self) -> u32\n\nPerforms the unary `!` operation. Read more1.0.0 · source### impl Octal for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl Ord for u32\n\n#### fn cmp(&self, other: &u32) -> Ordering\n\nThis method returns an `Ordering` between `self` and `other`. Read more1.21.0 · source#### fn max(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the maximum of two values. Read more1.21.0 · source#### fn min(self, other: Self) -> Selfwhere\n Self: Sized,\n\nCompares and returns the minimum of two values. Read more1.50.0 · source#### fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,\n\nRestrict a value to a certain interval. \n\n#### fn eq(&self, other: &BigEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq> for u32\n\n#### fn eq(&self, other: &LittleEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq> for u32\n\n#### fn eq(&self, other: &NativeEndian) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialEq for u32\n\n#### fn eq(&self, other: &u32) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.#### fn ne(&self, other: &u32) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.1.0.0 · source### impl PartialOrd for u32\n\n#### fn partial_cmp(&self, other: &u32) -> Option=`\noperator. \n\nThis method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more1.12.0 · source### impl<'a> Product<&'a u32> for u32\n\n#### fn product(iter: I) -> u32where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by multiplying the items.1.12.0 · source### impl Product for u32\n\n#### fn product(iter: I) -> u32where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by multiplying the items.### impl Rem<&BigEndian> for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: &BigEndian) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `%` operation. Read more1.0.0 · source### impl Rem<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: &u32) -> >::Output\n\nPerforms the `%` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: BigEndian) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `%` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `%` operation. Read more1.51.0 · source### impl Rem for u32\n\n#### fn rem(self, other: NonZeroU32) -> u32\n\nThis operation satisfies `n % d == n - (n / d) * d`, and cannot panic.\n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.1.0.0 · source### impl Rem for u32\n\nThis operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand.\n\n#### Panics\n\nThis operation will panic if `other == 0`.\n\n#### type Output = u32\n\nThe resulting type after applying the `%` operator.#### fn rem(self, other: u32) -> u32\n\nPerforms the `%` operation. Read more1.22.0 · source### impl RemAssign<&u32> for u32\n\n#### fn rem_assign(&mut self, other: &u32)\n\nPerforms the `%=` operation. Read more1.8.0 · source### impl RemAssign for u32\n\n#### fn rem_assign(&mut self, other: u32)\n\nPerforms the `%=` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &BigEndian) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i128> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i128) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i16> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i16) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i32) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i64> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i64) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&i8> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &i8) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&isize> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &isize) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u128> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u128) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u16> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u16) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u32) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u64> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u64) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&u8> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &u8) -> >::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl<&usize> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: &usize) -> >::Output\n\nPerforms the `<<` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: BigEndian) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `<<` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i128) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i16) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i32) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i64) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: i8) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: isize) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u128) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u16) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u32) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u64) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: u8) -> u32\n\nPerforms the `<<` operation. Read more1.0.0 · source### impl Shl for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `<<` operator.#### fn shl(self, other: usize) -> u32\n\nPerforms the `<<` operation. Read more1.22.0 · source### impl ShlAssign<&i128> for u32\n\n#### fn shl_assign(&mut self, other: &i128)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i16> for u32\n\n#### fn shl_assign(&mut self, other: &i16)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i32> for u32\n\n#### fn shl_assign(&mut self, other: &i32)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i64> for u32\n\n#### fn shl_assign(&mut self, other: &i64)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&i8> for u32\n\n#### fn shl_assign(&mut self, other: &i8)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&isize> for u32\n\n#### fn shl_assign(&mut self, other: &isize)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u128> for u32\n\n#### fn shl_assign(&mut self, other: &u128)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u16> for u32\n\n#### fn shl_assign(&mut self, other: &u16)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u32> for u32\n\n#### fn shl_assign(&mut self, other: &u32)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u64> for u32\n\n#### fn shl_assign(&mut self, other: &u64)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&u8> for u32\n\n#### fn shl_assign(&mut self, other: &u8)\n\nPerforms the `<<=` operation. Read more1.22.0 · source### impl ShlAssign<&usize> for u32\n\n#### fn shl_assign(&mut self, other: &usize)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: i128)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: i16)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: i32)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: i64)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: i8)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: isize)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: u128)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: u16)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: u32)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: u64)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: u8)\n\nPerforms the `<<=` operation. Read more1.8.0 · source### impl ShlAssign for u32\n\n#### fn shl_assign(&mut self, other: usize)\n\nPerforms the `<<=` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &BigEndian) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i128> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i128) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i16> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i16) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i32) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i64> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i64) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&i8> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &i8) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&isize> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &isize) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u128> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u128) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u16> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u16) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u32) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u64> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u64) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&u8> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &u8) -> >::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr<&usize> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: &usize) -> >::Output\n\nPerforms the `>>` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: BigEndian) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `>>` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i128) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i16) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i32) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i64) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: i8) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: isize) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u128) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u16) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u32) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u64) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: u8) -> u32\n\nPerforms the `>>` operation. Read more1.0.0 · source### impl Shr for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `>>` operator.#### fn shr(self, other: usize) -> u32\n\nPerforms the `>>` operation. Read more1.22.0 · source### impl ShrAssign<&i128> for u32\n\n#### fn shr_assign(&mut self, other: &i128)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i16> for u32\n\n#### fn shr_assign(&mut self, other: &i16)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i32> for u32\n\n#### fn shr_assign(&mut self, other: &i32)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i64> for u32\n\n#### fn shr_assign(&mut self, other: &i64)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&i8> for u32\n\n#### fn shr_assign(&mut self, other: &i8)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&isize> for u32\n\n#### fn shr_assign(&mut self, other: &isize)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u128> for u32\n\n#### fn shr_assign(&mut self, other: &u128)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u16> for u32\n\n#### fn shr_assign(&mut self, other: &u16)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u32> for u32\n\n#### fn shr_assign(&mut self, other: &u32)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u64> for u32\n\n#### fn shr_assign(&mut self, other: &u64)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&u8> for u32\n\n#### fn shr_assign(&mut self, other: &u8)\n\nPerforms the `>>=` operation. Read more1.22.0 · source### impl ShrAssign<&usize> for u32\n\n#### fn shr_assign(&mut self, other: &usize)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: i128)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: i16)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: i32)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: i64)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: i8)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: isize)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: u128)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: u16)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: u32)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: u64)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: u8)\n\nPerforms the `>>=` operation. Read more1.8.0 · source### impl ShrAssign for u32\n\n#### fn shr_assign(&mut self, other: usize)\n\nPerforms the `>>=` operation. \n\n#### unsafe fn forward_unchecked(start: u32, n: usize) -> u32\n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *successor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *predecessor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *successor*\nof `self` `count` times. \n\n🔬This is a nightly-only experimental API. (`step_trait`)Returns the value that would be obtained by taking the *predecessor*\nof `self` `count` times. \nof `self` `count` times. \nof `self` `count` times. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: &BigEndian) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: &LittleEndian\n) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: &NativeEndian\n) -> >>::Output\n\nPerforms the `-` operation. Read more1.0.0 · source### impl Sub<&u32> for u32\n\n#### type Output = >::Output\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: &u32) -> >::Output\n\nPerforms the `-` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: BigEndian) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: LittleEndian\n) -> >>::Output\n\nPerforms the `-` operation. \n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(\n self,\n other: NativeEndian\n) -> >>::Output\n\nPerforms the `-` operation. Read more1.0.0 · source### impl Sub for u32\n\n#### type Output = u32\n\nThe resulting type after applying the `-` operator.#### fn sub(self, other: u32) -> u32\n\nPerforms the `-` operation. Read more1.22.0 · source### impl SubAssign<&u32> for u32\n\n#### fn sub_assign(&mut self, other: &u32)\n\nPerforms the `-=` operation. Read more1.8.0 · source### impl SubAssign for u32\n\n#### fn sub_assign(&mut self, other: u32)\n\nPerforms the `-=` operation. Read more1.12.0 · source### impl<'a> Sum<&'a u32> for u32\n\n#### fn sum(iter: I) -> u32where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by\n“summing up” the items.1.12.0 · source### impl Sum for u32\n\n#### fn sum(iter: I) -> u32where\n I: Iterator,\n\nMethod which takes an iterator and generates `Self` from the elements by\n“summing up” the items.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: i128) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: i16) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: i32) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: i64) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: i8) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: isize) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: u128) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: u64) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.34.0 · source### impl TryFrom for u32\n\n#### fn try_from(u: usize) -> Result>::ErrorTry to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.\n\n#### type Error = TryFromIntError\n\nThe type returned in the event of a conversion error.1.42.0 · source### impl UpperExp for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.1.0.0 · source### impl UpperHex for u32\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter.### impl ValueType for u32\n\n#### fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit])\n\nThis method is passed a byte slice which contains the byte representation of `self`. It must zero out any bytes which are uninitialized (e.g. padding bytes).### impl ConstParamTy for u32\n\n1.0.0 · source### impl Copy for u32\n\n1.0.0 · source### impl Eq for u32\n\n### impl StructuralEq for u32\n\n### impl StructuralPartialEq for u32\n\n### impl TrustedStep for u32\n\nUnion wasmer_types::RawValue\n===\n\n\n```\n#[repr(C)]\npub union RawValue {\n    pub i32: i32,\n    pub i64: i64,\n    pub u32: u32,\n    pub u64: u64,\n    pub f32: f32,\n    pub f64: f64,\n    pub i128: i128,\n    pub u128: u128,\n    pub funcref: usize,\n    pub externref: usize,\n    pub bytes: [u8; 16],\n}\n```\nRaw representation of a WebAssembly value.\n\nIn most cases you will want to use the type-safe `Value` wrapper instead.\n\nFields\n---\n\n`i32: i32``i64: i64``u32: u32``u64: u64``f32: f32``f64: f64``i128: i128``u128: u128``funcref: usize``externref: usize``bytes: [u8; 16]`Trait Implementations\n---\n\n### impl Clone for RawValue\n\n#### fn clone(&self) -> RawValue\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. \n\n#### fn from(value: f32) -> Self\n\nConverts to this type from the input type.### impl From for RawValue\n\n#### fn from(value: f64) -> Self\n\nConverts to this type from the input type.### impl From for RawValue\n\n#### fn from(value: i32) -> Self\n\nConverts to this type from the input type.### impl From for RawValue\n\n#### fn from(value: i64) -> Self\n\nConverts to this type from the input type.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &Self) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &f32) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &f64) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &i128) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &i32) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &i64) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &u128) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &u32) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl PartialEq for RawValue\n\n#### fn eq(&self, o: &u64) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Copy for RawValue\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for RawValue\n\n### impl Send for RawValue\n\n### impl Sync for RawValue\n\n### impl Unpin for RawValue\n\n### impl UnwindSafe for RawValue\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n\n#### type ArchivedMetadata = ()\n\nThe archived version of the pointer metadata for this type.#### fn pointer_metadata(\n _: &::ArchivedMetadata\n) -> ::Metadata\n\nConverts some archived metadata to the pointer metadata for itself.### impl Borrow for Twhere\n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n W: DeserializeWith,\n D: Fallible + ?Sized,\n F: ?Sized,\n\n#### fn deserialize(\n &self,\n deserializer: &mut D\n) -> Result, ::ErrorDeserializes using the given deserializer### impl From for T\n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl LayoutRaw for T\n\n#### fn layout_raw(_: ::Metadata) -> Result Pointee for T\n\n#### type Metadata = ()\n\nThe type for metadata in pointers and references to `Self`.### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion."}}},{"rowIdx":470,"cells":{"project":{"kind":"string","value":"equivalence"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘equivalence’\n                                            October 13, 2022\nType Package\nTitle Provides Tests and Graphics for Assessing Tests of Equivalence\nVersion 0.7.2\nDate 2016-05-10\nAuthor  <>\nMaintainer  <>\nDepends lattice, boot, PairedData\nImports grid\nDescription Provides statistical tests and graphics for assessing tests\n      of equivalence. Such tests have similarity as the alternative\n      hypothesis instead of the null. Sample data sets are included.\nLicense GPL-2\nNeedsCompilation yes\nRepository CRAN\nDate/Publication 2016-05-14 00:10:45\nR topics documented:\nequiv.boo... 2\nequiv.... 3\nequivalenc... 5\nequivalence-deprecate... 6\nequivalence.xyplo... 6\npref.4P... 9\npref.LA... 10\nprint.tos... 11\nptte.dat... 12\nptte.sta... 13\nrtos... 15\ntos... 16\ntost.sta... 18\nuf... 20\n  equiv.boot                     Regression-based TOST using bootstrap\nDescription\n    This function wraps the regression-based TOST equivalence test inside a bootstrap, extracts and\n    reports the useful quantities, and reports the outcome of the test. The function was written for vali-\n    dating models, and requires paired data points. To use it for this purpose, pass the model predictions\n    as the predictor variable, and the observations (which the predictions are intended to match) as the\n    response variable.\nUsage\n    equiv.boot(x, y, alpha = 0.05, b0.ii = 0.25, b1.ii = 0.25, reps = 100,\n                    b0.ii.absolute = FALSE)\nArguments\n    x                    the predictor variable (commonly predictions)\n    y                    the response variable (commonly observations)\n    alpha                the size of the test\n    b0.ii                the half-length of the region of similarity for the intercept, expressed as a pro-\n                         portion of the estimate or in the same units as the estimate (see b0.ii.absolute).\n    b1.ii                the half-length of the region of similarity for the slope, expressed as a proportion\n                         of the estimate.\n    reps                 the number of bootstrap replicates required\n    b0.ii.absolute option to express b0.ii in the same units as the estimate of the intercept.\nDetails\n    In each case, if the two one-sided confidence interval is inside the region of similarity then the null\n    hypothesis of dissimilarity is rejected.\nValue\n    A list of length 10, comprising\n    n                    The effective (non-missing) sample size\n    ci.b0                The intercept TOST confidence interval\n    rs.b0                The intercept region of similarity\n    q.b0                 The proportions of simulations below, within, and above, the intercept region of\n                         similarity\n    Test.b0              The outcome of the test of the null hypothesis of dissimilarity for the intercept\n                         (Reject/Not Reject)\n    ci.b1              The slope TOST confidence interval\n    rs.b1              The slope region of similarity\n    q.b1               The proportions of simulations below, within, and above, the slope region of\n                       similarity\n    Test.b1            The outcome of the test of the null hypothesis of dissimilarity for the slope\n                       (Reject/Not Reject)\n    eff.alpha          The corrected alpha for each of the two independent tests.\nAcknowledgements\n    Feedback from Mohammad Al-Ahmadi has been very useful for this function.\nAuthor(s)\n     <>\nReferences\n    Robinson, A.P., , and . 2005. A regression-based equivalence test for\n    model validation: shifting the burden of proof. Tree Physiology 25, 903-913.\nSee Also\n    lm, boot, tost\nExamples\n    # Approximately reproduces the first row from Table 2 of Robinson et al. (2005)\n    data(pref.4PG)\n    equiv.boot(pref.4PG$volinc4PG, pref.4PG$stemvolinc)\n  equiv.p                        Inverts the regression-based TOST equivalence test\nDescription\n    This function generates the TOST intervals for the intercept and the slope of the regression of y\n    on x, and determines the smallest region of indifference in each case that would reject the null\n    hypothesis of dissimilarity.\nUsage\n    equiv.p(x, y, alpha = 0.05)\nArguments\n    x                    The predictor variable - perhaps the model predictions\n    y                    The response variable - perhaps the observations\n    alpha                The size of the test\nDetails\n    The generated confidence intervals are corrected for experiment-level size of alpha using Bonfer-\n    roni.\nValue\n    A list of two items:\n    Intercept            The smallest half-length of the interval that leads to rejection of the null hypoth-\n                         esis of dissimilarity for the intercept, in the units of y.\n    Slope                The smallest half-length of the interval that leads to rejection of the null hypoth-\n                         esis of dissimilarity for the slope, in the units of the slope.\nNote\n    The accuracy of the output of this function is contingent on the usual regression assumptions, which\n    are not checked here. Caveat emptor!\nAuthor(s)\n     <>\nReferences\n    ., and . 2004. Model validation using equivalence tests. Ecological\n    Modelling 176, 349–358.\n    ., , and . 2005. A regression-based equivalence test for\n    model validation: shifting the burden of proof. Tree Physiology 25, 903-913.\nSee Also\n    tost.data\nExamples\n    data(ufc)\n    equiv.p(ufc$Height.m.p, ufc$Height.m)\n  equivalence                 Equivalence Tests\nDescription\n    This package provides tools to perform several equivalence tests.\nNote\n    Recent changes: the tost.data function is deprecated as of version 0.5.0; please use tost, which\n    provides more functionality.\nAuthor(s)\n     <>\nReferences\n    . 1981. On hypothesis testing to determine if the mean of a normal distribution is\n    contained in a known interval. Biometrics 37 617.\n    ., and . 2004. Model validation using equivalence tests. Ecological\n    Modelling 176, 349–358.\n    . 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\n    West. 1981. Response to T.B.L. Kirkwood: bioequivalence testing - a need to rethink.\n    Biometrics 37, 589-594.\nExamples\n    data(ufc)\n    ### Tost\n    tost(ufc$Height.m.p, ufc$Height.m, epsilon = 1)\n    ### equivalence plot\n    ufc.ht <- ufc[!is.na(ufc$Height),]\n    equivalence.xyplot(ufc.ht$Height.m ~ ufc.ht$Height.m.p,\n                         alpha=0.05, b0.ii=0.1, b1.ii=0.2,\n                         xlab=\"Predicted height (m)\",\n                         ylab=\"Measured height (m)\")\n  equivalence-deprecated\n                                Deprecated Functions in Equivalence package\nDescription\n    These functions are provided for compatibility with older versions of R only, and may be defunct\n    as soon as the next release.\nUsage\n    tost.data(x, null = 0, alpha = 0.05, Epsilon = 0.36, absolute = FALSE)\nArguments\n    x                   the sample of paired differences\n    null                the value of the parameter in the null hypothesis\n    alpha               test size\n    Epsilon             magnitude of region of similarity\n    absolute            choose units: absolute (TRUE) or relative to the standard deviation (FALSE).\nDetails\n    The original help page for these functions is available at help(\"oldName-deprecated\") (note the\n    quotes). Functions in packages other than the base package are listed in help(\"pkg-deprecated\").\n    tost.data is superceded by tost.\nSee Also\n    Deprecated\n  equivalence.xyplot            Constructs graphical regression-based tests of equivalence inside a\n                                lattice coplot\nDescription\n    Implements regression-based tests of equivalence within lattice graphics.\nUsage\n      equivalence.xyplot(formula, alpha, b0.ii, b1.ii,\n    add.smooth=FALSE, b0.absolute=FALSE, ...)\nArguments\n    formula               a formula describing the form of conditioning plot. See the manual entry for\n                          xyplot for more details.\n    alpha                 the size of the test\n    b0.ii                 the half-length of the region of similarity for the intercept, can be relative or\n                          absolute (see below).\n    b1.ii                 the half-length of the region of similarity for the slope.\n    add.smooth            adds a loess smooth to the graph.\n    b0.absolute           is b0.ii in absolute or relative units?\n    ...                   extra arguments passed on to xyplot\nDetails\n    The graphic created by this function was proposed by Robinson et al. (2005) as a visual summary\n    of the regression-based TOST. At first glance the graph will look messy; interpretation eases with\n    practice. The following points should be noted.\n        • LS line:A black, solid line of best fit is added.\n        • Mean:A grey vertical bar indicates the mean of x and the TOST confidence interval for the\n          intercept.\n        • b0 R.S.:A shaded polygon is the region of similarity of the intercept, to test the model bias.\n        • Test b0:If the grey vertical bar is within the shaded polygon then reject the null hypothesis of\n          dissimilarity. This is a test of bias.\n        • ...1 -If the region is too low then the predictions are too low.\n        • ...2 -If the region is too high then the predictions are too high.\n        • ...3 -If the region is too narrow then the predictions are too variable.\n        • b1 C.I.:A black vertical bar undermeath the grey bar represents a confidence interval for the\n          slope of the line of best fit.\n        • b1 R.S.:Two black dashed lines are added representing the region of similarity.\n        • Test b1:If the black bar is within the angle described by the dashed black lines then the slope of\n          the observed/predicted regression is significantly similar to 1. This is a test of proportionality.\n        • ...1 -If the bar is too high then the slope is too high; the model over-predicts the higher obser-\n          vations and under-predicts the lower observations.\n        • ...2 -If the bar is too low then the slope is too low; the model underpredicts the higher obser-\n          vations and overpredicts the lower observations (analogous to regression to the mean).\n        • ...3 -If the bar is too narrow then the predictions are too variable.\n    The implementation in Robinson et al. (2005) required shifting so that the predictor has 0 mean.\n    This hack has been removed here so that the basic graph object is a plot of the two variables being\n    compared.\nValue\n    Run for its side effect of producing a lattice plot object.\nWarning\n    The accuracy of the output of this function is contingent on the usual regression assumptions, which\n    are not checked here. Caveat emptor! Consider using equiv.boot() for a bootstrap-based solution.\n    Transforming either variable will probably complicate the analysis considerably.\nAcknowledgements\n    Feedback from  has been very useful for this function.\nNote\n    This version produces a regression-based TOST for each level of the conditioning factor. There may\n    be an argument for pooling the test across these levels, in which case some prepanel computations\n    will be helpful.\n    The TOST requires only estimates and standard errors from the data. Therefore the linear model\n    used in the panel function can be replaced by any model that will produce suitable estimates. For\n    example, in applying this function to hierarchical data we have had success using lme() instead.\n    I’m not entirely convinced that all these lines on one image are a good idea. It’s straightforward to\n    remove some, or change the colours. Recommendations for graphics that are visually cleaner are\n    welcome.\nAuthor(s)\n     <>\nReferences\n    Robinson, A.P., , and . 2005. A regression-based equivalence test for\n    model validation: shifting the burden of proof. Tree Physiology 25, 903-913.\nSee Also\n    tost.stat, xyplot, equiv.boot\nExamples\n    data(pref.4PG)\n    equivalence.xyplot(pref.4PG$stemvolinc ~ pref.4PG$volinc4PG,\n                         alpha=0.05, b0.ii=0.25, b1.ii=0.25, add.smooth=TRUE,\n                         xlab=expression(paste(\"4PG decadal volume growth (\", m^3,\n                              ha^-1, decade^-1, \")\", sep=\"\")),\n                         ylab=expression(paste(\"Measured decadal volume growth (\",\n                              m^3, ha^-1, decade^-1, \")\", sep=\"\")))\n    data(pref.LAI)\n    equivalence.xyplot(pref.LAI$lai.pa ~ pref.LAI$lai.bl,\n                         alpha=0.05, b0.ii=0.25, b1.ii=0.25,\n                         xlab=expression(paste(\"LAI Beer-Lambert (\", m^2, m^-2, \")\",\n                              sep=\"\")),\n                           ylab=expression(paste(\"LAI Ceptometer (\", m^2, m^-2, \")\",\n                               sep=\"\")))\n     data(ufc)\n     ufc.ht <- ufc[!is.na(ufc$Height),]\n     equivalence.xyplot(ufc.ht$Height.m ~ ufc.ht$Height.m.p,\n                           alpha=0.05, b0.ii=0.1, b1.ii=0.2,\n                           xlab=\"Predicted height (m)\",\n                           ylab=\"Measured height (m)\")\n     equivalence.xyplot(ufc.ht$Height.m ~ ufc.ht$Height.m.p | ufc.ht$Species,\n                           alpha=0.05, b0.ii=0.1, b1.ii=0.2,\n                           xlab=\"Predicted height (m)\",\n                           ylab=\"Measured height (m)\",\n                           subset=ufc.ht$Species %in%\n                                levels(ufc.ht$Species)[table(ufc.ht$Species)>5])\n  pref.4PG                     Measured and simulated data from PREF, northern Idaho, USA, and\n                               4-PG\nDescription\n     These data are the juxtaposition of model output and field measurements for the Priest River Ex-\n     perimental Forest in northern Idaho, USA. The model was a process-based aspatial forest stand\n     model called 4-PG, developed from 3-PG by Duursma (2004). The data were used to demonstrate\n     a regression-based TOST in Robinson et al (2005).\nUsage\n     data(pref.4PG)\nFormat\n     A dataset with 35 observations on 33 variables, of which the following two were used for the model\n     validation exercise.\n     stemvolinc measured decadal stem growth in $m^3/ha$\n     volinc4PG predicted decadal stem growth in $m^3/ha$\nDetails\n     Nothing in particular. Devil’s club (Oplopanax horridus) is very painful.\nSource\n     The data are documented in Duursma (2004) and Robinson et al (2005).\nReferences\n     . 2004. A simple process-based model of forest growth, and a test for the Priest River\n     Experimental Forest. Ph.D. Thesis, University of Idaho, 169 p.\n     ., , and . 2005. A regression-based equivalence test for\n     model validation: shifting the burden of proof. Tree Physiology 25, 903-913\nExamples\n     data(pref.4PG)\n   pref.LAI                     Measured Leaf Area Index data from PREF, northern Idaho, USA\nDescription\n     These data are the juxtaposition of model output and field measurements for 36 forest plots in\n     the Priest River Experimental Forest in northern Idaho, USA. The model was based on the Beer-\n     Lambert model (Duursma et al. 2003). The data were used to demonstrate a regression-based TOST\n     in Robinson et al (2005).\nUsage\n     data(pref.LAI)\nFormat\n     A dataset with 36 observations on 8 variables, the following two of which were used for the test of\n     equivalence:\n     lai.pa LAI as estimated using allometric functions applied to measurements of trees within the\n          sample plot.\n     lai.bl LAI as estimated using the Beer-Lambert model from measurements of interception using\n          a hand-held ceptometer.\nDetails\n     Nothing in particular. PREF, and northern Idaho, are very attractive.\nSource\n     The data are documented in Duursma et al. (2003) and Robinson et al (2005).\nReferences\n     ., , and . 2003. Leaf area index inferred from solar beam\n     transmission in mixed conifer forests on complex terrain. Agricultural and Forest Meteorology 118,\n     221-236.\n     ., , and . 2005. A regression-based equivalence test for\n     model validation: shifting the burden of proof. Tree Physiology 25, 903-913.\nExamples\n     data(pref.LAI)\n   print.tost                    Print methods for TOST objects\nDescription\n     Printing objects of class ’\"tost\"’ by simple ’print’ methods.\nUsage\n        ## S3 method for class 'tost'\n     print(x, ...)\nArguments\n     x                   object of class ’\"tost\"’\n     ...                 arguments to be passed to other functions.\nDetails\n     The function inherits infrastructure from R’s print.htest, so a number of elements have been copied\n     from the help file of that function.\nValue\n     the argument ’x’, invisibly, as for all ’print’ methods.\nAuthor(s)\n      <>\nSee Also\n     tost\nExamples\n     data(ufc)\n     tost(ufc$Height.m.p, ufc$Height.m, epsilon = 1, paired = TRUE)\n   ptte.data                      Computes a paired t-test for equivalence from a single sample of a\n                                  normally-distributed population\nDescription\n     This function computes the test and key test quantities for the paired t-test for equivalence, as doc-\n     umented in Wellek (2003, pp 77-80). This function computes the test from a sample of a normally-\n     distributed population.\nUsage\n     ptte.data(x, alpha = 0.05, Epsilon = 0.25)\nArguments\n     x                    paired differences\n     alpha                test size\n     Epsilon              magnitude of region of similarity\nDetails\n     This test requires the assumption of normality of the population. Under that assumption the test is\n     the uniformly most powerful invariant test (Wellek, 2003, pp. 78-79).\n     The function as documented by Wellek (2003) uses units relative to the standard deviation, noting\n     (p. 12) that 0.25 corresponds to a strict test and 0.5 to a liberal test.\nValue\n     A list with the following components\n     Dissimilarity        the outcome of the test of the null hypothesis of dissimilarity\n     Mean                 the mean of the sample\n     StdDev               the standard deviation of the sample\n     n                    the sample size\n     alpha                the size of the test\n     missing              the number of observations missing\n     Epsilon              the magnitude of the region of similarity\n     cutoff               the critical value\n     Tstat                the test statistic; if Tstat < cutoff then the null hypothesis is rejected.\n     Power                the power of the test evaluated at the observed value\nNote\n     This test requires the assumption of normality of the population. Under that assumption the test is\n     the uniformly most powerful invariant test (Wellek, 2003, pp. 78-79). The exposition in Robinson\n     and Froese (2004) mistakenly omits the square root of the F-quantile.\nAuthor(s)\n     <>\nReferences\n     ., and ese. 2004. Model validation using equivalence tests. Ecological\n     Modelling 176, 349–358.\n     Wellek, S. 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\nSee Also\n     ptte.stat, tost.data\nExamples\n     data(ufc)\n     ptte.data(ufc$Height.m.p - ufc$Height.m)\n   ptte.stat                     Computes a paired t-test for equivalence from the mean and standard\n                                 deviation of a sample from a normally-distributed population\nDescription\n     This function computes the test and key test quantities for the paired t-test for equivalence, as doc-\n     umented in Wellek (2003, pp 77-80). This function computes the test from the mean and standard\n     deviation of a sample of paired differences from a normally-distributed population.\nUsage\n     ptte.stat(mean, std, n, alpha = 0.05, Epsilon = 0.25)\nArguments\n     mean                the sample mean\n     std                 the sample standard deviation\n     n                   sample size\n     alpha               test size\n     Epsilon             magnitude of region of similarity\nDetails\n    This test requires the assumption of normality of the population. Under that assumption the test is\n    the uniformly most powerful invariant test (Wellek, 2003, pp. 78-79). This version of the test can\n    be applied post-hoc to any testing situation in which you have the mean, standard deviation, and\n    sample size, and are confident that the sample is drawn from a normally-distributed population.\n    The function as documented by Wellek (2003) uses units relative to the standard deviation, noting\n    (p. 12) that 0.25 corresponds to a strict test and 0.5 to a liberal test.\nValue\n    A list with the following components\n    Dissimilarity        the outcome of the test of the null hypothesis of dissimilarity\n    Mean                 the mean of the sample\n    StdDev               the standard deviation of the sample\n    n                    the sample size\n    alpha                the size of the test\n    Epsilon              the magnitude of the region of similarity\n    cutoff               the critical value\n    Tstat                the test statistic; if Tstat < cutoff then the null hypothesis is rejected.\n    Power                the power of the test evaluated at the observed value\nNote\n    The exposition in Robinson and Froese (2004) mistakenly omits the square root of the F-quantile.\nAuthor(s)\n     <>\nReferences\n    ., and . 2004. Model validation using equivalence tests. Ecological\n    Modelling 176, 349–358.\n    . 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\nSee Also\n    ptte.data, tost.stat\nExamples\n    data(ufc)\n    ptte.stat(mean(ufc$Height.m.p - ufc$Height.m, na.rm=TRUE),\n      sd(ufc$Height.m.p - ufc$Height.m, na.rm=TRUE),\n      sum(!is.na(ufc$Height.m.p - ufc$Height.m)))\n   rtost                            Computes a robust TOST for equivalence from paired or unpaired data\nDescription\n      This function computes the TOST and key TOST quantities for the two one-sided test for equiva-\n      lence [Schuirmann (1981) and Westlake (1981)], using the robust t-test of Yuen [Yuen and Dixon\n      (1973), Yuen (1974)] in place of the standard Welch t test (t.test stats). The yuen t test makes no as-\n      sumption of normality. The function computes the robust TOST for a sample of paired differences\n      or for two samples. The function performs almost as well as the Welch t test when the population\n      distribution is normal and is more robust than the Welch t test in the face of non-normality (e.g., dis-\n      tributions that are long-tailed, heteroscedastic, or contaminated by outliers)[Yuen and Dixon (1973),\n      Yuen (1974)].\nUsage\n      rtost(x, y = NULL, alpha = 0.05, epsilon = 0.31, tr = 0.2,                     ...)\nArguments\n      x                     the first (or only) sample\n      y                     the second sample\n      alpha                 test size\n      tr                    the proportion (percent/100) of the data set to be trimmed\n      epsilon               magnitude of region of similarity\n      ...                   arguments to be passed to yuen.t.test\nDetails\n      The rtost function is wrapped around the yuen PairedData t test, a robust variant of the t test using\n      trimmed means and winsorized variances. It provides tosts for the same range of designs, accepts\n      the same arguments, and handles missing values the same way as tost equivalence. For the tost, the\n      user must set epsilon, which is the magnitude of region similarity. Warning: with tr > 0.25 type I\n      error control might be poor.\nValue\n      A list with the following components\n      mean.diff             the mean of the difference\n      se.diff               the standard error of the difference\n      alpha                 the size of the test\n      ci.diff               the 1-alpha confidence interval for the difference\n      df                    the degrees of freedom used for the confidence interval\n      epsilon               the magnitude of the region of similarity\n     result               the outcome of the test of the null hypothesis of dissimilarity\n     p.value              the p-value of the significance test\n     check.me             the confidence interval corresponding to the p-value\nNote\n     This test is the tost for equivalence (tost equivalence) wrapped around the robust, trimmed mean,\n     winsorized variance yuen.t.test (yuen PairedData).\nAuthor(s)\n      <>\nReferences\n     . 1981. On hypothesis testing to determine if the mean of a normal distribution is\n     contained in a known interval. Biometrics 37, 617.\n     ., and . 2004. Model validation using equivalence tests. Ecological\n     Modelling 176, 349–358.\n     . 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\n     Westlake, W.J. 1981. Response to T.B.L. Kirkwood: bioequivalence testing - a need to rethink.\n     Biometrics 37, 589-594.\n     . (1974) The two-sample trimmed t for unequal population variances. Biometrika, 61,\n     165-170.\n     ., and . (1973) The approximate behavior and performance of the two-sample\n     trimmed t. Biometrika, 60, 369-374.\nSee Also\n     tost, yuen.t.test\nExamples\n     data(ufc)\n     rtost(ufc$Height.m.p, ufc$Height.m, epsilon = 1, tr = 0.2)\n   tost                          Computes a TOST for equivalence from paired or unpaired data\nDescription\n     This function computes the test and key test quantities for the two one-sided test for equivalence,\n     as documented in Schuirmann (1981) and Westlake (1981). The function computes the test for a\n     sample of paired differences or two samples, assumed to be from a normally-distributed population.\n     Much code in the function has been copied and adapted from R’s t.test.default function.\nUsage\n     tost(x, y = NULL, epsilon = 1, paired = FALSE, var.equal = FALSE,\n                        conf.level = 0.95, alpha = NULL,\n          ...)\nArguments\n     x                    the first (or only) sample\n     y                    the second sample\n     epsilon              magnitude of region of similarity\n     paired               a logical indicating whether you want a paired tost\n     var.equal            a logical variable indicating whether to treat the two variances as being equal. If\n                          ’TRUE’ then the pooled variance is used to estimate the variance otherwise the\n                          Welch (or Satterthwaite) approximation to the degrees of freedom is used.\n     conf.level           confidence level of the interval\n     alpha                test size (for backwards-compatibility, overrides conf.level)\n     ...                  arguments to be passed to other functions.\nDetails\n     The function inherits infrastructure from R’s t.test.default, so a number of elements have been\n     copied from the help file of that function.\n     This test requires the assumption of normality of the population, or an invocation of large-sample\n     theory. The function wraps around the t.test function, so it provides tosts for the same range of\n     designs, accepts the same arguments, and handles missing values the same way.\n     If ’paired’ is ’TRUE’ then both ’x’ and ’y’ must be specified and they must be the same length.\n     Missing values are silently removed (in pairs if ’paired’ is ’TRUE’). If ’var.equal’ is ’TRUE’ then\n     the pooled estimate of the variance is used. By default, if ’var.equal’ is ’FALSE’ then the variance is\n     estimated separately for both groups and the Welch modification to the degrees of freedom is used.\nValue\n     A list with the following components\n     estimate             the mean of the difference\n     se.diff              the standard error of the difference\n     alpha                the size of the test\n     data.name            a character string giving the name(s) of the data\n     ci.diff              the 1-alpha confidence interval for the difference\n     parameter            the degrees of freedom used for the confidence interval\n     epsilon              the magnitude of the region of similarity\n     result               the outcome of the test of the null hypothesis of dissimilarity\n     method               a character string indicating what type of t-test was performed\n     null.value           the specified hypothesized value of the mean or mean difference depending on\n                          whether it was a one-sample tost or a two-sample tost.\n     tost.p.value         the p-value of the tost significance test\n     tost.interval        the two one-sided confidence interval corresponding to the test.\nNote\n     This test requires the assumption of normality of the population. The components of the test are\n     t-based confidence intervals, so the Central Limit Theorem and Slutsky’s Theorem may be relevant\n     to its application in large samples.\nAuthor(s)\n      <>\nReferences\n     . 1981. On hypothesis testing to determine if the mean of a normal distribution is\n     contained in a known interval. Biometrics 37 617.\n     ., and . 2004. Model validation using equivalence tests. Ecological\n     Modelling 176, 349–358.\n     . 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\n     Westlake, W.J. 1981. Response to T.: bioequivalence testing - a need to rethink.\n     Biometrics 37, 589-594.\nSee Also\n     tost.stat, ptte.data\nExamples\n     data(ufc)\n     tost(ufc$Height.m.p, ufc$Height.m, epsilon = 1, paired = TRUE)\n   tost.stat                       Computes a TOST for equivalence from sample statistics\nDescription\n     This function computes the test and key test quantities for the two one-sided test for equivalence, as\n     documented in Schuirmann (1981) and Westlake (1981). This function computes the test from the\n     statistics of a sample of paired differences of a normally-distributed population.\nUsage\n     tost.stat(mean, std, n, null = 0, alpha = 0.05, Epsilon = 0.36)\nArguments\n     mean                 sample mean\n     std                  sample standard deviation\n     n                    sample size\n     null                 the value of the parameter in the null hypothesis\n     alpha                test size\n     Epsilon              magnitude of region of similarity\nDetails\n     This test requires the assumption of normality of the population.\nValue\n     A list with the following components\n     Dissimilarity        the outcome of the test of the null hypothesis of dissimilarity\n     Mean                 the mean of the sample\n     StdDev               the standard deviation of the sample\n     n                    the non-missing sample size\n     alpha                the size of the test\n     Epsilon              the magnitude of the region of similarity\n     Interval             the half-length of the two one-sided interval\nNote\n     This test requires the assumption of normality of the population. The components of the test are\n     t-based confidence intervals, so the Central Limit Theorem and Slutsky’s Theorem may be relevant\n     to its application in large samples.\nAuthor(s)\n      <>\nReferences\n     Schuirmann, D.L. 1981. On hypothesis testing to determine if the mean of a normal distribution is\n     contained in a known interval. Biometrics 37 617.\n     Wellek, S. 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.\n     Westlake, W.J. 1981. Response to T.B.L. Kirkwood: bioequivalence testing - a need to rethink.\n     Biometrics 37, 589-594.\nSee Also\n     tost.data, ptte.stat\nExamples\n     data(ufc)\n     tost.stat(mean(ufc$Height.m.p - ufc$Height.m, na.rm=TRUE),\n       sd(ufc$Height.m.p - ufc$Height.m, na.rm=TRUE),\n       sum(!is.na(ufc$Height.m.p - ufc$Height.m)))\n   ufc                         Upper Flat Creek cruise data\nDescription\n     These are forest measurement data from the Upper Flat Creek unit of the University of Idaho Ex-\n     perimental Forest, measured in 1991. The inventory was based on variable radius plots with 6.43\n     sq. m. per ha. BAF (Basal Area Factor). The forest stand was 121.5 ha.\nUsage\n     data(ufc)\nFormat\n     A data frame with 633 observations on the following 12 variables.\n     Plot plot label\n     Tree tree label\n     Species species kbd\n     Dbh tree diameter at 1.37 m. from the ground, measured in millimetres.\n     Height tree height measured in decimetres\n     Height.ft tree height converted to feet\n     Dbh.in tree diameter converted to inches\n     Height.ft.p predicted tree height in feet\n     Height.m tree height in metres\n     Height.m.p predicted tree height in metres\nDetails\n     Plots that were measured with no trees are signified in the dataset by lines that have blank species\n     codes and missing DBH.\nSource\n     The data are provided courtesy of  and  of the University of Idaho\n     Experimental Forest. The predicted height comes from the height/diameter model documented in\n     Wykoff et al. (1982). The data and model were used in Robinson et al. (2005).\nReferences\n    ., , and . 2005. A regression-based equivalence test for\n    model validation: shifting the burden of proof. Tree Physiology 25, 903-913.\n    Wykoff,W.R., , and . 1982. User’s guide to the stand Prognosis model.\n    GTR-INT 133, USDA Forest Service, Intermountain Research Station, Ogden, UT, 113 p.\nExamples\n    data(ufc)"}}},{"rowIdx":471,"cells":{"project":{"kind":"string","value":"atomic_lib"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate atomic_lib\n===\n\n`atomic_lib` helps you to get, store, serialize, parse and validate Atomic Data.\n\nSee the Atomic Data Docs for more information.\n\n### Features\n\n* Two stores for Atomic Data:\n\t+ **In-memory** Store for getting / setting data. Useful for client applications.\n\t+ **On disk** [Db], powered by Sled. Useful for applications that persist Atomic Data, such as `atomic-server`.\n* serialize and parse tools for JSON-AD, plain JSON, RDF, Turtle, N-Triples and JSON-LD.\n* Resource with getters, setters and a `.save` function that creates Commits.\n* Value converts Atomic Data to Rust native types\n* Validate Atomic Schema\n* Commits (transactions / delta’s / changes / updates / versioning / history).\n* [plugins] system (although not very mature)\n* collections (pagination, sorting, filtering)\n* Querying (using triple pattern fragments) (see storelike::Query)\n* [plugins::invite] for sharing\n* hierarchy for authorization\n* [crate::endpoints::Endpoint] for custom API endpoints\n* [config::Config] files.\n\n### Getting started\n```\n// Import the `Storelike` trait to get access to most functions use atomic_lib::Storelike;\n// Start with initializing the in-memory store let store = atomic_lib::Store::init().unwrap();\n// Pre-load the default Atomic Data Atoms (from atomicdata.dev),\n// this is not necessary, but will probably make your project a bit faster store.populate().unwrap();\n// We can create a new Resource, linked to the store.\n// Note that since this store only exists in memory, it's data cannot be accessed from the internet.\n// Let's make a new Property instance! Let's create \"age\".\nlet mut new_property = atomic_lib::Resource::new_instance(\"https://atomicdata.dev/classes/Property\", &store).unwrap();\n// And add a description for that Property new_property.set_propval_shortname(\"description\", \"the age of a person\", &store).unwrap();\n// A subject URL for the new resource has been created automatically.\nlet subject = new_property.get_subject().clone();\n// Now we need to make sure these changes are also applied to the store.\n// In order to change things in the store, we should use Commits,\n// which are signed pieces of data that contain state changes.\n// Because these are signed, we need an Agent, which has a private key to sign Commits.\nlet agent = store.create_agent(Some(\"my_agent\")).unwrap();\nstore.set_default_agent(agent);\nlet _fails   = new_property.save_locally(&store);\n// But.. when we commit, we get an error!\n// Because we haven't set all the properties required for the Property class.\n// We still need to set `shortname` and `datatype`.\nnew_property.set_propval_shortname(\"shortname\", \"age\", &store).unwrap();\nnew_property.set_propval_shortname(\"datatype\", atomic_lib::urls::INTEGER, &store).unwrap();\nnew_property.save_locally(&store).unwrap();\n// Now the changes to the resource applied to the store, and we can fetch the newly created resource!\nlet fetched_new_resource = store.get_resource(&subject).unwrap();\nassert!(fetched_new_resource.get_shortname(\"description\", &store).unwrap().to_string() == \"the age of a person\");\n```\nRe-exports\n---\n\n* `pub use atoms::Atom;`\n* `pub use commit::Commit;`\n* `pub use errors::AtomicError;`\n* `pub use errors::AtomicErrorType;`\n* `pub use resources::Resource;`\n* `pub use store::Store;`\n* `pub use storelike::Storelike;`\n* `pub use values::Value;`\n\nModules\n---\n\n* agentsLogic for Agents Agents are actors (such as users) that can edit content.\nhttps://docs.atomicdata.dev/commits/concepts.html\n* atomsThe smallest units of data, consisting of a Subject, a Property and a Value\n* authenticationCheck signatures in authentication headers, find the correct agent. Authorization is done in Hierarchies\n* clientFunctions for interacting with an Atomic Server\n* collectionsCollections are dynamic resources that refer to multiple resources.\nThey are constructed using a Query\n* commitDescribe changes / mutations to data\n* datatypeDataTypes constrain values of Atoms\n* errorsMostly contains implementations for Error types.\n* hierarchyThe Hierarchy model describes how Resources are structured in a tree-like shape.\nIt deals with authorization (read / write permissions, rights, grants)\nSee\n* mappingBecause writing full URLs is error prone and time consuming, we map URLs to shortnames.\nThese are often user-specific.\nThis section provides tools to store, share and resolve these Mappings.\n* parseParsing / deserialization / decoding\n* populatePopulating a Store means adding resources to it.\nSome of these are the core Atomic Data resources, such as the Property class.\nThese base models are required for having a functioning store.\nOther populate methods help to set up an Atomic Server, by creating a basic file hierarcy and creating default collections.\n* resourcesA Resource is a set of Atoms that share a URL.\nHas methods for saving resources and getting properties inside them.\n* schemaStructs and models at the core of Atomic Schema (Class, Property, Datatype).\n* serializeSerialization / formatting / encoding (JSON, RDF, N-Triples)\n* storeIn-memory store of Atomic data.\nThis provides many methods for finding, changing, serializing and parsing Atomic Data.\n* storelikeThe Storelike Trait contains many useful methods for maniupulting / retrieving data.\n* urlsContains some of the most important Atomic Data URLs.\n* utilsHelper functions for dealing with URLs\n* validateValidate the Store and create a ValidationReport.\nMight be deprecated soon, as Validation hasn’t been necessary since parsing has built-in data validation.\n* valuesA value is the part of an Atom that contains the actual information.\n\nCrate atomic_lib\n===\n\n`atomic_lib` helps you to get, store, serialize, parse and validate Atomic Data.\n\nSee the Atomic Data Docs for more information.\n\n### Features\n\n* Two stores for Atomic Data:\n\t+ **In-memory** Store for getting / setting data. Useful for client applications.\n\t+ **On disk** [Db], powered by Sled. Useful for applications that persist Atomic Data, such as `atomic-server`.\n* serialize and parse tools for JSON-AD, plain JSON, RDF, Turtle, N-Triples and JSON-LD.\n* Resource with getters, setters and a `.save` function that creates Commits.\n* Value converts Atomic Data to Rust native types\n* Validate Atomic Schema\n* Commits (transactions / delta’s / changes / updates / versioning / history).\n* [plugins] system (although not very mature)\n* collections (pagination, sorting, filtering)\n* Querying (using triple pattern fragments) (see storelike::Query)\n* [plugins::invite] for sharing\n* hierarchy for authorization\n* [crate::endpoints::Endpoint] for custom API endpoints\n* [config::Config] files.\n\n### Getting started\n```\n// Import the `Storelike` trait to get access to most functions use atomic_lib::Storelike;\n// Start with initializing the in-memory store let store = atomic_lib::Store::init().unwrap();\n// Pre-load the default Atomic Data Atoms (from atomicdata.dev),\n// this is not necessary, but will probably make your project a bit faster store.populate().unwrap();\n// We can create a new Resource, linked to the store.\n// Note that since this store only exists in memory, it's data cannot be accessed from the internet.\n// Let's make a new Property instance! Let's create \"age\".\nlet mut new_property = atomic_lib::Resource::new_instance(\"https://atomicdata.dev/classes/Property\", &store).unwrap();\n// And add a description for that Property new_property.set_propval_shortname(\"description\", \"the age of a person\", &store).unwrap();\n// A subject URL for the new resource has been created automatically.\nlet subject = new_property.get_subject().clone();\n// Now we need to make sure these changes are also applied to the store.\n// In order to change things in the store, we should use Commits,\n// which are signed pieces of data that contain state changes.\n// Because these are signed, we need an Agent, which has a private key to sign Commits.\nlet agent = store.create_agent(Some(\"my_agent\")).unwrap();\nstore.set_default_agent(agent);\nlet _fails   = new_property.save_locally(&store);\n// But.. when we commit, we get an error!\n// Because we haven't set all the properties required for the Property class.\n// We still need to set `shortname` and `datatype`.\nnew_property.set_propval_shortname(\"shortname\", \"age\", &store).unwrap();\nnew_property.set_propval_shortname(\"datatype\", atomic_lib::urls::INTEGER, &store).unwrap();\nnew_property.save_locally(&store).unwrap();\n// Now the changes to the resource applied to the store, and we can fetch the newly created resource!\nlet fetched_new_resource = store.get_resource(&subject).unwrap();\nassert!(fetched_new_resource.get_shortname(\"description\", &store).unwrap().to_string() == \"the age of a person\");\n```\nRe-exports\n---\n\n* `pub use atoms::Atom;`\n* `pub use commit::Commit;`\n* `pub use errors::AtomicError;`\n* `pub use errors::AtomicErrorType;`\n* `pub use resources::Resource;`\n* `pub use store::Store;`\n* `pub use storelike::Storelike;`\n* `pub use values::Value;`\n\nModules\n---\n\n* agentsLogic for Agents Agents are actors (such as users) that can edit content.\nhttps://docs.atomicdata.dev/commits/concepts.html\n* atomsThe smallest units of data, consisting of a Subject, a Property and a Value\n* authenticationCheck signatures in authentication headers, find the correct agent. Authorization is done in Hierarchies\n* clientFunctions for interacting with an Atomic Server\n* collectionsCollections are dynamic resources that refer to multiple resources.\nThey are constructed using a Query\n* commitDescribe changes / mutations to data\n* datatypeDataTypes constrain values of Atoms\n* errorsMostly contains implementations for Error types.\n* hierarchyThe Hierarchy model describes how Resources are structured in a tree-like shape.\nIt deals with authorization (read / write permissions, rights, grants)\nSee\n* mappingBecause writing full URLs is error prone and time consuming, we map URLs to shortnames.\nThese are often user-specific.\nThis section provides tools to store, share and resolve these Mappings.\n* parseParsing / deserialization / decoding\n* populatePopulating a Store means adding resources to it.\nSome of these are the core Atomic Data resources, such as the Property class.\nThese base models are required for having a functioning store.\nOther populate methods help to set up an Atomic Server, by creating a basic file hierarcy and creating default collections.\n* resourcesA Resource is a set of Atoms that share a URL.\nHas methods for saving resources and getting properties inside them.\n* schemaStructs and models at the core of Atomic Schema (Class, Property, Datatype).\n* serializeSerialization / formatting / encoding (JSON, RDF, N-Triples)\n* storeIn-memory store of Atomic data.\nThis provides many methods for finding, changing, serializing and parsing Atomic Data.\n* storelikeThe Storelike Trait contains many useful methods for maniupulting / retrieving data.\n* urlsContains some of the most important Atomic Data URLs.\n* utilsHelper functions for dealing with URLs\n* validateValidate the Store and create a ValidationReport.\nMight be deprecated soon, as Validation hasn’t been necessary since parsing has built-in data validation.\n* valuesA value is the part of an Atom that contains the actual information.\n\nStruct atomic_lib::store::Store\n===\n\n\n```\npub struct Store { /* private fields */ }\n```\nThe in-memory store of data, containing the Resources, Properties and Classes\n\nImplementations\n---\n\n### impl Store\n\n#### pub fn init() -> AtomicResult Store\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn add_atoms(&self, atoms: Vec) -> AtomicResult<()👎Deprecated since 0.28.0: The atoms abstraction has been deprecated in favor of ResourcesAdds Atoms to the store.\nWill replace existing Atoms that share Subject / Property combination.\nValidates datatypes and required props presence.#### fn add_resource_opts(\n &self,\n resource: &Resource,\n check_required_props: bool,\n update_index: bool,\n overwrite_existing: bool\n) -> AtomicResult<()Adds a Resource to the store.\nReplaces existing resource with the contents.\nDoes not do any validations.#### fn all_resources(\n &self,\n _include_external: bool\n) -> BoxReturns an iterator that iterates over all resources in the store.\nIf Include_external is false, this is filtered by selecting only resoureces that match the `self` URL of the store.#### fn get_server_url(&self) -> &str\n\nReturns the base URL where the default store is.\nE.g. `https://example.com`\nThis is where deltas should be sent to.\nAlso useful for Subject URL generation.#### fn get_self_url(&self) -> Option AtomicResult AtomicResult AtomicResult<()Removes a resource from the store. Errors if not present.#### fn set_default_agent(&self, agent: Agent)\n\nSets the default Agent for applying commits.#### fn query(&self, q: &Query) -> AtomicResult AtomicResult<()Adds an Atom to the PropSubjectMap. Overwrites if already present.\nThe default implementation for this does not do anything, so overwrite it if your store needs indexing.#### fn add_resource(&self, resource: &Resource) -> AtomicResult<()Adds a Resource to the store.\nReplaces existing resource with the contents.\nUpdates the index.\nValidates the fields (checks required props).\nIn most cases, you should use `resource.save()` instead, which uses Commits.#### fn build_index(&self, include_external: bool) -> AtomicResult<()Constructs the value index from all resources in the store. Could take a while.#### fn get_value(&self, subject: &str, property: &str) -> AtomicResult) -> AtomicResult AtomicResult AtomicResult Resource\n\nReturns an existing resource, or creates a new one with the given Subject#### fn get_class(&self, subject: &str) -> AtomicResult AtomicResultFinds all classes (isA) for any subject.\nReturns an empty vector if there are none.#### fn get_property(&self, subject: &str) -> AtomicResult AtomicResult AtomicResult AtomicResult,\n for_agent: &ForAgent\n) -> AtomicResult,\n _for_agent: &ForAgent\n) -> AtomicResult AtomicResult<()Loads the default store. For DBs it also adds default Collections and Endpoints.#### fn remove_atom_from_index(\n &self,\n _atom: &Atom,\n _resource: &Resource\n) -> AtomicResult<()Removes an Atom from the PropSubjectMap.#### fn validate(&self) -> ValidationReport\n\nPerforms a light validation, without fetching external dataAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Store\n\n### impl Send for Store\n\n### impl Sync for Store\n\n### impl Unpin for Store\n\n### impl UnwindSafe for Store\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nModule atomic_lib::serialize\n===\n\nSerialization / formatting / encoding (JSON, RDF, N-Triples)\n\nEnums\n---\n\n* FormatShould list all the supported serialization formats\n\nFunctions\n---\n\n* propvals_to_json_ad_mapSerializes a Resource to a Serde JSON Map according to the JSON-AD spec.\nhttps://docs.atomicdata.dev/core/json-ad.html\n* propvals_to_json_ldSerializes a Resource to a Serde JSON Map.\nSupports both JSON and JSON-LD.\nIf you opt in for JSON-LD, an @context object is created mapping the shortnames to URLs.\nhttps://docs.atomicdata.dev/interoperability/json.html#from-atomic-data-to-json-ld\n* resources_to_json_adSerializes a vector or Resources to a JSON-AD string\n* serialize_json_array\n\nModule atomic_lib::parse\n===\n\nParsing / deserialization / decoding\n\nStructs\n---\n\n* ParseOptsOptions for parsing (JSON-AD) resources.\nMany of these are related to rights, as parsing often implies overwriting / setting resources.\n\nEnums\n---\n\n* SaveOpts\n\nConstants\n---\n\n* JSON_AD_MIME\n\nFunctions\n---\n\n* parse_json_ad_commit_resourceParse a single Json AD string that represents an incoming Commit.\nWARNING: Does not match all props to datatypes (in Nested Resources), so it could result in invalid data,\nif the input data does not match the required datatypes.\n* parse_json_ad_resourceParse a single Json AD string, convert to Atoms WARNING: Does not match all props to datatypes (in Nested Resources),\nso it could result in invalid data, if the input data does not match the required datatypes.\n* parse_json_ad_stringParses JSON-AD string.\nAccepts an array containing multiple objects, or one single object.\n* parse_json_array\n\nStruct atomic_lib::resources::Resource\n===\n\n\n```\npub struct Resource { /* private fields */ }\n```\nA Resource is a set of Atoms that shares a single Subject.\nA Resource only contains valid Values, but it *might* lack required properties.\nAll changes to the Resource are applied after committing them (e.g. by using).\n\nImplementations\n---\n\n### impl Resource\n\n#### pub fn check_required_props(&self, store: &impl Storelike) -> AtomicResult<()Fetches all ‘required’ properties. Returns an error if any are missing in this Resource.\n\n#### pub fn destroy(\n &mut self,\n store: &impl Storelike\n) -> AtomicResult AtomicResultGets the children of this resource.\n\n#### pub fn from_propvals(propvals: PropVals, subject: String) -> Resource\n\n#### pub fn get(&self, property_url: &str) -> AtomicResult<&ValueGet a value by property URL\n\n#### pub fn get_commit_builder(&self) -> &CommitBuilder\n\n#### pub fn get_classes(&self, store: &impl Storelike) -> AtomicResultChecks if the classes are there, if not, fetches them.\nReturns an empty vector if there are no classes found.\n\n#### pub fn get_main_class(&self) -> AtomicResult AtomicResult AtomicResultWalks the parent tree upwards until there is no parent, then returns them as a vector.\n\n#### pub fn get_propvals(&self) -> &PropVals\n\nReturns all PropVals.\nUseful if you want to iterate over all Atoms / Properties.\n\n#### pub fn get_shortname(\n &self,\n shortname: &str,\n store: &impl Storelike\n) -> AtomicResult<&ValueGets a value by its property shortname or property URL.\n\n#### pub fn get_subject(&self) -> &String\n\n#### pub fn has_parent(&self, store: &impl Storelike, parent: &str) -> bool\n\nchecks if a resouce has a specific parent. iterates over all parents.\n\n#### pub fn into_propvals(self) -> PropVals\n\nReturns all PropVals.\n\n#### pub fn new(subject: String) -> Resource\n\nCreate a new, empty Resource.\n\n#### pub fn new_generate_subject(store: &impl Storelike) -> Resource\n\nCreate a new resource with a generated Subject\n\n#### pub fn new_instance(\n class_url: &str,\n store: &impl Storelike\n) -> AtomicResult AtomicResult<()Appends a Resource to a specific property through the commitbuilder.\nUseful if you want to have compact Commits that add things to existing ResourceArrays.\n\n#### pub fn remove_propval(&mut self, property_url: &str)\n\nRemove a propval from a resource by property URL.\n\n#### pub fn remove_propval_shortname(\n &mut self,\n property_shortname: &str,\n store: &impl Storelike\n) -> AtomicResult<()Remove a propval from a resource by property URL or shortname.\nReturns error if propval does not exist in this resource or its class.\n\n#### pub fn resolve_shortname_to_property(\n &self,\n shortname: &str,\n store: &impl Storelike\n) -> AtomicResult AtomicResult AtomicResult AtomicResult<()Insert a Property/Value combination.\nOverwrites existing Property/Value.\nValidates the datatype.\n\n#### pub fn set_propval(\n &mut self,\n property: String,\n value: Value,\n store: &impl Storelike\n) -> AtomicResult<()Inserts a Property/Value combination.\nChecks datatype.\nOverwrites existing.\nAdds the change to the commit builder’s `set` map.\n\n#### pub fn set_propval_unsafe(&mut self, property: String, value: Value)\n\nDoes not validate property / datatype combination.\nInserts a Property/Value combination.\nOverwrites existing.\nAdds it to the CommitBuilder.\n\n#### pub fn set_propval_shortname(\n &mut self,\n property: &str,\n value: &str,\n store: &impl Storelike\n) -> AtomicResult<()Sets a property / value combination.\nProperty can be a shortname (e.g. ‘description’ instead of the full URL).\nReturns error if propval does not exist in this resource or its class.\n\n#### pub fn set_propvals_unsafe(&mut self, propvals: PropVals)\n\nOverwrites all current PropVals. Does not perform validation.\n\n#### pub fn set_subject(&mut self, url: String)\n\nChanges the subject of the Resource.\nDoes not ‘move’ the Resource See https://github.com/atomicdata-dev/atomic-server/issues/44\n\n#### pub fn to_json_ad(&self) -> AtomicResult AtomicResult AtomicResult Vec Resource\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn from(val: Resource) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: Resource) -> Self\n\nConverts to this type from the input type.### impl Serialize for Resource\n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Resource\n\n### impl Send for Resource\n\n### impl Sync for Resource\n\n### impl Unpin for Resource\n\n### impl UnwindSafe for Resource\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. \n T: for<'de> Deserialize<'de>,\n\nEnum atomic_lib::values::Value\n===\n\n\n```\npub enum Value {\n AtomicUrl(String),\n Date(String),\n Integer(i64),\n Float(f64),\n Markdown(String),\n ResourceArray(Vec),\n Slug(String),\n String(String),\n Timestamp(i64),\n NestedResource(SubResource),\n Resource(Box),\n Boolean(bool),\n Unsupported(UnsupportedValue),\n}\n```\nAn individual Value in an Atom.\nNote that creating values using `Value::from` might result in the wrong Datatype, as the from conversion makes assumptions (e.g. integers are Integers, not Timestamps).\nUse `Value::SomeDataType()` for explicit creation.\n\nVariants\n---\n\n### AtomicUrl(String)\n\n### Date(String)\n\n### Integer(i64)\n\n### Float(f64)\n\n### Markdown(String)\n\n### ResourceArray(Vec)\n\n### Slug(String)\n\n### String(String)\n\n### Timestamp(i64)\n\nUnix Epoch datetime in milliseconds\n\n### NestedResource(SubResource)\n\n### Resource(Box)\n\n### Boolean(bool)\n\n### Unsupported(UnsupportedValue)\n\nImplementations\n---\n\n### impl Value\n\n#### pub fn contains_value(&self, q_val: &Value) -> bool\n\nCheck if the value `q_val` is present in `val`\n\n#### pub fn datatype(&self) -> DataType\n\nReturns the datatype for the value\n\n#### pub fn new(value: &str, datatype: &DataType) -> AtomicResult AtomicResult\n) -> AtomicResultTurns the value into a Vector of subject strings.\nWorks for resource arrays with nested resources, full resources, single resources.\nReturns a path for for Anonymous Nested Resources, which is why you need to pass a parent_path e.g. `http://example.com/foo/bar https://atomicdata.dev/properties/children`.\n\n#### pub fn to_bool(&self) -> AtomicResult AtomicResult AtomicResult<&PropValsReturns a PropVals Hashmap, if the Atom is a NestedResource\n\n#### pub fn to_sortable_string(&self) -> SortableValue\n\nReturns a Lexicographically sortable string representation of the value\n\n#### pub fn to_reference_index_strings(&self) -> OptionConverts one Value to a bunch of indexable items.\nReturns None for unsupported types.\n\nTrait Implementations\n---\n\n### impl Clone for Value\n\n#### fn clone(&self) -> Value\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn from(val: Box) -> Self\n\nConverts to this type from the input type.### impl From> for Value\n\n#### fn from(val: PropVals) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: Resource) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: String) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: SubResource) -> Self\n\nConverts to this type from the input type.### impl From> for Value\n\n#### fn from(val: Vec<&str>) -> Self\n\nConverts to this type from the input type.### impl From> for Value\n\n#### fn from(val: Vec) -> Self\n\nConverts to this type from the input type.### impl From> for Value\n\n#### fn from(val: Vec) -> Self\n\nConverts to this type from the input type.### impl From> for Value\n\n#### fn from(val: Vec) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: bool) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: f64) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: i32) -> Self\n\nConverts to this type from the input type.### impl From for Value\n\n#### fn from(val: usize) -> Self\n\nConverts to this type from the input type.### impl Serialize for Value\n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Value\n\n### impl Send for Value\n\n### impl Sync for Value\n\n### impl Unpin for Value\n\n### impl UnwindSafe for Value\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. \n T: for<'de> Deserialize<'de>,\n\nStruct atomic_lib::commit::Commit\n===\n\n\n```\npub struct Commit {\n    pub subject: String,\n    pub created_at: i64,\n    pub signer: String,\n    pub set: Option>,\n    pub remove: Option>,\n    pub destroy: Option,\n    pub signature: Option,\n    pub push: Option>,\n    pub previous_commit: Option,\n    pub url: Option,\n}\n```\nA Commit is a set of changes to a Resource.\nUse CommitBuilder if you’re programmatically constructing a Delta.\n\nFields\n---\n\n`subject: String`The subject URL that is to be modified by this Delta\n\n`created_at: i64`The date it was created, as a unix timestamp\n\n`signer: String`The URL of the one signing this Commit\n\n`set: Option>`The set of PropVals that need to be added.\nOverwrites existing values\n\n`remove: Option>`The set of property URLs that need to be removed\n\n`destroy: Option`If set to true, deletes the entire resource\n\n`signature: Option`Base64 encoded signature of the JSON serialized Commit\n\n`push: Option>`List of Properties and Arrays to be appended to them\n\n`previous_commit: Option`The previously applied commit to this Resource.\n\n`url: Option`The URL of the Commit\n\nImplementations\n---\n\n### impl Commit\n\n#### pub fn apply_opts(\n &self,\n store: &impl Storelike,\n opts: &CommitOpts\n) -> AtomicResult AtomicResult AtomicResult AtomicResult AtomicResult &str\n\n#### pub fn serialize_deterministically_json_ad(\n &self,\n store: &impl Storelike\n) -> AtomicResult Commit\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Commit\n\n### impl Send for Commit\n\n### impl Sync for Commit\n\n### impl Unpin for Commit\n\n### impl UnwindSafe for Commit\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nModule atomic_lib::collections\n===\n\nCollections are dynamic resources that refer to multiple resources.\nThey are constructed using a Query\n\nStructs\n---\n\n* CollectionDynamic resource used for ordering, filtering and querying content.\nContains members / results. Use CollectionBuilder if you don’t (yet) need the results.\nFeatures pagination.\n* CollectionBuilderUsed to construct a Collection. Does not contain results / members.\nHas to be constructed using `Collection::new()` or `storelike.new_collection()`.\n\nFunctions\n---\n\n* construct_collection_from_paramsBuilds a collection from query params and the passed Collection resource.\nThe query params are used to override the stored Collection resource properties.\nThis also sets defaults for Collection properties when fields are missing\n* create_collection_resource_for_classCreates a Collection resource in the Store for a Class, for example `/documents`.\nDoes not save it, though.\n* sort_resourcesSorts a vector or resources by some property.\n\nStruct atomic_lib::storelike::Query\n===\n\n\n```\npub struct Query {\n    pub property: Option,\n    pub value: Option,\n    pub limit: Option,\n    pub start_val: Option,\n    pub end_val: Option,\n    pub offset: usize,\n    pub sort_by: Option,\n    pub sort_desc: bool,\n    pub include_external: bool,\n    pub include_nested: bool,\n    pub for_agent: ForAgent,\n}\n```\nUse this to construct a list of Resources\n\nFields\n---\n\n`property: Option`Filter by Property\n\n`value: Option`Filter by Value\n\n`limit: Option`Maximum of items to return, if none returns all items.\n\n`start_val: Option`Value at which to begin lexicographically sorting things.\n\n`end_val: Option`Value at which to stop lexicographically sorting things.\n\n`offset: usize`How many items to skip from the first one\n\n`sort_by: Option`The Property URL that is used to sort the results\n\n`sort_desc: bool`Sort descending instead of ascending.\n\n`include_external: bool`Whether to include non-server resources\n\n`include_nested: bool`Whether to include full Resources in the result, if not, will add empty vector here.\n\n`for_agent: ForAgent`For which Agent the query is executed. Pass `None` if you want to skip permission checks.\n\nImplementations\n---\n\n### impl Query\n\n#### pub fn new() -> Self\n\n#### pub fn new_prop_val(prop: &str, val: &str) -> Self\n\nSearch for a property-value combination\n\n#### pub fn new_class(class: &str) -> Self\n\nSearch for instances of some Class\n\nTrait Implementations\n---\n\n### impl Debug for Query\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> Self\n\nReturns the “default value” for a type. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Query\n\n### impl Send for Query\n\n### impl Sync for Query\n\n### impl Unpin for Query\n\n### impl UnwindSafe for Query\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nModule atomic_lib::hierarchy\n===\n\nThe Hierarchy model describes how Resources are structured in a tree-like shape.\nIt deals with authorization (read / write permissions, rights, grants)\nSee\n\nEnums\n---\n\n* Right\n\nFunctions\n---\n\n* add_childrenLooks for children relations, adds to the resource. Performs a Query, might be expensive.\n* check_appendDoes the Agent have the right to *append* to its parent?\nThis checks the `append` rights, and if that fails, checks the `write` right.\nThrows if not allowed.\nReturns string with explanation if allowed.\n* check_readDoes the Agent have the right to read / view the properties of the selected resource, or any of its parents?\nThrows if not allowed.\nReturns string with explanation if allowed.\n* check_rightsRecursively checks a Resource and its Parents for rights.\nThrows if not allowed.\nReturns string with explanation if allowed.\n* check_writeThrows if not allowed.\nReturns string with explanation if allowed.\n\nStruct atomic_lib::atoms::Atom\n===\n\n\n```\npub struct Atom {\n    pub subject: String,\n    pub property: String,\n    pub value: Value,\n}\n```\nThe Atom is the smallest meaningful piece of data.\nIt describes how one value relates to a subject.\nA [Resource] can be converted into a bunch of Atoms.\n\nFields\n---\n\n`subject: String`The URL where the resource is located\n\n`property: String``value: Value`Implementations\n---\n\n### impl Atom\n\n#### pub fn new(subject: String, property: String, value: Value) -> Self\n\n#### pub fn values_to_subjects(&self) -> AtomicResultIf the Atom’s Value is an Array, this will try to convert it into a set of Subjects.\nUsed for indexing.\n\n#### pub fn to_indexable_atoms(&self) -> Vec Atom\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, fmt: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Atom\n\n### impl Send for Atom\n\n### impl Sync for Atom\n\n### impl Unpin for Atom\n\n### impl UnwindSafe for Atom\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nStruct atomic_lib::errors::AtomicError\n===\n\n\n```\npub struct AtomicError {\n    pub message: String,\n    pub error_type: AtomicErrorType,\n    pub subject: Option,\n}\n```\nFields\n---\n\n`message: String``error_type: AtomicErrorType``subject: Option`Implementations\n---\n\n### impl AtomicError\n\n#### pub fn method_not_allowed(message: &str) -> AtomicError\n\n#### pub fn not_found(message: String) -> AtomicError\n\nA server will probably return a 404.\n\n#### pub fn unauthorized(message: String) -> AtomicError\n\nA server will probably return this error as a 403.\n\n#### pub fn other_error(message: String) -> AtomicError\n\nA server will probably return a 500.\n\n#### pub fn parse_error(\n message: &str,\n subject: Option<&str>,\n property: Option<&str>\n) -> AtomicError\n\n#### pub fn into_resource(self, subject: String) -> Resource\n\nConverts the Error into a Resource. This helps clients to handle errors, such as show error messages in the right Form input fields.\n\n#### pub fn set_subject(self, subject: &str) -> Self\n\nTrait Implementations\n---\n\n### impl Clone for AtomicError\n\n#### fn clone(&self) -> AtomicError\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn description(&self) -> &str\n\n👎Deprecated since 1.42.0: use the Display impl or to_string() Read more1.30.0 · source#### fn source(&self) -> Option<&(dyn Error + 'static)The lower-level source of this error, if any. Read more1.0.0 · source#### fn cause(&self) -> Option<&dyn Error👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting#### fn provide<'a>(&'a self, demand: &mut Demand<'a>)\n\n🔬This is a nightly-only experimental API. (`error_generic_member_access`)Provides type based access to context intended for error reports. \n\n#### fn from(message: &str) -> Self\n\nConverts to this type from the input type.### impl From> for AtomicError\n\n#### fn from(error: Box) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: DecodeError) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: Error) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: Error) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: FromUtf8Error) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: Infallible) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: ParseBoolError) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: ParseError) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: ParseFloatError) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(error: ParseIntError) -> Self\n\nConverts to this type from the input type.### impl From> for AtomicError\n\n#### fn from(error: PoisonError) -> Self\n\nConverts to this type from the input type.### impl From for AtomicError\n\n#### fn from(message: String) -> Self\n\nConverts to this type from the input type.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for AtomicError\n\n### impl Send for AtomicError\n\n### impl Sync for AtomicError\n\n### impl Unpin for AtomicError\n\n### impl UnwindSafe for AtomicError\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl Provider for Ewhere\n E: Error + ?Sized,\n\n#### fn provide<'a>(&'a self, demand: &mut Demand<'a>)\n\n🔬This is a nightly-only experimental API. (`provide_any`)Data providers should implement this method to provide *all* values they are able to provide by using `demand`. \n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nEnum atomic_lib::errors::AtomicErrorType\n===\n\n\n```\npub enum AtomicErrorType {\n    NotFoundError,\n    UnauthorizedError,\n    ParseError,\n    OtherError,\n    MethodNotAllowed,\n}\n```\nVariants\n---\n\n### NotFoundError\n\n### UnauthorizedError\n\n### ParseError\n\n### OtherError\n\n### MethodNotAllowed\n\nTrait Implementations\n---\n\n### impl Clone for AtomicErrorType\n\n#### fn clone(&self) -> AtomicErrorType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. Read moreAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for AtomicErrorType\n\n### impl Send for AtomicErrorType\n\n### impl Sync for AtomicErrorType\n\n### impl Unpin for AtomicErrorType\n\n### impl UnwindSafe for AtomicErrorType\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. Read more\n\nTrait atomic_lib::storelike::Storelike\n===\n\n\n```\npub trait Storelike: Sized {\n // Required methods\n fn add_atoms(&self, atoms: Vec) -> AtomicResult<()>;\n fn add_resource_opts(\n &self,\n resource: &Resource,\n check_required_props: bool,\n update_index: bool,\n overwrite_existing: bool\n ) -> AtomicResult<()>;\n fn all_resources(\n &self,\n include_external: bool\n ) -> Box>;\n fn get_server_url(&self) -> &str;\n fn get_resource(&self, subject: &str) -> AtomicResult;\n fn remove_resource(&self, subject: &str) -> AtomicResult<()>;\n fn query(&self, q: &Query) -> AtomicResult;\n fn set_default_agent(&self, agent: Agent);\n\n // Provided methods\n fn add_atom_to_index(\n &self,\n _atom: &Atom,\n _resource: &Resource\n ) -> AtomicResult<()> { ... }\n fn add_resource(&self, resource: &Resource) -> AtomicResult<()> { ... }\n fn build_index(&self, include_external: bool) -> AtomicResult<()> { ... }\n fn get_value(&self, subject: &str, property: &str) -> AtomicResult { ... }\n fn get_self_url(&self) -> Option { ... }\n fn get_default_agent(&self) -> AtomicResult { ... }\n fn create_agent(&self, name: Option<&str>) -> AtomicResult { ... }\n fn export(&self, include_external: bool) -> AtomicResult { ... }\n fn fetch_resource(&self, subject: &str) -> AtomicResult { ... }\n fn get_resource_new(&self, subject: &str) -> Resource { ... }\n fn get_class(&self, subject: &str) -> AtomicResult { ... }\n fn get_classes_for_subject(&self, subject: &str) -> AtomicResult> { ... }\n fn get_property(&self, subject: &str) -> AtomicResult { ... }\n fn get_resource_extended(\n &self,\n subject: &str,\n skip_dynamic: bool,\n for_agent: &ForAgent\n ) -> AtomicResult { ... }\n fn handle_commit(&self, _commit_response: &CommitResponse) { ... }\n fn handle_not_found(\n &self,\n subject: &str,\n error: AtomicError\n ) -> AtomicResult { ... }\n fn import(\n &self,\n string: &str,\n parse_opts: &ParseOpts\n ) -> AtomicResult { ... }\n fn get_path(\n &self,\n atomic_path: &str,\n mapping: Option<&Mapping>,\n for_agent: &ForAgent\n ) -> AtomicResult { ... }\n fn post_resource(\n &self,\n _subject: &str,\n _body: Vec,\n _for_agent: &ForAgent\n ) -> AtomicResult { ... }\n fn populate(&self) -> AtomicResult<()> { ... }\n fn remove_atom_from_index(\n &self,\n _atom: &Atom,\n _resource: &Resource\n ) -> AtomicResult<()> { ... }\n fn validate(&self) -> ValidationReport { ... }\n}\n```\nStorelike provides many useful methods for interacting with an Atomic Store.\nIt serves as a basic store Trait, agnostic of how it functions under the hood.\nThis is useful, because we can create methods for Storelike that will work with either in-memory stores, as well as with persistent on-disk stores.\n\nRequired Methods\n---\n\n#### fn add_atoms(&self, atoms: Vec) -> AtomicResult<()👎Deprecated since 0.28.0: The atoms abstraction has been deprecated in favor of ResourcesAdds Atoms to the store.\nWill replace existing Atoms that share Subject / Property combination.\nValidates datatypes and required props presence.\n\n#### fn add_resource_opts(\n &self,\n resource: &Resource,\n check_required_props: bool,\n update_index: bool,\n overwrite_existing: bool\n) -> AtomicResult<()Adds a Resource to the store.\nReplaces existing resource with the contents.\nDoes not do any validations.\n\n#### fn all_resources(\n &self,\n include_external: bool\n) -> BoxReturns an iterator that iterates over all resources in the store.\nIf Include_external is false, this is filtered by selecting only resoureces that match the `self` URL of the store.\n\n#### fn get_server_url(&self) -> &str\n\nReturns the base URL where the default store is.\nE.g. `https://example.com`\nThis is where deltas should be sent to.\nAlso useful for Subject URL generation.\n\n#### fn get_resource(&self, subject: &str) -> AtomicResult AtomicResult<()Removes a resource from the store. Errors if not present.\n\n#### fn query(&self, q: &Query) -> AtomicResult AtomicResult<()Adds an Atom to the PropSubjectMap. Overwrites if already present.\nThe default implementation for this does not do anything, so overwrite it if your store needs indexing.\n\n#### fn add_resource(&self, resource: &Resource) -> AtomicResult<()Adds a Resource to the store.\nReplaces existing resource with the contents.\nUpdates the index.\nValidates the fields (checks required props).\nIn most cases, you should use `resource.save()` instead, which uses Commits.\n\n#### fn build_index(&self, include_external: bool) -> AtomicResult<()Constructs the value index from all resources in the store. Could take a while.\n\n#### fn get_value(&self, subject: &str, property: &str) -> AtomicResult Option AtomicResult) -> AtomicResult AtomicResult AtomicResult Resource\n\nReturns an existing resource, or creates a new one with the given Subject\n\n#### fn get_class(&self, subject: &str) -> AtomicResult AtomicResultFinds all classes (isA) for any subject.\nReturns an empty vector if there are none.\n\n#### fn get_property(&self, subject: &str) -> AtomicResult AtomicResult AtomicResult AtomicResult,\n for_agent: &ForAgent\n) -> AtomicResult,\n _for_agent: &ForAgent\n) -> AtomicResult AtomicResult<()Loads the default store. For DBs it also adds default Collections and Endpoints.\n\n#### fn remove_atom_from_index(\n &self,\n _atom: &Atom,\n _resource: &Resource\n) -> AtomicResult<()Removes an Atom from the PropSubjectMap.\n\n#### fn validate(&self) -> ValidationReport\n\nPerforms a light validation, without fetching external data\n\nImplementors\n---\n\n### impl Storelike for Store\n\nModule atomic_lib::agents\n===\n\nLogic for Agents Agents are actors (such as users) that can edit content.\nhttps://docs.atomicdata.dev/commits/concepts.html\n\nStructs\n---\n\n* Agent\n* Pairkeypair, serialized using base64\n\nEnums\n---\n\n* ForAgentNone represents no right checks will be performed, effectively SUDO mode.\n\nFunctions\n---\n\n* decode_base64\n* encode_base64\n* generate_public_keyReturns a Key Pair (including public key) from a private key, base64 encoded.\n* verify_public_keyChecks if the public key is a valid ED25519 base64 key.\nNot perfect - only checks byte length and parses base64.\n\nModule atomic_lib::atoms\n===\n\nThe smallest units of data, consisting of a Subject, a Property and a Value\n\nStructs\n---\n\n* AtomThe Atom is the smallest meaningful piece of data.\nIt describes how one value relates to a subject.\nA [Resource] can be converted into a bunch of Atoms.\n* IndexAtomDiffers from a regular Atom, since the value here is always a string,\nand in the case of ResourceArrays, only a *single* subject is used for each atom.\nOne IndexAtom for every member of the ResourceArray is created.\n\nModule atomic_lib::authentication\n===\n\nCheck signatures in authentication headers, find the correct agent. Authorization is done in Hierarchies\n\nStructs\n---\n\n* AuthValuesSet of values extracted from the request.\nMost are coming from headers.\n\nFunctions\n---\n\n* check_auth_signatureChecks if the signature is valid for this timestamp.\nDoes not check if the agent has rights to access the subject.\n* get_agent_from_auth_values_and_checkGet the Agent’s subject from AuthValues Checks if the auth headers are correct, whether signature matches the public key, whether the timestamp is valid.\nby default, returns the public agent\n\nModule atomic_lib::client\n===\n\nFunctions for interacting with an Atomic Server\n\nFunctions\n---\n\n* fetch_bodyFetches a URL, returns its body.\nUses the store’s Agent agent (if set) to sign the request.\n* fetch_resourceFetches a resource, makes sure its subject matches.\nChecks the datatypes for the Values.\nIgnores all atoms where the subject is different.\nWARNING: Calls store methods, and is called by store methods, might get stuck in a loop!\n* get_authentication_headersReturns the various x-atomic authentication headers, includign agent signature\n* post_commitPosts a Commit to the endpoint of the Subject from the Commit\n* post_commit_custom_endpointPosts a Commit to an endpoint Default commit endpoint is `https://example.com/commit`\n\nModule atomic_lib::commit\n===\n\nDescribe changes / mutations to data\n\nStructs\n---\n\n* CommitA Commit is a set of changes to a Resource.\nUse CommitBuilder if you’re programmatically constructing a Delta.\n* CommitBuilderUse this for creating Commits.\n* CommitOptsDescribes options for applying a Commit.\nSkip the checks you don’t need to get better performance, or if you want to break the rules a little.\n* CommitResponseThe `resource_new`, `resource_old` and `commit_resource` fields are only created if the Commit is persisted.\nWhen the Db is only notifying other of changes (e.g. if a new Message was added to a ChatRoom), these fields are not created.\nWhen deleting a resource, the `resource_new` field is None.\n\nFunctions\n---\n\n* check_timestampChecks if the Commit has been created in the future or if it is expired.\n* sign_messageSigns a string using a base64 encoded ed25519 private key. Outputs a base64 encoded ed25519 signature.\n\nModule atomic_lib::datatype\n===\n\nDataTypes constrain values of Atoms\n\nEnums\n---\n\n* DataType\n\nFunctions\n---\n\n* match_datatype\n\nEnum atomic_lib::datatype::DataType\n===\n\n\n```\npub enum DataType {\n    AtomicUrl,\n    Boolean,\n    Date,\n    Integer,\n    Float,\n    Markdown,\n    ResourceArray,\n    Slug,\n    String,\n    Timestamp,\n    Unsupported(String),\n}\n```\nVariants\n---\n\n### AtomicUrl\n\nEither a full Resource, a link to a resource (subject) or a Nested Anonymous Resource\n\n### Boolean\n\n### Date\n\n### Integer\n\n### Float\n\n### Markdown\n\n### ResourceArray\n\n### Slug\n\n### String\n\n### Timestamp\n\n### Unsupported(String)\n\nTrait Implementations\n---\n\n### impl Clone for DataType\n\n#### fn clone(&self) -> DataType\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn deserialize<__D>(__deserializer: __D) -> Resultwhere\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### type Err = Infallible\n\nThe associated error which can be returned from parsing.#### fn from_str(s: &str) -> Result bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Serialize for DataType\n\n#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\n### impl StructuralEq for DataType\n\n### impl StructuralPartialEq for DataType\n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for DataType\n\n### impl Send for DataType\n\n### impl Sync for DataType\n\n### impl Unpin for DataType\n\n### impl UnwindSafe for DataType\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Instrument for T\n\n#### fn instrument(self, span: Span) -> Instrumented,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n T: Display + ?Sized,\n\n#### default fn to_string(&self) -> String\n\nConverts the given value to a `String`. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl WithSubscriber for T\n\n#### fn with_subscriber(self, subscriber: S) -> WithDispatchwhere\n S: Into,\n\nAttaches the provided `Subscriber` to this type, returning a\n`WithDispatch` wrapper. \n`WithDispatch` wrapper. \n T: for<'de> Deserialize<'de>,\n\nModule atomic_lib::errors\n===\n\nMostly contains implementations for Error types.\n\nThe AtomicError type should be returned from any function that may fail, although it is not returned everywhere at this moment.\n\nStructs\n---\n\n* AtomicError\n\nEnums\n---\n\n* AtomicErrorType\n\nType Definitions\n---\n\n* AtomicResultThe default Error type for all Atomic Lib Errors.\n\nModule atomic_lib::mapping\n===\n\nBecause writing full URLs is error prone and time consuming, we map URLs to shortnames.\nThese are often user-specific.\nThis section provides tools to store, share and resolve these Mappings.\n\nStructs\n---\n\n* MappingMaps shortanmes (bookmarks) to URLs\n\nFunctions\n---\n\n* is_urlCheck if something is a URL\n\nModule atomic_lib::populate\n===\n\nPopulating a Store means adding resources to it.\nSome of these are the core Atomic Data resources, such as the Property class.\nThese base models are required for having a functioning store.\nOther populate methods help to set up an Atomic Server, by creating a basic file hierarcy and creating default collections.\n\nFunctions\n---\n\n* create_driveCreates a Drive resource at the base URL. Does not set rights. Use set_drive_rights for that.\n* populate_base_modelsPopulates a store with some of the most fundamental Properties and Classes needed to bootstrap the whole.\nThis is necessary to prevent a loop where Property X (like the `shortname` Property)\ncannot be added, because it’s Property Y (like `description`) has to be fetched before it can be added,\nwhich in turn has property Property X (`shortname`) which needs to be fetched before.\nhttps://github.com/atomicdata-dev/atomic-server/issues/60\n* populate_collectionsGenerates collections for classes, such as `/agent` and `/collection`.\nRequires a `self_url` to be set in the store.\n* populate_default_storeImports the Atomic Data Core items (the entire atomicdata.dev Ontology / Vocabulary)\n* set_drive_rightsAdds rights to the default agent to the Drive resource (at the base URL). Optionally give Public Read rights.\n\nModule atomic_lib::resources\n===\n\nA Resource is a set of Atoms that share a URL.\nHas methods for saving resources and getting properties inside them.\n\nStructs\n---\n\n* ResourceA Resource is a set of Atoms that shares a single Subject.\nA Resource only contains valid Values, but it *might* lack required properties.\nAll changes to the Resource are applied after committing them (e.g. by using).\n\nType Definitions\n---\n\n* PropValsMaps Property URLs to their values\n\nModule atomic_lib::schema\n===\n\nStructs and models at the core of Atomic Schema (Class, Property, Datatype).\n\nStructs\n---\n\n* Class\n* Property\n\nModule atomic_lib::store\n===\n\nIn-memory store of Atomic data.\nThis provides many methods for finding, changing, serializing and parsing Atomic Data.\n\nStructs\n---\n\n* StoreThe in-memory store of data, containing the Resources, Properties and Classes\n\nModule atomic_lib::storelike\n===\n\nThe Storelike Trait contains many useful methods for maniupulting / retrieving data.\n\nStructs\n---\n\n* QueryUse this to construct a list of Resources\n* QueryResult\n\nEnums\n---\n\n* PathReturn\n\nTraits\n---\n\n* StorelikeStorelike provides many useful methods for interacting with an Atomic Store.\nIt serves as a basic store Trait, agnostic of how it functions under the hood.\nThis is useful, because we can create methods for Storelike that will work with either in-memory stores, as well as with persistent on-disk stores.\n\nType Definitions\n---\n\n* ResourceCollection\n\nModule atomic_lib::urls\n===\n\nContains some of the most important Atomic Data URLs.\n\nConstants\n---\n\n* AGENT\n* ALLOWS_ONLY\n* APPEND\n* ATOM\n* ATOMIC_URL\n* ATOM_PROPERTY\n* ATOM_SUBJECT\n* ATOM_VALUE\n* ATTACHMENTS\n* BOOKMARK\n* BOOLEAN\n* CHATROOM\n* CHECKSUM\n* CHILDREN\n* CLASS\n* CLASSTYPE_PROP\n* COLLECTION\n* COLLECTION_CURRENT_PAGE\n* COLLECTION_INCLUDE_EXTERNAL\n* COLLECTION_INCLUDE_NESTED\n* COLLECTION_MEMBERS\n* COLLECTION_MEMBER_COUNT\n* COLLECTION_PAGE_SIZE\n* COLLECTION_PROPERTY\n* COLLECTION_SORT_BY\n* COLLECTION_SORT_DESC\n* COLLECTION_TOTAL_PAGES\n* COLLECTION_VALUE\n* COMMIT\n* CREATED_AT\n* DATATYPE_CLASS\n* DATATYPE_PROP\n* DATE\n* DELETE\n* DESCRIPTION\n* DESTINATION\n* DESTROY\n* DOWNLOAD_URL\n* DRIVE\n* DRIVES\n* ENDPOINT\n* ENDPOINT_PARAMETERS\n* ENDPOINT_RESULTS\n* ERROR\n* EXPIRES_AT\n* FILE\n* FILENAME\n* FILESIZE\n* FLOAT\n* IMAGE_URL\n* IMPORTER\n* IMPORTER_JSON\n* IMPORTER_OVERWRITE_OUTSIDE\n* IMPORTER_PARENT\n* IMPORTER_URL\n* INCOMPLETE\n* INSERT\n* INTEGER\n* INTERNAL_ID\n* INVITE\n* INVITE_AGENT\n* INVITE_PUBKEY\n* IS_A\n* IS_DYNAMIC\n* IS_LOCKED\n* LAST_COMMIT\n* LOCAL_ID\n* MARKDOWN\n* MESSAGE\n* MESSAGES\n* MIMETYPE\n* NAME\n* NEXT_PAGE\n* PARAGRAPH\n* PARENT\n* PATH\n* PATH_FETCH_BOOKMARK\n* PATH_IMPORT\n* PATH_QUERY\n* PREVIEW\n* PREVIOUS_COMMIT\n* PROPERTY\n* PUBLIC_AGENT\n* PUBLIC_KEY\n* PUSH\n* READ\n* RECOMMENDS\n* REDIRECT\n* REDIRECT_AGENT\n* REMOVE\n* REQUIRES\n* RESOURCE_ARRAY\n* SEARCH_LIMIT\n* SEARCH_PROPERTY\n* SEARCH_QUERY\n* SET\n* SHORTNAME\n* SIGNATURE\n* SIGNER\n* SLUG\n* STRING\n* SUBJECT\n* SUBRESOURCES\n* SUDO_AGENT\n* TARGET\n* TIMESTAMP\n* URL\n* USAGES_LEFT\n* USED_BY\n* WRITE\n* WRITE_BOOL\n\nFunctions\n---\n\n* construct_path_import\n\nModule atomic_lib::utils\n===\n\nHelper functions for dealing with URLs\n\nFunctions\n---\n\n* check_valid_urlThrows an error if the URL is not a valid URL\n* nowReturns the current timestamp in milliseconds since UNIX epoch\n* random_stringGenerates a relatively short random string of n length\n* server_urlRemoves the path and query from a String, returns the base server URL\n\nModule atomic_lib::validate\n===\n\nValidate the Store and create a ValidationReport.\nMight be deprecated soon, as Validation hasn’t been necessary since parsing has built-in data validation.\n\nStructs\n---\n\n* ValidationReport\n\nFunctions\n---\n\n* validate_storeChecks Atomic Data in the store for validity.\nReturns an Error if it is not valid.\n\nModule atomic_lib::values\n===\n\nA value is the part of an Atom that contains the actual information.\n\nStructs\n---\n\n* UnsupportedValueWhen the Datatype of a Value is not handled by this library\n\nEnums\n---\n\n* SubResourceA resource in a JSON-AD body can be any of these\n* ValueAn individual Value in an Atom.\nNote that creating values using `Value::from` might result in the wrong Datatype, as the from conversion makes assumptions (e.g. integers are Integers, not Timestamps).\nUse `Value::SomeDataType()` for explicit creation.\n\nConstants\n---\n\n* DATE_REGEXYYYY-MM-DD\n* SLUG_REGEXOnly alphanumeric characters, no spaces\n\nType Definitions\n---\n\n* ReferenceStringA value that is meant for checking reference indexes.\nshort. Vectors of subjects are turned into individual ReferenceStrings.\n* SortableValueString Value representing a lexicographically sortable string."}}},{"rowIdx":472,"cells":{"project":{"kind":"string","value":"pythonwhat"},"source":{"kind":"string","value":"readthedoc"},"language":{"kind":"string","value":"SQL"},"content":{"kind":"string","value":"This article lists some example solutions. For each of these solutions, an SCT is included, as well as some example student submissions that would pass and fail. In all of these, a submission that is identical to the solution will pass.\n\nThese SCT examples are not golden bullets that are perfect for your situation. Depending on the exercise, you may want to focus on certain parts of a statement, or be more accepting for different alternative answers.\n\n## Check object¶\n\n```\n# solution\nx = 10\n\n# sct\nEx().check_object('x').has_equal_value()\n\n# passing submissions\nx = 5 + 5\nx = 6 + 4\ny = 4; x = y + 6\n```\n\n## Check function call¶\n\n```\n# solution\nimport pandas as pd\npd.DataFrame([1, 2, 3], columns=['a'])\n\n# sct\nEx().check_function('pandas.DataFrame')\\\n    .multi(\n        check_args('data').has_equal_value(),\n        check_args('columns').has_equal_value()\n    )\n\n# passing submissions\npd.DataFrame([1, 1+1, 3], columns=['a'])\npd.DataFrame(data=[1, 2, 3], columns=['a'])\npd.DataFrame(columns=['a'], data=[1, 2, 3])\n```\n\n## Check pandas chain (1)¶\n\n```\n# solution\nimport pandas as pd\ndf = pd.DataFrame([1, 2, 3], columns=['a'])\ndf.a.sum()\n\n# sct\nEx().check_function(\"df.a.sum\").has_equal_value()\n```\n\n## Check pandas chain (2)¶\n\n```\n# pec\nimport pandas as pd\ndf = pd.DataFrame({'a': [1, 2, 3], 'b': ['x', 'x', 'y']})\n\n# solution\ndf.groupby('b').sum()\n\n# sct\nsig = sig_from_obj(\"df.groupby('b').sum\")\nEx().check_correct(\n    # check if group by works\n    check_function(\"df.groupby.sum\", signature = sig).has_equal_value(),\n    # check if group_by called correctly\n    check_function(\"df.groupby\").check_correct(\n        has_equal_value(func = lambda x,y: x.keys == y.keys),\n        check_args(0).has_equal_value()\n    )\n)\n\n# passing submissions\ndf.groupby('b').sum()\ndf.groupby(['b']).sum()\n\n# failing submissions\ndf               # Did you call df.groupby()?\ndf.groupby('a')  # arg of groupby is incorrect\ndf.groupby('b')  # did you call df.groupby.sum()?\n```\n\n## Check pandas plotting¶\n\n```\n# pec\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nnp.random.seed(42)\ndf = pd.DataFrame({'val': np.random.rand(300) })\n\n# solution\ndf.val.plot(kind='hist')\nplt.title('my plot')\nplt.show()\nplt.clf()\n\n# sct\nEx().check_or(\n    multi(\n        check_function('df.val.plot').check_args('kind').has_equal_value(),\n        check_function('matplotlib.pyplot.title').check_args(0).has_equal_value()\n    ),\n    override(\"df.val.plot(kind='hist', title='my plot')\").check_function('df.val.plot').multi(\n        check_args('kind').has_equal_value(),\n        check_args('title').has_equal_value()\n    ),\n    override(\"df['val'].plot(kind = 'hist'); plt.title('my plot')\").multi(\n        check_function('df.plot').check_args('kind').has_equal_value(),\n        check_function('matplotlib.pyplot.title').check_args(0).has_equal_value()\n    ),\n    override(\"df['val'].plot(kind='hist', title='my plot')\").check_function('df.plot').multi(\n        check_args('kind').has_equal_value(),\n        check_args('title').has_equal_value()\n    )\n)\nEx().check_function('matplotlib.pyplot.show')\nEx().check_function('matplotlib.pyplot.clf')\n```\n\n## Check object created through function call¶\n\n```\n# pec\nimport numpy as np\narr = np.array([1, 2, 3, 4, 5, 6])\n\n# solution\nresult = np.mean(arr)\n\n# sct\nEx().check_correct(\n    check_object(\"result\").has_equal_value(),\n    check_function(\"numpy.mean\").check_args(\"a\").has_equal_value()\n)\n\n# passing submissions\nresult = np.mean(arr)\nresult = np.sum(arr) / arr.size\n```\n\n## Check DataFrame¶\n\n```\n# solution\nimport pandas as pd\nmy_df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [4, 5, 6]})\n\n# sct\nEx().check_df(\"my_df\").check_keys(\"a\").has_equal_value()\n\n# passing submissions\nmy_df = pd.DataFrame({\"a\": [1, 1 + 1, 3], \"b\": [4, 5, 6]})\nmy_df = pd.DataFrame({\"b\": [4, 5,  6], \"a\": [1, 2, 3]})\n```\n\n## Check printout¶\n\n```\n# solution\nx = 3\nprint(x)\n\n# sct\nEx().has_printout(0)\n\n# passing submissions\nprint(3)\nprint(1 + 1)\nx = 4; print(x - 1)\n```\n\n## Check output¶\n\n```\n# solution\nprint(\"This is weird stuff\")\n\n# sct\nEx().has_output(r\"This is \\w* stuff\")\n\n# passing submissions\nprint(\"This is weird stuff\")\nprint(\"This is fancy stuff\")\nprint(\"This is cool stuff\")\n\n# failing submissions\nprint(\"this is weird stuff\")\nprint(\"Thisis weird stuff\")\n```\n\n## Check Multiple Choice¶\n\n```\n# solution (implicit)\n# 3 is the correct answer\n\n# sct\nEx().has_chosen(correct = 3, # 1-base indexed\n                msgs = [\"That's someone who makes soups.\",\n                        \"That's a clown who likes burgers.\",\n                        \"Correct! Head over to the next exercise!\"])\n```\n\n* \n `check_` functions typically ‘dive’ deeper into a part of the state it was passed. They are typically chained for further checking. * \n `has_` functions always return the state that they were intially passed and are used at the ‘end’ of a chain. \n\n## Objects¶\n\n* \n `check_object` (state, index, missing_msg=None, expand_msg=None, typestr='variable')¶ * \n\nCheck object existence (and equality)\n\nCheck whether an object is defined in the student’s process, and zoom in on its value in both student and solution process to inspect quality (with has_equal_value().\n\nIn\n  `pythonbackend` , both the student’s submission as well as the solution code are executed, in separate processes.  `check_object()` looks at these processes and checks if the referenced object is available in the student process. Next, you can use  `has_equal_value()` to check whether the objects in the student and solution process correspond. b'Parameters:'\n\n* index (str) – the name of the object which value has to be checked.\n * missing_msg (str) – feedback message when the object is not defined in the student process.\n * expand_msg (str) – If specified, this overrides any messages that are prepended by previous SCT chains.\n b'Example:'\n\nSuppose you want the student to create a variable\n  `x` , equal to 15: > x = 15\n\nThe following SCT will verify this:\n > Ex().check_object(\"x\").has_equal_value()\n\n* \n `check_object()` will check if the variable  `x` is defined in the student process. * \n `has_equal_value()` will check whether the value of  `x` in the solution process is the same as in the student process. \nNote that\n  `has_equal_value()` only looks at end result of a variable in the student process. In the example, how the object  `x` came about in the student’s submission, does not matter. This means that all of the following submission will also pass the above SCT: > x = 15 x = 12 + 3 x = 3; x += 12\n b'Example:'\n\nAs the previous example mentioned,\n  `has_equal_value()` only looks at the end result. If your exercise is first initializing and object and further down the script is updating the object, you can only look at the final value! \nSuppose you want the student to initialize and populate a list my_list as follows:\n > my_list = [] for i in range(20): if i % 3 == 0: my_list.append(i)\n\nThere is no robust way to verify whether my_list = [0] was coded correctly in a separate way. The best SCT would look something like this:\n > msg = \"Have you correctly initialized `my_list`?\" Ex().check_correct( check_object('my_list').has_equal_value(), multi( # check initialization: [] or list() check_or( has_equal_ast(code = \"[]\", incorrect_msg = msg), check_function('list') ), check_for_loop().multi( check_iter().has_equal_value(), check_body().check_if_else().multi( check_test().multi( set_context(2).has_equal_value(), set_context(3).has_equal_value() ), check_body().set_context(3).\\ set_env(my_list = [0]).\\ has_equal_value(name = 'my_list') ) ) ) )\n\n* \n `check_correct()` is used to robustly check whether  `my_list` was built correctly. * If\n `my_list` is not correct, both the initialization and the population code are checked. b'Example:'\n\nBecause checking object correctness incorrectly is such a common misconception, we’re adding another example:\n > import pandas as pd df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}) df['c'] = [7, 8, 9]\n\nThe following SCT would be wrong, as it does not factor in the possibility that the ‘add column\n  `c` ’ step could’ve been wrong: > Ex().check_correct( check_object('df').has_equal_value(), check_function('pandas.DataFrame').check_args(0).has_equal_value() )\n\nThe following SCT would be better, as it is specific to the steps:\n > # verify the df = pd.DataFrame(...) step Ex().check_correct( check_df('df').multi( check_keys('a').has_equal_value(), check_keys('b').has_equal_value() ), check_function('pandas.DataFrame').check_args(0).has_equal_value() ) # verify the df['c'] = [...] step Ex().check_df('df').check_keys('c').has_equal_value()\n b'Example:'\n\npythonwhat compares the objects in the student and solution process with the\n  `==` operator. For basic objects, this  `==` is operator is properly implemented, so that the objects can be effectively compared. For more complex objects that are produced by third-party packages, however, it’s possible that this equality operator is not implemented in a way you’d expect. Often, for these object types the  `==` will compare the actual object instances: > # pre exercise code class Number(): def __init__(self, n): self.n = n # solution x = Number(1) # sct that won't work Ex().check_object().has_equal_value() # sct Ex().check_object().has_equal_value(expr_code = 'x.n') # submissions that will pass this sct x = Number(1) x = Number(2 - 1)\n\nThe basic SCT like in the previous example will notwork here. Notice how we used the\n  `expr_code` argument to _override_ which value has_equal_value() is checking. Instead of checking whether x corresponds between student and solution process, it’s now executing the expression  `x.n` and seeing if the result of running this expression in both student and solution process match. \n\n* \n `is_instance` (state, inst, not_instance_msg=None)¶ * \n\nCheck whether an object is an instance of a certain class.\n  `is_instance()` can currently only be used when chained from  `check_object()` , the function that is used to ‘zoom in’ on the object of interest. b'Parameters:'\n\n* inst (class) – The class that the object should have.\n * not_instance_msg (str) – When specified, this overrides the automatically generated message in case the object does not have the expected class.\n * state (State) – The state that is passed in through the SCT chain (don’t specify this).\n b'Example:'\n\nSCT:\n > # Verify the class of arr import numpy Ex().check_object('arr').is_instance(numpy.ndarray)\n\n* \n `check_df` (state, index, missing_msg=None, not_instance_msg=None, expand_msg=None)¶ * \n\nCheck whether a DataFrame was defined and it is the right type\n  `check_df()` is a combo of  `check_object()` and  `is_instance()` that checks whether the specified object exists and whether the specified object is pandas DataFrame. \nYou can continue checking the data frame with\n  `check_keys()` function to ‘zoom in’ on a particular column in the pandas DataFrame: b'Parameters:'\n\n* index (str) – Name of the data frame to zoom in on.\n * missing_msg (str) – See\n `check_object()` . * not_instance_msg (str) – See\n `is_instance()` . * expand_msg (str) – If specified, this overrides any messages that are prepended by previous SCT chains.\n b'Example:'\n\nSuppose you want the student to create a DataFrame\n  `my_df` with two columns. The column  `a` should contain the numbers 1 to 3, while the contents of column  `b` can be anything: > import pandas as pd my_df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [\"a\", \"n\", \"y\"]})\n\nThe following SCT would robustly check that:\n > Ex().check_df(\"my_df\").multi( check_keys(\"a\").has_equal_value(), check_keys(\"b\") )\n\n* \n `check_df()` checks if  `my_df` exists (  `check_object()` behind the scenes) and is a DataFrame (  `is_instance()` ) * \n `check_keys(\"a\")` zooms in on the column  `a` of the data frame, and  `has_equal_value()` checks if the columns correspond between student and solution process. * \n `check_keys(\"b\")` zooms in on hte column  `b` of the data frame, but there’s no ‘equality checking’ happening \nThe following submissions would pass the SCT above:\n > my_df = pd.DataFrame({\"a\": [1, 1 + 1, 3], \"b\": [\"a\", \"l\", \"l\"]}) my_df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [4, 5, 6], \"c\": [7, 8, 9]})\n\n* \n `check_keys` (state, key, missing_msg=None, expand_msg=None)¶ * \n\nCheck whether an object (dict, DataFrame, etc) has a key.\n  `check_keys()` can currently only be used when chained from  `check_object()` , the function that is used to ‘zoom in’ on the object of interest. b'Parameters:'\n\n* key (str) – Name of the key that the object should have.\n * missing_msg (str) – When specified, this overrides the automatically generated message in case the key does not exist.\n * expand_msg (str) – If specified, this overrides any messages that are prepended by previous SCT chains.\n * state (State) – The state that is passed in through the SCT chain (don’t specify this).\n b'Example:'\n\nStudent code and solution code:\n > x = {'a': 2}\n\nSCT:\n > # Verify that x contains a key a Ex().check_object('x').check_keys('a') # Verify that x contains a key a and a is correct. Ex().check_object('x').check_keys('a').has_equal_value()\n\n## Function calls¶\n\n* \n `check_function` (state, name, index=0, missing_msg=None, params_not_matched_msg=None, expand_msg=None, signature=True)¶ * \n\nCheck whether a particular function is called.\n  `check_function()` is typically followed by: \n\n* \n `check_args()` to check whether the arguments were specified. In turn,  `check_args()` can be followed by  `has_equal_value()` or  `has_equal_ast()` to assert that the arguments were correctly specified. * \n `has_equal_value()` to check whether rerunning the function call coded by the student gives the same result as calling the function call as in the solution. \nChecking function calls is a tricky topic. Please visit the dedicated article for more explanation, edge cases and best practices.\n b'Parameters:'\n\n* name (str) – the name of the function to be tested. When checking functions in packages, always use the ‘full path’ of the function.\n * index (int) – index of the function call to be checked. Defaults to 0.\n * missing_msg (str) – If specified, this overrides an automatically generated feedback message in case the student did not call the function correctly.\n * params_not_matched_msg (str) – If specified, this overrides an automatically generated feedback message in case the function parameters were not successfully matched.\n * expand_msg (str) – If specified, this overrides any messages that are prepended by previous SCT chains.\n * signature (Signature) – Normally, check_function() can figure out what the function signature is, but it might be necessary to use\n `sig_from_params()` to manually build a signature and pass this along. * state (State) – State object that is passed from the SCT Chain (don’t specify this).\n b'Examples:'\n\nSCT:\n > # Verify whether arr was correctly set in np.mean Ex().check_function('numpy.mean').check_args('a').has_equal_value() # Verify whether np.mean(arr) produced the same result Ex().check_function('numpy.mean').has_equal_value()\n\n* \n `check_args` (state, name, missing_msg=None)¶ * \n\nCheck whether a function argument is specified.\n\nThis function can follow\n  `check_function()` in an SCT chain and verifies whether an argument is specified. If you want to go on and check whether the argument was correctly specified, you can can continue chaining with  `has_equal_value()` (value-based check) or  `has_equal_ast()` (AST-based check) \nThis function can also follow\n  `check_function_def()` or \n\nto see if arguments have been specified. b'Parameters:'\n\n* name (str) – the name of the argument for which you want to check if it is specified. This can also be a number, in which case it refers to the positional arguments. Named arguments take precedence.\n * missing_msg (str) – If specified, this overrides the automatically generated feedback message in case the student did specify the argument.\n * state (State) – State object that is passed from the SCT Chain (don’t specify this).\n b'Examples:'\n\nSCT:\n > # Verify whether arr was correctly set in np.mean # has_equal_value() checks the value of arr, used to set argument a Ex().check_function('numpy.mean').check_args('a').has_equal_value() # Verify whether arr was correctly set in np.mean # has_equal_ast() checks the expression used to set argument a Ex().check_function('numpy.mean').check_args('a').has_equal_ast()\n\nSCT:\n > Ex().check_function_def('my_power').multi( check_args('x') # will fail if student used y as arg check_args(0) # will still pass if student used y as arg )\n\n## Output¶\n\n* \n `has_output` (state, text, pattern=True, no_output_msg=None)¶ * \n\nSearch student output for a pattern.\n\nAmong the student and solution process, the student submission and solution code as a string, the\n  `Ex()` state also contains the output that a student generated with his or her submission. \nWith\n  `has_output()` , you can access this output and match it against a regular or fixed expression. b'Parameters:'\n\n* text (str) – the text that is searched for\n * pattern (bool) – if True (default), the text is treated as a pattern. If False, it is treated as plain text.\n * no_output_msg (str) – feedback message to be displayed if the output is not found.\n b'Example:'\n\nAs an example, suppose we want a student to print out a sentence:\n > # Print the \"This is some ... stuff\" print(\"This is some weird stuff\")\n\nThe following SCT tests whether the student prints out\n\n```\nThis is some weird stuff\n```\n\n: > # Using exact string matching Ex().has_output(\"This is some weird stuff\", pattern = False) # Using a regular expression (more robust) # pattern = True is the default msg = \"Print out ``This is some ... stuff`` to the output, \" + \\ \"fill in ``...`` with a word you like.\" Ex().has_output(r\"This is some \\w* stuff\", no_output_msg = msg)\n\n* \n `has_printout` (state, index, not_printed_msg=None, pre_code=None, name=None, copy=False)¶ * \n\nCheck if the right printouts happened.\n  `has_printout()` will look for the printout in the solution code that you specified with  `index` (0 in this case), rerun the  `print()` call in the solution process, capture its output, and verify whether the output is present in the output of the student. \nThis is more robust as\n\n```\nEx().check_function('print')\n```\n\ninitiated chains as students can use as many printouts as they want, as long as they do the correct one somewhere. b'Parameters:'\n\n* index (int) – index of the\n `print()` call in the solution whose output you want to search for in the student output. * not_printed_msg (str) – if specified, this overrides the default message that is generated when the output is not found in the student output.\n * pre_code (str) – Python code as a string that is executed before running the targeted student call. This is the ideal place to set a random seed, for example.\n * copy (bool) – whether to try to deep copy objects in the environment, such as lists, that could accidentally be mutated. Disabled by default, which speeds up SCTs.\n * state (State) – state as passed by the SCT chain. Don’t specify this explicitly.\n b'Example:'\n\nSuppose you want somebody to print out 4:\n > print(1, 2, 3, 4)\n\nThe following SCT would check that:\n > Ex().has_printout(0)\n\nAll of the following SCTs would pass:\n > print(1, 2, 3, 4) print('1 2 3 4') print(1, 2, '3 4') print(\"random\"); print(1, 2, 3, 4)\n b'Example:'\n\nWatch out:\n  `has_printout()` will effectively rerun the  `print()` call in the solution process after the entire solution script was executed. If your solution script updates the value of x after executing it,  `has_printout()` will not work. \nSuppose you have the following solution:\n > x = 4 print(x) x = 6\n\nThe following SCT will not work:\n > Ex().has_printout(0)\n\nWhy? When the\n  `print(x)` call is executed, the value of  `x` will be 6, and pythonwhat will look for the output ‘6’ in the output the student generated. In cases like these,  `has_printout()` cannot be used. b'Example:'\n\nInside a for loop\n  `has_printout()`  \nSuppose you have the following solution:\n > for i in range(5): print(i)\n\nThe following SCT will not work:\n > Ex().check_for_loop().check_body().has_printout(0)\n\nThe reason is that\n  `has_printout()` can only be called from the root state.  `Ex()` . If you want to check printouts done in e.g. a for loop, you have to use a check_function(‘print’) chain instead: > Ex().check_for_loop().check_body().\\ set_context(0).check_function('print').\\ check_args(0).has_equal_value()\n * index (int) – index of the\n\n* \n `has_no_error` (state, incorrect_msg='Have a look at the console: your code contains an error. Fix it and try again!')¶ * \n\nCheck whether the submission did not generate a runtime error.\n\nIf all SCTs for an exercise pass, before marking the submission as correct pythonwhat will automatically check whether the student submission generated an error. This means it is not needed to use\n  `has_no_error()` explicitly. \nHowever, in some cases, using\n  `has_no_error()` explicitly somewhere throughout your SCT execution can be helpful: \n\n* If you want to make sure people didn’t write typos when writing a long function name.\n * If you want to first verify whether a function actually runs, before checking whether the arguments were specified correctly.\n * More generally, if, because of the content, it’s instrumental that the script runs without errors before doing any other verifications.\n b'Parameters:'\n\nincorrect_msg – if specified, this overrides the default message if the student code generated an error.\n b'Example:'\n\nSuppose you’re verifying an exercise about model training and validation:\n > # pre exercise code import numpy as np from sklearn.model_selection import train_test_split from sklearn import datasets from sklearn import svm iris = datasets.load_iris() iris.data.shape, iris.target.shape # solution X_train, X_test, y_train, y_test = train_test_split( iris.data, iris.target, test_size=0.4, random_state=0)\n\nIf you want to make sure that\n  `train_test_split()` ran without errors, which would check if the student typed the function without typos and used sensical arguments, you could use the following SCT: > Ex().has_no_error() Ex().check_function('sklearn.model_selection.train_test_split').multi( check_args(['arrays', 0]).has_equal_value(), check_args(['arrays', 0]).has_equal_value(), check_args(['options', 'test_size']).has_equal_value(), check_args(['options', 'random_state']).has_equal_value() )\n\nIf, on the other hand, you want to fall back onto pythonwhat’s built in behavior, that checks for an error before marking the exercise as correct, you can simply leave of the\n  `has_no_error()` step. \n\n## Code¶\n\n* \n `has_code` (state, text, pattern=True, not_typed_msg=None)¶ * \n\nTest the student code.\n\nTests if the student typed a (pattern of) text. It is advised to use\n  `has_equal_ast()` instead of  `has_code()` , as it is more robust to small syntactical differences that don’t change the code’s behavior. b'Parameters:'\n\n* text (str) – the text that is searched for\n * pattern (bool) – if True (the default), the text is treated as a pattern. If False, it is treated as plain text.\n * not_typed_msg (str) – feedback message to be displayed if the student did not type the text.\n b'Example:'\n\nStudent code and solution code:\n > y = 1 + 2 + 3\n\nSCT:\n > # Verify that student code contains pattern (not robust!!): Ex().has_code(r\"1\\s*\\+2\\s*\\+3\")\n\n* \n `has_import` (state, name, same_as=False, not_imported_msg='Did you import `{{pkg}}`?', incorrect_as_msg='Did you import `{{pkg}}` as `{{alias}}`?')¶ * \n\nChecks whether student imported a package or function correctly.\n\nPython features many ways to import packages. All of these different methods revolve around the\n  `import` ,  `from` and  `as` keywords.  `has_import()` provides a robust way to check whether a student correctly imported a certain package. \nBy default,\n  `has_import()` allows for different ways of aliasing the imported package or function. If you want to make sure the correct alias was used to refer to the package or function that was imported, set  `same_as=True` . b'Parameters:'\n\n* name (str) – the name of the package that has to be checked.\n * same_as (bool) – if True, the alias of the package or function has to be the same. Defaults to False.\n * not_imported_msg (str) – feedback message when the package is not imported.\n * incorrect_as_msg (str) – feedback message if the alias is wrong.\n b'Example:'\n\nExample 1, where aliases don’t matter (defaut):\n > # solution import matplotlib.pyplot as plt # sct Ex().has_import(\"matplotlib.pyplot\") # passing submissions import matplotlib.pyplot as plt from matplotlib import pyplot as plt import matplotlib.pyplot as pltttt # failing submissions import matplotlib as mpl\n\nExample 2, where the SCT is coded so aliases do matter:\n > # solution import matplotlib.pyplot as plt # sct Ex().has_import(\"matplotlib.pyplot\", same_as=True) # passing submissions import matplotlib.pyplot as plt from matplotlib import pyplot as plt # failing submissions import matplotlib.pyplot as pltttt\n\n## has_equal_x¶\n\nRun targeted student and solution code, and compare returned value.\n\nWhen called on an SCT chain,\n  `has_equal_value()` will execute the student and solution code that is ‘zoomed in on’ and compare the returned values. b'Parameters:'\n\nor if you want to allow for different solutions other than the one coded up in the solution. b'Example:'\n\nSCT:\n > # Verify equality of arr: Ex().check_object('arr').has_equal_value() # Verify whether arr was correctly set in np.mean Ex().check_function('numpy.mean').check_args('a').has_equal_value() # Verify whether np.mean(arr) produced the same result Ex().check_function('numpy.mean').has_equal_value()\n * incorrect_msg (str) – feedback message if the returned value of the expression in the solution doesn’t match the one of the student. This feedback message will be expanded if it is used in the context of another check function, like\n\nRun targeted student and solution code, and compare output.\n\nWhen called on an SCT chain,\n  `has_equal_output()` will execute the student and solution code that is ‘zoomed in on’ and compare the output. b'Parameters:'\n\nRun targeted student and solution code, and compare generated errors.\n\nWhen called on an SCT chain,\n  `has_equal_error()` will execute the student and solution code that is ‘zoomed in on’ and compare the errors that they generate. b'Parameters:'\n\n* \n `has_equal_ast` (state, incorrect_msg=None, code=None, exact=True, append=None)¶ * \n\nTest whether abstract syntax trees match between the student and solution code.\n  `has_equal_ast()` can be used in two ways: \n\n* As a robust version of\n `has_code()` . By setting  `code` , you can look for the AST representation of  `code` in the student’s submission. But be aware that  `a` and  `a = 1` won’t match, as reading and assigning are not the same in an AST. Use \n\n```\nast.dump(ast.parse(code))\n```\n\nto see an AST representation of  `code` . * As an expression-based check when using more advanced SCT chain, e.g. to compare the equality of expressions to set function arguments.\n b'Parameters:'\n\n* incorrect_msg – message displayed when ASTs mismatch. When you specify\n `code` yourself, you have to specify this. * code – optional code to use instead of the solution AST.\n * exact – whether the representations must match exactly. If false, the solution AST only needs to be contained within the student AST (similar to using test student typed). Defaults to\n `True` , unless the  `code` argument has been specified. b'Example:'\n\nStudent and Solution Code:\n > dict(a = 'value').keys()\n\nSCT:\n > # all pass Ex().has_equal_ast() Ex().has_equal_ast(code = \"dict(a = 'value').keys()\") Ex().has_equal_ast(code = \"dict(a = 'value')\", exact = False)\n\nStudent and Solution Code:\n > import numpy as np arr = np.array([1, 2, 3, 4, 5]) np.mean(arr)\n\nSCT:\n > # Check underlying value of arugment a of np.mean: Ex().check_function('numpy.mean').check_args('a').has_equal_ast() # Only check AST equality of expression used to specify argument a: Ex().check_function('numpy.mean').check_args('a').has_equal_ast()\n * As a robust version of\n\n## Combining SCTs¶\n\n* \n `multi` (state, *tests)¶ * \n\nRun multiple subtests. Return original state (for chaining).\n\nThis function could be thought as an AND statement, since all tests it runs must pass\n b'Parameters:'\n\nThe SCT below checks two has_code cases..\n > Ex().multi(has_code('SELECT'), has_code('WHERE'))\n\nThe SCT below uses\n  `multi` to ‘branch out’ to check that the SELECT statement has both a WHERE and LIMIT clause.. > Ex().check_node('SelectStmt', 0).multi( check_edge('where_clause'), check_edge('limit_clause') )\n b'Example:'\n\nSuppose we want to verify the following function call:\n > round(1.2345, ndigits=2)\n\nThe following SCT would verify this, using\n  `multi` to ‘branch out’ the state to two sub-SCTs: > Ex().check_function('round').multi( check_args(0).has_equal_value(), check_args('ndigits').has_equal_value() )\n\n* \n `check_correct` (state, check, diagnose)¶ * \n\nAllows feedback from a diagnostic SCT, only if a check SCT fails.\n b'Parameters:'\n\n* state – State instance describing student and solution code. Can be omitted if used with Ex().\n * check – An sct chain that must succeed.\n * diagnose – An sct chain to run if the check fails.\n b'Example:'\n\nThe SCT below tests whether students query result is correct, before running diagnostic SCTs..\n > Ex().check_correct( check_result(), check_node('SelectStmt') )\n b'Example:'\n\nThe SCT below tests whether an object is correct. Only if the object is not correct, will the function calling checks be executed\n > Ex().check_correct( check_object('x').has_equal_value(), check_function('round').check_args(0).has_equal_value() )\n\n* \n `check_or` (state, *tests)¶ * \n\nTest whether at least one SCT passes.\n b'Parameters:'\n\nThe SCT below tests that the student typed either ‘SELECT’ or ‘WHERE’ (or both)..\n > Ex().check_or( has_code('SELECT'), has_code('WHERE') )\n\nThe SCT below checks that a SELECT statement has at least a WHERE c or LIMIT clause..\n > Ex().check_node('SelectStmt', 0).check_or( check_edge('where_clause'), check_edge('limit_clause') )\n b'Example:'\n\nThe SCT below tests that the student typed either ‘mean’ or ‘median’:\n > Ex().check_or( has_code('mean'), has_code('median') )\n\nIf the student didn’t type either, the feedback message generated by\n  `has_code(mean)` , the first SCT, will be presented to the student. \n\n* \n `check_not` (state, *tests, msg)¶ * \n\nRun multiple subtests that should fail. If all subtests fail, returns original state (for chaining)\n\n* This function is currently only tested in working with\n `has_code()` in the subtests. * This function can be thought as a\n `NOT(x OR y OR ...)` statement, since all tests it runs must fail * This function can be considered a direct counterpart of multi.\n b'Parameters:'\n\n* state – State instance describing student and solution code, can be omitted if used with Ex()\n * *tests – one or more sub-SCTs to run\n * msg – feedback message that is shown in case not all tests specified in\n `*tests` fail. b'Example:'\n\nThh SCT below runs two has_code cases..\n > Ex().check_not( has_code('INNER'), has_code('OUTER'), incorrect_msg=\"Don't use `INNER` or `OUTER`!\" )\n\nIf students use\n  `INNER (JOIN)` or  `OUTER (JOIN)` in their code, this test will fail. b'Example:'\n\nThe SCT fails with feedback for a specific incorrect value, defined using an override:\n > Ex().check_object('result').multi( check_not( has_equal_value(override=100), msg='100 is incorrect for reason xyz.' ), has_equal_value() )\n\nNotice that\n  `check_not` comes before the  `has_equal_value` test that checks if the student value is equal to the solution value. b'Example:'\n\nThe SCT below runs two\n  `has_code` cases: > Ex().check_not( has_code('mean'), has_code('median'), msg='Check your code' )\n\nIf students use\n  `mean` or  `median` anywhere in their code, this SCT will fail. \nNote\n\n* This function is not yet tested with all checks, please report unexpected behaviour.\n * This function can be thought as a NOT(x OR y OR …) statement, since all tests it runs must fail\n * This function can be considered a direct counterpart of multi.\n * This function is currently only tested in working with\n\n## Function/Class/Lambda definitions¶\n\nCheck whether a function was defined and zoom in on it.\n\nSuppose you want a student to create a function\n  `shout_echo()` : > def shout_echo(word1, echo=1): echo_word = word1 * echo shout_words = echo_word + '!!!' return shout_words\n\nThe following SCT robustly checks this:\n > Ex().check_function_def('shout_echo').check_correct( multi( check_call(\"f('hey', 3)\").has_equal_value(), check_call(\"f('hi', 2)\").has_equal_value(), check_call(\"f('hi')\").has_equal_value() ), check_body().set_context('test', 1).multi( has_equal_value(name = 'echo_word'), has_equal_value(name = 'shout_words') ) )\n\n* \n `check_function_def()` zooms in on the function definition of  `shout_echo` in both student and solution code (and process). * \n `check_correct()` is used to \n\n* First check whether the function gives the correct result when called in different ways (through\n `check_call()` ). * Only if these ‘function unit tests’ don’t pass,\n `check_correct()` will run the check_body() chain that dives deeper into the function definition body. This chain sets the context variables -  `word1` and  `echo` , the arguments of the function - to the values  `'test'` and  `1` respectively, again while being agnostic to the actual name of these context variables. * First check whether the function gives the correct result when called in different ways (through\n\nNotice how\n  `check_correct()` is used to great effect here: why check the function definition internals if the I/O of the function works fine? Because of this construct, all the following submissions will pass the SCT: > # passing submission 1 def shout_echo(w, e=1): ew = w * e return ew + '!!!' # passing submission 2 def shout_echo(a, b=1): return a * b + '!!!'\n b'Example:'\n  `check_args()` is most commonly used in combination with  `check_function()` to verify the arguments of function calls, but it can also be used to verify the arguments specified in the signature of a function definition. \nWe can extend the SCT for the previous example to explicitly verify the signature:\n > msg1 = \"Make sure to specify 2 arguments!\" msg2 = \"don't specify default arg!\" msg3 = \"specify a default arg!\" Ex().check_function_def('shout_echo').check_correct( multi( check_call(\"f('hey', 3)\").has_equal_value(), check_call(\"f('hi', 2)\").has_equal_value(), check_call(\"f('hi')\").has_equal_value() ), multi( has_equal_part_len(\"args\", unequal_msg=1), check_args(0).has_equal_part('is_default', msg=msg2), check_args('word1').has_equal_part('is_default', msg=msg2), check_args(1).\\ has_equal_part('is_default', msg=msg3).has_equal_value(), check_args('echo').\\ has_equal_part('is_default', msg=msg3).has_equal_value(), check_body().set_context('test', 1).multi( has_equal_value(name = 'echo_word'), has_equal_value(name = 'shout_words') ) ) )\n\n```\nhas_equal_part_len(\"args\")\n```\n\nverifies whether student and solution function definition have the same number of arguments. * \n `check_args(0)` refers to the first argument in the signature by position, and the chain checks whether the student did not specify a default as in the solution. * An alternative for the\n `check_args(0)` chain is to use  `check_args('word1')` to refer to the first argument. This is more restrictive, as the requires the student to use the exact same name. * \n `check_args(1)` refers to the second argument in the signature by position, and the chain checks whether the student specified a default, as in the solution, and whether the value of this default corresponds to the one in the solution. * The\n `check_args('echo')` chain is a more restrictive alternative for the  `check_args(1)` chain. \nNotice that support for verifying arguments is not great yet:\n\n* A lot of work is needed to verify the number of arguments and whether or not defaults are set.\n * You have to specify custom messages because pythonwhat doesn’t automatically generate messages.\n\nWe are working on it!\n\n* \n `has_equal_part_len` (state, name, unequal_msg)¶ * \n\nVerify that a part that is zoomed in on has equal length.\n\nTypically used in the context of\n  `check_function_def()`  b'Parameters:'\n\n* name (str) – name of the part for which to check the length to the corresponding part in the solution.\n * unequal_msg (str) – Message in case the lengths do not match.\n * state (State) – state as passed by the SCT chain. Don’t specify this explicitly.\n b'Examples:'\n\nStudent and solution code:\n > def shout(word): return word + '!!!'\n\nSCT that checks number of arguments:\n > Ex().check_function_def('shout').has_equal_part_len('args', 'not enough args!')\n\n* \n `check_call` (state, callstr, argstr=None, expand_msg=None)¶ * \n\nWhen checking a function definition of lambda function, prepare has_equal_x for checking the call of a user-defined function.\n b'Parameters:'\n\n* callstr (str) – call string that specifies how the function should be called, e.g. f(1, a = 2).\n `check_call()` will replace  `f` with the function/lambda you’re targeting. * argstr (str) – If specified, this overrides the way the function call is refered to in the expand message.\n * expand_msg (str) – If specified, this overrides any messages that are prepended by previous SCT chains.\n * state (State) – state object that is chained from.\n b'Example:'\n\nSCT:\n > Ex().check_function_def('my_power').multi( check_call(\"f(3)\").has_equal_value() check_call(\"f(3)\").has_equal_output() )\n * callstr (str) – call string that specifies how the function should be called, e.g. f(1, a = 2).\n\nCheck whether a class was defined and zoom in on its definition\n\nCan be chained with\n  `check_bases()` and  `check_body()` . b'Parameters:'\n\nSuppose you want to check whether a class was defined correctly:\n > class MyInt(int): def __init__(self, i): super().__init__(i + 1)\n\nThe following SCT would verify this:\n > Ex().check_class_def('MyInt').multi( check_bases(0).has_equal_ast(), check_body().check_function_def('__init__').multi( check_args('self'), check_args('i'), check_body().set_context(i = 2).multi( check_function('super', signature=False), check_function('super.__init__').check_args(0).has_equal_value() ) ) )\n\n* \n `check_class_def()` looks for the class definition itself. * With\n `check_bases()` , you can zoom in on the different basse classes that the class definition inherits from. * With\n `check_body()` , you zoom in on the class body, after which you can use other functions such as  `check_function_def()` to look for class methods. * Of course, just like for other examples, you can use\n `check_correct()` where necessary, e.g. to verify whether class methods give the right behavior with  `check_call()` before diving into the body of the method itself. \n\n```\ncheck_lambda_function\n```\n\nSuppose you want a student to create a lambda function that returns the length of an array times two:\n > lambda x: len(x)*2\n\nThe following SCT robustly checks this:\n > Ex().check_lambda_function().check_correct( multi( check_call(\"f([1])\").has_equal_value(), check_call(\"f([1, 2])\").has_equal_value() ), check_body().set_context([1, 2, 3]).has_equal_value() )\n\nzooms in on the first lambda function in both student and solution code. * \n `check_correct()` is used to \n\n* First check whether the lambda function gives the correct result when called in different ways (through\n `check_call()` ). * Only if these ‘function unit tests’ don’t pass,\n `check_correct()` will run the check_body() chain that dives deeper into the lambda function’s body. This chain sets the context variable x, the argument of the function, to the values  `[1, 2, 3]` , while being agnostic to the actual name the student used for this context variable. * First check whether the lambda function gives the correct result when called in different ways (through\n\nNotice how\n  `check_correct()` is used to great effect here: why check the function definition internals if the I/O of the function works fine? Because of this construct, all the following submissions will pass the SCT: > # passing submission 1 lambda x: len(x) + len(x) # passing submission 2 lambda y, times=2: len(y) * times\n\n## Control flow¶\n\nSuppose you want students to print out a message if\n  `x` is larger than 0: > x = 4 if x > 0: print(\"x is strictly positive\")\n\nThe following SCT would verify that:\n > Ex().check_if_else().multi( check_test().multi( set_env(x = -1).has_equal_value(), set_env(x = 1).has_equal_value(), set_env(x = 0).has_equal_value() ), check_body().check_function('print', 0).\\ check_args('value').has_equal_value() )\n\n* \n `check_if_else()` zooms in on the first if statement in the student and solution submission. * \n `check_test()` zooms in on the ‘test’ portion of the if statement,  `x > 0` in case of the solution.  `has_equal_value()` reruns this expression and the corresponding expression in the student code for different values of  `x` (set with  `set_env()` ) and compare there results. This way, you can robustly verify whether the if test was coded up correctly. If the student codes up the condition as  `0 < x` , this would also be accepted. * \n `check_body()` zooms in on the ‘body’ portion of the if statement,  `print(\"...\")` in case of the solution. With a classical  `check_function()` chain, it is verified whether the if statement contains a function  `print()` and whether its argument is set correctly. b'Example:'\n\nIn Python, when an if-else statement has an\n  `elif` clause, it is held in the orelse part. In this sense, an if-elif-else statement is represented by python as nested if-elses. More specifically, this if-else statement: > if x > 0: print(x) elif y > 0: print(y) else: print('none')\n\nIs syntactically equivalent to:\n > if x > 0: print(x) else: if y > 0: print(y) else: print('none')\n\nThe second representation has to be followed when writing the corresponding SCT:\n > Ex().check_if_else().multi( check_test(), # zoom in on x > 0 check_body(), # zoom in on print(x) check_orelse().check_if_else().multi( check_test(), # zoom in on y > 0 check_body(), # zoom in on print(y) check_orelse() # zoom in on print('none') ) )\n\nCheck whether a try except statement was coded zoom in on it.\n\nCan be chained with\n  `check_body()` ,  `check_handlers()` ,  `check_orelse()` and  `check_finalbody()` . b'Parameters:'\n\nSuppose you want to verify whether the student did a try-except statement properly:\n > do_dangerous_thing = lambda n: n try: x = do_dangerous_thing(n = 4) except ValueError as e: x = 'something wrong with inputs' except: x = 'something went wrong' finally: print('ciao!')\n\nThe following SCT can be used to verify this:\n > Ex().check_try_except().multi( check_body().\\ check_function('do_dangerous_thing').\\ check_args('n').has_equal_value(), check_handlers('ValueError').\\ has_equal_value(name = 'x'), check_handlers('all').\\ has_equal_value(name = 'x'), check_finalbody().\\ check_function('print').check_args(0).has_equal_value() )\n\n* \n `check_if_exp` (state, index=0, typestr='{{ordinal}} node', missing_msg=None, expand_msg=None)¶ * \n\nThis function works the exact same way as\n  `check_if_else()` . \n\n* \n `check_with` (state, index=0, typestr='{{ordinal}} node', missing_msg=None, expand_msg=None)¶ * \n\nCheck whether a with statement was coded zoom in on it.\n b'Parameters:'\n\n## Loops¶\n\nCan be chained with\n  `check_iter()` and  `check_body()` . b'Parameters:'\n\nSuppose you want a student to iterate over a predefined dictionary\n  `my_dict` and do the appropriate printouts: > for key, value in my_dict.items(): print(key + \" - \" + str(value))\n\nThe following SCT would verify this:\n > Ex().check_for_loop().multi( check_iter().has_equal_value(), check_body().multi( set_context('a', 1).has_equal_output(), set_context('b', 2).has_equal_output() ) )\n\n* \n `check_for_loop()` zooms in on the  `for` loop, and makes its parts available for further checking. * \n `check_iter()` zooms in on the iterator part of the for loop,  `my_dict.items()` in the solution.  `has_equal_value()` re-executes the expressions specified by student and solution and compares their results. * \n `check_body()` zooms in on the body part of the for loop, \n\n```\nprint(key + \" - \" + str(value))\n```\n\n. For different values of  `key` and  `value` , the student’s body and solution’s body are executed again and the printouts are captured and compared to see if they are equal. \nNotice how you do not need to specify the variables by name in\n  `set_context()` . pythonwhat can figure out the variable names used in both student and solution code, and can do the verification independent of that. That way, we can make the SCT robust against submissions that code the correct logic, but use different names for the context values. In other words, the following student submissions that would also pass the SCT: > # passing submission 1 my_dict = {'a': 1, 'b': 2} for k, v in my_dict.items(): print(k + \" - \" + str(v)) # passing submission 2 my_dict = {'a': 1, 'b': 2} for first, second in my_dict.items(): mess = first + \" - \" + str(second) print(mess)\n b'Example:'\n\nAs another example, suppose you want the student to build a list of doubles as follows:\n > even = [] for i in range(10): even.append(2*i)\n\nThe following SCT would robustly verify this:\n > Ex().check_correct( check_object('even').has_equal_value(), check_for_loop().multi( check_iter().has_equal_value(), check_body().set_context(2).set_env(even = []).\\ has_equal_value(name = 'even') ) )\n\n* \n `check_correct()` makes sure that we do not dive into the  `for` loop if the array  `even` is correctly populated in the end. * If\n `even` was not correctly populated,  `check_for_loop()` will zoom in on the for loop. * The\n `check_iter()` chain verifies whether range(10) (or something equivalent) was used to iterate over. * \n `check_body()` zooms in on the body, and reruns the body (  `even.append(2*i)` in the solution) for  `i` equal to 2, and even temporarily set to an empty array. Notice how we use  `set_context()` to robustly set the context value (the student can use a different variable name), while we have to explicitly set  `even` with  `set_env()` . Also notice how we use \n\n```\nhas_equal_value(name = 'even')\n```\n\ninstead of the usual  `check_object()` ;  `check_object()` can only be called from the root state  `Ex()` . b'Example:'\n\nAs a follow-up example, suppose you want the student to build a list of doubles of the even numbers only:\n > even = [] for i in range(10): if i % 2 == 0: even.append(2*i)\n\nThe following SCT would robustly verify this:\n > Ex().check_correct( check_object('even').has_equal_value(), check_for_loop().multi( check_iter().has_equal_value(), check_body().check_if_else().multi( check_test().multi( set_context(1).has_equal_value(), set_context(2).has_equal_value() ), check_body().set_context(2).\\ set_env(even = []).has_equal_value(name = 'even') ) ) )\n\nCheck whether a while loop was coded and zoom in on it.\n\nSuppose you want a student to code a while loop that counts down a counter from 50 until a multilpe of 11 is found. If it is found, the value should be printed out.\n > i = 50 while i % 11 != 0: i -= 1\n\nThe following SCT robustly verifies this:\n > Ex().check_correct( check_object('i').has_equal_value(), check_while().multi( check_test().multi( set_env(i = 45).has_equal_value(), set_env(i = 44).has_equal_value() ), check_body().set_env(i = 3).has_equal_value(name = 'i') ) )\n\n* \n `check_correct()` first checks whether the end result of  `i` is correct. If it is, the entire chain that checks the  `while` loop is skipped. * If\n `i` is not correctly calculated,  `check_while_loop()` zooms in on the while loop. * \n `check_test()` zooms in on the condition of the  `while` loop,  `i % 11 != 0` in the solution, and verifies whether the expression gives the same results for different values of  `i` , set through  `set_env()` , when comparing student and solution. * \n `check_body()` zooms in on the body of the  `while` loop, and  `has_equal_value()` checks whether rerunning this body updates  `i` as expected when  `i` is temporarily set to 3 with  `set_env()` . \n\nSuppose you expect students to create a list\n  `my_list` as follows: > my_list = [ i*2 for i in range(0,10) if i>2 ]\n\nThe following SCT would robustly verify this:\n > Ex().check_correct( check_object('my_list').has_equal_value(), check_list_comp().multi( check_iter().has_equal_value(), check_body().set_context(4).has_equal_value(), check_ifs(0).multi( set_context(0).has_equal_value(), set_context(3).has_equal_value(), set_context(5).has_equal_value() ) ) )\n\n* With\n `check_correct()` , we’re making sure that the list comprehension checking is not executed if  `my_list` was calculated properly. * If\n `my_list` is not correct, the ‘diagnose’ chain will run:  `check_list_comp()` looks for the first list comprehension in the student’s submission. * Next,\n `check_iter()` zooms in on the iterator,  `range(0, 10)` in the case of the solution.  `has_equal_value()` verifies whether the expression that the student used evaluates to the same value as the expression that the solution used. * \n `check_body()` zooms in on the body,  `i*2` in the case of the solution.  `set_context()` sets the iterator to 4, allowing for the fact that the student used another name instead of  `i` for this iterator.  `has_equal_value()` reruns the body in the student and solution code with the iterator set to 4, and checks if the results are the same. * \n `check_ifs(0)` zooms in on the first  `if` of the list comprehension,  `i>2` in case of the solution. With a series of  `set_context()` and  `has_equal_value()` , it is verifies whether this condition evaluates to the same value in student and solution code for different values of the iterator (i in the case of the solution, whatever in the case of the student). \n\nCan be chained with\n  `check_key()` ,  `check_value()` , and  `check_ifs()` . b'Parameters:'\n\nSuppose you expect students to create a dictionary\n  `my_dict` as follows: > my_dict = { m:len(m) for m in ['a', 'ab', 'abc'] }\n\nThe following SCT would robustly verify this:\n > Ex().check_correct( check_object('my_dict').has_equal_value(), check_dict_comp().multi( check_iter().has_equal_value(), check_key().set_context('ab').has_equal_value(), check_value().set_context('ab').has_equal_value() ) )\n\n* With\n `check_correct()` , we’re making sure that the dictionary comprehension checking is not executed if  `my_dict` was created properly. * If\n `my_dict` is not correct, the ‘diagnose’ chain will run:  `check_dict_comp()` looks for the first dictionary comprehension in the student’s submission. * Next,\n `check_iter()` zooms in on the iterator,  `['a', 'ab', 'abc']` in the case of the solution.  `has_equal_value()` verifies whether the expression that the student used evaluates to the same value as the expression that the solution used. * \n `check_key()` zooms in on the key of the comprehension,  `m` in the case of the solution.  `set_context()` temporaritly sets the iterator to  `'ab'` , allowing for the fact that the student used another name instead of  `m` for this iterator.  `has_equal_value()` reruns the key expression in the student and solution code with the iterator set to  `'ab'` , and checks if the results are the same. * \n `check_value()` zooms in on the value of the comprehension,  `len(m)` in the case of the solution.  `has_equal_value()` reruns the value expression in the student and solution code with the iterator set to  `'ab'` , and checks if the results are the same. \n\nCheck whether a generator expression was coded and zoom in on it.\n\nSuppose you expect students to create a generator\n  `my_gen` as follows: > my_gen = ( i*2 for i in range(0,10) )\n\nThe following SCT would robustly verify this:\n > Ex().check_correct( check_object('my_gen').has_equal_value(), check_generator_exp().multi( check_iter().has_equal_value(), check_body().set_context(4).has_equal_value() ) )\n\nHave a look at\n  `check_list_comp` to understand what’s going on; it is very similar. \n\n## State management¶\n\n* \n `override` (state, solution)¶ * \n\nOverride the solution code with something arbitrary.\n\nThere might be cases in which you want to temporarily override the solution code so you can allow for alternative ways of solving an exercise. When you use\n  `override()` in an SCT chain, the remainder of that SCT chain will run as if the solution code you specified is the only code that was in the solution. \nCheck the glossary for an example (pandas plotting)\n b'Parameters:'\n\n* solution – solution code as a string that overrides the original solution code.\n * state – State instance describing student and solution code. Can be omitted if used with Ex().\n\n* \n `disable_highlighting` (state)¶ * \n\nDisable highlighting in the remainder of the SCT chain.\n\nInclude this function if you want to avoid that pythonwhat marks which part of the student submission is incorrect.\n b'Examples:'\n\nSCT that will mark the ‘number’ portion if it is incorrect:\n > Ex().check_function('round').check_args(0).has_equal_ast()\n\nSCT chains that will not mark certain mistakes. The earlier you put the function, the more types of mistakes will no longer be highlighted:\n > Ex().disable_highlighting().check_function('round').check_args(0).has_equal_ast() Ex().check_function('round').disable_highlighting().check_args(0).has_equal_ast() Ex().check_function('round').check_args(0).disable_highlighting().has_equal_ast()\n\n* \n `set_context` (state, *args, **kwargs)¶ * \n\nUpdate context values for student and solution environments.\n\nWhen\n  `has_equal_x()` is used after this, the context values (in  `for` loops and function definitions, for example) will have the values specified through his function. It is the function equivalent of the  `context_vals` argument of the  `has_equal_x()` functions. \n\n* Note 1: excess args and unmatched kwargs will be unused in the student environment.\n * Note 2: When you try to set context values that don’t match any target variables in the solution code,\n `set_context()` raises an exception that lists the ones available. * Note 3: positional arguments are more robust to the student using different names for context values.\n * Note 4: You have to specify arguments either by position, either by name. A combination is not possible.\n b'Example:'\n\nSolution code:\n > total = 0 for i in range(10): print(i ** 2)\n\nStudent submission that will pass (different iterator, different calculation):\n > total = 0 for j in range(10): print(j * j)\n\nSCT:\n > # set_context is robust against different names of context values. Ex().check_for_loop().check_body().multi( set_context(1).has_equal_output(), set_context(2).has_equal_output(), set_context(3).has_equal_output() ) # equivalent SCT, by setting context_vals in has_equal_output() Ex().check_for_loop().check_body().\\ multi([s.has_equal_output(context_vals=[i]) for i in range(1, 4)])\n\n* \n `set_env` (state, **kwargs)¶ * \n\nUpdate/set environemnt variables for student and solution environments.\n\nWhen\n  `has_equal_x()` is used after this, the variables specified through this function will be available in the student and solution process. Note that you will not see these variables in the student process of the state produced by this function: the values are saved on the state and are only added to the student and solution processes when  `has_equal_ast()` is called. b'Example:'\n\nStudent and Solution Code:\n > a = 1 if a > 4: print('pretty large')\n\nSCT:\n > # check if condition works with different values of a Ex().check_if_else().check_test().multi( set_env(a = 3).has_equal_value(), set_env(a = 4).has_equal_value(), set_env(a = 5).has_equal_value() ) # equivalent SCT, by setting extra_env in has_equal_value() Ex().check_if_else().check_test().\\ multi([has_equal_value(extra_env={'a': i}) for i in range(3, 6)])\n\n## Checking files¶\n\n* \n `check_file` (state: protowhat.State.State, path, missing_msg='Did you create the file `{}`?', is_dir_msg='Want to check the file `{}`, but found a directory.', parse=True, solution_code=None)¶ * \n\nTest whether file exists, and make its contents the student code.\n b'Parameters:'\n\n* state – State instance describing student and solution code. Can be omitted if used with Ex().\n * path – expected location of the file\n * missing_msg – feedback message if no file is found in the expected location\n * is_dir_msg – feedback message if the path is a directory instead of a file\n * parse – If\n `True` (the default) the content of the file is interpreted as code in the main exercise technology. This enables more checks on the content of the file. * solution_code – this argument can be used to pass the expected code for the file so it can be used by subsequent checks.\n\nThis SCT fails if the file is a directory.\n b'Example:'\n\nTo check if a user created the file\n  `my_output.txt` in the subdirectory  `resources` of the directory where the exercise is run, use this SCT: > Ex().check_file(\"resources/my_output.txt\", parse=False)\n\n* \n `has_dir` (state: protowhat.State.State, path, msg='Did you create a directory `{}`?')¶ * \n\nTest whether a directory exists.\n b'Parameters:'\n\n* state – State instance describing student and solution code. Can be omitted if used with Ex().\n * path – expected location of the directory\n * msg – feedback message if no directory is found in the expected location\n b'Example:'\n\nTo check if a user created the subdirectory\n  `resources` in the directory where the exercise is run, use this SCT: > Ex().has_dir(\"resources\")\n\n* \n `run` (state, relative_working_dir=None, solution_dir='../solution', run_solution=True)¶ * \n\nRun the focused student and solution code in the specified location\n\nThis function can be used after\n  `check_file` to execute student and solution code. The arguments allow configuring the correct context for execution. \nSCT functions chained after this one that execute pieces of code (custom expressions or the focused part of a file) execute in the same student and solution locations as the file.\n\nThis function does not execute the file itself, but code in memory. This can have an impact when:\n\n* the solution code imports from a different file in the expected solution (code that is not installed)\n * using functionality depending on e.g.\n `__file__` and  `inspect`  \nWhen the expected code has imports from a different file that is part of the exercise, it can only work if the solution code provided earlier does not have these imports but instead has all that functionality inlined.\n b'Parameters:'\n\n* relative_working_dir (str) – if specified, this relative path is the subdirectory inside the student and solution context in which the code is executed\n * solution_dir (str) – a relative path,\n `solution` by default, that sets the root of the solution context, relative to that of the student execution context * state (State) – state as passed by the SCT chain. Don’t specify this explicitly.\n\nIf\n  `relative_working_dir` is not set, it will be the directory the file was loaded from by  `check_file` and fall back to the root of the student execution context (the working directory pythonwhat runs in). \nThe\n  `solution_dir` helps to prevent solution side effects from conflicting with those of the student. If the set or derived value of  `relative_working_dir` is an absolute path,  `relative_working_dir` will not be used to form the solution execution working directory: the solution code will be executed in the root of the solution execution context. b'Example:'\n\nSuppose the student and solution have a file\n  `script.py` in  `/home/repl/` : > if True: a = 1 print(\"Hi!\")\n\nWe can check it with this SCT (with\n  `file_content` containing the expected file content): > Ex().check_file( \"script.py\", solution_code=file_content ).run().multi( check_object(\"a\").has_equal_value(), has_printout(0) )\n\n## Bash history checks¶\n\n* \n `get_bash_history` (full_history=False, bash_history_path=None)¶ * \n\nGet the commands in the bash history\n b'Parameters:'\n\n* full_history (bool) – if true, returns all commands in the bash history, else only return the commands executed after the last bash history info update\n * bash_history_path (str | Path) – path to the bash history file\n b'Returns:'\n\na list of commands (empty if the file is not found)\n\nImport from\n\n* \n `has_command` (state, pattern, msg, fixed=False, commands=None)¶ * \n\nTest whether the bash history has a command matching the pattern\n b'Parameters:'\n\n* state – State instance describing student and solution code. Can be omitted if used with Ex().\n * pattern – text that command must contain (can be a regex pattern or a simple string)\n * msg – feedback message if no matching command is found\n * fixed – whether to match text exactly, rather than using regular expressions\n * commands – the bash history commands to check against. By default this will be all commands since the last bash history info update. Otherwise pass a list of commands to search through, created by calling the helper function\n `get_bash_history()` . \nNote\n\nThe helper function\n\n```\nupdate_bash_history_info(bash_history_path=None)\n```\n\nneeds to be called in the pre-exercise code in exercise types that don’t have built-in support for bash history features. \nNote\n\nIf the bash history info is updated every time code is submitted (by using\n\n```\nupdate_bash_history_info()\n```\n\nin the pre-exercise code), it’s advised to only use this function as the second part of a  `check_correct()` to help students debug the command they haven’t correctly run yet. Look at the examples to see what could go wrong. \nIf bash history info is only updated at the start of an exercise, this can be used everywhere as the (cumulative) commands from all submissions are known.\n b'Example:'\n\nThe goal of an exercise is to use\n  `man` . \nIf the exercise doesn’t have built-in support for bash history SCTs, update the bash history info in the pre-exercise code:\n > update_bash_history_info()\n\nIn the SCT, check whether a command with\n  `man` was used: > Ex().has_command(\"$man\\s\", \"Your command should start with ``man ...``.\")\n b'Example:'\n\nThe goal of an exercise is to use\n  `touch` to create two files. \nIn the pre-exercise code, put:\n > update_bash_history_info()\n\nThis SCT can cause problems:\n > Ex().has_command(\"touch.*file1\", \"Use `touch` to create `file1`\") Ex().has_command(\"touch.*file2\", \"Use `touch` to create `file2`\")\n\nIf a student submits after running\n\n```\ntouch file0 && touch file1\n```\n\nin the console, they will get feedback to create  `file2` . If they submit again after running  `touch file2` in the console, they will get feedback to create  `file1` , since the SCT only has access to commands after the last bash history info update (only the second command in this case). Only if they execute all required commands in a single submission the SCT will pass. \nA better SCT in this situation checks the outcome first and checks the command to help the student achieve it:\n > Ex().check_correct( check_file('file1', parse=False), has_command(\"touch.*file1\", \"Use `touch` to create `file1`\") ) Ex().check_correct( check_file('file2', parse=False), has_command(\"touch.*file2\", \"Use `touch` to create `file2`\") )\n\n* \n `prepare_validation` (state: protowhat.State.State, commands: List[str], bash_history_path: Optional[str] = None) → protowhat.State.State¶ * \n\nLet the exercise validation know what shell commands are required to complete the exercise\n\n```\nfrom protowhat.checks import prepare_validation\n```\n\n. b'Parameters:'\n\n* state – State instance describing student and solution code. Can be omitted if used with Ex().\n * commands – List of strings that a student is expected to execute\n * bash_history_path (str | Path) – path to the bash history file\n b'Example:'\n\nThe goal of an exercise is to run a build and check the output.\n\nAt the start of the SCT, put:\n > Ex().prepare_validation([\"make\", \"cd build\", \"ls\"])\n\nFurther down you can now use\n  `has_command` . \n\n```\nupdate_bash_history_info\n```\n\n(bash_history_path=None)¶ * \n\nStore the current number of commands in the bash history\n  `get_bash_history` can use this info later to get only newer commands. \nDepending on the wanted behaviour this function should be called at the start of the exercise or every time the exercise is submitted.\n\n## Electives¶\n\n* \n `has_chosen` (state, correct, msgs)¶ * \n\nTest multiple choice exercise.\n\nTest for a MultipleChoiceExercise. The correct answer (as an integer) and feedback messages are passed to this function.\n b'Parameters:'\n\n* correct (int) – the index of the correct answer (should be an instruction). Starts at 1.\n * msgs (list(str)) – a list containing all feedback messages belonging to each choice of the student. The list should have the same length as the number of options.\n\n* \n `success_msg` (message)¶ * \n\nSet the succes message of the sct. This message will be the feedback if all tests pass. :param message: A string containing the feedback message. :type message: str\n\n* \n `allow_errors` (state)¶ * \n\nAllow running the student code to generate errors.\n\nThis has to be used only once for every time code is executed or a different xwhat library is used. In most exercises that means it should be used just once.\n b'Example:'\n\nThe following SCT allows the student code to generate errors:\n > Ex().allow_errors()\n\n* \n `fail` (state, msg='fail')¶ * \n\nAlways fails the SCT, with an optional msg.\n\nThis function takes a single argument,\n  `msg` , that is the feedback given to the student. Note that this would be a terrible idea for grading submissions, but may be useful while writing SCTs. For example, failing a test will highlight the code as if the previous test/check had failed. b'Example:'\n\nAs a trivial SCT example,\n > Ex().check_for_loop().check_body().fail()\n\nThis can also be helpful for debugging SCTs, as it can be used to stop testing as a given point.\n\n## Basic functionality¶\n\n Take the following example that checks whether a student used the `round()` function correctly: \n\n```\n# solution\nround(2.718282, ndigits = 3)\n\n# sct\nEx().check_function(\"round\").multi(\n    check_args(\"number\").has_equal_value(),\n    check_args(\"ndigits\").has_equal_value()\n)\n\n# submissions that pass:\nround(2.718282, 3)\nround(2.718282, ndigits = 3\nround(number=2.718282, ndigits=3)\nround(ndigits=3, number=2.718282)\nval=2.718282; dig=3; round(val, dig)\nval=2.718282; dig=3; round(number=val, dig)\nint_part = 2; dec_part = 0.718282; round(int_part + dec_part, 3)\n```\n\n* check_function() checks whether\n `round()` is called by the student, and parses all the arguments. * \n `check_args()` checks whether a certain argument was specified, and zooms in on the expression used to specify that argument. * \n `has_equal_value()` will rerun the expressions used to specify the arguments in both student and solution process, and compare the results. \nNote\n In `check_args()` you can refer to the argument of a function call both by argument name and by position. \n\n### Customizations¶\n\n If you only want to check the `number` parameter, just don’t include a second chain with \n\n```\ncheck_args(\"ndigits\")\n```\n\n: \n\n```\nEx().check_function(\"round\").check_args(\"number\").has_equal_value()\n```\n\n If you only want to check whether the `number` parameter was specified, but not that it was specified correctly, drop  `has_equal_value()` : \n\n```\nEx().check_function(\"round\").check_args(\"number\")\n```\n\n If you just want to check whether the function was called, drop `check_args()` : \n\n```\nEx().check_function(\"round\")\n```\n\n If you want to compare the ‘string versions’ of the expressions used to set the arguments instead of the evaluated result of these expressions, you can use `has_equal_ast()` instead of  `has_equal_value()` : \nNow, the following submissions would fail:\n\n```\nval=2.718282; dig=3; round(val, dig)\n```\n\n– the string representation of  `val` in the student code is compared to  `2.718282` in the solution code. * \n\n```\nval=2.718282; dig=3; round(number=val, dig)\n```\n\n– same * \n\n```\nint_part = 2; dec_part = 0.718282; round(int_part + dec_part, 3)\n```\n\n– the string representation of  `int_part + dec_part` in the student code is compered to  `2.718282` in the solution code. \nAs you can see, doing exact string comparison of arguments is not a good idea here, as it is very inflexible. There are cases, however, where it makes sense to use this, e.g. when there are very big objects passed to functions, and you don’t want to spend the processing power to fetch these objects from the student and solution processes.\n\n## Functions in packages¶\n\n If you’re testing whether function calls of particular packages are used correctly, you should always refer to these functions with their ‘full name’. Suppose you want to test whether the function `show` of  `matplotlib.pyplot` was called, use this SCT: \n\n```\nEx().check_function(\"matplotlib.pyplot.show\")\n```\n\n  `check_function()` can handle it when a student used aliases for the python packages (all  `import` and  `import * from *` calls are supported).\nIf the student did not properly call the function,  `check_function()` will automatically generate a feedback message that corresponds to how the student imported the modules/functions. \n\n## has_equal_value? has_equal_ast?¶\n\n In the customizations section above, you could already notice the difference between `has_equal_value()` and  `has_equal_ast()` for checking\nwhether arguments are correct. The former reruns the expression used to specify the argument in both student and solution process\nand compares their results, while the latter simply compares the expression’s AST representations. Clearly, the former is more robust, but there\nare some cases in which  `has_equal_ast()` can be useful: \n\n* For better feedback. When using\n `has_equal_ast()` , the ‘expected x got y’ message that is automatically generated when the arguments don’t match up will use the actual expressions used.  `has_equal_value()` will use string representations of the evaluations of the expressions, if they make sense, and this is typically less useful. * To avoid very expensive object comparisons. If you are 100% sure that the object people have to pass as an argument is already correct (because you checked it earlier in the SCT or because it was already specified in the pre exercise code) and doing an equality check on this object between student and solution project is likely going to be expensive, then you can safely use\n `has_equal_ast()` to speed things up. * If you want to save yourself the trouble of building exotic contexts. You’ll often find yourself checking function calls in e.g. a for loop. Typically, these function calls will use objects that were generated inside the loop. To easily unit test the body of a for loop, you’ll typically have to use\n `set_context()` and  `set_env()` . For exotic for loops, this can become tricky, and it might be a quick fix to be a little more specific about the object names people should use, and just use  `has_equal_ast()` for the argument comparison. That way, you’re bypassing the need to build up a context in the student/solution process and do object comparisions. \n\n## Signatures¶\n\n The `round()` example earlier in this article showed that a student can call the function in a multitude of ways,\nspecifying arguments by position, by keyword or a mix of those. To be robust against this, pythonwhat uses the concept of argument binding. More specifically, each function has a function signature. Given this signature and the way the function was called, argument binding can map each parameter you specified to an argument. This small demo fetches the signature of the `open` function and tries to\nbind arguments that have been specified in two different ways. Notice how the resulting bound arguments are the same: \n\n>>> sig = inspect.signature(open)\n\n>>> sig\n>> sig.bind('my_file.txt', mode = 'r')\n>> sig.bind(file = 'my_file.txt', mode = 'r')\n\n```\n\n When you’re using `check_args()` you are actually selecting these bound arguments.\nThis works fine for functions like  `round()` and  `open()` that have a list of named arguments,\nbut things get tricky when dealing with functions that take  `*args` and  `*kwargs` . \n\n `*args` example¶ Python allows functions to take a variable number of unnamed arguments through `*args` , like this function: \n\n```\ndef multiply(*args):\n    res = 1\n    for num in args:\n        res *= num\n    return res\n```\n\n>>> inspect.signature(multiply)\n>> sig = inspect.signature(multiply)\n\n>>> sig\n>> sig.bind(1, 2)\n>> sig.bind(3, 4, 5)\n\n```\n\n Notice how now the list of arguments is grouped under a tuple with the name `args` in the bound arguments.\nTo be able to check each of these arguments individually, pythonwhat allows you to do repeated indexing in  `check_args()` .\nInstead of specifying the name of an argument, you can specify a list of indices: \n\n```\n# solution to check against\nmultiply(2, 3, 4)\n\n# corresponding SCT\nEx().check_function(\"multiply\").multi(\n    check_args([\"args\", 0]).has_equal_value(),\n    check_args([\"args\", 1]).has_equal_value(),\n    check_args([\"args\", 2]).has_equal_value()\n)\n```\n\n The `check_args()` subchains each zoom in on a particular tuple element of the bound  `args` argument. \n\n `**kwargs` example¶ Python allows functions to take a variable number of named arguments through `**kwargs` , like this function: \n\n```\ndef my_dict(**kwargs):\n    return dict(**kwargs)\n```\n\n>>> sig = inspect.signature(my_dict)\n\n>>> sig.bind(a = 1, b = 2)\n>> sig.bind(c = 2, b = 3)\n\n```\n\n Notice how now the list of arguments is grouped under a dictionary name `kwargs` in the bound arguments.\nTo be able to check each of these arguments individually, pythonwhat allows you to do repeated indexing in  `check_args()` .\nInstead of specifying the name of an argument, you can specify a list of indices: \n\n```\n# solution to check against\nmy_dict(a = 1, b = 2)\n\n# corresponding SCT\nEx().check_function(\"my_dict\").multi(\n    check_args([\"kwargs\", \"a\"]).has_equal_value(),\n    check_args([\"kwargs\", \"b\"]).has_equal_value()\n)\n```\n\n The `check_args()` subchains each zoom in on a particular dictionary element of the bound  `kwargs` argument. \n\n### Manual signatures¶\n\n Unfortunately for a lot of Python’s built-in functions no function signature is readily available because the function has been implemented in C code. To work around this, pythonwhat already includes manually specified signatures for functions such as `print()` ,  `str()` ,  `hasattr()` , etc,\nbut it’s still possible that some signatures are missing. That’s why `check_function()` features a  `signature` parameter, that is  `True` by default.\nIf pythonwhat can’t retrieve a signature for the function you want to test,\nyou can pass an object of the class  `inspect.Signature` to the  `signature` parameter. Suppose, for the sake of example, that `check_function()` can’t find a signature for the  `round()` function.\nIn a real situation, you will be informed about a missing signature through a backend error.\nTo be able to implement this SCT, you can use the  `sig_from_params()` function: \n\n```\nsig = sig_from_params(param(\"number\", param.POSITIONAL_OR_KEYWORD),\n                      param(\"ndigits\", param.POSITIONAL_OR_KEYWORD, default=0))\nEx().check_function(\"round\", signature=sig).multi(\n    check_args(\"number\").has_equal_value(),\n    check_args(\"ndigits\").has_equal_value()\n)\n```\n\n You can pass `sig_from_params()` as many parameters as you want.  `param` is an alias of the  `Parameter` class that’s inside the  `inspect` module.\n- The first argument of  `param()` should be the name of the parameter,\n- The second argument should be the ‘kind’ of parameter. \n\n```\nparam.POSITIONAL_OR_KEYWORD\n```\n\ntells  `check_function` that the parameter can be specified either through a positional argument or through a keyword argument.\nOther common possibilities are \n\n```\nparam.POSITIONAL_ONLY\n```\n\nand  `param.KEYWORD_ONLY` (for a full list, refer to the docs).\n- The third optional argument allows you to specify a default value for the parameter. \nNote\n\nIf you find vital Python functions that are used very often and that are not included in pythonwhat by default, you can let us know and we’ll add the function to our list of manual signatures.\n\n## Multiple function calls¶\n\n Inside `check_function()` the  `index` argument (  `0` by default), becomes important when there are several calls of the same function.\nSuppose that your exercise requires the student to call the  `round()` function twice: once on  `pi` and once on Euler’s number: \n\n```\n# Call round on pi\nround(3.14159, 3)\n\n# Call round on e\nround(2.71828, 3)\n```\n\nTo test both these function calls, you’ll need the following SCT:\n\n```\nEx().check_function(\"round\", 0).multi(\n    check_args(\"number\").has_equal_value()\n    check_args(\"ndigits\").has_equal_value()\n)\nEx().check_function(\"round\", 1).multi(\n    check_args(\"number\").has_equal_value()\n    check_args(\"ndigits\").has_equal_value()\n)\n```\n\n The first `check_function()` chain, where  `index=0` , looks for the first call of  `round()` in both student solution code,\nwhile  `check_funtion()` with  `index=1` will look for the second function call. After this, the rest of the SCT chain behaves as before. \n\n## Methods¶\n\n Methods are Python functions that are called on objects. For testing this, you can also use `check_function()` .\nConsider the following examples, that calculates the  `mean()` of the column  `a` in the pandas data frame  `df` : \n\n```\n# pec\nimport pandas as pd\ndf = pd.DataFrame({ 'a': [1, 2, 3, 4] })\n\n# solution\ndf.a.mean()\n\n# sct\nEx().check_function('df.a.mean').has_equal_value()\n```\n```\n\n The SCT is checking whether the method `df.a.mean` was called in the student code, and whether rerunning the call in both student and solution process is returning the same result. \nAs a more advanced example, consider this example of chained method calls:\n\n# sct\nEx().check_function('df.groupby').check_args(0).has_equal_value()\nEx().check_function('df.groupby.mean', signature=sig_from_obj('df.mean')).has_equal_value()\n```\n\n* The first SCT is checking whether\n `df.groupby()` was called and whether the argument for  `df.groupby()` was specified correctly to be  `'type'` . * The second SCT is first checking whether\n `df.groupby.mean()` was called and whether calling it gives the right result. Notice several things: \n\n* We describe the entire chain of method calls, leaving out the parentheses and arguments used for method calls in between.\n * We use\n `sig_from_obj()` to manually specify a Python expression that pythonwhat can use to derive the signature from. If the string you use to describe the function to check evaluates to a method or function in the solution process, like for  `'df.groupby'` , pythonwhat can figure out the signature. However, for  `'df.groupby.mean'` will not evaluate to a method object in the solution process, so we need to manually specify a valid expression that will evaluate to a valid signature with  `sig_from_obj()` . In this example, you are only checking whether the function is called and whether rerunning it gives the correct result. You are not checking the actual arguments, so there’s actually no point in trying to match the function call to its signature. In cases like this, you can set `signature=False` , which skips the fetching of a signature and the binding or arguments altogether: \n\n# sct\nEx().check_function('df.groupby').check_args(0).has_equal_value()\nEx().check_function('df.groupby.mean', signature=False).has_equal_value()\n```\n\nWarning\n Watch out with disabling signature binding as a one-stop solution to make your SCT run without errors. If there are arguments to check, argument binding makes sure that various ways of calling the function can all work. Setting `signature=False` will skip this binding, which can\ncause your SCT to mark perfectly valid student submissions as incorrect! \nNote\n You can also use the `sig_from_params()` function to manually build the signature from scratch,\nbut this this more work than simply specifying the function object as a string from which to extract the signature."}}},{"rowIdx":473,"cells":{"project":{"kind":"string","value":"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/nginx/armnginx/v2"},"source":{"kind":"string","value":"go"},"language":{"kind":"string","value":"Go"},"content":{"kind":"string","value":"README\n [¶](#section-readme)\n---\n\n### Azure Nginx Module for Go\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/nginx/armnginx/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/nginx/armnginx/v2)\n\nThe `armnginx` module provides operations for working with Azure Nginx.\n\n[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/nginx/armnginx)\n\n### Getting started\n\n#### Prerequisites\n\n* an [Azure subscription](https://azure.microsoft.com/free/)\n* Go 1.19 or above\n\n#### Install the package\n\nThis project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.\n\nInstall the Azure Nginx module:\n```\ngo get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/nginx/armnginx/v2\n```\n#### Authorization\n\nWhen creating a client, you will need to provide a credential for authenticating with Azure Nginx. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.\n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\n```\nFor more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).\n\n#### Client Factory\n\nAzure Nginx module consists of one or more clients. We provide a client factory which could be used to create any client in this module.\n```\nclientFactory, err := armnginx.NewClientFactory(, cred, nil)\n```\nYou can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).\n```\noptions := arm.ClientOptions {\n    ClientOptions: azcore.ClientOptions {\n        Cloud: cloud.AzureChina,\n    },\n}\nclientFactory, err := armnginx.NewClientFactory(, cred, &options)\n```\n#### Clients\n\nA client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.\n```\nclient := clientFactory.NewDeploymentsClient()\n```\n#### Provide Feedback\n\nIf you encounter bugs or have suggestions, please\n[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Nginx` label.\n\n### Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.\nFor details, visit .\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label,\ncomment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the\n[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information, see the\n[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\nor contact [](mailto:) with any additional questions or comments.\n\nDocumentation\n [¶](#section-documentation)\n---\n\n \n### Index [¶](#pkg-index)\n\n* [type Certificate](#Certificate)\n* + [func (c Certificate) MarshalJSON() ([]byte, error)](#Certificate.MarshalJSON)\n\t+ [func (c *Certificate) UnmarshalJSON(data []byte) error](#Certificate.UnmarshalJSON)\n* [type CertificateListResponse](#CertificateListResponse)\n* + [func (c CertificateListResponse) MarshalJSON() ([]byte, error)](#CertificateListResponse.MarshalJSON)\n\t+ [func (c *CertificateListResponse) UnmarshalJSON(data []byte) error](#CertificateListResponse.UnmarshalJSON)\n* [type CertificateProperties](#CertificateProperties)\n* + [func (c CertificateProperties) MarshalJSON() ([]byte, error)](#CertificateProperties.MarshalJSON)\n\t+ [func (c *CertificateProperties) UnmarshalJSON(data []byte) error](#CertificateProperties.UnmarshalJSON)\n* [type CertificatesClient](#CertificatesClient)\n* + [func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredential, ...) (*CertificatesClient, error)](#NewCertificatesClient)\n* + [func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[CertificatesClientCreateOrUpdateResponse], error)](#CertificatesClient.BeginCreateOrUpdate)\n\t+ [func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[CertificatesClientDeleteResponse], error)](#CertificatesClient.BeginDelete)\n\t+ [func (client *CertificatesClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, ...) (CertificatesClientGetResponse, error)](#CertificatesClient.Get)\n\t+ [func (client *CertificatesClient) NewListPager(resourceGroupName string, deploymentName string, ...) *runtime.Pager[CertificatesClientListResponse]](#CertificatesClient.NewListPager)\n* [type CertificatesClientBeginCreateOrUpdateOptions](#CertificatesClientBeginCreateOrUpdateOptions)\n* [type CertificatesClientBeginDeleteOptions](#CertificatesClientBeginDeleteOptions)\n* [type CertificatesClientCreateOrUpdateResponse](#CertificatesClientCreateOrUpdateResponse)\n* [type CertificatesClientDeleteResponse](#CertificatesClientDeleteResponse)\n* [type CertificatesClientGetOptions](#CertificatesClientGetOptions)\n* [type CertificatesClientGetResponse](#CertificatesClientGetResponse)\n* [type CertificatesClientListOptions](#CertificatesClientListOptions)\n* [type CertificatesClientListResponse](#CertificatesClientListResponse)\n* [type ClientFactory](#ClientFactory)\n* + [func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, ...) (*ClientFactory, error)](#NewClientFactory)\n* + [func (c *ClientFactory) NewCertificatesClient() *CertificatesClient](#ClientFactory.NewCertificatesClient)\n\t+ [func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient](#ClientFactory.NewConfigurationsClient)\n\t+ [func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient](#ClientFactory.NewDeploymentsClient)\n\t+ [func (c *ClientFactory) NewOperationsClient() *OperationsClient](#ClientFactory.NewOperationsClient)\n* [type Configuration](#Configuration)\n* + [func (c Configuration) MarshalJSON() ([]byte, error)](#Configuration.MarshalJSON)\n\t+ [func (c *Configuration) UnmarshalJSON(data []byte) error](#Configuration.UnmarshalJSON)\n* [type ConfigurationFile](#ConfigurationFile)\n* + [func (c ConfigurationFile) MarshalJSON() ([]byte, error)](#ConfigurationFile.MarshalJSON)\n\t+ [func (c *ConfigurationFile) UnmarshalJSON(data []byte) error](#ConfigurationFile.UnmarshalJSON)\n* [type ConfigurationListResponse](#ConfigurationListResponse)\n* + [func (c ConfigurationListResponse) MarshalJSON() ([]byte, error)](#ConfigurationListResponse.MarshalJSON)\n\t+ [func (c *ConfigurationListResponse) UnmarshalJSON(data []byte) error](#ConfigurationListResponse.UnmarshalJSON)\n* [type ConfigurationPackage](#ConfigurationPackage)\n* + [func (c ConfigurationPackage) MarshalJSON() ([]byte, error)](#ConfigurationPackage.MarshalJSON)\n\t+ [func (c *ConfigurationPackage) UnmarshalJSON(data []byte) error](#ConfigurationPackage.UnmarshalJSON)\n* [type ConfigurationProperties](#ConfigurationProperties)\n* + [func (c ConfigurationProperties) MarshalJSON() ([]byte, error)](#ConfigurationProperties.MarshalJSON)\n\t+ [func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error](#ConfigurationProperties.UnmarshalJSON)\n* [type ConfigurationsClient](#ConfigurationsClient)\n* + [func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, ...) (*ConfigurationsClient, error)](#NewConfigurationsClient)\n* + [func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error)](#ConfigurationsClient.BeginCreateOrUpdate)\n\t+ [func (client *ConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[ConfigurationsClientDeleteResponse], error)](#ConfigurationsClient.BeginDelete)\n\t+ [func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, ...) (ConfigurationsClientGetResponse, error)](#ConfigurationsClient.Get)\n\t+ [func (client *ConfigurationsClient) NewListPager(resourceGroupName string, deploymentName string, ...) *runtime.Pager[ConfigurationsClientListResponse]](#ConfigurationsClient.NewListPager)\n* [type ConfigurationsClientBeginCreateOrUpdateOptions](#ConfigurationsClientBeginCreateOrUpdateOptions)\n* [type ConfigurationsClientBeginDeleteOptions](#ConfigurationsClientBeginDeleteOptions)\n* [type ConfigurationsClientCreateOrUpdateResponse](#ConfigurationsClientCreateOrUpdateResponse)\n* [type ConfigurationsClientDeleteResponse](#ConfigurationsClientDeleteResponse)\n* [type ConfigurationsClientGetOptions](#ConfigurationsClientGetOptions)\n* [type ConfigurationsClientGetResponse](#ConfigurationsClientGetResponse)\n* [type ConfigurationsClientListOptions](#ConfigurationsClientListOptions)\n* [type ConfigurationsClientListResponse](#ConfigurationsClientListResponse)\n* [type CreatedByType](#CreatedByType)\n* + [func PossibleCreatedByTypeValues() []CreatedByType](#PossibleCreatedByTypeValues)\n* [type Deployment](#Deployment)\n* + [func (d Deployment) MarshalJSON() ([]byte, error)](#Deployment.MarshalJSON)\n\t+ [func (d *Deployment) UnmarshalJSON(data []byte) error](#Deployment.UnmarshalJSON)\n* [type DeploymentListResponse](#DeploymentListResponse)\n* + [func (d DeploymentListResponse) MarshalJSON() ([]byte, error)](#DeploymentListResponse.MarshalJSON)\n\t+ [func (d *DeploymentListResponse) UnmarshalJSON(data []byte) error](#DeploymentListResponse.UnmarshalJSON)\n* [type DeploymentProperties](#DeploymentProperties)\n* + [func (d DeploymentProperties) MarshalJSON() ([]byte, error)](#DeploymentProperties.MarshalJSON)\n\t+ [func (d *DeploymentProperties) UnmarshalJSON(data []byte) error](#DeploymentProperties.UnmarshalJSON)\n* [type DeploymentUpdateParameters](#DeploymentUpdateParameters)\n* + [func (d DeploymentUpdateParameters) MarshalJSON() ([]byte, error)](#DeploymentUpdateParameters.MarshalJSON)\n\t+ [func (d *DeploymentUpdateParameters) UnmarshalJSON(data []byte) error](#DeploymentUpdateParameters.UnmarshalJSON)\n* [type DeploymentUpdateProperties](#DeploymentUpdateProperties)\n* + [func (d DeploymentUpdateProperties) MarshalJSON() ([]byte, error)](#DeploymentUpdateProperties.MarshalJSON)\n\t+ [func (d *DeploymentUpdateProperties) UnmarshalJSON(data []byte) error](#DeploymentUpdateProperties.UnmarshalJSON)\n* [type DeploymentsClient](#DeploymentsClient)\n* + [func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, ...) (*DeploymentsClient, error)](#NewDeploymentsClient)\n* + [func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[DeploymentsClientCreateOrUpdateResponse], error)](#DeploymentsClient.BeginCreateOrUpdate)\n\t+ [func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[DeploymentsClientDeleteResponse], error)](#DeploymentsClient.BeginDelete)\n\t+ [func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (*runtime.Poller[DeploymentsClientUpdateResponse], error)](#DeploymentsClient.BeginUpdate)\n\t+ [func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, ...) (DeploymentsClientGetResponse, error)](#DeploymentsClient.Get)\n\t+ [func (client *DeploymentsClient) NewListByResourceGroupPager(resourceGroupName string, options *DeploymentsClientListByResourceGroupOptions) *runtime.Pager[DeploymentsClientListByResourceGroupResponse]](#DeploymentsClient.NewListByResourceGroupPager)\n\t+ [func (client *DeploymentsClient) NewListPager(options *DeploymentsClientListOptions) *runtime.Pager[DeploymentsClientListResponse]](#DeploymentsClient.NewListPager)\n* [type DeploymentsClientBeginCreateOrUpdateOptions](#DeploymentsClientBeginCreateOrUpdateOptions)\n* [type DeploymentsClientBeginDeleteOptions](#DeploymentsClientBeginDeleteOptions)\n* [type DeploymentsClientBeginUpdateOptions](#DeploymentsClientBeginUpdateOptions)\n* [type DeploymentsClientCreateOrUpdateResponse](#DeploymentsClientCreateOrUpdateResponse)\n* [type DeploymentsClientDeleteResponse](#DeploymentsClientDeleteResponse)\n* [type DeploymentsClientGetOptions](#DeploymentsClientGetOptions)\n* [type DeploymentsClientGetResponse](#DeploymentsClientGetResponse)\n* [type DeploymentsClientListByResourceGroupOptions](#DeploymentsClientListByResourceGroupOptions)\n* [type DeploymentsClientListByResourceGroupResponse](#DeploymentsClientListByResourceGroupResponse)\n* [type DeploymentsClientListOptions](#DeploymentsClientListOptions)\n* [type DeploymentsClientListResponse](#DeploymentsClientListResponse)\n* [type DeploymentsClientUpdateResponse](#DeploymentsClientUpdateResponse)\n* [type ErrorResponseBody](#ErrorResponseBody)\n* + [func (e ErrorResponseBody) MarshalJSON() ([]byte, error)](#ErrorResponseBody.MarshalJSON)\n\t+ [func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error](#ErrorResponseBody.UnmarshalJSON)\n* [type FrontendIPConfiguration](#FrontendIPConfiguration)\n* + [func (f FrontendIPConfiguration) MarshalJSON() ([]byte, error)](#FrontendIPConfiguration.MarshalJSON)\n\t+ [func (f *FrontendIPConfiguration) UnmarshalJSON(data []byte) error](#FrontendIPConfiguration.UnmarshalJSON)\n* [type IdentityProperties](#IdentityProperties)\n* + [func (i IdentityProperties) MarshalJSON() ([]byte, error)](#IdentityProperties.MarshalJSON)\n\t+ [func (i *IdentityProperties) UnmarshalJSON(data []byte) error](#IdentityProperties.UnmarshalJSON)\n* [type IdentityType](#IdentityType)\n* + [func PossibleIdentityTypeValues() []IdentityType](#PossibleIdentityTypeValues)\n* [type Logging](#Logging)\n* + [func (l Logging) MarshalJSON() ([]byte, error)](#Logging.MarshalJSON)\n\t+ [func (l *Logging) UnmarshalJSON(data []byte) error](#Logging.UnmarshalJSON)\n* [type NetworkInterfaceConfiguration](#NetworkInterfaceConfiguration)\n* + [func (n NetworkInterfaceConfiguration) MarshalJSON() ([]byte, error)](#NetworkInterfaceConfiguration.MarshalJSON)\n\t+ [func (n *NetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error](#NetworkInterfaceConfiguration.UnmarshalJSON)\n* [type NetworkProfile](#NetworkProfile)\n* + [func (n NetworkProfile) MarshalJSON() ([]byte, error)](#NetworkProfile.MarshalJSON)\n\t+ [func (n *NetworkProfile) UnmarshalJSON(data []byte) error](#NetworkProfile.UnmarshalJSON)\n* [type NginxPrivateIPAllocationMethod](#NginxPrivateIPAllocationMethod)\n* + [func PossibleNginxPrivateIPAllocationMethodValues() []NginxPrivateIPAllocationMethod](#PossibleNginxPrivateIPAllocationMethodValues)\n* [type OperationDisplay](#OperationDisplay)\n* + [func (o OperationDisplay) MarshalJSON() ([]byte, error)](#OperationDisplay.MarshalJSON)\n\t+ [func (o *OperationDisplay) UnmarshalJSON(data []byte) error](#OperationDisplay.UnmarshalJSON)\n* [type OperationListResult](#OperationListResult)\n* + [func (o OperationListResult) MarshalJSON() ([]byte, error)](#OperationListResult.MarshalJSON)\n\t+ [func (o *OperationListResult) UnmarshalJSON(data []byte) error](#OperationListResult.UnmarshalJSON)\n* [type OperationResult](#OperationResult)\n* + [func (o OperationResult) MarshalJSON() ([]byte, error)](#OperationResult.MarshalJSON)\n\t+ [func (o *OperationResult) UnmarshalJSON(data []byte) error](#OperationResult.UnmarshalJSON)\n* [type OperationsClient](#OperationsClient)\n* + [func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)](#NewOperationsClient)\n* + [func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]](#OperationsClient.NewListPager)\n* [type OperationsClientListOptions](#OperationsClientListOptions)\n* [type OperationsClientListResponse](#OperationsClientListResponse)\n* [type PrivateIPAddress](#PrivateIPAddress)\n* + [func (p PrivateIPAddress) MarshalJSON() ([]byte, error)](#PrivateIPAddress.MarshalJSON)\n\t+ [func (p *PrivateIPAddress) UnmarshalJSON(data []byte) error](#PrivateIPAddress.UnmarshalJSON)\n* [type ProvisioningState](#ProvisioningState)\n* + [func PossibleProvisioningStateValues() []ProvisioningState](#PossibleProvisioningStateValues)\n* [type PublicIPAddress](#PublicIPAddress)\n* + [func (p PublicIPAddress) MarshalJSON() ([]byte, error)](#PublicIPAddress.MarshalJSON)\n\t+ [func (p *PublicIPAddress) UnmarshalJSON(data []byte) error](#PublicIPAddress.UnmarshalJSON)\n* [type ResourceProviderDefaultErrorResponse](#ResourceProviderDefaultErrorResponse)\n* + [func (r ResourceProviderDefaultErrorResponse) MarshalJSON() ([]byte, error)](#ResourceProviderDefaultErrorResponse.MarshalJSON)\n\t+ [func (r *ResourceProviderDefaultErrorResponse) UnmarshalJSON(data []byte) error](#ResourceProviderDefaultErrorResponse.UnmarshalJSON)\n* [type ResourceSKU](#ResourceSKU)\n* + [func (r ResourceSKU) MarshalJSON() ([]byte, error)](#ResourceSKU.MarshalJSON)\n\t+ [func (r *ResourceSKU) UnmarshalJSON(data []byte) error](#ResourceSKU.UnmarshalJSON)\n* [type StorageAccount](#StorageAccount)\n* + [func (s StorageAccount) MarshalJSON() ([]byte, error)](#StorageAccount.MarshalJSON)\n\t+ [func (s *StorageAccount) UnmarshalJSON(data []byte) error](#StorageAccount.UnmarshalJSON)\n* [type SystemData](#SystemData)\n* + [func (s SystemData) MarshalJSON() ([]byte, error)](#SystemData.MarshalJSON)\n\t+ [func (s *SystemData) UnmarshalJSON(data []byte) error](#SystemData.UnmarshalJSON)\n* [type UserIdentityProperties](#UserIdentityProperties)\n* + [func (u UserIdentityProperties) MarshalJSON() ([]byte, error)](#UserIdentityProperties.MarshalJSON)\n\t+ [func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error](#UserIdentityProperties.UnmarshalJSON)\n\n#### Examples [¶](#pkg-examples)\n\n* [CertificatesClient.BeginCreateOrUpdate](#example-CertificatesClient.BeginCreateOrUpdate)\n* [CertificatesClient.BeginDelete](#example-CertificatesClient.BeginDelete)\n* [CertificatesClient.Get](#example-CertificatesClient.Get)\n* [CertificatesClient.NewListPager](#example-CertificatesClient.NewListPager)\n* [ConfigurationsClient.BeginCreateOrUpdate](#example-ConfigurationsClient.BeginCreateOrUpdate)\n* [ConfigurationsClient.BeginDelete](#example-ConfigurationsClient.BeginDelete)\n* [ConfigurationsClient.Get](#example-ConfigurationsClient.Get)\n* [ConfigurationsClient.NewListPager](#example-ConfigurationsClient.NewListPager)\n* [DeploymentsClient.BeginCreateOrUpdate](#example-DeploymentsClient.BeginCreateOrUpdate)\n* [DeploymentsClient.BeginDelete](#example-DeploymentsClient.BeginDelete)\n* [DeploymentsClient.BeginUpdate](#example-DeploymentsClient.BeginUpdate)\n* [DeploymentsClient.Get](#example-DeploymentsClient.Get)\n* [DeploymentsClient.NewListByResourceGroupPager](#example-DeploymentsClient.NewListByResourceGroupPager)\n* [DeploymentsClient.NewListPager](#example-DeploymentsClient.NewListPager)\n* [OperationsClient.NewListPager](#example-OperationsClient.NewListPager)\n\n### Constants [¶](#pkg-constants)\n\nThis section is empty.\n\n### Variables [¶](#pkg-variables)\n\nThis section is empty.\n\n### Functions [¶](#pkg-functions)\n\nThis section is empty.\n\n### Types [¶](#pkg-types)\n\n#### \ntype [Certificate](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L14) [¶](#Certificate)\n```\ntype Certificate struct {\n Location *[string](/builtin#string) `json:\"location,omitempty\"`\n Properties *[CertificateProperties](#CertificateProperties) `json:\"properties,omitempty\"`\n\n // Dictionary of\n\tTags map[[string](/builtin#string)]*[string](/builtin#string) `json:\"tags,omitempty\"`\n\n // READ-ONLY\n\tID *[string](/builtin#string) `json:\"id,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tName *[string](/builtin#string) `json:\"name,omitempty\" azure:\"ro\"`\n\n // READ-ONLY; Metadata pertaining to creation and last modification of the resource.\n\tSystemData *[SystemData](#SystemData) `json:\"systemData,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tType *[string](/builtin#string) `json:\"type,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (Certificate) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L20) [¶](#Certificate.MarshalJSON)\n```\nfunc (c [Certificate](#Certificate)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type Certificate.\n\n#### \nfunc (*Certificate) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L33) [¶](#Certificate.UnmarshalJSON)\n```\nfunc (c *[Certificate](#Certificate)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type Certificate.\n\n#### \ntype [CertificateListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L34) [¶](#CertificateListResponse)\n```\ntype CertificateListResponse struct {\n NextLink *[string](/builtin#string) `json:\"nextLink,omitempty\"`\n Value []*[Certificate](#Certificate) `json:\"value,omitempty\"`\n}\n```\n#### \nfunc (CertificateListResponse) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L71) [¶](#CertificateListResponse.MarshalJSON)\n```\nfunc (c [CertificateListResponse](#CertificateListResponse)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type CertificateListResponse.\n\n#### \nfunc (*CertificateListResponse) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L79) [¶](#CertificateListResponse.UnmarshalJSON)\n```\nfunc (c *[CertificateListResponse](#CertificateListResponse)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type CertificateListResponse.\n\n#### \ntype [CertificateProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L39) [¶](#CertificateProperties)\n```\ntype CertificateProperties struct {\n CertificateVirtualPath *[string](/builtin#string) `json:\"certificateVirtualPath,omitempty\"`\n KeyVaultSecretID *[string](/builtin#string) `json:\"keyVaultSecretId,omitempty\"`\n KeyVirtualPath *[string](/builtin#string) `json:\"keyVirtualPath,omitempty\"`\n\n // READ-ONLY\n\tProvisioningState *[ProvisioningState](#ProvisioningState) `json:\"provisioningState,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (CertificateProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L102) [¶](#CertificateProperties.MarshalJSON)\n```\nfunc (c [CertificateProperties](#CertificateProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type CertificateProperties.\n\n#### \nfunc (*CertificateProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L112) [¶](#CertificateProperties.UnmarshalJSON)\n```\nfunc (c *[CertificateProperties](#CertificateProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties.\n\n#### \ntype [CertificatesClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L26) [¶](#CertificatesClient)\n```\ntype CertificatesClient struct {\n\t// contains filtered or unexported fields\n}\n```\nCertificatesClient contains the methods for the Certificates group.\nDon't use this type directly, use NewCertificatesClient() instead.\n\n#### \nfunc [NewCertificatesClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L35) [¶](#NewCertificatesClient)\n```\nfunc NewCertificatesClient(subscriptionID [string](/builtin#string), credential [azcore](/github.com/Azure/azure-sdk-for-go/sdk/azcore).[TokenCredential](/github.com/Azure/azure-sdk-for-go/sdk/azcore#TokenCredential), options *[arm](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm).[ClientOptions](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm#ClientOptions)) (*[CertificatesClient](#CertificatesClient), [error](/builtin#error))\n```\nNewCertificatesClient creates a new instance of CertificatesClient with the specified values.\n\n* subscriptionID - The ID of the target subscription.\n* credential - used to authorize requests. Usually a credential from azidentity.\n* options - pass nil to accept the default values.\n\n#### \nfunc (*CertificatesClient) [BeginCreateOrUpdate](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L56) [¶](#CertificatesClient.BeginCreateOrUpdate)\n```\nfunc (client *[CertificatesClient](#CertificatesClient)) BeginCreateOrUpdate(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), certificateName [string](/builtin#string), options *[CertificatesClientBeginCreateOrUpdateOptions](#CertificatesClientBeginCreateOrUpdateOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[CertificatesClientCreateOrUpdateResponse](#CertificatesClientCreateOrUpdateResponse)], [error](/builtin#error))\n```\nBeginCreateOrUpdate - Create or update the Nginx certificates for given Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* certificateName - The name of certificate\n* options - CertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.BeginCreateOrUpdate method.\n\nExample [¶](#example-CertificatesClient.BeginCreateOrUpdate)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewCertificatesClient().BeginCreateOrUpdate(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", &armnginx.CertificatesClientBeginCreateOrUpdateOptions{Body: nil})\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\nres, err := poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Certificate = armnginx.Certificate{\n// \tName: to.Ptr(\"default\"),\n// \tType: to.Ptr(\"nginx.nginxplus/nginxdeployments/certificates\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/certificates/default\"),\n// \tProperties: &armnginx.CertificateProperties{\n// \t\tCertificateVirtualPath: to.Ptr(\"/src/cert/somePath.cert\"),\n// \t\tKeyVaultSecretID: to.Ptr(\"https://someKV.vault.azure.com/someSecretID\"),\n// \t\tKeyVirtualPath: to.Ptr(\"/src/cert/somekey.key\"),\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*CertificatesClient) [BeginDelete](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L131) [¶](#CertificatesClient.BeginDelete)\n```\nfunc (client *[CertificatesClient](#CertificatesClient)) BeginDelete(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), certificateName [string](/builtin#string), options *[CertificatesClientBeginDeleteOptions](#CertificatesClientBeginDeleteOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[CertificatesClientDeleteResponse](#CertificatesClientDeleteResponse)], [error](/builtin#error))\n```\nBeginDelete - Deletes a certificate from the nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* certificateName - The name of certificate\n* options - CertificatesClientBeginDeleteOptions contains the optional parameters for the CertificatesClient.BeginDelete method.\n\nExample [¶](#example-CertificatesClient.BeginDelete)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewCertificatesClient().BeginDelete(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n_, err = poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n```\n```\nOutput:\n```\n#### \nfunc (*CertificatesClient) [Get](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L200) [¶](#CertificatesClient.Get)\n```\nfunc (client *[CertificatesClient](#CertificatesClient)) Get(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), certificateName [string](/builtin#string), options *[CertificatesClientGetOptions](#CertificatesClientGetOptions)) ([CertificatesClientGetResponse](#CertificatesClientGetResponse), [error](/builtin#error))\n```\nGet - Get a certificate of given Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* certificateName - The name of certificate\n* options - CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method.\n\nExample [¶](#example-CertificatesClient.Get)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\nres, err := clientFactory.NewCertificatesClient().Get(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Certificate = armnginx.Certificate{\n// \tName: to.Ptr(\"default\"),\n// \tType: to.Ptr(\"nginx.nginxplus/nginxdeployments/certificates\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/certificates/default\"),\n// \tProperties: &armnginx.CertificateProperties{\n// \t\tCertificateVirtualPath: to.Ptr(\"/src/cert/somePath.cert\"),\n// \t\tKeyVaultSecretID: to.Ptr(\"https://someKV.vault.azure.com/someSecretID\"),\n// \t\tKeyVirtualPath: to.Ptr(\"/src/cert/somekey.key\"),\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*CertificatesClient) [NewListPager](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/certificates_client.go#L260) [¶](#CertificatesClient.NewListPager)\n```\nfunc (client *[CertificatesClient](#CertificatesClient)) NewListPager(resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[CertificatesClientListOptions](#CertificatesClientListOptions)) *[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Pager](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Pager)[[CertificatesClientListResponse](#CertificatesClientListResponse)]\n```\nNewListPager - List all certificates of given Nginx deployment\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method.\n\nExample [¶](#example-CertificatesClient.NewListPager)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npager := clientFactory.NewCertificatesClient().NewListPager(\"myResourceGroup\", \"myDeployment\", nil)\nfor pager.More() {\n\tpage, err := pager.NextPage(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t}\n\tfor _, v := range page.Value {\n\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t_ = v\n\t}\n\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// page.CertificateListResponse = armnginx.CertificateListResponse{\n\t// \tValue: []*armnginx.Certificate{\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"cert1\"),\n\t// \t\t\tType: to.Ptr(\"nginx.nginxplus/nginxdeployments/certificates\"),\n\t// \t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/certificates/cert1\"),\n\t// \t\t\tProperties: &armnginx.CertificateProperties{\n\t// \t\t\t\tCertificateVirtualPath: to.Ptr(\"/src/cert/somePath.cert\"),\n\t// \t\t\t\tKeyVaultSecretID: to.Ptr(\"https://someKV.vault.azure.com/someSecretID\"),\n\t// \t\t\t\tKeyVirtualPath: to.Ptr(\"/src/cert/somekey.key\"),\n\t// \t\t\t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n\t// \t\t\t},\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"cert2\"),\n\t// \t\t\tType: to.Ptr(\"nginx.nginxplus/nginxdeployments/certificates\"),\n\t// \t\t\tID: to.Ptr(\"/subscritions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/certificates/cert2\"),\n\t// \t\t\tProperties: &armnginx.CertificateProperties{\n\t// \t\t\t\tCertificateVirtualPath: to.Ptr(\"/src/cert/somePath2.cert\"),\n\t// \t\t\t\tKeyVaultSecretID: to.Ptr(\"https://someKV.vault.azure.com/someSecretID2\"),\n\t// \t\t\t\tKeyVirtualPath: to.Ptr(\"/src/cert/somekey2.key\"),\n\t// \t\t\t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n\t// \t\t\t},\n\t// \t}},\n\t// }\n}\n```\n```\nOutput:\n```\n#### \ntype [CertificatesClientBeginCreateOrUpdateOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L50) [¶](#CertificatesClientBeginCreateOrUpdateOptions)\n```\ntype CertificatesClientBeginCreateOrUpdateOptions struct {\n // The certificate\n\tBody *[Certificate](#Certificate)\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.BeginCreateOrUpdate method.\n\n#### \ntype [CertificatesClientBeginDeleteOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L58) [¶](#CertificatesClientBeginDeleteOptions)\n```\ntype CertificatesClientBeginDeleteOptions struct {\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nCertificatesClientBeginDeleteOptions contains the optional parameters for the CertificatesClient.BeginDelete method.\n\n#### \ntype [CertificatesClientCreateOrUpdateResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L13) [¶](#CertificatesClientCreateOrUpdateResponse)\n```\ntype CertificatesClientCreateOrUpdateResponse struct {\n [Certificate](#Certificate)\n}\n```\nCertificatesClientCreateOrUpdateResponse contains the response from method CertificatesClient.BeginCreateOrUpdate.\n\n#### \ntype [CertificatesClientDeleteResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L18) [¶](#CertificatesClientDeleteResponse)\n```\ntype CertificatesClientDeleteResponse struct {\n}\n```\nCertificatesClientDeleteResponse contains the response from method CertificatesClient.BeginDelete.\n\n#### \ntype [CertificatesClientGetOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L64) [¶](#CertificatesClientGetOptions)\n```\ntype CertificatesClientGetOptions struct {\n}\n```\nCertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method.\n\n#### \ntype [CertificatesClientGetResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L23) [¶](#CertificatesClientGetResponse)\n```\ntype CertificatesClientGetResponse struct {\n [Certificate](#Certificate)\n}\n```\nCertificatesClientGetResponse contains the response from method CertificatesClient.Get.\n\n#### \ntype [CertificatesClientListOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L69) [¶](#CertificatesClientListOptions)\n```\ntype CertificatesClientListOptions struct {\n}\n```\nCertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method.\n\n#### \ntype [CertificatesClientListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L28) [¶](#CertificatesClientListResponse)\n```\ntype CertificatesClientListResponse struct {\n [CertificateListResponse](#CertificateListResponse)\n}\n```\nCertificatesClientListResponse contains the response from method CertificatesClient.NewListPager.\n\n#### \ntype [ClientFactory](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L19) [¶](#ClientFactory)\n\nadded in v2.1.0\n```\ntype ClientFactory struct {\n\t// contains filtered or unexported fields\n}\n```\nClientFactory is a client factory used to create any client in this module.\nDon't use this type directly, use NewClientFactory instead.\n\n#### \nfunc [NewClientFactory](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L30) [¶](#NewClientFactory)\n\nadded in v2.1.0\n```\nfunc NewClientFactory(subscriptionID [string](/builtin#string), credential [azcore](/github.com/Azure/azure-sdk-for-go/sdk/azcore).[TokenCredential](/github.com/Azure/azure-sdk-for-go/sdk/azcore#TokenCredential), options *[arm](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm).[ClientOptions](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm#ClientOptions)) (*[ClientFactory](#ClientFactory), [error](/builtin#error))\n```\nNewClientFactory creates a new instance of ClientFactory with the specified values.\nThe parameter values will be propagated to any client created from this factory.\n\n* subscriptionID - The ID of the target subscription.\n* credential - used to authorize requests. Usually a credential from azidentity.\n* options - pass nil to accept the default values.\n\n#### \nfunc (*ClientFactory) [NewCertificatesClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L41) [¶](#ClientFactory.NewCertificatesClient)\n\nadded in v2.1.0\n```\nfunc (c *[ClientFactory](#ClientFactory)) NewCertificatesClient() *[CertificatesClient](#CertificatesClient)\n```\n#### \nfunc (*ClientFactory) [NewConfigurationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L46) [¶](#ClientFactory.NewConfigurationsClient)\n\nadded in v2.1.0\n```\nfunc (c *[ClientFactory](#ClientFactory)) NewConfigurationsClient() *[ConfigurationsClient](#ConfigurationsClient)\n```\n#### \nfunc (*ClientFactory) [NewDeploymentsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L51) [¶](#ClientFactory.NewDeploymentsClient)\n\nadded in v2.1.0\n```\nfunc (c *[ClientFactory](#ClientFactory)) NewDeploymentsClient() *[DeploymentsClient](#DeploymentsClient)\n```\n#### \nfunc (*ClientFactory) [NewOperationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/client_factory.go#L56) [¶](#ClientFactory.NewOperationsClient)\n\nadded in v2.1.0\n```\nfunc (c *[ClientFactory](#ClientFactory)) NewOperationsClient() *[OperationsClient](#OperationsClient)\n```\n#### \ntype [Configuration](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L73) [¶](#Configuration)\n```\ntype Configuration struct {\n Location *[string](/builtin#string) `json:\"location,omitempty\"`\n Properties *[ConfigurationProperties](#ConfigurationProperties) `json:\"properties,omitempty\"`\n\n // Dictionary of\n\tTags map[[string](/builtin#string)]*[string](/builtin#string) `json:\"tags,omitempty\"`\n\n // READ-ONLY\n\tID *[string](/builtin#string) `json:\"id,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tName *[string](/builtin#string) `json:\"name,omitempty\" azure:\"ro\"`\n\n // READ-ONLY; Metadata pertaining to creation and last modification of the resource.\n\tSystemData *[SystemData](#SystemData) `json:\"systemData,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tType *[string](/builtin#string) `json:\"type,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (Configuration) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L141) [¶](#Configuration.MarshalJSON)\n```\nfunc (c [Configuration](#Configuration)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type Configuration.\n\n#### \nfunc (*Configuration) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L154) [¶](#Configuration.UnmarshalJSON)\n```\nfunc (c *[Configuration](#Configuration)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type Configuration.\n\n#### \ntype [ConfigurationFile](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L93) [¶](#ConfigurationFile)\n```\ntype ConfigurationFile struct {\n Content *[string](/builtin#string) `json:\"content,omitempty\"`\n VirtualPath *[string](/builtin#string) `json:\"virtualPath,omitempty\"`\n}\n```\n#### \nfunc (ConfigurationFile) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L192) [¶](#ConfigurationFile.MarshalJSON)\n```\nfunc (c [ConfigurationFile](#ConfigurationFile)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ConfigurationFile.\n\n#### \nfunc (*ConfigurationFile) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L200) [¶](#ConfigurationFile.UnmarshalJSON)\n```\nfunc (c *[ConfigurationFile](#ConfigurationFile)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationFile.\n\n#### \ntype [ConfigurationListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L99) [¶](#ConfigurationListResponse)\n```\ntype ConfigurationListResponse struct {\n // Link to the next set of results, if any.\n\tNextLink *[string](/builtin#string) `json:\"nextLink,omitempty\"`\n\n // Results of a list operation.\n\tValue []*[Configuration](#Configuration) `json:\"value,omitempty\"`\n}\n```\nConfigurationListResponse - Response of a list operation.\n\n#### \nfunc (ConfigurationListResponse) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L223) [¶](#ConfigurationListResponse.MarshalJSON)\n```\nfunc (c [ConfigurationListResponse](#ConfigurationListResponse)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ConfigurationListResponse.\n\n#### \nfunc (*ConfigurationListResponse) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L231) [¶](#ConfigurationListResponse.UnmarshalJSON)\n```\nfunc (c *[ConfigurationListResponse](#ConfigurationListResponse)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResponse.\n\n#### \ntype [ConfigurationPackage](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L107) [¶](#ConfigurationPackage)\n```\ntype ConfigurationPackage struct {\n Data *[string](/builtin#string) `json:\"data,omitempty\"`\n}\n```\n#### \nfunc (ConfigurationPackage) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L254) [¶](#ConfigurationPackage.MarshalJSON)\n```\nfunc (c [ConfigurationPackage](#ConfigurationPackage)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ConfigurationPackage.\n\n#### \nfunc (*ConfigurationPackage) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L261) [¶](#ConfigurationPackage.UnmarshalJSON)\n```\nfunc (c *[ConfigurationPackage](#ConfigurationPackage)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationPackage.\n\n#### \ntype [ConfigurationProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L111) [¶](#ConfigurationProperties)\n```\ntype ConfigurationProperties struct {\n Files []*[ConfigurationFile](#ConfigurationFile) `json:\"files,omitempty\"`\n Package *[ConfigurationPackage](#ConfigurationPackage) `json:\"package,omitempty\"`\n ProtectedFiles []*[ConfigurationFile](#ConfigurationFile) `json:\"protectedFiles,omitempty\"`\n RootFile *[string](/builtin#string) `json:\"rootFile,omitempty\"`\n\n // READ-ONLY\n\tProvisioningState *[ProvisioningState](#ProvisioningState) `json:\"provisioningState,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (ConfigurationProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L281) [¶](#ConfigurationProperties.MarshalJSON)\n```\nfunc (c [ConfigurationProperties](#ConfigurationProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.\n\n#### \nfunc (*ConfigurationProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L292) [¶](#ConfigurationProperties.UnmarshalJSON)\n```\nfunc (c *[ConfigurationProperties](#ConfigurationProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.\n\n#### \ntype [ConfigurationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L26) [¶](#ConfigurationsClient)\n```\ntype ConfigurationsClient struct {\n\t// contains filtered or unexported fields\n}\n```\nConfigurationsClient contains the methods for the Configurations group.\nDon't use this type directly, use NewConfigurationsClient() instead.\n\n#### \nfunc [NewConfigurationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L35) [¶](#NewConfigurationsClient)\n```\nfunc NewConfigurationsClient(subscriptionID [string](/builtin#string), credential [azcore](/github.com/Azure/azure-sdk-for-go/sdk/azcore).[TokenCredential](/github.com/Azure/azure-sdk-for-go/sdk/azcore#TokenCredential), options *[arm](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm).[ClientOptions](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm#ClientOptions)) (*[ConfigurationsClient](#ConfigurationsClient), [error](/builtin#error))\n```\nNewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values.\n\n* subscriptionID - The ID of the target subscription.\n* credential - used to authorize requests. Usually a credential from azidentity.\n* options - pass nil to accept the default values.\n\n#### \nfunc (*ConfigurationsClient) [BeginCreateOrUpdate](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L56) [¶](#ConfigurationsClient.BeginCreateOrUpdate)\n```\nfunc (client *[ConfigurationsClient](#ConfigurationsClient)) BeginCreateOrUpdate(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), configurationName [string](/builtin#string), options *[ConfigurationsClientBeginCreateOrUpdateOptions](#ConfigurationsClientBeginCreateOrUpdateOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[ConfigurationsClientCreateOrUpdateResponse](#ConfigurationsClientCreateOrUpdateResponse)], [error](/builtin#error))\n```\nBeginCreateOrUpdate - Create or update the Nginx configuration for given Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* configurationName - The name of configuration, only 'default' is supported value due to the singleton of Nginx conf\n* options - ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.\n\nExample [¶](#example-ConfigurationsClient.BeginCreateOrUpdate)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", &armnginx.ConfigurationsClientBeginCreateOrUpdateOptions{Body: nil})\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\nres, err := poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Configuration = armnginx.Configuration{\n// \tName: to.Ptr(\"default\"),\n// \tType: to.Ptr(\"nginx.nginxplus/nginxDeployments/configurations\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/configurations/default\"),\n// \tProperties: &armnginx.ConfigurationProperties{\n// \t\tFiles: []*armnginx.ConfigurationFile{\n// \t\t\t{\n// \t\t\t\tContent: to.Ptr(\"ABCDEF==\"),\n// \t\t\t\tVirtualPath: to.Ptr(\"/etc/nginx/nginx.conf\"),\n// \t\t}},\n// \t\tPackage: &armnginx.ConfigurationPackage{\n// \t\t},\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t\tRootFile: to.Ptr(\"/etc/nginx/nginx.conf\"),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*ConfigurationsClient) [BeginDelete](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L131) [¶](#ConfigurationsClient.BeginDelete)\n```\nfunc (client *[ConfigurationsClient](#ConfigurationsClient)) BeginDelete(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), configurationName [string](/builtin#string), options *[ConfigurationsClientBeginDeleteOptions](#ConfigurationsClientBeginDeleteOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[ConfigurationsClientDeleteResponse](#ConfigurationsClientDeleteResponse)], [error](/builtin#error))\n```\nBeginDelete - Reset the Nginx configuration of given Nginx deployment to default If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* configurationName - The name of configuration, only 'default' is supported value due to the singleton of Nginx conf\n* options - ConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConfigurationsClient.BeginDelete method.\n\nExample [¶](#example-ConfigurationsClient.BeginDelete)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewConfigurationsClient().BeginDelete(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n_, err = poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n```\n```\nOutput:\n```\n#### \nfunc (*ConfigurationsClient) [Get](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L200) [¶](#ConfigurationsClient.Get)\n```\nfunc (client *[ConfigurationsClient](#ConfigurationsClient)) Get(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), configurationName [string](/builtin#string), options *[ConfigurationsClientGetOptions](#ConfigurationsClientGetOptions)) ([ConfigurationsClientGetResponse](#ConfigurationsClientGetResponse), [error](/builtin#error))\n```\nGet - Get the Nginx configuration of given Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* configurationName - The name of configuration, only 'default' is supported value due to the singleton of Nginx conf\n* options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.\n\nExample [¶](#example-ConfigurationsClient.Get)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\nres, err := clientFactory.NewConfigurationsClient().Get(ctx, \"myResourceGroup\", \"myDeployment\", \"default\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Configuration = armnginx.Configuration{\n// \tName: to.Ptr(\"default\"),\n// \tType: to.Ptr(\"nginx.nginxplus/nginxDeployments/configurations\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/configurations/default\"),\n// \tProperties: &armnginx.ConfigurationProperties{\n// \t\tFiles: []*armnginx.ConfigurationFile{\n// \t\t\t{\n// \t\t\t\tContent: to.Ptr(\"ABCDEF==\"),\n// \t\t\t\tVirtualPath: to.Ptr(\"/etc/nginx/nginx.conf\"),\n// \t\t}},\n// \t\tPackage: &armnginx.ConfigurationPackage{\n// \t\t},\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t\tRootFile: to.Ptr(\"/etc/nginx/nginx.conf\"),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*ConfigurationsClient) [NewListPager](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/configurations_client.go#L260) [¶](#ConfigurationsClient.NewListPager)\n```\nfunc (client *[ConfigurationsClient](#ConfigurationsClient)) NewListPager(resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[ConfigurationsClientListOptions](#ConfigurationsClientListOptions)) *[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Pager](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Pager)[[ConfigurationsClientListResponse](#ConfigurationsClientListResponse)]\n```\nNewListPager - List the Nginx configuration of given Nginx deployment.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method.\n\nExample [¶](#example-ConfigurationsClient.NewListPager)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npager := clientFactory.NewConfigurationsClient().NewListPager(\"myResourceGroup\", \"myDeployment\", nil)\nfor pager.More() {\n\tpage, err := pager.NextPage(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t}\n\tfor _, v := range page.Value {\n\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t_ = v\n\t}\n\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// page.ConfigurationListResponse = armnginx.ConfigurationListResponse{\n\t// \tValue: []*armnginx.Configuration{\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"default\"),\n\t// \t\t\tType: to.Ptr(\"nginx.nginxplus/nginxDeployments/configurations\"),\n\t// \t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/configurations/default\"),\n\t// \t\t\tProperties: &armnginx.ConfigurationProperties{\n\t// \t\t\t\tFiles: []*armnginx.ConfigurationFile{\n\t// \t\t\t\t\t{\n\t// \t\t\t\t\t\tContent: to.Ptr(\"ABCDEF==\"),\n\t// \t\t\t\t\t\tVirtualPath: to.Ptr(\"/etc/nginx/nginx.conf\"),\n\t// \t\t\t\t}},\n\t// \t\t\t\tPackage: &armnginx.ConfigurationPackage{\n\t// \t\t\t\t},\n\t// \t\t\t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n\t// \t\t\t\tRootFile: to.Ptr(\"/etc/nginx/nginx.conf\"),\n\t// \t\t\t},\n\t// \t}},\n\t// }\n}\n```\n```\nOutput:\n```\n#### \ntype [ConfigurationsClientBeginCreateOrUpdateOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L123) [¶](#ConfigurationsClientBeginCreateOrUpdateOptions)\n```\ntype ConfigurationsClientBeginCreateOrUpdateOptions struct {\n // The Nginx configuration\n\tBody *[Configuration](#Configuration)\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.\n\n#### \ntype [ConfigurationsClientBeginDeleteOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L131) [¶](#ConfigurationsClientBeginDeleteOptions)\n```\ntype ConfigurationsClientBeginDeleteOptions struct {\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConfigurationsClient.BeginDelete method.\n\n#### \ntype [ConfigurationsClientCreateOrUpdateResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L33) [¶](#ConfigurationsClientCreateOrUpdateResponse)\n```\ntype ConfigurationsClientCreateOrUpdateResponse struct {\n [Configuration](#Configuration)\n}\n```\nConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.BeginCreateOrUpdate.\n\n#### \ntype [ConfigurationsClientDeleteResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L38) [¶](#ConfigurationsClientDeleteResponse)\n```\ntype ConfigurationsClientDeleteResponse struct {\n}\n```\nConfigurationsClientDeleteResponse contains the response from method ConfigurationsClient.BeginDelete.\n\n#### \ntype [ConfigurationsClientGetOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L137) [¶](#ConfigurationsClientGetOptions)\n```\ntype ConfigurationsClientGetOptions struct {\n}\n```\nConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.\n\n#### \ntype [ConfigurationsClientGetResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L43) [¶](#ConfigurationsClientGetResponse)\n```\ntype ConfigurationsClientGetResponse struct {\n [Configuration](#Configuration)\n}\n```\nConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.\n\n#### \ntype [ConfigurationsClientListOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L142) [¶](#ConfigurationsClientListOptions)\n```\ntype ConfigurationsClientListOptions struct {\n}\n```\nConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method.\n\n#### \ntype [ConfigurationsClientListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L48) [¶](#ConfigurationsClientListResponse)\n```\ntype ConfigurationsClientListResponse struct {\n [ConfigurationListResponse](#ConfigurationListResponse)\n}\n```\nConfigurationsClientListResponse contains the response from method ConfigurationsClient.NewListPager.\n\n#### \ntype [CreatedByType](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L18) [¶](#CreatedByType)\n```\ntype CreatedByType [string](/builtin#string)\n```\nCreatedByType - The type of identity that created the resource.\n```\nconst (\n CreatedByTypeApplication [CreatedByType](#CreatedByType) = \"Application\"\n CreatedByTypeKey [CreatedByType](#CreatedByType) = \"Key\"\n CreatedByTypeManagedIdentity [CreatedByType](#CreatedByType) = \"ManagedIdentity\"\n CreatedByTypeUser [CreatedByType](#CreatedByType) = \"User\"\n)\n```\n#### \nfunc [PossibleCreatedByTypeValues](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L28) [¶](#PossibleCreatedByTypeValues)\n```\nfunc PossibleCreatedByTypeValues() [][CreatedByType](#CreatedByType)\n```\nPossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.\n\n#### \ntype [Deployment](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L146) [¶](#Deployment)\n```\ntype Deployment struct {\n Identity *[IdentityProperties](#IdentityProperties) `json:\"identity,omitempty\"`\n Location *[string](/builtin#string) `json:\"location,omitempty\"`\n Properties *[DeploymentProperties](#DeploymentProperties) `json:\"properties,omitempty\"`\n SKU *[ResourceSKU](#ResourceSKU) `json:\"sku,omitempty\"`\n\n // Dictionary of\n\tTags map[[string](/builtin#string)]*[string](/builtin#string) `json:\"tags,omitempty\"`\n\n // READ-ONLY\n\tID *[string](/builtin#string) `json:\"id,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tName *[string](/builtin#string) `json:\"name,omitempty\" azure:\"ro\"`\n\n // READ-ONLY; Metadata pertaining to creation and last modification of the resource.\n\tSystemData *[SystemData](#SystemData) `json:\"systemData,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tType *[string](/builtin#string) `json:\"type,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (Deployment) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L324) [¶](#Deployment.MarshalJSON)\n```\nfunc (d [Deployment](#Deployment)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type Deployment.\n\n#### \nfunc (*Deployment) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L339) [¶](#Deployment.UnmarshalJSON)\n```\nfunc (d *[Deployment](#Deployment)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type Deployment.\n\n#### \ntype [DeploymentListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L168) [¶](#DeploymentListResponse)\n```\ntype DeploymentListResponse struct {\n NextLink *[string](/builtin#string) `json:\"nextLink,omitempty\"`\n Value []*[Deployment](#Deployment) `json:\"value,omitempty\"`\n}\n```\n#### \nfunc (DeploymentListResponse) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L383) [¶](#DeploymentListResponse.MarshalJSON)\n```\nfunc (d [DeploymentListResponse](#DeploymentListResponse)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type DeploymentListResponse.\n\n#### \nfunc (*DeploymentListResponse) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L391) [¶](#DeploymentListResponse.UnmarshalJSON)\n```\nfunc (d *[DeploymentListResponse](#DeploymentListResponse)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type DeploymentListResponse.\n\n#### \ntype [DeploymentProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L173) [¶](#DeploymentProperties)\n```\ntype DeploymentProperties struct {\n EnableDiagnosticsSupport *[bool](/builtin#bool) `json:\"enableDiagnosticsSupport,omitempty\"`\n Logging *[Logging](#Logging) `json:\"logging,omitempty\"`\n\n\t// The managed resource group to deploy VNet injection related network resources.\n ManagedResourceGroup *[string](/builtin#string) `json:\"managedResourceGroup,omitempty\"`\n NetworkProfile *[NetworkProfile](#NetworkProfile) `json:\"networkProfile,omitempty\"`\n\n // READ-ONLY; The IP address of the deployment.\n\tIPAddress *[string](/builtin#string) `json:\"ipAddress,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tNginxVersion *[string](/builtin#string) `json:\"nginxVersion,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tProvisioningState *[ProvisioningState](#ProvisioningState) `json:\"provisioningState,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (DeploymentProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L414) [¶](#DeploymentProperties.MarshalJSON)\n```\nfunc (d [DeploymentProperties](#DeploymentProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type DeploymentProperties.\n\n#### \nfunc (*DeploymentProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L427) [¶](#DeploymentProperties.UnmarshalJSON)\n```\nfunc (d *[DeploymentProperties](#DeploymentProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.\n\n#### \ntype [DeploymentUpdateParameters](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L191) [¶](#DeploymentUpdateParameters)\n```\ntype DeploymentUpdateParameters struct {\n Identity *[IdentityProperties](#IdentityProperties) `json:\"identity,omitempty\"`\n Location *[string](/builtin#string) `json:\"location,omitempty\"`\n Properties *[DeploymentUpdateProperties](#DeploymentUpdateProperties) `json:\"properties,omitempty\"`\n SKU *[ResourceSKU](#ResourceSKU) `json:\"sku,omitempty\"`\n\n // Dictionary of\n\tTags map[[string](/builtin#string)]*[string](/builtin#string) `json:\"tags,omitempty\"`\n}\n```\n#### \nfunc (DeploymentUpdateParameters) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L465) [¶](#DeploymentUpdateParameters.MarshalJSON)\n```\nfunc (d [DeploymentUpdateParameters](#DeploymentUpdateParameters)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type DeploymentUpdateParameters.\n\n#### \nfunc (*DeploymentUpdateParameters) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L476) [¶](#DeploymentUpdateParameters.UnmarshalJSON)\n```\nfunc (d *[DeploymentUpdateParameters](#DeploymentUpdateParameters)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type DeploymentUpdateParameters.\n\n#### \ntype [DeploymentUpdateProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L201) [¶](#DeploymentUpdateProperties)\n```\ntype DeploymentUpdateProperties struct {\n EnableDiagnosticsSupport *[bool](/builtin#bool) `json:\"enableDiagnosticsSupport,omitempty\"`\n Logging *[Logging](#Logging) `json:\"logging,omitempty\"`\n}\n```\n#### \nfunc (DeploymentUpdateProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L508) [¶](#DeploymentUpdateProperties.MarshalJSON)\n```\nfunc (d [DeploymentUpdateProperties](#DeploymentUpdateProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type DeploymentUpdateProperties.\n\n#### \nfunc (*DeploymentUpdateProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L516) [¶](#DeploymentUpdateProperties.UnmarshalJSON)\n```\nfunc (d *[DeploymentUpdateProperties](#DeploymentUpdateProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type DeploymentUpdateProperties.\n\n#### \ntype [DeploymentsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L26) [¶](#DeploymentsClient)\n```\ntype DeploymentsClient struct {\n\t// contains filtered or unexported fields\n}\n```\nDeploymentsClient contains the methods for the Deployments group.\nDon't use this type directly, use NewDeploymentsClient() instead.\n\n#### \nfunc [NewDeploymentsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L35) [¶](#NewDeploymentsClient)\n```\nfunc NewDeploymentsClient(subscriptionID [string](/builtin#string), credential [azcore](/github.com/Azure/azure-sdk-for-go/sdk/azcore).[TokenCredential](/github.com/Azure/azure-sdk-for-go/sdk/azcore#TokenCredential), options *[arm](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm).[ClientOptions](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm#ClientOptions)) (*[DeploymentsClient](#DeploymentsClient), [error](/builtin#error))\n```\nNewDeploymentsClient creates a new instance of DeploymentsClient with the specified values.\n\n* subscriptionID - The ID of the target subscription.\n* credential - used to authorize requests. Usually a credential from azidentity.\n* options - pass nil to accept the default values.\n\n#### \nfunc (*DeploymentsClient) [BeginCreateOrUpdate](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L55) [¶](#DeploymentsClient.BeginCreateOrUpdate)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) BeginCreateOrUpdate(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[DeploymentsClientBeginCreateOrUpdateOptions](#DeploymentsClientBeginCreateOrUpdateOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[DeploymentsClientCreateOrUpdateResponse](#DeploymentsClientCreateOrUpdateResponse)], [error](/builtin#error))\n```\nBeginCreateOrUpdate - Create or update the Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate method.\n\nExample [¶](#example-DeploymentsClient.BeginCreateOrUpdate)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, \"myResourceGroup\", \"myDeployment\", &armnginx.DeploymentsClientBeginCreateOrUpdateOptions{Body: nil})\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\nres, err := poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Deployment = armnginx.Deployment{\n// \tName: to.Ptr(\"myDeployment\"),\n// \tType: to.Ptr(\"nginx.nginxplus/deployments\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment\"),\n// \tLocation: to.Ptr(\"westus\"),\n// \tProperties: &armnginx.DeploymentProperties{\n// \t\tIPAddress: to.Ptr(\"1.1.1.1\"),\n// \t\tManagedResourceGroup: to.Ptr(\"myManagedResourceGroup\"),\n// \t\tNetworkProfile: &armnginx.NetworkProfile{\n// \t\t\tFrontEndIPConfiguration: &armnginx.FrontendIPConfiguration{\n// \t\t\t\tPrivateIPAddresses: []*armnginx.PrivateIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tPrivateIPAddress: to.Ptr(\"1.1.1.1\"),\n// \t\t\t\t\t\tPrivateIPAllocationMethod: to.Ptr(armnginx.NginxPrivateIPAllocationMethodStatic),\n// \t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t\t}},\n// \t\t\t\tPublicIPAddresses: []*armnginx.PublicIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress\"),\n// \t\t\t\t}},\n// \t\t\t},\n// \t\t\tNetworkInterfaceConfiguration: &armnginx.NetworkInterfaceConfiguration{\n// \t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t},\n// \t\t},\n// \t\tNginxVersion: to.Ptr(\"nginx-1.19.6\"),\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t},\n// \tTags: map[string]*string{\n// \t\t\"Environment\": to.Ptr(\"Dev\"),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*DeploymentsClient) [BeginDelete](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L124) [¶](#DeploymentsClient.BeginDelete)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) BeginDelete(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[DeploymentsClientBeginDeleteOptions](#DeploymentsClientBeginDeleteOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[DeploymentsClientDeleteResponse](#DeploymentsClientDeleteResponse)], [error](/builtin#error))\n```\nBeginDelete - Delete the Nginx deployment resource If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method.\n\nExample [¶](#example-DeploymentsClient.BeginDelete)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewDeploymentsClient().BeginDelete(ctx, \"myResourceGroup\", \"myDeployment\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n_, err = poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n```\n```\nOutput:\n```\n#### \nfunc (*DeploymentsClient) [BeginUpdate](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L369) [¶](#DeploymentsClient.BeginUpdate)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) BeginUpdate(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[DeploymentsClientBeginUpdateOptions](#DeploymentsClientBeginUpdateOptions)) (*[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Poller](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Poller)[[DeploymentsClientUpdateResponse](#DeploymentsClientUpdateResponse)], [error](/builtin#error))\n```\nBeginUpdate - Update the Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - DeploymentsClientBeginUpdateOptions contains the optional parameters for the DeploymentsClient.BeginUpdate method.\n\nExample [¶](#example-DeploymentsClient.BeginUpdate)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npoller, err := clientFactory.NewDeploymentsClient().BeginUpdate(ctx, \"myResourceGroup\", \"myDeployment\", &armnginx.DeploymentsClientBeginUpdateOptions{Body: nil})\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\nres, err := poller.PollUntilDone(ctx, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to pull the result: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Deployment = armnginx.Deployment{\n// \tName: to.Ptr(\"myDeployment\"),\n// \tType: to.Ptr(\"nginx.nginxplus/deployments\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment\"),\n// \tLocation: to.Ptr(\"westus\"),\n// \tProperties: &armnginx.DeploymentProperties{\n// \t\tIPAddress: to.Ptr(\"1.1.1.1\"),\n// \t\tManagedResourceGroup: to.Ptr(\"myManagedResourceGroup\"),\n// \t\tNetworkProfile: &armnginx.NetworkProfile{\n// \t\t\tFrontEndIPConfiguration: &armnginx.FrontendIPConfiguration{\n// \t\t\t\tPrivateIPAddresses: []*armnginx.PrivateIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tPrivateIPAddress: to.Ptr(\"1.1.1.1\"),\n// \t\t\t\t\t\tPrivateIPAllocationMethod: to.Ptr(armnginx.NginxPrivateIPAllocationMethodStatic),\n// \t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t\t}},\n// \t\t\t\tPublicIPAddresses: []*armnginx.PublicIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress\"),\n// \t\t\t\t}},\n// \t\t\t},\n// \t\t\tNetworkInterfaceConfiguration: &armnginx.NetworkInterfaceConfiguration{\n// \t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t},\n// \t\t},\n// \t\tNginxVersion: to.Ptr(\"nginx-1.19.6\"),\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t},\n// \tTags: map[string]*string{\n// \t\t\"Environment\": to.Ptr(\"Dev\"),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*DeploymentsClient) [Get](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L188) [¶](#DeploymentsClient.Get)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) Get(ctx [context](/context).[Context](/context#Context), resourceGroupName [string](/builtin#string), deploymentName [string](/builtin#string), options *[DeploymentsClientGetOptions](#DeploymentsClientGetOptions)) ([DeploymentsClientGetResponse](#DeploymentsClientGetResponse), [error](/builtin#error))\n```\nGet - Get the Nginx deployment If the operation fails it returns an *azcore.ResponseError type.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* deploymentName - The name of targeted Nginx deployment\n* options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.\n\nExample [¶](#example-DeploymentsClient.Get)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\nres, err := clientFactory.NewDeploymentsClient().Get(ctx, \"myResourceGroup\", \"myDeployment\", nil)\nif err != nil {\n\tlog.Fatalf(\"failed to finish the request: %v\", err)\n}\n// You could use response here. We use blank identifier for just demo purposes.\n_ = res\n// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n// res.Deployment = armnginx.Deployment{\n// \tName: to.Ptr(\"myDeployment\"),\n// \tType: to.Ptr(\"nginx.nginxplus/deployments\"),\n// \tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment\"),\n// \tLocation: to.Ptr(\"westus\"),\n// \tProperties: &armnginx.DeploymentProperties{\n// \t\tManagedResourceGroup: to.Ptr(\"myManagedResourceGroup\"),\n// \t\tNetworkProfile: &armnginx.NetworkProfile{\n// \t\t\tFrontEndIPConfiguration: &armnginx.FrontendIPConfiguration{\n// \t\t\t\tPrivateIPAddresses: []*armnginx.PrivateIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tPrivateIPAddress: to.Ptr(\"1.1.1.1\"),\n// \t\t\t\t\t\tPrivateIPAllocationMethod: to.Ptr(armnginx.NginxPrivateIPAllocationMethodStatic),\n// \t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t\t}},\n// \t\t\t\tPublicIPAddresses: []*armnginx.PublicIPAddress{\n// \t\t\t\t\t{\n// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress\"),\n// \t\t\t\t}},\n// \t\t\t},\n// \t\t\tNetworkInterfaceConfiguration: &armnginx.NetworkInterfaceConfiguration{\n// \t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n// \t\t\t},\n// \t\t},\n// \t\tNginxVersion: to.Ptr(\"nginx-1.19.6\"),\n// \t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n// \t},\n// }\n```\n```\nOutput:\n```\n#### \nfunc (*DeploymentsClient) [NewListByResourceGroupPager](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L303) [¶](#DeploymentsClient.NewListByResourceGroupPager)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) NewListByResourceGroupPager(resourceGroupName [string](/builtin#string), options *[DeploymentsClientListByResourceGroupOptions](#DeploymentsClientListByResourceGroupOptions)) *[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Pager](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Pager)[[DeploymentsClientListByResourceGroupResponse](#DeploymentsClientListByResourceGroupResponse)]\n```\nNewListByResourceGroupPager - List all Nginx deployments under the specified resource group.\n\nGenerated from API version 2022-08-01\n\n* resourceGroupName - The name of the resource group. The name is case insensitive.\n* options - DeploymentsClientListByResourceGroupOptions contains the optional parameters for the DeploymentsClient.NewListByResourceGroupPager method.\n\nExample [¶](#example-DeploymentsClient.NewListByResourceGroupPager)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npager := clientFactory.NewDeploymentsClient().NewListByResourceGroupPager(\"myResourceGroup\", nil)\nfor pager.More() {\n\tpage, err := pager.NextPage(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t}\n\tfor _, v := range page.Value {\n\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t_ = v\n\t}\n\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// page.DeploymentListResponse = armnginx.DeploymentListResponse{\n\t// \tValue: []*armnginx.Deployment{\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"myDeployment\"),\n\t// \t\t\tType: to.Ptr(\"nginx.nginxplus/deployments\"),\n\t// \t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment\"),\n\t// \t\t\tLocation: to.Ptr(\"westus\"),\n\t// \t\t\tProperties: &armnginx.DeploymentProperties{\n\t// \t\t\t\tIPAddress: to.Ptr(\"1.1.1.1\"),\n\t// \t\t\t\tManagedResourceGroup: to.Ptr(\"myManagedResourceGroup\"),\n\t// \t\t\t\tNetworkProfile: &armnginx.NetworkProfile{\n\t// \t\t\t\t\tFrontEndIPConfiguration: &armnginx.FrontendIPConfiguration{\n\t// \t\t\t\t\t\tPrivateIPAddresses: []*armnginx.PrivateIPAddress{\n\t// \t\t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\t\tPrivateIPAddress: to.Ptr(\"1.1.1.1\"),\n\t// \t\t\t\t\t\t\t\tPrivateIPAllocationMethod: to.Ptr(armnginx.NginxPrivateIPAllocationMethodStatic),\n\t// \t\t\t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n\t// \t\t\t\t\t\t}},\n\t// \t\t\t\t\t\tPublicIPAddresses: []*armnginx.PublicIPAddress{\n\t// \t\t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress\"),\n\t// \t\t\t\t\t\t}},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t\tNetworkInterfaceConfiguration: &armnginx.NetworkInterfaceConfiguration{\n\t// \t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n\t// \t\t\t\t\t},\n\t// \t\t\t\t},\n\t// \t\t\t\tNginxVersion: to.Ptr(\"nginx-1.19.6\"),\n\t// \t\t\t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n\t// \t\t\t},\n\t// \t}},\n\t// }\n}\n```\n```\nOutput:\n```\n#### \nfunc (*DeploymentsClient) [NewListPager](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/deployments_client.go#L242) [¶](#DeploymentsClient.NewListPager)\n```\nfunc (client *[DeploymentsClient](#DeploymentsClient)) NewListPager(options *[DeploymentsClientListOptions](#DeploymentsClientListOptions)) *[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Pager](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Pager)[[DeploymentsClientListResponse](#DeploymentsClientListResponse)]\n```\nNewListPager - List the Nginx deployments resources\n\nGenerated from API version 2022-08-01\n\n* options - DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.\n\nExample [¶](#example-DeploymentsClient.NewListPager)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npager := clientFactory.NewDeploymentsClient().NewListPager(nil)\nfor pager.More() {\n\tpage, err := pager.NextPage(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t}\n\tfor _, v := range page.Value {\n\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t_ = v\n\t}\n\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// page.DeploymentListResponse = armnginx.DeploymentListResponse{\n\t// \tValue: []*armnginx.Deployment{\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"myDeployment\"),\n\t// \t\t\tType: to.Ptr(\"nginx.nginxplus/deployments\"),\n\t// \t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment\"),\n\t// \t\t\tLocation: to.Ptr(\"westus\"),\n\t// \t\t\tProperties: &armnginx.DeploymentProperties{\n\t// \t\t\t\tIPAddress: to.Ptr(\"1.1.1.1\"),\n\t// \t\t\t\tManagedResourceGroup: to.Ptr(\"myManagedResourceGroup\"),\n\t// \t\t\t\tNetworkProfile: &armnginx.NetworkProfile{\n\t// \t\t\t\t\tFrontEndIPConfiguration: &armnginx.FrontendIPConfiguration{\n\t// \t\t\t\t\t\tPrivateIPAddresses: []*armnginx.PrivateIPAddress{\n\t// \t\t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\t\tPrivateIPAddress: to.Ptr(\"1.1.1.1\"),\n\t// \t\t\t\t\t\t\t\tPrivateIPAllocationMethod: to.Ptr(armnginx.NginxPrivateIPAllocationMethodStatic),\n\t// \t\t\t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n\t// \t\t\t\t\t\t}},\n\t// \t\t\t\t\t\tPublicIPAddresses: []*armnginx.PublicIPAddress{\n\t// \t\t\t\t\t\t\t{\n\t// \t\t\t\t\t\t\t\tID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress\"),\n\t// \t\t\t\t\t\t}},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t\tNetworkInterfaceConfiguration: &armnginx.NetworkInterfaceConfiguration{\n\t// \t\t\t\t\t\tSubnetID: to.Ptr(\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet\"),\n\t// \t\t\t\t\t},\n\t// \t\t\t\t},\n\t// \t\t\t\tNginxVersion: to.Ptr(\"nginx-1.19.6\"),\n\t// \t\t\t\tProvisioningState: to.Ptr(armnginx.ProvisioningStateSucceeded),\n\t// \t\t\t},\n\t// \t}},\n\t// }\n}\n```\n```\nOutput:\n```\n#### \ntype [DeploymentsClientBeginCreateOrUpdateOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L208) [¶](#DeploymentsClientBeginCreateOrUpdateOptions)\n```\ntype DeploymentsClientBeginCreateOrUpdateOptions struct {\n Body *[Deployment](#Deployment)\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate method.\n\n#### \ntype [DeploymentsClientBeginDeleteOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L215) [¶](#DeploymentsClientBeginDeleteOptions)\n```\ntype DeploymentsClientBeginDeleteOptions struct {\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nDeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method.\n\n#### \ntype [DeploymentsClientBeginUpdateOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L221) [¶](#DeploymentsClientBeginUpdateOptions)\n```\ntype DeploymentsClientBeginUpdateOptions struct {\n Body *[DeploymentUpdateParameters](#DeploymentUpdateParameters)\n // Resumes the LRO from the provided token.\n\tResumeToken [string](/builtin#string)\n}\n```\nDeploymentsClientBeginUpdateOptions contains the optional parameters for the DeploymentsClient.BeginUpdate method.\n\n#### \ntype [DeploymentsClientCreateOrUpdateResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L53) [¶](#DeploymentsClientCreateOrUpdateResponse)\n```\ntype DeploymentsClientCreateOrUpdateResponse struct {\n [Deployment](#Deployment)\n}\n```\nDeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.BeginCreateOrUpdate.\n\n#### \ntype [DeploymentsClientDeleteResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L58) [¶](#DeploymentsClientDeleteResponse)\n```\ntype DeploymentsClientDeleteResponse struct {\n}\n```\nDeploymentsClientDeleteResponse contains the response from method DeploymentsClient.BeginDelete.\n\n#### \ntype [DeploymentsClientGetOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L228) [¶](#DeploymentsClientGetOptions)\n```\ntype DeploymentsClientGetOptions struct {\n}\n```\nDeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.\n\n#### \ntype [DeploymentsClientGetResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L63) [¶](#DeploymentsClientGetResponse)\n```\ntype DeploymentsClientGetResponse struct {\n [Deployment](#Deployment)\n}\n```\nDeploymentsClientGetResponse contains the response from method DeploymentsClient.Get.\n\n#### \ntype [DeploymentsClientListByResourceGroupOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L234) [¶](#DeploymentsClientListByResourceGroupOptions)\n```\ntype DeploymentsClientListByResourceGroupOptions struct {\n}\n```\nDeploymentsClientListByResourceGroupOptions contains the optional parameters for the DeploymentsClient.NewListByResourceGroupPager method.\n\n#### \ntype [DeploymentsClientListByResourceGroupResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L68) [¶](#DeploymentsClientListByResourceGroupResponse)\n```\ntype DeploymentsClientListByResourceGroupResponse struct {\n [DeploymentListResponse](#DeploymentListResponse)\n}\n```\nDeploymentsClientListByResourceGroupResponse contains the response from method DeploymentsClient.NewListByResourceGroupPager.\n\n#### \ntype [DeploymentsClientListOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L239) [¶](#DeploymentsClientListOptions)\n```\ntype DeploymentsClientListOptions struct {\n}\n```\nDeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.\n\n#### \ntype [DeploymentsClientListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L73) [¶](#DeploymentsClientListResponse)\n```\ntype DeploymentsClientListResponse struct {\n [DeploymentListResponse](#DeploymentListResponse)\n}\n```\nDeploymentsClientListResponse contains the response from method DeploymentsClient.NewListPager.\n\n#### \ntype [DeploymentsClientUpdateResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L78) [¶](#DeploymentsClientUpdateResponse)\n```\ntype DeploymentsClientUpdateResponse struct {\n [Deployment](#Deployment)\n}\n```\nDeploymentsClientUpdateResponse contains the response from method DeploymentsClient.BeginUpdate.\n\n#### \ntype [ErrorResponseBody](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L243) [¶](#ErrorResponseBody)\n```\ntype ErrorResponseBody struct {\n Code *[string](/builtin#string) `json:\"code,omitempty\"`\n Details []*[ErrorResponseBody](#ErrorResponseBody) `json:\"details,omitempty\"`\n Message *[string](/builtin#string) `json:\"message,omitempty\"`\n Target *[string](/builtin#string) `json:\"target,omitempty\"`\n}\n```\n#### \nfunc (ErrorResponseBody) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L539) [¶](#ErrorResponseBody.MarshalJSON)\n```\nfunc (e [ErrorResponseBody](#ErrorResponseBody)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.\n\n#### \nfunc (*ErrorResponseBody) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L549) [¶](#ErrorResponseBody.UnmarshalJSON)\n```\nfunc (e *[ErrorResponseBody](#ErrorResponseBody)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.\n\n#### \ntype [FrontendIPConfiguration](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L250) [¶](#FrontendIPConfiguration)\n```\ntype FrontendIPConfiguration struct {\n PrivateIPAddresses []*[PrivateIPAddress](#PrivateIPAddress) `json:\"privateIPAddresses,omitempty\"`\n PublicIPAddresses []*[PublicIPAddress](#PublicIPAddress) `json:\"publicIPAddresses,omitempty\"`\n}\n```\n#### \nfunc (FrontendIPConfiguration) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L578) [¶](#FrontendIPConfiguration.MarshalJSON)\n```\nfunc (f [FrontendIPConfiguration](#FrontendIPConfiguration)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type FrontendIPConfiguration.\n\n#### \nfunc (*FrontendIPConfiguration) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L586) [¶](#FrontendIPConfiguration.UnmarshalJSON)\n```\nfunc (f *[FrontendIPConfiguration](#FrontendIPConfiguration)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type FrontendIPConfiguration.\n\n#### \ntype [IdentityProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L255) [¶](#IdentityProperties)\n```\ntype IdentityProperties struct {\n Type *[IdentityType](#IdentityType) `json:\"type,omitempty\"`\n\n // Dictionary of\n\tUserAssignedIdentities map[[string](/builtin#string)]*[UserIdentityProperties](#UserIdentityProperties) `json:\"userAssignedIdentities,omitempty\"`\n\n // READ-ONLY\n\tPrincipalID *[string](/builtin#string) `json:\"principalId,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tTenantID *[string](/builtin#string) `json:\"tenantId,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (IdentityProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L609) [¶](#IdentityProperties.MarshalJSON)\n```\nfunc (i [IdentityProperties](#IdentityProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type IdentityProperties.\n\n#### \nfunc (*IdentityProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L619) [¶](#IdentityProperties.UnmarshalJSON)\n```\nfunc (i *[IdentityProperties](#IdentityProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties.\n\n#### \ntype [IdentityType](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L37) [¶](#IdentityType)\n```\ntype IdentityType [string](/builtin#string)\n```\n```\nconst (\n IdentityTypeNone [IdentityType](#IdentityType) = \"None\"\n IdentityTypeSystemAssigned [IdentityType](#IdentityType) = \"SystemAssigned\"\n IdentityTypeSystemAssignedUserAssigned [IdentityType](#IdentityType) = \"SystemAssigned, UserAssigned\"\n IdentityTypeUserAssigned [IdentityType](#IdentityType) = \"UserAssigned\"\n)\n```\n#### \nfunc [PossibleIdentityTypeValues](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L47) [¶](#PossibleIdentityTypeValues)\n```\nfunc PossibleIdentityTypeValues() [][IdentityType](#IdentityType)\n```\nPossibleIdentityTypeValues returns the possible values for the IdentityType const type.\n\n#### \ntype [Logging](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L268) [¶](#Logging)\n```\ntype Logging struct {\n StorageAccount *[StorageAccount](#StorageAccount) `json:\"storageAccount,omitempty\"`\n}\n```\n#### \nfunc (Logging) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L648) [¶](#Logging.MarshalJSON)\n```\nfunc (l [Logging](#Logging)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type Logging.\n\n#### \nfunc (*Logging) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L655) [¶](#Logging.UnmarshalJSON)\n```\nfunc (l *[Logging](#Logging)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type Logging.\n\n#### \ntype [NetworkInterfaceConfiguration](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L272) [¶](#NetworkInterfaceConfiguration)\n```\ntype NetworkInterfaceConfiguration struct {\n SubnetID *[string](/builtin#string) `json:\"subnetId,omitempty\"`\n}\n```\n#### \nfunc (NetworkInterfaceConfiguration) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L675) [¶](#NetworkInterfaceConfiguration.MarshalJSON)\n```\nfunc (n [NetworkInterfaceConfiguration](#NetworkInterfaceConfiguration)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type NetworkInterfaceConfiguration.\n\n#### \nfunc (*NetworkInterfaceConfiguration) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L682) [¶](#NetworkInterfaceConfiguration.UnmarshalJSON)\n```\nfunc (n *[NetworkInterfaceConfiguration](#NetworkInterfaceConfiguration)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceConfiguration.\n\n#### \ntype [NetworkProfile](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L276) [¶](#NetworkProfile)\n```\ntype NetworkProfile struct {\n FrontEndIPConfiguration *[FrontendIPConfiguration](#FrontendIPConfiguration) `json:\"frontEndIPConfiguration,omitempty\"`\n NetworkInterfaceConfiguration *[NetworkInterfaceConfiguration](#NetworkInterfaceConfiguration) `json:\"networkInterfaceConfiguration,omitempty\"`\n}\n```\n#### \nfunc (NetworkProfile) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L702) [¶](#NetworkProfile.MarshalJSON)\n```\nfunc (n [NetworkProfile](#NetworkProfile)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type NetworkProfile.\n\n#### \nfunc (*NetworkProfile) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L710) [¶](#NetworkProfile.UnmarshalJSON)\n```\nfunc (n *[NetworkProfile](#NetworkProfile)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile.\n\n#### \ntype [NginxPrivateIPAllocationMethod](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L56) [¶](#NginxPrivateIPAllocationMethod)\n```\ntype NginxPrivateIPAllocationMethod [string](/builtin#string)\n```\n```\nconst (\n NginxPrivateIPAllocationMethodDynamic [NginxPrivateIPAllocationMethod](#NginxPrivateIPAllocationMethod) = \"Dynamic\"\n NginxPrivateIPAllocationMethodStatic [NginxPrivateIPAllocationMethod](#NginxPrivateIPAllocationMethod) = \"Static\"\n)\n```\n#### \nfunc [PossibleNginxPrivateIPAllocationMethodValues](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L64) [¶](#PossibleNginxPrivateIPAllocationMethodValues)\n```\nfunc PossibleNginxPrivateIPAllocationMethodValues() [][NginxPrivateIPAllocationMethod](#NginxPrivateIPAllocationMethod)\n```\nPossibleNginxPrivateIPAllocationMethodValues returns the possible values for the NginxPrivateIPAllocationMethod const type.\n\n#### \ntype [OperationDisplay](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L282) [¶](#OperationDisplay)\n```\ntype OperationDisplay struct {\n // Description of the operation, e.g., 'Write deployments'.\n\tDescription *[string](/builtin#string) `json:\"description,omitempty\"`\n\n // Operation type, e.g., read, write, delete, etc.\n\tOperation *[string](/builtin#string) `json:\"operation,omitempty\"`\n\n // Service provider: Nginx.NginxPlus\n\tProvider *[string](/builtin#string) `json:\"provider,omitempty\"`\n\n // Type on which the operation is performed, e.g., 'deployments'.\n\tResource *[string](/builtin#string) `json:\"resource,omitempty\"`\n}\n```\nOperationDisplay - The object that represents the operation.\n\n#### \nfunc (OperationDisplay) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L733) [¶](#OperationDisplay.MarshalJSON)\n```\nfunc (o [OperationDisplay](#OperationDisplay)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type OperationDisplay.\n\n#### \nfunc (*OperationDisplay) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L743) [¶](#OperationDisplay.UnmarshalJSON)\n```\nfunc (o *[OperationDisplay](#OperationDisplay)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.\n\n#### \ntype [OperationListResult](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L297) [¶](#OperationListResult)\n```\ntype OperationListResult struct {\n // URL to get the next set of operation list results if there are any.\n\tNextLink *[string](/builtin#string) `json:\"nextLink,omitempty\"`\n\n // List of operations supported by the Nginx.NginxPlus provider.\n\tValue []*[OperationResult](#OperationResult) `json:\"value,omitempty\"`\n}\n```\nOperationListResult - Result of GET request to list Nginx.NginxPlus operations.\n\n#### \nfunc (OperationListResult) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L772) [¶](#OperationListResult.MarshalJSON)\n```\nfunc (o [OperationListResult](#OperationListResult)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type OperationListResult.\n\n#### \nfunc (*OperationListResult) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L780) [¶](#OperationListResult.UnmarshalJSON)\n```\nfunc (o *[OperationListResult](#OperationListResult)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.\n\n#### \ntype [OperationResult](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L306) [¶](#OperationResult)\n```\ntype OperationResult struct {\n // The object that represents the operation.\n\tDisplay *[OperationDisplay](#OperationDisplay) `json:\"display,omitempty\"`\n\n // Indicates whether the operation is a data action\n\tIsDataAction *[bool](/builtin#bool) `json:\"isDataAction,omitempty\"`\n\n // Operation name: {provider}/{resource}/{operation}\n\tName *[string](/builtin#string) `json:\"name,omitempty\"`\n}\n```\nOperationResult - A Nginx.NginxPlus REST API operation.\n\n#### \nfunc (OperationResult) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L803) [¶](#OperationResult.MarshalJSON)\n```\nfunc (o [OperationResult](#OperationResult)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type OperationResult.\n\n#### \nfunc (*OperationResult) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L812) [¶](#OperationResult.UnmarshalJSON)\n```\nfunc (o *[OperationResult](#OperationResult)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type OperationResult.\n\n#### \ntype [OperationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/operations_client.go#L23) [¶](#OperationsClient)\n```\ntype OperationsClient struct {\n\t// contains filtered or unexported fields\n}\n```\nOperationsClient contains the methods for the Operations group.\nDon't use this type directly, use NewOperationsClient() instead.\n\n#### \nfunc [NewOperationsClient](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/operations_client.go#L30) [¶](#NewOperationsClient)\n```\nfunc NewOperationsClient(credential [azcore](/github.com/Azure/azure-sdk-for-go/sdk/azcore).[TokenCredential](/github.com/Azure/azure-sdk-for-go/sdk/azcore#TokenCredential), options *[arm](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm).[ClientOptions](/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm#ClientOptions)) (*[OperationsClient](#OperationsClient), [error](/builtin#error))\n```\nNewOperationsClient creates a new instance of OperationsClient with the specified values.\n\n* credential - used to authorize requests. Usually a credential from azidentity.\n* options - pass nil to accept the default values.\n\n#### \nfunc (*OperationsClient) [NewListPager](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/operations_client.go#L45) [¶](#OperationsClient.NewListPager)\n```\nfunc (client *[OperationsClient](#OperationsClient)) NewListPager(options *[OperationsClientListOptions](#OperationsClientListOptions)) *[runtime](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime).[Pager](/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime#Pager)[[OperationsClientListResponse](#OperationsClientListResponse)]\n```\nNewListPager - List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.\n\nGenerated from API version 2022-08-01\n\n* options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.\n\nExample [¶](#example-OperationsClient.NewListPager)\n\nGenerated from example definition: \n```\ncred, err := azidentity.NewDefaultAzureCredential(nil)\nif err != nil {\n\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n}\nctx := context.Background()\nclientFactory, err := armnginx.NewClientFactory(\"\", cred, nil)\nif err != nil {\n\tlog.Fatalf(\"failed to create client: %v\", err)\n}\npager := clientFactory.NewOperationsClient().NewListPager(nil)\nfor pager.More() {\n\tpage, err := pager.NextPage(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t}\n\tfor _, v := range page.Value {\n\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t_ = v\n\t}\n\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// page.OperationListResult = armnginx.OperationListResult{\n\t// \tValue: []*armnginx.OperationResult{\n\t// \t\t{\n\t// \t\t\tName: to.Ptr(\"Nginx.NginxPlus/nginxDeployments/write\"),\n\t// \t\t\tDisplay: &armnginx.OperationDisplay{\n\t// \t\t\t\tDescription: to.Ptr(\"Write deployments resource\"),\n\t// \t\t\t\tOperation: to.Ptr(\"write\"),\n\t// \t\t\t\tProvider: to.Ptr(\"Nginx.NginxPlus\"),\n\t// \t\t\t\tResource: to.Ptr(\"deployments\"),\n\t// \t\t\t},\n\t// \t}},\n\t// }\n}\n```\n```\nOutput:\n```\n#### \ntype [OperationsClientListOptions](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L318) [¶](#OperationsClientListOptions)\n```\ntype OperationsClientListOptions struct {\n}\n```\nOperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.\n\n#### \ntype [OperationsClientListResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/response_types.go#L83) [¶](#OperationsClientListResponse)\n```\ntype OperationsClientListResponse struct {\n [OperationListResult](#OperationListResult)\n}\n```\nOperationsClientListResponse contains the response from method OperationsClient.NewListPager.\n\n#### \ntype [PrivateIPAddress](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L322) [¶](#PrivateIPAddress)\n```\ntype PrivateIPAddress struct {\n PrivateIPAddress *[string](/builtin#string) `json:\"privateIPAddress,omitempty\"`\n PrivateIPAllocationMethod *[NginxPrivateIPAllocationMethod](#NginxPrivateIPAllocationMethod) `json:\"privateIPAllocationMethod,omitempty\"`\n SubnetID *[string](/builtin#string) `json:\"subnetId,omitempty\"`\n}\n```\n#### \nfunc (PrivateIPAddress) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L838) [¶](#PrivateIPAddress.MarshalJSON)\n```\nfunc (p [PrivateIPAddress](#PrivateIPAddress)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type PrivateIPAddress.\n\n#### \nfunc (*PrivateIPAddress) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L847) [¶](#PrivateIPAddress.UnmarshalJSON)\n```\nfunc (p *[PrivateIPAddress](#PrivateIPAddress)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type PrivateIPAddress.\n\n#### \ntype [ProvisioningState](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L71) [¶](#ProvisioningState)\n```\ntype ProvisioningState [string](/builtin#string)\n```\n```\nconst (\n ProvisioningStateAccepted [ProvisioningState](#ProvisioningState) = \"Accepted\"\n ProvisioningStateCanceled [ProvisioningState](#ProvisioningState) = \"Canceled\"\n ProvisioningStateCreating [ProvisioningState](#ProvisioningState) = \"Creating\"\n ProvisioningStateDeleted [ProvisioningState](#ProvisioningState) = \"Deleted\"\n ProvisioningStateDeleting [ProvisioningState](#ProvisioningState) = \"Deleting\"\n ProvisioningStateFailed [ProvisioningState](#ProvisioningState) = \"Failed\"\n ProvisioningStateNotSpecified [ProvisioningState](#ProvisioningState) = \"NotSpecified\"\n ProvisioningStateSucceeded [ProvisioningState](#ProvisioningState) = \"Succeeded\"\n ProvisioningStateUpdating [ProvisioningState](#ProvisioningState) = \"Updating\"\n)\n```\n#### \nfunc [PossibleProvisioningStateValues](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/constants.go#L86) [¶](#PossibleProvisioningStateValues)\n```\nfunc PossibleProvisioningStateValues() [][ProvisioningState](#ProvisioningState)\n```\nPossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.\n\n#### \ntype [PublicIPAddress](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L328) [¶](#PublicIPAddress)\n```\ntype PublicIPAddress struct {\n ID *[string](/builtin#string) `json:\"id,omitempty\"`\n}\n```\n#### \nfunc (PublicIPAddress) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L873) [¶](#PublicIPAddress.MarshalJSON)\n```\nfunc (p [PublicIPAddress](#PublicIPAddress)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type PublicIPAddress.\n\n#### \nfunc (*PublicIPAddress) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L880) [¶](#PublicIPAddress.UnmarshalJSON)\n```\nfunc (p *[PublicIPAddress](#PublicIPAddress)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddress.\n\n#### \ntype [ResourceProviderDefaultErrorResponse](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L332) [¶](#ResourceProviderDefaultErrorResponse)\n```\ntype ResourceProviderDefaultErrorResponse struct {\n Error *[ErrorResponseBody](#ErrorResponseBody) `json:\"error,omitempty\"`\n}\n```\n#### \nfunc (ResourceProviderDefaultErrorResponse) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L900) [¶](#ResourceProviderDefaultErrorResponse.MarshalJSON)\n```\nfunc (r [ResourceProviderDefaultErrorResponse](#ResourceProviderDefaultErrorResponse)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ResourceProviderDefaultErrorResponse.\n\n#### \nfunc (*ResourceProviderDefaultErrorResponse) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L907) [¶](#ResourceProviderDefaultErrorResponse.UnmarshalJSON)\n```\nfunc (r *[ResourceProviderDefaultErrorResponse](#ResourceProviderDefaultErrorResponse)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderDefaultErrorResponse.\n\n#### \ntype [ResourceSKU](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L336) [¶](#ResourceSKU)\n```\ntype ResourceSKU struct {\n // REQUIRED; Name of the SKU.\n\tName *[string](/builtin#string) `json:\"name,omitempty\"`\n}\n```\n#### \nfunc (ResourceSKU) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L927) [¶](#ResourceSKU.MarshalJSON)\n```\nfunc (r [ResourceSKU](#ResourceSKU)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type ResourceSKU.\n\n#### \nfunc (*ResourceSKU) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L934) [¶](#ResourceSKU.UnmarshalJSON)\n```\nfunc (r *[ResourceSKU](#ResourceSKU)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.\n\n#### \ntype [StorageAccount](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L341) [¶](#StorageAccount)\n```\ntype StorageAccount struct {\n AccountName *[string](/builtin#string) `json:\"accountName,omitempty\"`\n ContainerName *[string](/builtin#string) `json:\"containerName,omitempty\"`\n}\n```\n#### \nfunc (StorageAccount) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L954) [¶](#StorageAccount.MarshalJSON)\n```\nfunc (s [StorageAccount](#StorageAccount)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type StorageAccount.\n\n#### \nfunc (*StorageAccount) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L962) [¶](#StorageAccount.UnmarshalJSON)\n```\nfunc (s *[StorageAccount](#StorageAccount)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount.\n\n#### \ntype [SystemData](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L347) [¶](#SystemData)\n```\ntype SystemData struct {\n // The timestamp of resource creation (UTC).\n\tCreatedAt *[time](/time).[Time](/time#Time) `json:\"createdAt,omitempty\"`\n\n // The identity that created the resource.\n\tCreatedBy *[string](/builtin#string) `json:\"createdBy,omitempty\"`\n\n // The type of identity that created the resource.\n\tCreatedByType *[CreatedByType](#CreatedByType) `json:\"createdByType,omitempty\"`\n\n // The timestamp of resource last modification (UTC)\n\tLastModifiedAt *[time](/time).[Time](/time#Time) `json:\"lastModifiedAt,omitempty\"`\n\n // The identity that last modified the resource.\n\tLastModifiedBy *[string](/builtin#string) `json:\"lastModifiedBy,omitempty\"`\n\n // The type of identity that last modified the resource.\n\tLastModifiedByType *[CreatedByType](#CreatedByType) `json:\"lastModifiedByType,omitempty\"`\n}\n```\nSystemData - Metadata pertaining to creation and last modification of the resource.\n\n#### \nfunc (SystemData) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L985) [¶](#SystemData.MarshalJSON)\n```\nfunc (s [SystemData](#SystemData)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type SystemData.\n\n#### \nfunc (*SystemData) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L997) [¶](#SystemData.UnmarshalJSON)\n```\nfunc (s *[SystemData](#SystemData)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type SystemData.\n\n#### \ntype [UserIdentityProperties](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models.go#L367) [¶](#UserIdentityProperties)\n```\ntype UserIdentityProperties struct {\n // READ-ONLY\n\tClientID *[string](/builtin#string) `json:\"clientId,omitempty\" azure:\"ro\"`\n\n // READ-ONLY\n\tPrincipalID *[string](/builtin#string) `json:\"principalId,omitempty\" azure:\"ro\"`\n}\n```\n#### \nfunc (UserIdentityProperties) [MarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L1032) [¶](#UserIdentityProperties.MarshalJSON)\n```\nfunc (u [UserIdentityProperties](#UserIdentityProperties)) MarshalJSON() ([][byte](/builtin#byte), [error](/builtin#error))\n```\nMarshalJSON implements the json.Marshaller interface for type UserIdentityProperties.\n\n#### \nfunc (*UserIdentityProperties) [UnmarshalJSON](https://github.com/Azure/azure-sdk-for-go/blob/sdk/resourcemanager/nginx/armnginx/v2.1.0/sdk/resourcemanager/nginx/armnginx/models_serde.go#L1040) [¶](#UserIdentityProperties.UnmarshalJSON)\n```\nfunc (u *[UserIdentityProperties](#UserIdentityProperties)) UnmarshalJSON(data [][byte](/builtin#byte)) [error](/builtin#error)\n```\nUnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties."}}},{"rowIdx":474,"cells":{"project":{"kind":"string","value":"lzf"},"source":{"kind":"string","value":"hex"},"language":{"kind":"string","value":"Erlang"},"content":{"kind":"string","value":"Toggle Theme\n\nlzf v0.1.3\n API Reference\n===\n\n Modules\n---\n\n[Lzf](Lzf.html)\nDecompresses a binary that was compressed in LZF format\n\nToggle Theme\n\nlzf v0.1.3\n Lzf\n===\n\nDecompresses a binary that was compressed in LZF format.\n\n[Link to this section](#summary)\n Summary\n===\n\n[Functions](#functions)\n---\n\n[decompress(compressed)](#decompress/1)\n\nReturns a decompressed binary\n\n[decompress_chunk(chunk)](#decompress_chunk/1)\n\n[decompress_chunk(arg1, position, decompressed)](#decompress_chunk/3)\n\n[parse_chunks(arg1, chunks)](#parse_chunks/2)\n\n[Link to this section](#functions)\n Functions\n===\n\n[Link to this function](#decompress/1 \"Link to this function\")\ndecompress(compressed)\n```\ndecompress([binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: [binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()\n```\nReturns a decompressed binary\n\n[Link to this function](#decompress_chunk/1 \"Link to this function\")\ndecompress_chunk(chunk)\n\n[Link to this function](#decompress_chunk/3 \"Link to this function\")\ndecompress_chunk(arg1, position, decompressed)\n\n[Link to this function](#parse_chunks/2 \"Link to this function\")\nparse_chunks(arg1, chunks)\n```\nparse_chunks([binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)(), [iodata](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()) :: [binary](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()\n```"}}},{"rowIdx":475,"cells":{"project":{"kind":"string","value":"jinja.js"},"source":{"kind":"string","value":"npm"},"language":{"kind":"string","value":"JavaScript"},"content":{"kind":"string","value":"Jinja.js\n===\n\nClient-side rendering of Twig/Jinja/Jinjs templates.\n\n---\n\nDemos\n---\n\nYou can find demos under the `/tests` folder:\n\n* [Basic Javascript](https://github.com/visionmedia/express/blob/HEAD/tests/01-vanilla.html)\n* [The `include` function](https://github.com/visionmedia/express/blob/HEAD/tests/02-include.html)\n* [The `extends` function](https://github.com/visionmedia/express/blob/HEAD/tests/03-extends.html)\n* [The `macro` function](https://github.com/visionmedia/express/blob/HEAD/tests/04-macro.html)\n\n---\n\nGet Started\n---\n\n### 1. Include Script\n```\n\n```\n### 2. Add HTML Markup\n```\n\n```\n### 3. Render\n\n#### a. jQuery\n```\n\n...\n\n```\n#### b. Vanilla Javascript\n```\n\n```\n---\n\nBuilding\n---\n\nA quick build script is included at `bin/build` that will install dependencies, compile & compress:\n```\n$ ./bin/build npm info it worked if it ends with ok npm info using npm@1.1.0-2\n…\nFinished!\n```\nThis will create:\n\n* `build/build.js` -> `lib/jinja.js`\n* `build/build.min.js` -> `lib/jinja.min.js`\n\n### Requirements\n\n* [NodeJS](http://nodejs.org/)\n* [npm](http://npmjs.org/)\n* [Browserify](https://github.com/substack/node-browserify)\n* Java (for YUI Compressor)\n\n---\n\nAuthor\n---\n\n*  [](mailto:)\n\n---\n\n#### See Also\n\n* [node-jinjs](https://github.com/ravelsoft/node-jinjs/wiki)\n* [node-browserify](https://github.com/substack/node-browserify)\nReadme\n---\n\n### Keywords\n\nnone"}}},{"rowIdx":476,"cells":{"project":{"kind":"string","value":"sentry-backtrace"},"source":{"kind":"string","value":"rust"},"language":{"kind":"string","value":"Rust"},"content":{"kind":"string","value":"Crate sentry_backtrace\n===\n\nBacktrace Integration and utilities for sentry.\n\nExposes functions to capture, process and convert/parse stacktraces, as well as integrations to process event stacktraces.\n\nStructs\n---\n\n* AttachStacktraceIntegrationIntegration to attach stacktraces to Events.\n* FrameRepresents a frame.\n* ProcessStacktraceIntegrationIntegration to process Event stacktraces.\n* StacktraceRepresents a stacktrace.\n\nFunctions\n---\n\n* backtrace_to_stacktraceConvert a `backtrace::Backtrace` into a Rust `Stacktrace`\n* current_stacktraceReturns the current backtrace as sentry stacktrace.\n* current_threadCaptures information about the current thread.\n* parse_stacktraceParses a backtrace string into a Sentry `Stacktrace`.\n* process_event_stacktraceProcesses a `Stacktrace`.\n* trim_stacktraceA helper function to trim a stacktrace.\n\nStruct sentry_backtrace::AttachStacktraceIntegration\n===\n\n\n```\npub struct AttachStacktraceIntegration;\n```\nIntegration to attach stacktraces to Events.\n\nThis integration will add an additional thread backtrace to captured messages, respecting the `attach_stacktrace` option.\n\nImplementations\n---\n\n### impl AttachStacktraceIntegration\n\n#### pub fn new() -> Self\n\nCreates a new Integration to attach stacktraces to Events.\n\nTrait Implementations\n---\n\n### impl Debug for AttachStacktraceIntegration\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> AttachStacktraceIntegration\n\nReturns the “default value” for a type. \n\n#### fn name(&self) -> &'static str\n\nName of this integration. \n &self,\n event: Event<'static>,\n options: &ClientOptions\n) -> OptionThe Integrations Event Processor Hook. \n\nCalled whenever the integration is attached to a Client.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for AttachStacktraceIntegration\n\n### impl Send for AttachStacktraceIntegration\n\n### impl Sync for AttachStacktraceIntegration\n\n### impl Unpin for AttachStacktraceIntegration\n\n### impl UnwindSafe for AttachStacktraceIntegration\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\nStruct sentry_backtrace::Frame\n===\n\n[]\n```\npub struct Frame {\n pub function: Option,\n pub symbol: Option,\n pub module: Option,\n pub package: Option,\n pub filename: Option,\n pub abs_path: Option,\n pub lineno: Option,\n pub colno: Option,\n pub pre_context: Vec,\n pub context_line: Option,\n pub post_context: Vec,\n pub in_app: Option,\n pub vars: BTreeMap,\n pub image_addr: Option,\n pub instruction_addr: Option,\n pub symbol_addr: Option,\n pub addr_mode: Option,\n}\n```\nRepresents a frame.\n\nFields\n---\n\n`function: Option`The name of the function is known.\n\nNote that this might include the name of a class as well if that makes sense for the language.\n\n`symbol: Option`The potentially mangled name of the symbol as it appears in an executable.\n\nThis is different from a function name by generally being the mangled name that appears natively in the binary. This is relevant for languages like Swift, C++ or Rust.\n\n`module: Option`The name of the module the frame is contained in.\n\nNote that this might also include a class name if that is something the language natively considers to be part of the stack (for instance in Java).\n\n`package: Option`The name of the package that contains the frame.\n\nFor instance this can be a dylib for native languages, the name of the jar or .NET assembly.\n\n`filename: Option`The filename (basename only).\n\n`abs_path: Option`If known the absolute path.\n\n`lineno: Option`The line number if known.\n\n`colno: Option`The column number if known.\n\n`pre_context: Vec`The sources of the lines leading up to the current line.\n\n`context_line: Option`The current line as source.\n\n`post_context: Vec`The sources of the lines after the current line.\n\n`in_app: Option`In-app indicator.\n\n`vars: BTreeMap`Optional local variables.\n\n`image_addr: Option`If known the location of the image.\n\n`instruction_addr: Option`If known the location of the instruction.\n\n`symbol_addr: Option`If known the location of symbol.\n\n`addr_mode: Option`Optionally changes the addressing mode. The default value is the same as\n`\"abs\"` which means absolute referencing. This can also be set to\n`\"rel:DEBUG_ID\"` or `\"rel:IMAGE_INDEX\"` to make addresses relative to an object referenced by debug id or index. This for instance is necessary for WASM processing as WASM does not use a unified address space.\n\nTrait Implementations\n---\n\n### impl Clone for Frame\n\n#### fn clone(&self) -> Frame\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn default() -> Frame\n\nReturns the “default value” for a type. \n\n#### fn deserialize<__D>(\n __deserializer: __D\n) -> Result>::Error>where\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn eq(&self, other: &Frame) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Serialize for Frame\n\n#### fn serialize<__S>(\n &self,\n __serializer: __S\n) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Frame\n\n### impl Send for Frame\n\n### impl Sync for Frame\n\n### impl Unpin for Frame\n\n### impl UnwindSafe for Frame\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nStruct sentry_backtrace::ProcessStacktraceIntegration\n===\n\n\n```\npub struct ProcessStacktraceIntegration;\n```\nIntegration to process Event stacktraces.\n\nThis integration will trim backtraces, depending on the `trim_backtraces`\nand `extra_border_frames` options.\nIt will then classify each frame according to the `in_app_include` and\n`in_app_exclude` options.\n\nImplementations\n---\n\n### impl ProcessStacktraceIntegration\n\n#### pub fn new() -> Self\n\nCreates a new Integration to process stacktraces.\n\nTrait Implementations\n---\n\n### impl Debug for ProcessStacktraceIntegration\n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result\n\nFormats the value using the given formatter. \n\n#### fn default() -> ProcessStacktraceIntegration\n\nReturns the “default value” for a type. \n\n#### fn name(&self) -> &'static str\n\nName of this integration. \n &self,\n event: Event<'static>,\n options: &ClientOptions\n) -> OptionThe Integrations Event Processor Hook. \n\nCalled whenever the integration is attached to a Client.Auto Trait Implementations\n---\n\n### impl RefUnwindSafe for ProcessStacktraceIntegration\n\n### impl Send for ProcessStacktraceIntegration\n\n### impl Sync for ProcessStacktraceIntegration\n\n### impl Unpin for ProcessStacktraceIntegration\n\n### impl UnwindSafe for ProcessStacktraceIntegration\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl TryFrom for Twhere\n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\nStruct sentry_backtrace::Stacktrace\n===\n\n[]\n```\npub struct Stacktrace {\n    pub frames: Vec,\n    pub frames_omitted: Option<(u64, u64)>,\n    pub registers: BTreeMap,\n}\n```\nRepresents a stacktrace.\n\nFields\n---\n\n`frames: Vec`The list of frames in the stacktrace.\n\n`frames_omitted: Option<(u64, u64)>`Optionally a segment of frames removed (`start`, `end`).\n\n`registers: BTreeMap`Optional register values of the thread.\n\nImplementations\n---\n\n### impl Stacktrace\n\n#### pub fn from_frames_reversed(frames: Vec) -> Option Stacktrace\n\nReturns a copy of the value. Read more1.0.0 · source#### fn clone_from(&mut self, source: &Self)\n\nPerforms copy-assignment from `source`. \n\n#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), ErrorFormats the value using the given formatter. \n\n#### fn default() -> Stacktrace\n\nReturns the “default value” for a type. \n\n#### fn deserialize<__D>(\n __deserializer: __D\n) -> Result>::Error>where\n __D: Deserializer<'de>,\n\nDeserialize this value from the given Serde deserializer. \n\n#### fn eq(&self, other: &Stacktrace) -> bool\n\nThis method tests for `self` and `other` values to be equal, and is used by `==`.1.0.0 · source#### fn ne(&self, other: &Rhs) -> bool\n\nThis method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.### impl Serialize for Stacktrace\n\n#### fn serialize<__S>(\n &self,\n __serializer: __S\n) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where\n __S: Serializer,\n\nSerialize this value into the given Serde serializer. \n\nAuto Trait Implementations\n---\n\n### impl RefUnwindSafe for Stacktrace\n\n### impl Send for Stacktrace\n\n### impl Sync for Stacktrace\n\n### impl Unpin for Stacktrace\n\n### impl UnwindSafe for Stacktrace\n\nBlanket Implementations\n---\n\n### impl Any for Twhere\n T: 'static + ?Sized,\n\n#### fn type_id(&self) -> TypeId\n\nGets the `TypeId` of `self`. \n T: ?Sized,\n\n#### fn borrow(&self) -> &T\n\nImmutably borrows from an owned value. \n T: ?Sized,\n\n#### fn borrow_mut(&mut self) -> &mut T\n\nMutably borrows from an owned value. \n\n#### fn from(t: T) -> T\n\nReturns the argument unchanged.\n\n### impl Into for Twhere\n U: From,\n\n#### fn into(self) -> U\n\nCalls `U::from(self)`.\n\nThat is, this conversion is whatever the implementation of\n`From for U` chooses to do.\n\n### impl ToOwned for Twhere\n T: Clone,\n\n#### type Owned = T\n\nThe resulting type after obtaining ownership.#### fn to_owned(&self) -> T\n\nCreates owned data from borrowed data, usually by cloning. \n\nUses borrowed data to replace owned data, usually by cloning. \n U: Into,\n\n#### type Error = Infallible\n\nThe type returned in the event of a conversion error.#### fn try_from(value: U) -> Result>::ErrorPerforms the conversion.### impl TryInto for Twhere\n U: TryFrom,\n\n#### type Error = >::Error\n\nThe type returned in the event of a conversion error.#### fn try_into(self) -> Result>::ErrorPerforms the conversion.### impl VZip for Twhere\n V: MultiLane,\n\n#### fn vzip(self) -> V\n\n### impl DeserializeOwned for Twhere\n T: for<'de> Deserialize<'de>,\n\nFunction sentry_backtrace::backtrace_to_stacktrace\n===\n\n\n```\npub fn backtrace_to_stacktrace(bt: &Backtrace) -> Option\n```\nConvert a `backtrace::Backtrace` into a Rust `Stacktrace`\n\nFunction sentry_backtrace::current_stacktrace\n===\n\n\n```\npub fn current_stacktrace() -> Option\n```\nReturns the current backtrace as sentry stacktrace.\n\nFunction sentry_backtrace::current_thread\n===\n\n\n```\npub fn current_thread(with_stack: bool) -> Thread\n```\nCaptures information about the current thread.\n\nIf `with_stack` is set to `true` the current stacktrace is attached.\n\nFunction sentry_backtrace::process_event_stacktrace\n===\n\n\n```\npub fn process_event_stacktrace(\n    stacktrace: &mut Stacktrace,\n    options: &ClientOptions\n)\n```\nProcesses a `Stacktrace`.\n\nTrims a `Stacktrace` and marks frames as in-app based on the provided\n`ClientOptions`.\n\nFunction sentry_backtrace::trim_stacktrace\n===\n\n\n```\npub fn trim_stacktrace(stacktrace: &mut Stacktrace, f: F)where\n F: Fn(&Frame, &Stacktrace) -> bool,\n```\nA helper function to trim a stacktrace."}}},{"rowIdx":477,"cells":{"project":{"kind":"string","value":"GWASbyCluster"},"source":{"kind":"string","value":"cran"},"language":{"kind":"string","value":"R"},"content":{"kind":"string","value":"Package ‘GWASbyCluster’\n                                         October 12, 2022\nType Package\nTitle Identifying Significant SNPs in Genome Wide Association Studies\n      (GWAS) via Clustering\nVersion 0.1.7\nDate 2019-10-09\nAuthor , , , <>,  <>\nMaintainer  <>\nDepends R (>= 3.5.0), Biobase\nImports stats, snpStats, methods, rootSolve, limma\nDescription\n      Identifying disease-associated significant SNPs using clustering approach. This package is im-\n      plementation of method proposed in Xu et al (2019) .\nLicense GPL (>= 2)\nNeedsCompilation no\nRepository CRAN\nDate/Publication 2019-10-11 09:30:06 UTC\nR topics documented:\nesSi... 2\nesSimDiffPrior... 3\nestMemSNP... 5\nestMemSNPs.oneSetHyperPar... 8\nsimGenoFun... 11\nsimGenoFuncDiffPrior... 13\n  esSim                         An ExpressionSet Object Storing Simulated Genotype Data\nDescription\n    An ExpressionSet object storing simulated genotype data. The minor allele frequency (MAF) of\n    cases has the same prior as that of controls.\nUsage\n    data(\"esSim\")\nDetails\n    In this simulation, we generate additive-coded genotypes for 3 clusters of SNPs based on a mixture\n    of 3 Bayesian hierarchical models.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                      2h+ (θx+ ) h+ (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise. The\n    function h+ is the probability density function of the beta distribution Beta (α+ , β+ ).\n    We assume θ0 has the beta prior Beta(α0 , β0 ).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                      2h− (θx− ) h− (θy− ) I (θx− > θy− ) .\n    The function h− is the probability density function of the beta distribution Beta (α− , β− ).\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                             P r(geno = 2) = θ2\n                                         P r(geno = 1) = 2θ (1 − θ)\n                                          P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                           h        1 (heterozygote),ioand 2 (mutation) follows a multino-\n    mial distribution M ultinomial 1, θ2 , 2θ (1 − θ) , (1 − θ)\n    We set the number of cases as 100, the number of controls as 100, and the number of SNPs as 1000.\n    The hyperparameters are α+ = 2, β+ = 5, π+ = 0.1, α0 = 2, β0 = 5, π0 = 0.8, α− = 2, β− = 5,\n    π− = 0.1.\n    Note that when we generate MAFs from the half-flat shape bivariate priors, we might get very small\n    MAFs or get MAFs > 0.5. In these cased, we then delete this SNP.\n    So the final number of SNPs generated might be less than the initially-set number 1000 of SNPs.\n    For the dataset stored in esSim, there are 872 SNPs. 83 SNPs are in cluster -, 714 SNPs are in\n    cluster 0, and 75 SNPs are in cluster +.\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    data(esSim)\n    print(esSim)\n    pDat=pData(esSim)\n    print(pDat[1:2,])\n    print(table(pDat$memSubjs))\n    fDat=fData(esSim)\n    print(fDat[1:2,])\n    print(table(fDat$memGenes))\n    print(table(fDat$memGenes2))\n  esSimDiffPriors               An ExpressionSet Object Storing Simulated Genotype Data\nDescription\n    An ExpressionSet object storing simulated genotype data. The minor allele frequency (MAF) of\n    cases has different prior than that of controls.\nUsage\n    data(\"esSimDiffPriors\")\nDetails\n    In this simulation, we generate additive-coded genotypes for 3 clusters of SNPs based on a mixture\n    of 3 Bayesian hierarchical models.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                   2hx+ (θx+ ) hy+ (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise.\n    The function hx+ is the probability density function of the beta distribution Beta (αx+ , βx+ ). The\n    function hy+ is the probability density function of the beta distribution Beta (αy+ , βy+ ).\n    We assume θ0 has the beta prior Beta(α0 , β0 ).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                   2hx− (θx− ) hy− (θy− ) I (θx− > θy− ) .\n    The function hx− is the probability density function of the beta distribution Beta (αx− , βx− ). The\n    function hy− is the probability density function of the beta distribution Beta (αy− , βy− ).\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                              P r(geno = 2) = θ2\n                                        P r(geno = 1) = 2θ (1 − θ)\n                                          P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                          h         1 (heterozygote),ioand 2 (mutation) follows a multino-\n                                             2                    2\n    mial distribution M ultinomial 1, θ , 2θ (1 − θ) , (1 − θ)\n    We set the number of cases as 100, the number of controls as 100, and the number of SNPs as 1000.\n    The hyperparameters are αx+ = 2, βx+ = 3, αy+ = 2, βy+ = 8, π+ = 0.1,\n    α0 = 2, β0 = 5, π0 = 0.8,\n    αx− = 2, βx− = 8, αy− = 2, βy− = 3, π− = 0.1.\n    Note that when we generate MAFs from the half-flat shape bivariate priors, we might get very small\n    MAFs or get MAFs > 0.5. In these cased, we then delete this SNP.\n    So the final number of SNPs generated might be less than the initially-set number 1000 of SNPs.\n    For the dataset stored in esSim, there are 838 SNPs. 64 SNPs are in cluster -, 708 SNPs are in\n    cluster 0, and 66 SNPs are in cluster +.\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    data(esSimDiffPriors)\n    print(esSimDiffPriors)\n    pDat=pData(esSimDiffPriors)\n    print(pDat[1:2,])\n     print(table(pDat$memSubjs))\n     fDat=fData(esSimDiffPriors)\n     print(fDat[1:2,])\n     print(table(fDat$memGenes))\n     print(table(fDat$memGenes2))\n   estMemSNPs                    Estimate SNP cluster membership\nDescription\n     Estimate SNP cluster membership. Only update cluster mixture proportions. Assume the 3 clusters\n     have different sets of hyperparameters.\nUsage\n     estMemSNPs(es,\n                   var.memSubjs = \"memSubjs\",\n                   eps = 0.001,\n                   MaxIter = 50,\n                   bVec = rep(3, 3),\n                   pvalAdjMethod = \"fdr\",\n                   method = \"FDR\",\n                   fdr = 0.05,\n                   verbose = FALSE)\nArguments\n     es                  An ExpressionSet object storing SNP genotype data. It contains 3 matrices. The\n                         first matrix, which can be extracted by exprs method (e.g., exprs(es)), stores\n                         genotype data, with rows are SNPs and columns are subjects.\n                         The second matrix, which can be extracted by pData method (e.g., pData(es)),\n                         stores phenotype data describing subjects. Rows are subjects, and columns are\n                         phenotype variables.\n                         The third matrix, which can be extracted by fData method (e.g., fData(es)),\n                         stores feature data describing SNPs. Rows are SNPs and columns are feature\n                         variables.\n     var.memSubjs        character. The name of the phenotype variable indicating subject’s case-control\n                         status. It must take only two values: 1 indicating case and 0 indicating control.\n     eps                 numeric. A small positive number as threshold for convergence of EM algo-\n                         rithm.\n     MaxIter             integer. A positive integer indicating maximum iteration in EM algorithm.\n     bVec                numeric. A vector of 2 elements. Indicates the parameters of the symmetric\n                         Dirichlet prior for proportion mixtures.\n     pvalAdjMethod       character. Indicating p-value adjustment method. c.f. p.adjust.\n    method               method to obtain SNP cluster membership based on the responsibility matrix.\n                         The default value is “FDR”. The other possible value is “max”. see details.\n    fdr                  numeric. A small positive FDR threshold used to call SNP cluster membership\n    verbose              logical. Indicating if intermediate and final results should be output.\nDetails\n    In this simulation, we generate additive-coded genotypes for 3 clusters of SNPs based on a mixture\n    of 3 Bayesian hierarchical models.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                      2h+ (θx+ ) h+ (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise. The\n    function h+ is the probability density function of the beta distribution Beta (α+ , β+ ).\n    We assume θ0 has the beta prior Beta(α0 , β0 ).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                      2h− (θx− ) h− (θy− ) I (θx− > θy− ) .\n    The function h− is the probability density function of the beta distribution Beta (α− , β− ).\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                               P r(geno = 2) = θ2\n                                          P r(geno = 1) = 2θ (1 − θ)\n                                           P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                           h         1 (heterozygote),ioand 2 (mutation) follows a multino-\n                                              2                     2\n    mial distribution M ultinomial 1, θ , 2θ (1 − θ) , (1 − θ)\n    For each SNP, we calculat its posterior probabilities that it belongs to cluster k. This forms a matrix\n    with 3 columns. Rows are SNPs. The 1st column is the posterior probability that the SNP belongs\n    to cluster −. The 2nd column is the posterior probability that the SNP belongs to cluster 0. The\n    3rd column is the posterior probability that the SNP belongs to cluster +. We call this posterior\n    probability matrix as responsibility matrix. To determine which cluster a SNP eventually belongs\n    to, we can use 2 methods. The first method (the default method) is “FDR” method, which will\n    use FDR criterion to determine SNP cluster membership. The 2nd method is use the maximum\n    posterior probability to decide which cluster a SNP belongs to.\nValue\n    A list of 12 elements\n    wMat               matrix of posterior probabilities. The rows are SNPs. There are 3 columns. The\n                       first column is the posterior probability that a SNP belongs to cluster - given\n                       genotypes of subjects. The second column is the posterior probability that a\n                       SNP belongs to cluster 0 given genotypes of subjects. The third column is the\n                       posterior probability that a SNP belongs to cluster + given genotypes of subjects.\n    memSNPs            a vector of SNP cluster membership for the 3-cluster partitionfrom the mixture\n                       of 3 Bayesian hierarchical models.\n    memSNPs2           a vector of binary SNP cluster membership. 1 indicates the SNP has different\n                       MAFs between cases and controls. 0 indicates the SNP has the same MAF in\n                       cases as that in controls.\n    piVec              a vector of cluster mixture proportions.\n    alpha.p            the first shape parameter of the beta prior for MAF obtaind from initial 3-cluster\n                       partitions based on GWAS for cluster +.\n    beta.p             the second shape parameter of the beta prior for MAF obtaind from initial 3-\n                       cluster partitions based on GWAS for cluster +.\n    alpha0             the first shape parameter of the beta prior for MAF obtaind from initial 3-cluster\n                       partitions based on GWAS for cluster 0.\n    beta0              the second shape parameter of the beta prior for MAF obtaind from initial 3-\n                       cluster partitions based on GWAS for cluster 0.\n    alpha.n            the first shape parameter of the beta prior for MAF obtaind from initial 3-cluster\n                       partitions based on GWAS for cluster -.\n    beta.n             the second shape parameter of the beta prior for MAF obtaind from initial 3-\n                       cluster partitions based on GWAS for cluster -.\n    loop               number of iteration in EM algorithm\n    diff               sum of the squared difference of cluster mixture proportions between current\n                       iteration and previous iteration in EM algorithm. if eps < eps, we claim the EM\n                       algorithm converges.\n    res.limma          object returned by limma\nAuthor(s)\n     <>,  <>,  <>,\n     <>,  <>\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    data(esSimDiffPriors)\n    print(esSimDiffPriors)\n    es=esSimDiffPriors[1:500,]\n    fDat = fData(es)\n    print(fDat[1:2,])\n    print(table(fDat$memGenes))\n    res = estMemSNPs(\n      es = es,\n      var.memSubjs = \"memSubjs\")\n    print(table(fDat$memGenes, res$memSNPs))\n  estMemSNPs.oneSetHyperPara\n                               Estimate SNP cluster membership\nDescription\n    Estimate SNP cluster membership. Only update cluster mixture proportions. Assume all 3 clusters\n    have the same set of hyperparameters.\nUsage\n    estMemSNPs.oneSetHyperPara(es,\n                 var.memSubjs = \"memSubjs\",\n                 eps = 1.0e-3,\n                 MaxIter = 50,\n                 bVec = rep(3, 3),\n                 pvalAdjMethod = \"none\",\n                 method = \"FDR\",\n                 fdr = 0.05,\n                 verbose = FALSE)\nArguments\n    es                 An ExpressionSet object storing SNP genotype data. It contains 3 matrices. The\n                       first matrix, which can be extracted by exprs method (e.g., exprs(es)), stores\n                       genotype data, with rows are SNPs and columns are subjects.\n                       The second matrix, which can be extracted by pData method (e.g., pData(es)),\n                       stores phenotype data describing subjects. Rows are subjects, and columns are\n                       phenotype variables.\n                       The third matrix, which can be extracted by fData method (e.g., fData(es)),\n                       stores feature data describing SNPs. Rows are SNPs and columns are feature\n                       variables.\n    var.memSubjs         character. The name of the phenotype variable indicating subject’s case-control\n                         status. It must take only two values: 1 indicating case and 0 indicating control.\n    eps                  numeric. A small positive number as threshold for convergence of EM algo-\n                         rithm.\n    MaxIter              integer. A positive integer indicating maximum iteration in EM algorithm.\n    bVec                 numeric. A vector of 2 elements. Indicates the parameters of the symmetric\n                         Dirichlet prior for proportion mixtures.\n    pvalAdjMethod        character. Indicating p-value adjustment method. c.f. p.adjust.\n    method               method to obtain SNP cluster membership based on the responsibility matrix.\n                         The default value is “FDR”. The other possible value is “max”. see details.\n    fdr                  numeric. A small positive FDR threshold used to call SNP cluster membership\n    verbose              logical. Indicating if intermediate and final results should be output.\nDetails\n    We characterize the distribution of genotypes of SNPs by a mixture of 3 Bayesian hierarchical\n    models. The 3 Bayeisan hierarchical models correspond to 3 clusters of SNPs.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                       2h (θx+ ) h (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise. The\n    function h is the probability density function of the beta distribution Beta (α, β).\n    We assume θ0 has the beta prior Beta(α, β).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                       2h (θx− ) h (θy− ) I (θx− > θy− ) .\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                               P r(geno = 2) = θ2\n                                          P r(geno = 1) = 2θ (1 − θ)\n                                           P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                           h         1 (heterozygote),ioand 2 (mutation) follows a multino-\n                                              2                     2\n    mial distribution M ultinomial 1, θ , 2θ (1 − θ) , (1 − θ)\n    For each SNP, we calculat its posterior probabilities that it belongs to cluster k. This forms a matrix\n    with 3 columns. Rows are SNPs. The 1st column is the posterior probability that the SNP belongs\n    to cluster −. The 2nd column is the posterior probability that the SNP belongs to cluster 0. The\n    3rd column is the posterior probability that the SNP belongs to cluster +. We call this posterior\n    probability matrix as responsibility matrix. To determine which cluster a SNP eventually belongs\n    to, we can use 2 methods. The first method (the default method) is “FDR” method, which will\n    use FDR criterion to determine SNP cluster membership. The 2nd method is use the maximum\n    posterior probability to decide which cluster a SNP belongs to.\nValue\n    A list of 10 elements\n    wMat                matrix of posterior probabilities. The rows are SNPs. There are 3 columns. The\n                        first column is the posterior probability that a SNP belongs to cluster - given\n                        genotypes of subjects. The second column is the posterior probability that a\n                        SNP belongs to cluster 0 given genotypes of subjects. The third column is the\n                        posterior probability that a SNP belongs to cluster + given genotypes of subjects.\n    memSNPs             a vector of SNP cluster membership for the 3-cluster partitionfrom the mixture\n                        of 3 Bayesian hierarchical models.\n    memSNPs2            a vector of binary SNP cluster membership. 1 indicates the SNP has different\n                        MAFs between cases and controls. 0 indicates the SNP has the same MAF in\n                        cases as that in controls.\n    piVec               a vector of cluster mixture proportions.\n    alpha               the first shape parameter of the beta prior for MAF obtaind from initial 3-cluster\n                        partitions based on GWAS.\n    beta                the second shape parameter of the beta prior for MAF obtaind from initial 3-\n                        cluster partitions based on GWAS.\n    loop                number of iteration in EM algorithm\n    diff                sum of the squared difference of cluster mixture proportions between current\n                        iteration and previous iteration in EM algorithm. if eps < eps, we claim the EM\n                        algorithm converges.\n    res.limma           object returned by limma\nAuthor(s)\n     <>,  <>,  <>,\n     <>,  <>\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    data(esSimDiffPriors)\n    print(esSimDiffPriors)\n    fDat = fData(esSimDiffPriors)\n    print(fDat[1:2,])\n    print(table(fDat$memGenes))\n    res = estMemSNPs.oneSetHyperPara(\n       es = esSimDiffPriors,\n       var.memSubjs = \"memSubjs\")\n    print(table(fDat$memGenes, res$memSNPs))\n  simGenoFunc                 Simulate Genotype Data from a Mixture of 3 Bayesian Hierarchical\n                              Models\nDescription\n    Simulate Genotype Data from a Mixture of 3 Bayesian Hierarchical Models. The minor allele\n    frequency (MAF) of cases has the same prior as that of controls.\nUsage\n    simGenoFunc(nCases = 100,\n                  nControls = 100,\n                  nSNPs = 1000,\n                  alpha.p = 2,\n                  beta.p = 5,\n                  pi.p = 0.1,\n                  alpha0 = 2,\n                  beta0 = 5,\n                  pi0 = 0.8,\n                  alpha.n = 2,\n                  beta.n = 5,\n                  pi.n = 0.1,\n                  low = 0.02,\n                  upp = 0.5,\n                  verbose = FALSE)\nArguments\n    nCases            integer. Number of cases.\n    nControls         integer. Number of controls.\n    nSNPs             integer. Number of SNPs.\n    alpha.p           numeric. The first shape parameter of Beta prior in cluster +.\n    beta.p            numeric. The second shape parameter of Beta prior in cluster +.\n    pi.p              numeric. Mixture proportion for cluster +.\n    alpha0               numeric. The first shape parameter of Beta prior in cluster 0.\n    beta0                numeric. The second shape parameter of Beta prior in cluster 0.\n    pi0                  numeric. Mixture proportion for cluster 0.\n    alpha.n              numeric. The first shape parameter of Beta prior in cluster −.\n    beta.n               numeric. The second shape parameter of Beta prior in cluster −.\n    pi.n                 numeric. Mixture proportion for cluster −.\n    low                  numeric. A small positive value. If a MAF generated from half-flat shape bi-\n                         variate prior is smaller than low, we will delete the SNP to be generated.\n    upp                  numeric. A positive value. If a MAF generated from half-flat shape bivariate\n                         prior is greater than upp, we will delete the SNP to be generated.\n    verbose              logical. Indicating if intermediate results or final results should be output to\n                         output screen.\nDetails\n    In this simulation, we generate additive-coded genotypes for 3 clusters of SNPs based on a mixture\n    of 3 Bayesian hierarchical models.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                      2h+ (θx+ ) h+ (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise. The\n    function h+ is the probability density function of the beta distribution Beta (α+ , β+ ).\n    We assume θ0 has the beta prior Beta(α0 , β0 ).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                      2h− (θx− ) h− (θy− ) I (θx− > θy− ) .\n    The function h− is the probability density function of the beta distribution Beta (α− , β− ).\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                               P r(geno = 2) = θ2\n                                           P r(geno = 1) = 2θ (1 − θ)\n                                            P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                            h        1 (heterozygote),ioand 2 (mutation) follows a multino-\n    mial distribution M ultinomial 1, θ2 , 2θ (1 − θ) , (1 − θ)\n    Note that when we generate MAFs from the half-flat shape bivariate priors, we might get very small\n    MAFs or get MAFs > 0.5. In these cased, we then delete this SNP.\n    So the final number of SNPs generated might be less than the initially-set number of SNPs.\nValue\n    An ExpressionSet object stores genotype data.\nAuthor(s)\n     <>,  <>,  <>,\n     <>,  <>\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    set.seed(2)\n    esSim = simGenoFunc(\n       nCases = 100,\n       nControls = 100,\n       nSNPs = 500,\n       alpha.p = 2, beta.p = 5, pi.p = 0.1,\n       alpha0 = 2, beta0 = 5, pi0 = 0.8,\n       alpha.n = 2, beta.n = 5, pi.n = 0.1,\n       low = 0.02, upp = 0.5, verbose = FALSE\n    )\n    print(esSim)\n    pDat = pData(esSim)\n    print(pDat[1:2,])\n    print(table(pDat$memSubjs))\n    fDat = fData(esSim)\n    print(fDat[1:2,])\n    print(table(fDat$memGenes))\n    print(table(fDat$memGenes2))\n  simGenoFuncDiffPriors Simulate Genotype Data from a Mixture of 3 Bayesian Hierarchical\n                             Models\nDescription\n    Simulate Genotype Data from a Mixture of 3 Bayesian Hierarchical Models. The minor allele\n    frequency (MAF) of cases has different priors than that of controls.\nUsage\n   simGenoFuncDiffPriors(\n        nCases = 100,\n        nControls = 100,\n        nSNPs = 1000,\n        alpha.p.ca = 2,\n        beta.p.ca = 3,\n        alpha.p.co = 2,\n        beta.p.co = 8,\n        pi.p = 0.1,\n        alpha0 = 2,\n        beta0 = 5,\n        pi0 = 0.8,\n        alpha.n.ca = 2,\n        beta.n.ca = 8,\n        alpha.n.co = 2,\n        beta.n.co = 3,\n        pi.n = 0.1,\n        low = 0.02,\n        upp = 0.5,\n        verbose = FALSE)\nArguments\n   nCases           integer. Number of cases.\n   nControls        integer. Number of controls.\n   nSNPs            integer. Number of SNPs.\n   alpha.p.ca       numeric. The first shape parameter of Beta prior in cluster + for cases.\n   beta.p.ca        numeric. The second shape parameter of Beta prior in cluster + for cases.\n   alpha.p.co       numeric. The first shape parameter of Beta prior in cluster + for controls.\n   beta.p.co        numeric. The second shape parameter of Beta prior in cluster + for controls.\n   pi.p             numeric. Mixture proportion for cluster +.\n   alpha0           numeric. The first shape parameter of Beta prior in cluster 0.\n   beta0            numeric. The second shape parameter of Beta prior in cluster 0.\n   pi0              numeric. Mixture proportion for cluster 0.\n   alpha.n.ca       numeric. The first shape parameter of Beta prior in cluster − for cases.\n   beta.n.ca        numeric. The second shape parameter of Beta prior in cluster − for cases.\n   alpha.n.co       numeric. The first shape parameter of Beta prior in cluster − for controls.\n   beta.n.co        numeric. The second shape parameter of Beta prior in cluster − for controls.\n   pi.n             numeric. Mixture proportion for cluster −.\n   low              numeric. A small positive value. If a MAF generated from half-flat shape bi-\n                    variate prior is smaller than low, we will delete the SNP to be generated.\n    upp                  numeric. A positive value. If a MAF generated from half-flat shape bivariate\n                         prior is greater than upp, we will delete the SNP to be generated.\n    verbose              logical. Indicating if intermediate results or final results should be output to\n                         output screen.\nDetails\n    In this simulation, we generate additive-coded genotypes for 3 clusters of SNPs based on a mixture\n    of 3 Bayesian hierarchical models.\n    In cluster +, the minor allele frequency (MAF) θx+ of cases is greater than the MAF θy+ of controls.\n    In cluster 0, the MAF θ0 of cases is equal to the MAF of controls.\n    In cluster −, the MAF θx− of cases is smaller than the MAF θy− of controls.\n    The proportions of the 3 clusters of SNPs are π+ , π0 , and π− , respectively.\n    We assume a “half-flat shape” bivariate prior for the MAF in cluster +\n                                      2h+ (θx+ ) h+ (θy+ ) I (θx+ > θy+ ) ,\n    where I(a) is hte indicator function taking value 1 if the event a is true, and value 0 otherwise. The\n    function h+ is the probability density function of the beta distribution Beta (α+ , β+ ).\n    We assume θ0 has the beta prior Beta(α0 , β0 ).\n    We also assume a “half-flat shape” bivariate prior for the MAF in cluster −\n                                      2h− (θx− ) h− (θy− ) I (θx− > θy− ) .\n    The function h− is the probability density function of the beta distribution Beta (α− , β− ).\n    Given a SNP, we assume Hardy-Weinberg equilibrium holds for its genotypes. That is, given MAF\n    θ, the probabilities of genotypes are\n                                                P r(geno = 2) = θ2\n                                           P r(geno = 1) = 2θ (1 − θ)\n                                            P r(geno = 0) = (1 − θ)\n    We also assume the genotypes 0n(wild-type),\n                                            h         1 (heterozygote),ioand 2 (mutation) follows a multino-\n                                               2                    2\n    mial distribution M ultinomial 1, θ , 2θ (1 − θ) , (1 − θ)\n    Note that when we generate MAFs from the half-flat shape bivariate priors, we might get very small\n    MAFs or get MAFs > 0.5. In these cased, we then delete this SNP.\n    So the final number of SNPs generated might be less than the initially-set number of SNPs.\nValue\n    An ExpressionSet object stores genotype data.\nAuthor(s)\n     <>,  <>,  <>,\n     <>,  <>\nReferences\n    , , , , . Model-based clustering for identifying disease-associated\n    SNPs in case-control genome-wide association studies. Scientific Reports 9, Article number: 13686\n    (2019) https://www.nature.com/articles/s41598-019-50229-6.\nExamples\n    set.seed(2)\n    esSimDiffPriors = simGenoFuncDiffPriors(\n      nCases = 100,\n      nControls = 100,\n      nSNPs = 500,\n      alpha.p.ca = 2, beta.p.ca = 3,\n      alpha.p.co = 2, beta.p.co = 8, pi.p = 0.1,\n      alpha0 = 2, beta0 = 5, pi0 = 0.8,\n      alpha.n.ca = 2, beta.n.ca = 8,\n      alpha.n.co = 2, beta.n.co = 3, pi.n = 0.1,\n      low = 0.02, upp = 0.5, verbose = FALSE\n    )\n    print(esSimDiffPriors)\n    pDat = pData(esSimDiffPriors)\n    print(pDat[1:2,])\n    print(table(pDat$memSubjs))\n    fDat = fData(esSimDiffPriors)\n    print(fDat[1:2,])\n    print(table(fDat$memGenes))\n    print(table(fDat$memGenes2))"}}},{"rowIdx":478,"cells":{"project":{"kind":"string","value":"highcharts-vue"},"source":{"kind":"string","value":"npm"},"language":{"kind":"string","value":"JavaScript"},"content":{"kind":"string","value":"Highcharts-Vue\n===\n\n*The official Highcharts wrapper for Vue framework.*\n\n**This package now also supports Vue 3 and Composition API** 🎉\n\nTable of Contents\n---\n\n1. [Getting started](#getting-started)\n\t1. [Requirements](#requirements)\n\t2. [Installation](#installation)\n2. [Using](#using)\n\t1. [Registering globally as a plugin](#registering-globally-as-a-plugin)\n\t2. [Registering locally in your component](#registering-locally-in-your-component)\n\t3. [Implementing stockChart, mapChart and ganttChart](#implementing-stockchart-mapchart-and-ganttchart)\n\t4. [Loading maps](#loading-maps)\n\t5. [Changing global component tag name](#changing-global-component-tag-name)\n\t6. [Chart callback parameter](#chart-callback-parameter)\n\t7. [Chart object reference](#chart-object-reference)\n\t8. [Using a specific Highcharts instance](#using-a-specific-highcharts-instance)\n3. [Demo apps](#demo-apps)\n4. [Online demos](#online-demos)\n5. [Component Properties](#component-properties)\n6. [Useful links](#useful-links)\n\nGetting started\n---\n\n### Requirements\n\nIn order to use `highcharts-vue` you need to have the following installed:\n\n* `npm` (installed globally in the OS)\n* `vue` (version >= 2.0.0)\n* `highcharts` (*Highcharts package version should be at least `v5.0.11`, but it is always better to keep it up to date.*)\n\n### Installation\n\nInstall `highcharts-vue` package by:\n```\nnpm install highcharts-vue\n```\n### Using\n\nThere are two ways of adding Highcharts-Vue wrapper to your project:\n\n#### Registering globally as a plugin\n\nThe way described below is recommended when wanted to make a wrapper component available from everywhere in your app. In your main app file should have Vue and Highcharts-Vue packages imported:\n```\nimport Vue from 'vue'\nimport HighchartsVue from 'highcharts-vue'\n```\nNext, you can register it as a plugin in your Vue object:\n```\nVue.use(HighchartsVue)\n```\n#### Registering locally in your component\n\nThis option is recommended for direct use in specific components of your app. First, you should import the Chart component object from Highcharts-Vue package in your component file:\n```\nimport { Chart } from 'highcharts-vue'\n```\nThen, you've to register it in your Vue instance configuration, namely in `components` section:\n```\n{\n  components: {\n    highcharts: Chart \n  }\n}\n```\n*NOTE:*\n*If you would like to use Highcharts-Vue wrapper by attaching it using `\n  \n\n\n  

The current time is .

\n

Your name is .

\n \n\n\n #dialog {\n width: 200px;\n margin: auto;\n padding: 10px;\n border: thin solid black;\n background: lightgreen;\n }\n .hidden {\n display: none;\n }\n\n
\n
foobar
\n \n
\n \n \n
\n\n #progress-dialog {\n width: 200px;\n margin: auto;\n border: thin solid black;\n padding: 10px;\n background: lightgreen;\n }\n #progress-dialog .progress-bar {\n border: 1px solid black;\n margin: 10px auto;\n padding: 0;\n height: 20px;\n }\n #progress-dialog .progress-bar>div {\n background-color: blue;\n margin: 0;\n padding: 0;\n border: none;\n height: 20px;\n }\n\n
\n
\n
\n
\n \n
\ndiv');\n this.cancelButton = this.el.querySelector('button.cancel');\n this.attachDomEvents();\n}\nProgressDialog.prototype = Object.create(Dialog.prototype);\nProgressDialog.prototype.attachDomEvents = function() {\n var _this = this;\n this.cancelButton.addEventListener('click', function() {\n _this.cancel();\n });\n\n};\nProgressDialog.prototype.show = function(message) {\n this.messageEl.innerHTML = String(message);\n this.el.className = '';\n return this;\n};\nProgressDialog.prototype.hide = function() {\n this.el.className = 'hidden';\n return this;\n};\nProgressDialog.prototype.setProgress = function(percent) {\n this.progressBar.style.width = percent + '%';\n};\n\n```\n A common misconception is that promises are a form of callback management. This is not the case and is why the idea of having a progress callback is not part of the Promise spec. However, much like the Promise library passes in a `resolve` and `reject` callback when you create a new promise (`new Promise(…)`) we can do the same patter for a progress callback.\n\n Now to the fun part. For this tutorial we will *fake* a lengthy file upload by using `setTimeout`. The intent is to provide a promise and to allow a progress to be periodically ticked away. We will expect a function to be passed which is called whenever the progress needs updating. And it returns a promise.\n\n \n```\nfunction delayedPromise(progressCallback) {\n var step = 10;\n return new Promise(function(resolve, reject) {\n var progress = 0 - step; // So first run of nextTick will set progress to 0\n function nextTick() {\n if (progress >= 100 ) {\n resolve('done');\n } else {\n progress += step;\n progressCallback(progress);\n setTimeout(nextTick, 500);\n }\n }\n nextTick();\n });\n}\n\n```\n When we construct our `ProgressDialog` we use the `waitForUser()` method to capture the user interaction promise and then use `delayedPromise()` to capture the fake network promise and finally `Promise.reace()` to manage the two simultaneously and end with a single promise as usual.\n\n \n```\ndocument.addEventListener('DOMContentLoaded', function() {\n var button = document.getElementById('action');\n var output = document.getElementById('output');\n\n var prompt = new ProgressDialog();\n\n button.addEventListener('click', function() {\n var pendingProgress = true;\n var waitForPromise = delayedPromise(function(progress) {\n if (pendingProgress) {\n prompt.setProgress(progress);\n }\n });\n\n // Prevent user from pressing button while dialog is visible.\n button.disabled = true;\n\n prompt.show('Simulating a file upload.');\n\n Promise.race([waitForPromise, prompt.waitForUser()])\n .then(function() {\n output.innerHTML = 'Progress completed';\n })\n .catch(UserCanceledError, function() {\n output.innerHTML = 'Progress canceled by user';\n })\n .catch(function(e) {\n console.log('Error', e);\n })\n .finally(function() {\n pendingProgress = false;\n button.disabled = false;\n prompt.hide();\n });\n });\n});\n\n```\n [Run example on JSBin](http://jsbin.com/bipeve/edit?js,output)\n\n I hope this helps illustrate some concepts available with Promises and a different perspective on how promises can represent more then just AJAX data.\n\n Although the code may look verbose it does provide the benefit that it is modular and can be easily changed. A trait difficult to achieve with a more procedural style.\n\n Happy coding, [@sukima](https://github.com/sukima).\n\n © 2013–2018 \nLicensed under the MIT License. \n\n **Note** - please check the linked docs for more parameters and usage examples.\n Here's an example of `fs.readFile` with or without promises:\n\n \n```\n// callbacks\nvar fs = require(\"fs\");\nfs.readFile(\"name\", \"utf8\", function(err, data) {\n\n});\n\n```\n Promises:\n\n \n```\nvar fs = Promise.promisifyAll(require(\"fs\"));\nfs.readFileAsync(\"name\", \"utf8\").then(function(data) {\n\n});\n\n```\n Note the new method is suffixed with `Async`, as in `fs.readFileAsync`. It did not replace the `fs.readFile` function. Single functions can also be promisified for example:\n\n \n```\nvar request = Promise.promisify(require(\"request\"));\nrequest(\"foo.bar\").then(function(result) {\n\n});\n\n```\n \n> **Note** `Promise.promisify` and `Promise.promisifyAll` use dynamic recompilation for really fast wrappers and thus calling them should be done only once. [`Promise.fromCallback`](api/promise.fromcallback) exists for cases where this is not possible.\n ### Working with one time events\n\n Sometimes we want to find out when a single one time event has finished. For example - a stream is done. For this we can use [`new Promise`](api/new-promise). Note that this option should be considered only if [automatic conversion](#working-with-callback-apis-using-the-node-convention) isn't possible.\n\n Note that promises model a *single value through time*, they only resolve *once* - so while they're a good fit for a single event, they are not recommended for multiple event APIs.\n\n For example, let's say you have a window `onload` event you want to bind to. We can use the promise construction and resolve when the window has loaded as such:\n\n \n```\n// onload example, the promise constructor takes a\n// 'resolver' function that tells the promise when\n// to resolve and fire off its `then` handlers.\nvar loaded = new Promise(function(resolve, reject) {\n window.addEventListener(\"load\", resolve);\n});\n\nloaded.then(function() {\n // window is loaded here\n});\n\n```\n Here is another example with an API that lets us know when a connection is ready. The attempt here is imperfect and we'll describe why soon:\n\n \n```\nfunction connect() {\n var connection = myConnector.getConnection(); // Synchronous.\n return new Promise(function(resolve, reject) {\n connection.on(\"ready\", function() {\n // When a connection has been established\n // mark the promise as fulfilled.\n resolve(connection);\n });\n connection.on(\"error\", function(e) {\n // If it failed connecting, mark it\n // as rejected.\n reject(e); // e is preferably an `Error`.\n });\n });\n}\n\n```\n The problem with the above is that `getConnection` itself might throw for some reason and if it does we'll get a synchronous rejection. An asynchronous operation should always be asynchronous to prevent double guarding and race conditions so it's best to always put the sync parts inside the promise constructor as such:\n\n \n```\nfunction connect() {\n return new Promise(function(resolve, reject) {\n // If getConnection throws here instead of getting\n // an exception we're getting a rejection thus\n // producing a much more consistent API.\n var connection = myConnector.getConnection();\n connection.on(\"ready\", function() {\n // When a connection has been established\n // mark the promise as fulfilled.\n resolve(connection);\n });\n connection.on(\"error\", function(e) {\n // If it failed connecting, mark it\n // as rejected.\n reject(e); // e is preferably an `Error`\n });\n });\n}\n\n```\n ### Working with delays/setTimeout\n\n There is no need to convert timeouts/delays to a bluebird API, bluebird already ships with the [`Promise.delay`](api/promise.delay) function for this use case. Please consult the [`timers`](api/timers) section of the docs on usage and examples.\n\n ### Working with browser APIs\n\n Often browser APIs are nonstandard and automatic promisification will fail for them. If you're running into an API that you can't promisify with [`promisify`](api/promisify) and [`promisifyAll`](api/promisifyall) - please consult the [working with other APIs section](#working-with-any-other-apis)\n\n ### Working with databases\n\n For resource management in general and databases in particular, bluebird includes the powerful [`Promise.using`](api/promise.using) and disposers system. This is similar to `with` in Python, `using` in C#, try/resource in Java or RAII in C++ in that it lets you handle resource management in an automatic way.\n\n Several examples of databases follow.\n\n \n> **Note** for more examples please see the [`Promise.using`](api/promise.using) section.\n #### Mongoose/MongoDB\n\n Mongoose works with persistent connections and the driver takes care of reconnections/disposals. For this reason using `using` with it isn't required - instead connect on server startup and use promisification to expose promises.\n\n Note that Mongoose already ships with promise support but the promises it offers are significantly slower and don't report unhandled rejections so it is recommended to use automatic promisification with it anyway:\n\n \n```\nvar Mongoose = Promise.promisifyAll(require(\"mongoose\"));\n\n```\n #### Sequelize\n\n Sequelize already uses Bluebird promises internally and has promise returning APIs. Use those.\n\n #### RethinkDB\n\n Rethink already uses Bluebird promises internally and has promise returning APIs. Use those.\n\n #### Bookshelf\n\n Bookshelf already uses Bluebird promises internally and has promise returning APIs. Use those.\n\n #### PostgreSQL\n\n Here is how to create a disposer for the PostgreSQL driver:\n\n \n```\nvar pg = require(\"pg\");\n// Uncomment if pg has not been properly promisified yet.\n//var Promise = require(\"bluebird\");\n//Promise.promisifyAll(pg, {\n// filter: function(methodName) {\n// return methodName === \"connect\"\n// },\n// multiArgs: true\n//});\n// Promisify rest of pg normally.\n//Promise.promisifyAll(pg);\n\nfunction getSqlConnection(connectionString) {\n var close;\n return pg.connectAsync(connectionString).spread(function(client, done) {\n close = done;\n return client;\n }).disposer(function() {\n if (close) close();\n });\n}\n\nmodule.exports = getSqlConnection;\n\n```\n Which would allow you to use:\n\n \n```\nvar using = Promise.using;\n\nusing(getSqlConnection(), function(conn) {\n // use connection here and _return the promise_\n\n}).then(function(result) {\n // connection already disposed here\n\n});\n\n```\n It's also possible to use a disposer pattern (but not actual disposers) for transaction management:\n\n \n```\nfunction withTransaction(fn) {\n return Promise.using(pool.acquireConnection(), function(connection) {\n var tx = connection.beginTransaction()\n return Promise\n .try(fn, tx)\n .then(function(res) { return connection.commit().thenReturn(res) },\n function(err) {\n return connection.rollback()\n .catch(function(e) {/* maybe add the rollback error to err */})\n .thenThrow(err);\n });\n });\n}\nexports.withTransaction = withTransaction;\n\n```\n Which would let you do:\n\n \n```\nwithTransaction(tx => {\n return tx.queryAsync(...).then(function() {\n return tx.queryAsync(...)\n }).then(function() {\n return tx.queryAsync(...)\n });\n});\n\n```\n #### MySQL\n\n Here is how to create a disposer for the MySQL driver:\n\n \n```\nvar mysql = require(\"mysql\");\n// Uncomment if mysql has not been properly promisified yet\n// var Promise = require(\"bluebird\");\n// Promise.promisifyAll(mysql);\n// Promise.promisifyAll(require(\"mysql/lib/Connection\").prototype);\n// Promise.promisifyAll(require(\"mysql/lib/Pool\").prototype);\nvar pool = mysql.createPool({\n connectionLimit: 10,\n host: 'example.org',\n user: 'bob',\n password: 'secret'\n});\n\nfunction getSqlConnection() {\n return pool.getConnectionAsync().disposer(function(connection) {\n connection.release();\n });\n}\n\nmodule.exports = getSqlConnection;\n\n```\n The usage pattern is similar to the PostgreSQL example above. You can also use a disposer pattern (but not an actual .disposer). See the PostgreSQL example above for instructions.\n\n ### More common examples\n\n Some examples of the above practice applied to some popular libraries:\n\n \n```\n// The most popular redis module\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"redis\"));\n\n```\n\n```\n// The most popular mongodb module\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"mongodb\"));\n\n```\n\n```\n// The most popular mysql module\nvar Promise = require(\"bluebird\");\n// Note that the library's classes are not properties of the main export\n// so we require and promisifyAll them manually\nPromise.promisifyAll(require(\"mysql/lib/Connection\").prototype);\nPromise.promisifyAll(require(\"mysql/lib/Pool\").prototype);\n\n```\n\n```\n// Mongoose\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"mongoose\"));\n\n```\n\n```\n// Request\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"request\"));\n// Use request.getAsync(...) not request(..), it will not return a promise\n\n```\n\n```\n// mkdir\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"mkdirp\"));\n// Use mkdirp.mkdirpAsync not mkdirp(..), it will not return a promise\n\n```\n\n```\n// winston\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"winston\"));\n\n```\n\n```\n// rimraf\nvar Promise = require(\"bluebird\");\n// The module isn't promisified but the function returned is\nvar rimrafAsync = Promise.promisify(require(\"rimraf\"));\n\n```\n\n```\n// xml2js\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"xml2js\"));\n\n```\n\n```\n// jsdom\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"jsdom\"));\n\n```\n\n```\n// fs-extra\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"fs-extra\"));\n\n```\n\n```\n// prompt\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"prompt\"));\n\n```\n\n```\n// Nodemailer\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"nodemailer\"));\n\n```\n\n```\n// ncp\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"ncp\"));\n\n```\n\n```\n// pg\nvar Promise = require(\"bluebird\");\nPromise.promisifyAll(require(\"pg\"));\n\n```\n In all of the above cases the library made its classes available in one way or another. If this is not the case, you can still promisify by creating a throwaway instance:\n\n \n```\nvar ParanoidLib = require(\"...\");\nvar throwAwayInstance = ParanoidLib.createInstance();\nPromise.promisifyAll(Object.getPrototypeOf(throwAwayInstance));\n// Like before, from this point on, all new instances + even the throwAwayInstance suddenly support promises\n\n```\n ### Working with any other APIs\n\n Sometimes you have to work with APIs that are inconsistent and do not follow a common convention.\n\n \n> **Note** Promise returning function should never throw\n For example, something like:\n\n \n```\nfunction getUserData(userId, onLoad, onFail) { ...\n\n```\n We can use the promise constructor to convert it to a promise returning function:\n\n \n```\nfunction getUserDataAsync(userId) {\n return new Promise(function(resolve, reject) {\n // Put all your code here, this section is throw-safe.\n getUserData(userId, resolve, reject);\n });\n}\n\n```\n\n © 2013–2018 \nLicensed under the MIT License. \n\n {\n if(!items) throw new InvalidItemsError(); \n return items;\n }).catch(e => {\n // can address the error here and recover from it, from getItemsAsync rejects or returns a falsey value\n throw e; // Need to rethrow unless we actually recovered, just like in the synchronous version\n }).then(process);\n}\n\n```\n ### Catch-all\n\n \n```\n.catch(function(any error) handler) -> Promise\n\n```\n\n```\n.caught(function(any error) handler) -> Promise\n\n```\n This is a catch-all exception handler, shortcut for calling [`.then(null, handler)`](then) on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.\n\n *For compatibility with earlier ECMAScript versions, an alias `.caught` is provided for [`.catch`](catch).*\n\n ### Filtered Catch\n\n \n```\n.catch(\n class ErrorClass|function(any error)|Object predicate...,\n function(any error) handler\n) -> Promise\n\n```\n\n```\n.caught(\n class ErrorClass|function(any error)|Object predicate...,\n function(any error) handler\n) -> Promise\n\n```\n This is an extension to [`.catch`](catch) to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === \"SomeError\"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called.\n\n Example:\n\n \n```\nsomePromise.then(function() {\n return a.b.c.d();\n}).catch(TypeError, function(e) {\n //If it is a TypeError, will end up here because\n //it is a type error to reference property of undefined\n}).catch(ReferenceError, function(e) {\n //Will end up here if a was never declared at all\n}).catch(function(e) {\n //Generic catch-the rest, error wasn't TypeError nor\n //ReferenceError\n});\n\n```\n You may also add multiple filters for a catch handler:\n\n \n```\nsomePromise.then(function() {\n return a.b.c.d();\n}).catch(TypeError, ReferenceError, function(e) {\n //Will end up here on programmer error\n}).catch(NetworkError, TimeoutError, function(e) {\n //Will end up here on expected everyday network errors\n}).catch(function(e) {\n //Catch any unexpected errors\n});\n\n```\n For a parameter to be considered a type of error that you want to filter, you need the constructor to have its `.prototype` property be `instanceof Error`.\n\n Such a constructor can be minimally created like so:\n\n \n```\nfunction MyCustomError() {}\nMyCustomError.prototype = Object.create(Error.prototype);\n\n```\n Using it:\n\n \n```\nPromise.resolve().then(function() {\n throw new MyCustomError();\n}).catch(MyCustomError, function(e) {\n //will end up here now\n});\n\n```\n However if you want stack traces and cleaner string output, then you should do:\n\n *in Node.js and other V8 environments, with support for `Error.captureStackTrace`*\n\n \n```\nfunction MyCustomError(message) {\n this.message = message;\n this.name = \"MyCustomError\";\n Error.captureStackTrace(this, MyCustomError);\n}\nMyCustomError.prototype = Object.create(Error.prototype);\nMyCustomError.prototype.constructor = MyCustomError;\n\n```\n Using CoffeeScript's `class` for the same:\n\n \n```\nclass MyCustomError extends Error\n constructor: (@message) ->\n @name = \"MyCustomError\"\n Error.captureStackTrace(this, MyCustomError)\n\n```\n This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called.\n\n Predicates should allow for very fine grained control over caught errors: pattern matching, error-type sets with set operations and many other techniques can be implemented on top of them.\n\n Example of using a predicate-based filter:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar request = Promise.promisify(require(\"request\"));\n\nfunction ClientError(e) {\n return e.code >= 400 && e.code < 500;\n}\n\nrequest(\"http://www.google.com\").then(function(contents) {\n console.log(contents);\n}).catch(ClientError, function(e) {\n //A client error like 400 Bad Request happened\n});\n\n```\n Predicate functions that only check properties have a handy shorthand. In place of a predicate function, you can pass an object, and its properties will be checked against the error object for a match:\n\n \n```\nfs.readFileAsync(...)\n .then(...)\n .catch({code: 'ENOENT'}, function(e) {\n console.log(\"file not found: \" + e.path);\n });\n\n```\n The object predicate passed to `.catch` in the above code (`{code: 'ENOENT'}`) is shorthand for a predicate function `function predicate(e) { return isObject(e) && e.code == 'ENOENT' }`, I.E. loose equality is used.\n\n *For compatibility with earlier ECMAScript version, an alias `.caught` is provided for [`.catch`](catch).* \n\n By not returning a rejected value or `throw`ing from a catch, you \"recover from failure\" and continue the chain:\n\n \n```\nPromise.reject(Error('fail!'))\n .catch(function(e) {\n // fallback with \"recover from failure\"\n return Promise.resolve('success!'); // promise or value\n })\n .then(function(result) {\n console.log(result); // will print \"success!\"\n });\n\n```\n This is exactly like the synchronous code:\n\n \n```\nvar result;\ntry {\n throw Error('fail');\n} catch(e) {\n result = 'success!';\n}\nconsole.log(result);\n\n```\n\nPlease enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\n.lastly(function() handler) -> Promise\n\n```\n Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for [`.finally`](finally) in that the final value cannot be modified from the handler.\n\n *Note: using [`.finally`](finally) for resource management has better alternatives, see [resource management](resource-management)*\n\n Consider the example:\n\n \n```\nfunction anyway() {\n $(\"#ajax-loader-animation\").hide();\n}\n\nfunction ajaxGetAsync(url) {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest;\n xhr.addEventListener(\"error\", reject);\n xhr.addEventListener(\"load\", resolve);\n xhr.open(\"GET\", url);\n xhr.send(null);\n }).then(anyway, anyway);\n}\n\n```\n This example doesn't work as intended because the `then` handler actually swallows the exception and returns `undefined` for any further chainers.\n\n The situation can be fixed with `.finally`:\n\n \n```\nfunction ajaxGetAsync(url) {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest;\n xhr.addEventListener(\"error\", reject);\n xhr.addEventListener(\"load\", resolve);\n xhr.open(\"GET\", url);\n xhr.send(null);\n }).finally(function() {\n $(\"#ajax-loader-animation\").hide();\n });\n}\n\n```\n Now the animation is hidden but, unless it throws an exception, the function has no effect on the fulfilled or rejected value of the returned promise. This is similar to how the synchronous `finally` keyword behaves.\n\n If the handler function passed to `.finally` returns a promise, the promise returned by `.finally` will not be settled until the promise returned by the handler is settled. If the handler fulfills its promise, the returned promise will be fulfilled or rejected with the original value. If the handler rejects its promise, the returned promise will be rejected with the handler's value. This is similar to throwing an exception in a synchronous `finally` block, causing the original value or exception to be forgotten. This delay can be useful if the actions performed by the handler are done asynchronously. For example:\n\n \n```\nfunction ajaxGetAsync(url) {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest;\n xhr.addEventListener(\"error\", reject);\n xhr.addEventListener(\"load\", resolve);\n xhr.open(\"GET\", url);\n xhr.send(null);\n }).finally(function() {\n return Promise.fromCallback(function(callback) {\n $(\"#ajax-loader-animation\").fadeOut(1000, callback);\n });\n });\n}\n\n```\n If the fade out completes successfully, the returned promise will be fulfilled or rejected with the value from `xhr`. If `.fadeOut` throws an exception or passes an error to the callback, the returned promise will be rejected with the error from `.fadeOut`.\n\n *For compatibility with earlier ECMAScript version, an alias `.lastly` is provided for [`.finally`](finally).* \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|any values...,\n function handler\n) -> Promise\n\n```\n For coordinating multiple concurrent discrete promises. While [`.all`](all) is good for handling a dynamically sized list of uniform promises, `Promise.join` is much easier (and more performant) to use when you have a fixed amount of discrete promises that you want to coordinate concurrently. The final parameter, handler function, will be invoked with the result values of all of the fufilled promises. For example:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar join = Promise.join;\n\njoin(getPictures(), getComments(), getTweets(),\n function(pictures, comments, tweets) {\n console.log(\"in total: \" + pictures.length + comments.length + tweets.length);\n});\n\n```\n\n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\nvar pg = require(\"pg\");\nPromise.promisifyAll(pg, {\n filter: function(methodName) {\n return methodName === \"connect\"\n },\n multiArgs: true\n});\n// Promisify rest of pg normally\nPromise.promisifyAll(pg);\nvar join = Promise.join;\nvar connectionString = \"postgres://username:password@localhost/database\";\n\nvar fContents = fs.readFileAsync(\"file.txt\", \"utf8\");\nvar fStat = fs.statAsync(\"file.txt\");\nvar fSqlClient = pg.connectAsync(connectionString).spread(function(client, done) {\n client.close = done;\n return client;\n});\n\njoin(fContents, fStat, fSqlClient, function(contents, stat, sqlClient) {\n var query = \" \\\n INSERT INTO files (byteSize, contents) \\\n VALUES ($1, $2) \\\n \";\n return sqlClient.queryAsync(query, [stat.size, contents]).thenReturn(query);\n})\n.then(function(query) {\n console.log(\"Successfully ran the Query: \" + query);\n})\n.finally(function() {\n // This is why you want to use Promise.using for resource management\n if (fSqlClient.isFulfilled()) {\n fSqlClient.value().close();\n }\n});\n\n```\n *Note: In 1.x and 0.x `Promise.join` used to be a `Promise.all` that took the values in as arguments instead of an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply* \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n function\n\n```\n Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function.\n\n This method is convenient when a function can sometimes return synchronously or throw synchronously.\n\n Example without using `Promise.method`:\n\n \n```\nMyClass.prototype.method = function(input) {\n if (!this.isValid(input)) {\n return Promise.reject(new TypeError(\"input is not valid\"));\n }\n\n if (this.cache(input)) {\n return Promise.resolve(this.someCachedValue);\n }\n\n return db.queryAsync(input).bind(this).then(function(value) {\n this.someCachedValue = value;\n return value;\n });\n};\n\n```\n Using the same function `Promise.method`, there is no need to manually wrap direct return or throw values into a promise:\n\n \n```\nMyClass.prototype.method = Promise.method(function(input) {\n if (!this.isValid(input)) {\n throw new TypeError(\"input is not valid\");\n }\n\n if (this.cache(input)) {\n return this.someCachedValue;\n }\n\n return db.queryAsync(input).bind(this).then(function(value) {\n this.someCachedValue = value;\n return value;\n });\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|any value) -> Promise\n\n```\n Create a promise that is resolved with the given value. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled Promise is returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted Promise that assimilates the state of the thenable.\n\n This can be useful if a function returns a promise (say into a chain) but can optionally return a static value. Say, for a lazy-loaded value. Example:\n\n \n```\nvar someCachedValue;\n\nvar getValue = function() {\n if (someCachedValue) {\n return Promise.resolve(someCachedValue);\n }\n\n return db.queryAsync().then(function(value) {\n someCachedValue = value;\n return value;\n });\n};\n\n```\n Another example with handling jQuery castable objects (`$` is jQuery)\n\n \n```\nPromise.resolve($.get(\"http://www.google.com\")).then(function() {\n //Returning a thenable from a handler is automatically\n //cast to a trusted Promise as per Promises/A+ specification\n return $.post(\"http://www.yahoo.com\");\n}).then(function() {\n\n}).catch(function(e) {\n //jQuery doesn't throw real errors so use catch-all\n console.log(e.statusText);\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Create a promise that is rejected with the given `error`. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n.\nfunction authenticate() {\n return getUsername().then(function (username) {\n return getUser(username);\n // chained because we will not need the user name in the next event\n }).then(function (user) {\n // nested because we need both user and password next\n return getPassword().then(function (password) {\n if (user.passwordHash !== hash(password)) {\n throw new Error(\"Can't authenticate\");\n }\n });\n });\n}\n\n```\n Or you could take advantage of the fact that if we reach password validation, then the user promise must be fulfilled:\n\n \n```\nfunction authenticate() {\n var user = getUsername().then(function(username) {\n return getUser(username);\n });\n\n return user.then(function(user) {\n return getPassword();\n }).then(function(password) {\n // Guaranteed that user promise is fulfilled, so .value() can be called here\n if (user.value().passwordHash !== hash(password)) {\n throw new Error(\"Can't authenticate\");\n }\n });\n}\n\n```\n In the latter the indentation stays flat no matter how many previous variables you need, whereas with the former each additional previous value would require an additional nesting level. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n boolean\n\n```\n See if this promise has been fulfilled. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n boolean\n\n```\n See if this promise has been rejected. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n boolean\n\n```\n See if this `promise` is pending (not fulfilled or rejected or cancelled). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n boolean\n\n```\n See if this `promise` has been cancelled. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n any\n\n```\n Get the fulfillment value of this promise. Throws an error if the promise isn't fulfilled - it is a bug to call this method on an unfulfilled promise.\n\n You should check if this promise is [`.isFulfilled()`](isfulfilled) in code paths where it's not guaranteed that this promise is fulfilled. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n any\n\n```\n Get the rejection reason of this promise. Throws an error if the promise isn't rejected - it is a bug to call this method on an unrejected promise.\n\n You should check if this promise is [`.isRejected()`](isrejected) in code paths where it's guaranteed that this promise is rejected.\n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n|Promise> input) -> Promise```\n This method is useful for when you want to wait for more than one promise to complete.\n\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason.\n\n \n```\nvar files = [];\nfor (var i = 0; i < 100; ++i) {\n files.push(fs.writeFileAsync(\"file-\" + i + \".txt\", \"\", \"utf-8\"));\n}\nPromise.all(files).then(function() {\n console.log(\"all the files were created\");\n});\n\n```\n This method is compatible with [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) from native promises. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n input) -> Promise\n\n```\n Like [`.all`](all) but for object properties or `Map`s* entries instead of iterated values. Returns a promise that is fulfilled when all the properties of the object or the `Map`'s' values** are fulfilled. The promise's fulfillment value is an object or a `Map` with fulfillment values at respective keys to the original object or a `Map`. If any promise in the object or `Map` rejects, the returned promise is rejected with the rejection reason.\n\n If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects (except `Map`s) are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties.\n\n **Only the native [ECMAScript 6 `Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) implementation that is provided by the environment as is is supported*\n\n ***If the map's keys happen to be `Promise`s, they are not awaited for and the resulting `Map` will still have those same `Promise` instances as keys*\n\n \n```\nPromise.props({\n pictures: getPictures(),\n comments: getComments(),\n tweets: getTweets()\n}).then(function(result) {\n console.log(result.tweets, result.pictures, result.comments);\n});\n\n```\n\n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\nvar _ = require(\"lodash\");\nvar path = require(\"path\");\nvar util = require(\"util\");\n\nfunction directorySizeInfo(root) {\n var counts = {dirs: 0, files: 0};\n var stats = (function reader(root) {\n return fs.readdirAsync(root).map(function(fileName) {\n var filePath = path.join(root, fileName);\n return fs.statAsync(filePath).then(function(stat) {\n stat.filePath = filePath;\n if (stat.isDirectory()) {\n counts.dirs++;\n return reader(filePath)\n }\n counts.files++;\n return stat;\n });\n }).then(_.flatten);\n })(root).then(_.chain);\n\n var smallest = stats.call(\"min\", \"size\").call(\"pick\", \"size\", \"filePath\").call(\"value\");\n var largest = stats.call(\"max\", \"size\").call(\"pick\", \"size\", \"filePath\").call(\"value\");\n var totalSize = stats.call(\"pluck\", \"size\").call(\"reduce\", function(a, b) {\n return a + b;\n }, 0);\n\n return Promise.props({\n counts: counts,\n smallest: smallest,\n largest: largest,\n totalSize: totalSize\n });\n}\n\ndirectorySizeInfo(process.argv[2] || \".\").then(function(sizeInfo) {\n console.log(util.format(\" \\n\\\n %d directories, %d files \\n\\\n Total size: %d bytes \\n\\\n Smallest file: %s with %d bytes \\n\\\n Largest file: %s with %d bytes \\n\\\n \", sizeInfo.counts.dirs, sizeInfo.counts.files, sizeInfo.totalSize,\n sizeInfo.smallest.filePath, sizeInfo.smallest.size,\n sizeInfo.largest.filePath, sizeInfo.largest.size));\n});\n\n```\n Note that if you have no use for the result object other than retrieving the properties, it is more convenient to use [`Promise.join`](promise.join):\n\n \n```\nPromise.join(getPictures(), getComments(), getTweets(),\n function(pictures, comments, tweets) {\n console.log(pictures, comments, tweets);\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n|Promise> input) -> Promise\n\n```\n Like [`Promise.some`](promise.some), with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input,\n int count\n) -> Promise\n\n```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and return a promise that is fulfilled as soon as `count` promises are fulfilled in the array. The fulfillment value is an array with `count` values in the order they were fulfilled.\n\n This example pings 4 nameservers, and logs the fastest 2 on console:\n\n \n```\nPromise.some([\n ping(\"ns1.example.com\"),\n ping(\"ns2.example.com\"),\n ping(\"ns3.example.com\"),\n ping(\"ns4.example.com\")\n], 2).spread(function(first, second) {\n console.log(first, second);\n});\n\n```\n If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an [`AggregateError`](aggregateerror) of the rejection reasons in the order they were thrown in.\n\n You can get a reference to [`AggregateError`](aggregateerror) from `Promise.AggregateError`.\n\n \n```\nPromise.some(...)\n .then(...)\n .then(...)\n .catch(Promise.AggregateError, function(err) {\n err.forEach(function(e) {\n console.error(e.stack);\n });\n });\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input,\n function(any accumulator, any item, int index, int length) reducer,\n [any initialValue]\n) -> Promise\n\n```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and [reduce the array to a value](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) using the given `reducer` function.\n\n If the reducer function returns a promise, then the result of the promise is awaited, before continuing with next iteration. If any promise in the array is rejected or a promise returned by the reducer function is rejected, the result is rejected as well.\n\n Read given files sequentially while summing their contents as an integer. Each file contains just the text `10`.\n\n \n```\nPromise.reduce([\"file1.txt\", \"file2.txt\", \"file3.txt\"], function(total, fileName) {\n return fs.readFileAsync(fileName, \"utf8\").then(function(contents) {\n return total + parseInt(contents, 10);\n });\n}, 0).then(function(total) {\n //Total is 30\n});\n\n```\n *If `initialValue` is `undefined` (or a promise that resolves to `undefined`) and the iterable contains only 1 item, the callback will not be called and the iterable's single item is returned. If the iterable is empty, the callback will not be called and `initialValue` is returned (which may be `undefined`).*\n\n `Promise.reduce` will start calling the reducer as soon as possible, this is why you might want to use it over `Promise.all` (which awaits for the entire array before you can call [`Array#reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) on it). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input,\n function(any item, int index, int length) filterer,\n [Object {concurrency: int=Infinity} options]\n) -> Promise\n\n```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and [filter the array to another](http://en.wikipedia.org/wiki/Filter_(higher-order_function)) using the given `filterer` function.\n\n It is essentially an efficient shortcut for doing a [`.map`](map) and then [`Array#filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter):\n\n \n```\nPromise.map(valuesToBeFiltered, function(value, index, length) {\n return Promise.all([filterer(value, index, length), value]);\n}).then(function(values) {\n return values.filter(function(stuff) {\n return stuff[0] == true\n }).map(function(stuff) {\n return stuff[1];\n });\n});\n\n```\n Example for filtering files that are accessible directories in the current directory:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar E = require(\"core-error-predicates\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\n\nfs.readdirAsync(process.cwd()).filter(function(fileName) {\n return fs.statAsync(fileName)\n .then(function(stat) {\n return stat.isDirectory();\n })\n .catch(E.FileAccessError, function() {\n return false;\n });\n}).each(function(directoryName) {\n console.log(directoryName, \" is an accessible directory\");\n});\n\n```\n #### Filter Option: concurrency\n\n See [Map Option: concurrency](#map-option-concurrency) \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input) -> Promise\n\n```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value.\n\n This method is only implemented because it's in the ES6 standard. If you want to race promises to fulfillment the [`.any`](any) method is more appropriate as it doesn't qualify a rejected promise as the winner. It also has less surprises: `.race` must become infinitely pending if an empty array is passed but passing an empty array to [`.any`](any) is more usefully a `RangeError` \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Consume the resolved [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) and wait for all items to fulfill similar to [`Promise.all()`](promise.all).\n\n [`Promise.resolve(iterable).all()`](promise.resolve) is the same as [`Promise.all(iterable)`](promise.all). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.props(this)`](promise.props). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.any(this)`](promise.any). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.some(this, count)`](promise.some). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.map(this, mapper, options)`](promise.map). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.reduce(this, reducer, initialValue)`](promise.reduce). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.filter(this, filterer, options)`](promise.filter). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given `iterator` function with the signature `(value, index, length)` where `value` is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well.\n\n Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, then the result of the promise is awaited, before continuing with next iteration.\n\n Example where you might want to utilize `.each`:\n\n \n```\n// Source: http://jakearchibald.com/2014/es7-async-functions/\nfunction loadStory() {\n return getJSON('story.json')\n .then(function(story) {\n addHtmlToPage(story.heading);\n return story.chapterURLs.map(getJSON);\n })\n .each(function(chapter) { addHtmlToPage(chapter.html); })\n .then(function() { addTextToPage(\"All done\"); })\n .catch(function(err) { addTextToPage(\"Argh, broken: \" + err.message); })\n .then(function() { document.querySelector('.spinner').style.display = 'none'; });\n}\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as [`Promise.mapSeries(this, iterator)`](promise.mapseries). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n|Promise> input,\n function(any item, int index, int length) mapper,\n [Object {concurrency: int=Infinity} options]\n) -> Promise\n\n```\n Given a finite [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)(arrays are `Iterable`), or a promise of an `Iterable`, which produces promises (or a mix of promises and values), iterate over all the values in the `Iterable` into an array and [map the array to another](http://en.wikipedia.org/wiki/Map_(higher-order_function)) using the given `mapper` function.\n\n Promises returned by the `mapper` function are awaited for and the returned promise doesn't fulfill until all mapped promises have fulfilled as well. If any promise in the array is rejected, or any promise returned by the `mapper` function is rejected, the returned promise is rejected as well.\n\n The mapper function for a given item is called as soon as possible, that is, when the promise for that item's index in the input array is fulfilled. This doesn't mean that the result array has items in random order, it means that `.map` can be used for concurrency coordination unlike `.all`.\n\n A common use of `Promise.map` is to replace the `.push`+`Promise.all` boilerplate:\n\n \n```\nvar promises = [];\nfor (var i = 0; i < fileNames.length; ++i) {\n promises.push(fs.readFileAsync(fileNames[i]));\n}\nPromise.all(promises).then(function() {\n console.log(\"done\");\n});\n\n// Using Promise.map:\nPromise.map(fileNames, function(fileName) {\n // Promise.map awaits for returned promises as well.\n return fs.readFileAsync(fileName);\n}).then(function() {\n console.log(\"done\");\n});\n\n// Using Promise.map and async/await:\nawait Promise.map(fileNames, function(fileName) {\n // Promise.map awaits for returned promises as well.\n return fs.readFileAsync(fileName);\n});\nconsole.log(\"done\");\n\n```\n A more involved example:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar join = Promise.join;\nvar fs = Promise.promisifyAll(require(\"fs\"));\nfs.readdirAsync(\".\").map(function(fileName) {\n var stat = fs.statAsync(fileName);\n var contents = fs.readFileAsync(fileName).catch(function ignore() {});\n return join(stat, contents, function(stat, contents) {\n return {\n stat: stat,\n fileName: fileName,\n contents: contents\n }\n });\n// The return value of .map is a promise that is fulfilled with an array of the mapped values\n// That means we only get here after all the files have been statted and their contents read\n// into memory. If you need to do more operations per file, they should be chained in the map\n// callback for concurrency.\n}).call(\"sort\", function(a, b) {\n return a.fileName.localeCompare(b.fileName);\n}).each(function(file) {\n var contentLength = file.stat.isDirectory() ? \"(directory)\" : file.contents.length + \" bytes\";\n console.log(file.fileName + \" last modified \" + file.stat.mtime + \" \" + contentLength)\n});\n\n```\n #### Map Option: concurrency\n\n You may optionally specify a concurrency limit:\n\n \n```\n...map(..., {concurrency: 3});\n\n```\n The concurrency limit applies to Promises returned by the mapper function and it basically limits the number of Promises created. For example, if `concurrency` is `3` and the mapper callback has been called enough so that there are three returned Promises currently pending, no further callbacks are called until one of the pending Promises resolves. So the mapper function will be called three times and it will be called again only after at least one of the Promises resolves.\n\n Playing with the first example with and without limits, and seeing how it affects the duration when reading 20 files:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar join = Promise.join;\nvar fs = Promise.promisifyAll(require(\"fs\"));\nvar concurrency = parseFloat(process.argv[2] || \"Infinity\");\nconsole.time(\"reading files\");\nfs.readdirAsync(\".\").map(function(fileName) {\n var stat = fs.statAsync(fileName);\n var contents = fs.readFileAsync(fileName).catch(function ignore() {});\n return join(stat, contents, function(stat, contents) {\n return {\n stat: stat,\n fileName: fileName,\n contents: contents\n }\n });\n// The return value of .map is a promise that is fulfilled with an array of the mapped values\n// That means we only get here after all the files have been statted and their contents read\n// into memory. If you need to do more operations per file, they should be chained in the map\n// callback for concurrency.\n}, {concurrency: concurrency}).call(\"sort\", function(a, b) {\n return a.fileName.localeCompare(b.fileName);\n}).then(function() {\n console.timeEnd(\"reading files\");\n});\n\n```\n\n```\n$ sync && echo 3 > /proc/sys/vm/drop_caches\n$ node test.js 1\nreading files 35ms\n$ sync && echo 3 > /proc/sys/vm/drop_caches\n$ node test.js Infinity\nreading files: 9ms\n\n```\n The order `map` calls the mapper function on the array elements is not specified, there is no guarantee on the order in which it'll execute the `map`er on the elements. For order guarantee in sequential execution - see [`Promise.mapSeries`](promise.mapseries). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input,\n function(any value, int index, int arrayLength) iterator\n) -> Promise```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) (an array, for example), or a promise of an `Iterable`, iterates serially over all the values in it, executing the given `iterator` on each element. If an element is a promise, the iterator will wait for it before proceeding. The `iterator` function has signature `(value, index, arrayLength)` where `value` is the current element (or its resolved value if it is a promise).\n\n If, at any step:\n\n * The iterator returns a promise or a thenable, it is awaited before continuing to the next iteration.\n* The current element of the iteration is a *pending* promise, that promise will be awaited before running the iterator.\n* The current element of the iteration is a *rejected* promise, the iteration will stop and be rejected as well (with the same reason).\n\n If all iterations resolve successfully, the `Promise.each` call resolves to a new array containing the resolved values of the original input elements.\n\n `Promise.each` is very similar to [`Promise.mapSeries`](promise.mapseries). The difference between `Promise.each` and `Promise.mapSeries` is their resolution value. `Promise.each` resolves with an array as explained above, while `Promise.mapSeries` resolves with an array containing the *outputs* of the iterator function on each step. This way, `Promise.each` is meant to be mainly used for side-effect operations (since the outputs of the iterator are essentially discarded), just like the native `.forEach()` method of arrays, while `Promise.map` is meant to be used as an async version of the native `.map()` method of arrays.\n\n Basic example:\n\n \n```\n// The array to be iterated over can be a mix of values and promises.\nvar fileNames = [\"1.txt\", Promise.resolve(\"2.txt\"), \"3.txt\", Promise.delay(3000, \"4.txt\"), \"5.txt\"];\n\nPromise.each(fileNames, function(fileName, index, arrayLength) {\n // The iteration will be performed sequentially, awaiting for any\n // promises in the process.\n return fs.readFileAsync(fileName).then(function(fileContents) {\n // ...\n\n // The final resolution value of the iterator is is irrelevant,\n // since the result of the `Promise.each` has nothing to do with\n // the outputs of the iterator.\n return \"anything\"; // Doesn't matter\n });\n}).then(function(result) {\n // This will run after the last step is done\n console.log(\"Done!\")\n console.log(result); // [\"1.txt\", \"2.txt\", \"3.txt\", \"4.txt\", \"5.txt\"]\n});\n\n```\n Example with a rejected promise in the array:\n\n \n```\n// If one of the promises in the original array rejects,\n// the iteration will stop once it reaches it\nvar items = [\"A\", Promise.delay(8000, \"B\"), Promise.reject(\"C\"), \"D\"];\n\nPromise.each(items, function(item) {\n return Promise.delay(4000).then(function() {\n console.log(\"On iterator: \" + item);\n });\n}).then(function(result) {\n // This not run\n}).catch(function(rejection) {\n console.log(\"Catch: \" + rejection);\n});\n\n// The code above outputs the following after 12 seconds (not 16!):\n// On iterator: A\n// On iterator: B\n// Catch: C\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n|Promise> input,\n function(any value, int index, int arrayLength) mapper\n) -> Promise```\n Given an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) (an array, for example), or a promise of an `Iterable`, iterates serially over all the values in it, executing the given `mapper` on each element. If an element is a promise, the mapper will wait for it before proceeding. The `mapper` function has signature `(value, index, arrayLength)` where `value` is the current element (or its resolved value if it is a promise).\n\n If, at any step:\n\n * The mapper returns a promise or a thenable, it is awaited before continuing to the next iteration.\n* The current element of the iteration is a *pending* promise, that promise will be awaited before running the mapper.\n* The current element of the iteration is a *rejected* promise, the iteration will stop and be rejected as well (with the same reason).\n\n If all iterations resolve successfully, the `Promise.mapSeries` call resolves to a new array containing the results of each `mapper` execution, in order.\n\n `Promise.mapSeries` is very similar to [`Promise.each`](promise.each). The difference between `Promise.each` and `Promise.mapSeries` is their resolution value. `Promise.mapSeries` resolves with an array as explained above, while `Promise.each` resolves with an array containing the *resolved values of the input elements* (ignoring the outputs of the iteration steps). This way, `Promise.each` is meant to be mainly used for side-effect operations (since the outputs of the iterator are essentially discarded), just like the native `.forEach()` method of arrays, while `Promise.map` is meant to be used as an async version of the native `.map()` method of arrays.\n\n Basic example:\n\n \n```\n// The array to be mapped over can be a mix of values and promises.\nvar fileNames = [\"1.txt\", Promise.resolve(\"2.txt\"), \"3.txt\", Promise.delay(3000, \"4.txt\"), \"5.txt\"];\n\nPromise.mapSeries(fileNames, function(fileName, index, arrayLength) {\n // The iteration will be performed sequentially, awaiting for any\n // promises in the process.\n return fs.readFileAsync(fileName).then(function(fileContents) {\n // ...\n return fileName + \"!\";\n });\n}).then(function(result) {\n // This will run after the last step is done\n console.log(\"Done!\")\n console.log(result); // [\"1.txt!\", \"2.txt!\", \"3.txt!\", \"4.txt!\", \"5.txt!\"]\n});\n\n```\n Example with a rejected promise in the array:\n\n \n```\n// If one of the promises in the original array rejects,\n// the iteration will stop once it reaches it\nvar items = [\"A\", Promise.delay(8000, \"B\"), Promise.reject(\"C\"), \"D\"];\n\nPromise.each(items, function(item) {\n return Promise.delay(4000).then(function() {\n console.log(\"On mapper: \" + item);\n });\n}).then(function(result) {\n // This not run\n}).catch(function(rejection) {\n console.log(\"Catch: \" + rejection);\n});\n\n// The code above outputs the following after 12 seconds (not 16!):\n// On mapper: A\n// On mapper: B\n// Catch: C\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\nPromise.using(\n Array resources,\n function(Array resources) handler\n) -> Promise\n\n```\n In conjunction with [`.disposer`](disposer), `using` will make sure that no matter what, the specified disposer will be called when the promise returned by the callback passed to `using` has settled. The disposer is necessary because there is no standard interface in node for disposing resources.\n\n Here is a simple example (where `getConnection()` has been defined to return a proper Disposer object)\n\n \n```\nusing(getConnection(), function(connection) {\n // Don't leak the `connection` variable anywhere from here\n // it is only guaranteed to be open while the promise returned from\n // this callback is still pending\n return connection.queryAsync(\"SELECT * FROM TABLE\");\n // Code that is chained from the promise created in the line above\n // still has access to `connection`\n}).then(function(rows) {\n // The connection has been closed by now\n console.log(rows);\n});\n\n```\n Using multiple resources:\n\n \n```\nusing(getConnection(), function(conn1) {\n return using(getConnection(), function(conn2) {\n // use conn1 and conn 2 here\n });\n}).then(function() {\n // Both connections closed by now\n})\n\n```\n The above can also be written as (with a caveat, see below)\n\n \n```\nusing(getConnection(), getConnection(), function(conn1, conn2) {\n // use conn1 and conn2\n}).then(function() {\n // Both connections closed by now\n})\n\n```\n However, if the second `getConnection` throws **synchronously**, the first connection is leaked. This will not happen when using APIs through bluebird promisified methods though. You can wrap functions that could throw in [`Promise.method`](promise.method) which will turn synchronous rejections into rejected promises.\n\n Note that you can mix promises and disposers, so that you can acquire all the things you need in parallel instead of sequentially\n\n \n```\n// The files don't need resource management but you should\n// still start the process of reading them even before you have the connection\n// instead of waiting for the connection\n\n// The connection is always closed, no matter what fails at what point\nusing(readFile(\"1.txt\"), readFile(\"2.txt\"), getConnection(), function(txt1, txt2, conn) {\n // use conn and have access to txt1 and txt2\n});\n\n```\n You can also pass the resources in an array in the first argument. In this case the handler function will only be called with one argument that is the array containing the resolved resources in respective positions in the array. Example:\n\n \n```\nvar connectionPromises = [getConnection(), getConnection()];\n\nusing(connectionPromises, function(connections) {\n var conn1 = connections[0];\n var conn2 = connections[1];\n // use conn1 and conn2\n}).then(function() {\n // Both connections closed by now\n})\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Disposer\n\n```\n A meta method used to specify the disposer method that cleans up a resource when using [`Promise.using`](promise.using).\n\n Returns a Disposer object which encapsulates both the resource as well as the method to clean it up. The user can pass this object to `Promise.using` to get access to the resource when it becomes available, as well as to ensure it's automatically cleaned up.\n\n The second argument passed to a disposer is the result promise of the using block, which you can inspect synchronously.\n\n Example:\n\n \n```\n// This function doesn't return a promise but a Disposer\n// so it's very hard to use it wrong (not passing it to `using`)\nfunction getConnection() {\n return db.connect().disposer(function(connection, promise) {\n connection.close();\n });\n}\n\n```\n In the above example, the connection returned by `getConnection` can only be used via `Promise.using`, like so:\n\n \n```\nfunction useConnection(query) {\n return Promise.using(getConnection(), function(connection) {\n return connection.sendQuery(query).then(function(results) {\n return process(results);\n })\n });\n}\n\n```\n This will ensure that `connection.close()` will be called once the promise returned from the `Promise.using` closure is resolved or if an exception was thrown in the closure body.\n\n Real example:\n\n \n```\nvar pg = require(\"pg\");\n// Uncomment if pg has not been properly promisified yet\n//var Promise = require(\"bluebird\");\n//Promise.promisifyAll(pg, {\n// filter: function(methodName) {\n// return methodName === \"connect\"\n// },\n// multiArgs: true\n//});\n// Promisify rest of pg normally\n//Promise.promisifyAll(pg);\n\nfunction getSqlConnection(connectionString) {\n var close;\n return pg.connectAsync(connectionString).spread(function(client, done) {\n close = done;\n return client;\n }).disposer(function() {\n if (close) close();\n });\n}\n\nmodule.exports = getSqlConnection;\n\n```\n Real example 2:\n\n \n```\nvar mysql = require(\"mysql\");\n// Uncomment if mysql has not been properly promisified yet\n// var Promise = require(\"bluebird\");\n// Promise.promisifyAll(mysql);\n// Promise.promisifyAll(require(\"mysql/lib/Connection\").prototype);\n// Promise.promisifyAll(require(\"mysql/lib/Pool\").prototype);\nvar pool = mysql.createPool({\n connectionLimit: 10,\n host: 'example.org',\n user: 'bob',\n password: 'secret'\n});\n\nfunction getSqlConnection() {\n return pool.getConnectionAsync().disposer(function(connection) {\n connection.release();\n });\n}\n\nmodule.exports = getSqlConnection;\n\n```\n #### Note about disposers in node\n\n If a disposer method throws or returns a rejected promise, it's highly likely that it failed to dispose of the resource. In that case, Bluebird has two options - it can either ignore the error and continue with program execution or throw an exception (crashing the process in node.js).\n\n In bluebird we've chosen to do the latter because resources are typically scarce. For example, if a database connection cannot be disposed of and Bluebird ignores that, the connection pool will be quickly depleted and the process will become unusable (all requests that query the database will wait forever). Since Bluebird doesn't know how to handle that, the only sensible default is to crash the process. That way, rather than getting a useless process that cannot fulfill more requests, we can swap the faulty worker with a new one letting the OS clean up the resources for us.\n\n As a result, if you anticipate thrown errors or promise rejections while disposing of the resource you should use a `try..catch` block (or Promise.try) and write the appropriate catch code to handle the errors. If it's not possible to sensibly handle the error, letting the process crash is the next best option.\n\n This also means that disposers should not contain code that does anything other than resource disposal. For example, you cannot write code inside a disposer to commit or rollback a transaction, because there is no mechanism for the disposer to signal a failure of the commit or rollback action without crashing the process.\n\n For transactions, you can use the following similar pattern instead:\n\n \n```\nfunction withTransaction(fn) {\n return Promise.using(pool.acquireConnection(), function(connection) {\n var tx = connection.beginTransaction()\n return Promise\n .try(fn, tx)\n .then(function(res) { return connection.commit().thenReturn(res) },\n function(err) {\n return connection.rollback()\n .catch(function(e) {/* maybe add the rollback error to err */})\n .thenThrow(err);\n });\n });\n}\n\n// If the withTransaction block completes successfully, the transaction is automatically committed\n// Any error or rejection will automatically roll it back\n\nwithTransaction(function(tx) {\n return tx.queryAsync(...).then(function() {\n return tx.queryAsync(...)\n }).then(function() {\n return tx.queryAsync(...)\n });\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\n.timeout(\n int ms,\n [Error error]\n) -> Promise\n\n```\n Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. However, if this promise is not fulfilled or rejected within `ms` milliseconds, the returned promise is rejected with a [`TimeoutError`](timeouterror) or the `error` as the reason.\n\n When using the first signature, you may specify a custom error message with the `message` parameter.\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require('fs'));\nfs.readFileAsync(\"huge-file.txt\").timeout(100).then(function(fileContents) {\n\n}).catch(Promise.TimeoutError, function(e) {\n console.log(\"could not read file within 100ms\");\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n function\n\n```\n Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument.\n\n If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be the first fulfillment item.\n\n Setting `multiArgs` to `true` means the resulting promise will always fulfill with an array of the callback's success value(s). This is needed because promises only support a single success value while some callback API's have multiple success value. The default is to ignore all but the first success value of a callback function.\n\n If you pass a `context`, the `nodeFunction` will be called as a method on the `context`.\n\n Example of promisifying the asynchronous `readFile` of node.js `fs`-module:\n\n \n```\nvar readFile = Promise.promisify(require(\"fs\").readFile);\n\nreadFile(\"myfile.js\", \"utf8\").then(function(contents) {\n return eval(contents);\n}).then(function(result) {\n console.log(\"The result of evaluating myfile.js\", result);\n}).catch(SyntaxError, function(e) {\n console.log(\"File had syntax error\", e);\n//Catch any other error\n}).catch(function(e) {\n console.log(\"Error reading file\", e);\n});\n\n```\n Note that if the node function is a method of some object, you can pass the object as the second argument like so:\n\n \n```\nvar redisGet = Promise.promisify(redisClient.get, {context: redisClient});\nredisGet('foo').then(function() {\n //...\n});\n\n```\n But this will also work:\n\n \n```\nvar getAsync = Promise.promisify(redisClient.get);\ngetAsync.call(redisClient, 'foo').then(function() {\n //...\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n value=undefined]\n) -> Promise\n\n```\n Returns a promise that will be resolved with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. If `value` is a rejected promise, the resulting promise will be rejected immediately. \n\n \n```\nPromise.delay(500).then(function() {\n console.log(\"500 ms passed\");\n return \"Hello world\";\n}).delay(500).then(function(helloWorldString) {\n console.log(helloWorldString);\n console.log(\"another 500 ms passed\") ;\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Same as calling [`Promise.delay(ms, this)`](promise.delay). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n undefined\n\n```\n Cancel this promise. Will not do anything if this promise is already settled or if the [`Cancellation`](cancellation) feature has not been enabled. See [`Cancellation`](cancellation) for how to use cancellation.\n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n function\n\n```\n Returns a function that can use `yield` to yield promises. Control is returned back to the generator when the yielded promise settles. This can lead to less verbose code when doing lots of sequential async calls with minimal processing in between. Requires node.js 0.12+, io.js 1.0+ or Google Chrome 40+.\n\n \n```\nvar Promise = require(\"bluebird\");\n\nfunction PingPong() {\n\n}\n\nPingPong.prototype.ping = Promise.coroutine(function* (val) {\n console.log(\"Ping?\", val);\n yield Promise.delay(500);\n this.pong(val+1);\n});\n\nPingPong.prototype.pong = Promise.coroutine(function* (val) {\n console.log(\"Pong!\", val);\n yield Promise.delay(500);\n this.ping(val+1);\n});\n\nvar a = new PingPong();\na.ping(0);\n\n```\n Running the example:\n\n \n```\n$ node test.js\nPing? 0\nPong! 1\nPing? 2\nPong! 3\nPing? 4\nPong! 5\nPing? 6\nPong! 7\nPing? 8\n...\n\n```\n When called, the coroutine function will start an instance of the generator and returns a promise for its final value.\n\n Doing `Promise.coroutine` is almost like using the C# `async` keyword to mark the function, with `yield` working as the `await` keyword. Promises are somewhat like `Task`s.\n\n **Tip**\n\n You are able to yield non-promise values by adding your own yield handler using [`Promise.coroutine.addYieldHandler`](promise.coroutine.addyieldhandler) or calling `Promise.coroutine()` with a yield handler function as `options.yieldHandler`. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n Object\n\n```\n Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name suffixed with `suffix` (default is `\"Async\"`). Any class properties of the object (which is the case for the main export of many modules) are also promisified, both static and instance methods. Class property is a property with a function value that has a non-empty `.prototype` object. Returns the input object.\n\n Note that the original methods on the object are not overwritten but new methods are created with the `Async`-suffix. For example, if you `promisifyAll` the node.js `fs` object use `fs.statAsync` to call the promisified `stat` method.\n\n Example:\n\n \n```\nPromise.promisifyAll(require(\"redis\"));\n\n//Later on, all redis client instances have promise returning functions:\n\nredisClient.hexistsAsync(\"myhash\", \"field\").then(function(v) {\n\n}).catch(function(e) {\n\n});\n\n```\n It also works on singletons or specific instances:\n\n \n```\nvar fs = Promise.promisifyAll(require(\"fs\"));\n\nfs.readFileAsync(\"myfile.js\", \"utf8\").then(function(contents) {\n console.log(contents);\n}).catch(function(e) {\n console.error(e.stack);\n});\n\n```\n See [promisification](#promisification) for more examples.\n\n The entire prototype chain of the object is promisified on the object. Only enumerable are considered. If the object already has a promisified version of the method, it will be skipped. The target methods are assumed to conform to node.js callback convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. If the node method calls its callback with multiple success values, the fulfillment value will be an array of them.\n\n If a method name already has an `\"Async\"`-suffix, an exception will be thrown.\n\n #### Option: suffix\n\n Optionally, you can define a custom suffix through the options object:\n\n \n```\nvar fs = Promise.promisifyAll(require(\"fs\"), {suffix: \"MySuffix\"});\nfs.readFileMySuffix(...).then(...);\n\n```\n All the above limitations apply to custom suffices:\n\n * Choose the suffix carefully, it must not collide with anything\n* PascalCase the suffix\n* The suffix must be a valid JavaScript identifier using ASCII letters\n* Always use the same suffix everywhere in your application, you could create a wrapper to make this easier:\n\n \n```\nmodule.exports = function myPromisifyAll(target) {\n return Promise.promisifyAll(target, {suffix: \"MySuffix\"});\n};\n\n```\n #### Option: multiArgs\n\n Setting `multiArgs` to `true` means the resulting promise will always fulfill with an array of the callback's success value(s). This is needed because promises only support a single success value while some callback API's have multiple success value. The default is to ignore all but the first success value of a callback function.\n\n If a module has multiple argument callbacks as an exception rather than the rule, you can filter out the multiple argument methods in first go and then promisify rest of the module in second go:\n\n \n```\nPromise.promisifyAll(something, {\n filter: function(name) {\n return name === \"theMultiArgMethodIwant\";\n },\n multiArgs: true\n});\n// Rest of the methods\nPromise.promisifyAll(something);\n\n```\n #### Option: filter\n\n Optionally, you can define a custom filter through the options object:\n\n \n```\nPromise.promisifyAll(..., {\n filter: function(name, func, target, passesDefaultFilter) {\n // name = the property name to be promisified without suffix\n // func = the function\n // target = the target object where the promisified func will be put with name + suffix\n // passesDefaultFilter = whether the default filter would be passed\n // return boolean (return value is coerced, so not returning anything is same as returning false)\n\n return passesDefaultFilter && ...\n }\n})\n\n```\n The default filter function will ignore properties that start with a leading underscore, properties that are not valid JavaScript identifiers and constructor functions (function which have enumerable properties in their `.prototype`).\n\n #### Option: promisifier\n\n Optionally, you can define a custom promisifier, so you could promisifyAll e.g. the chrome APIs used in Chrome extensions.\n\n The promisifier gets a reference to the original method and should return a function which returns a promise.\n\n \n```\nfunction DOMPromisifier(originalMethod) {\n // return a function\n return function promisified() {\n var args = [].slice.call(arguments);\n // Needed so that the original method can be called with the correct receiver\n var self = this;\n // which returns a promise\n return new Promise(function(resolve, reject) {\n args.push(resolve, reject);\n originalMethod.apply(self, args);\n });\n };\n}\n\n// Promisify e.g. chrome.browserAction\nPromise.promisifyAll(chrome.browserAction, {promisifier: DOMPromisifier});\n\n// Later\nchrome.browserAction.getTitleAsync({tabId: 1})\n .then(function(result) {\n\n });\n\n```\n Combining `filter` with `promisifier` for the restler module to promisify event emitter:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar restler = require(\"restler\");\nvar methodNamesToPromisify = \"get post put del head patch json postJson putJson\".split(\" \");\n\nfunction EventEmitterPromisifier(originalMethod) {\n // return a function\n return function promisified() {\n var args = [].slice.call(arguments);\n // Needed so that the original method can be called with the correct receiver\n var self = this;\n // which returns a promise\n return new Promise(function(resolve, reject) {\n // We call the originalMethod here because if it throws,\n // it will reject the returned promise with the thrown error\n var emitter = originalMethod.apply(self, args);\n\n emitter\n .on(\"success\", function(data, response) {\n resolve([data, response]);\n })\n .on(\"fail\", function(data, response) {\n // Erroneous response like 400\n resolve([data, response]);\n })\n .on(\"error\", function(err) {\n reject(err);\n })\n .on(\"abort\", function() {\n reject(new Promise.CancellationError());\n })\n .on(\"timeout\", function() {\n reject(new Promise.TimeoutError());\n });\n });\n };\n};\n\nPromise.promisifyAll(restler, {\n filter: function(name) {\n return methodNamesToPromisify.indexOf(name) > -1;\n },\n promisifier: EventEmitterPromisifier\n});\n\n// ...\n\n// Later in some other file\n\nvar restler = require(\"restler\");\nrestler.getAsync(\"http://...\", ...,).spread(function(data, response) {\n\n})\n\n```\n Using `defaultPromisifier` parameter to add enhancements on top of normal node promisification:\n\n \n```\nvar fs = Promise.promisifyAll(require(\"fs\"), {\n promisifier: function(originalFunction, defaultPromisifer) {\n var promisified = defaultPromisifier(originalFunction);\n\n return function() {\n // Enhance normal promisification by supporting promises as\n // arguments\n\n var args = [].slice.call(arguments);\n var self = this;\n return Promise.all(args).then(function(awaitedArgs) {\n return promisified.apply(self, awaitedArgs);\n });\n };\n }\n});\n\n// All promisified fs functions now await their arguments if they are promises\nvar version = fs.readFileAsync(\"package.json\", \"utf8\").then(JSON.parse).get(\"version\");\nfs.writeFileAsync(\"the-version.txt\", version, \"utf8\");\n\n```\n #### Promisifying multiple classes in one go\n\n You can promisify multiple classes in one go by constructing an array out of the classes and passing it to `promisifyAll`:\n\n \n```\nvar Pool = require(\"mysql/lib/Pool\");\nvar Connection = require(\"mysql/lib/Connection\");\nPromise.promisifyAll([Pool, Connection]);\n\n```\n This works because the array acts as a \"module\" where the indices are the \"module\"'s properties for classes.\n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\nPromise.fromNode(\n function(function callback) resolver,\n [Object {multiArgs: boolean=false} options]\n) -> Promise\n\n```\n Returns a promise that is resolved by a node style callback function. This is the most fitting way to do on the fly promisification when libraries don't expose classes for automatic promisification by undefined.\n\n The resolver function is passed a callback that expects to be called back according to error-first node conventions.\n\n Setting `multiArgs` to `true` means the resulting promise will always fulfill with an array of the callback's success value(s). This is needed because promises only support a single success value while some callback API's have multiple success value. The default is to ignore all but the first success value of a callback function.\n\n Using manual resolver:\n\n \n```\nvar Promise = require(\"bluebird\");\n// \"email-templates\" doesn't expose prototypes for promisification\nvar emailTemplates = Promise.promisify(require('email-templates'));\nvar templatesDir = path.join(__dirname, 'templates');\n\nemailTemplates(templatesDir).then(function(template) {\n return Promise.fromCallback(function(callback) {\n return template(\"newsletter\", callback);\n }, {multiArgs: true}).spread(function(html, text) {\n console.log(html, text);\n });\n});\n\n```\n The same can also be written more concisely with `Function.prototype.bind`:\n\n \n```\nvar Promise = require(\"bluebird\");\n// \"email-templates\" doesn't expose prototypes for promisification\nvar emailTemplates = Promise.promisify(require('email-templates'));\nvar templatesDir = path.join(__dirname, 'templates');\n\nemailTemplates(templatesDir).then(function(template) {\n return Promise.fromCallback(template.bind(null, \"newsletter\"), {multiArgs: true})\n .spread(function(html, text) {\n console.log(html, text);\n });\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n this\n\n```\n\n```\n.nodeify(\n [function(any error, any value) callback],\n [Object {spread: boolean=false} options]\n) -> this\n\n```\n Register a node-style callback on this promise. When this promise is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success.\n\n Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything.\n\n This can be used to create APIs that both accept node-style callbacks and return promises:\n\n \n```\nfunction getDataFor(input, callback) {\n return dataFromDataBase(input).asCallback(callback);\n}\n\n```\n The above function can then make everyone happy.\n\n Promises:\n\n \n```\ngetDataFor(\"me\").then(function(dataForMe) {\n console.log(dataForMe);\n});\n\n```\n Normal callbacks:\n\n \n```\ngetDataFor(\"me\", function(err, dataForMe) {\n if( err ) {\n console.error( err );\n }\n console.log(dataForMe);\n});\n\n```\n Promises can be rejected with falsy values (or no value at all, equal to rejecting with `undefined`), however `.asCallback` will call the callback with an `Error` object if the promise's rejection reason is a falsy value. You can retrieve the original falsy value from the error's `.cause` property.\n\n Example:\n\n \n```\nPromise.reject(null).asCallback(function(err, result) {\n // If is executed\n if (err) {\n // Logs 'null'\n console.log(err.cause);\n }\n});\n\n```\n There is no effect on performance if the user doesn't actually pass a node-style callback function.\n\n #### Option: spread\n\n Some nodebacks expect more than 1 success value but there is no mapping for this in the promise world. You may specify the option `spread` to call the nodeback with multiple values when the fulfillment value is an array:\n\n \n```\nPromise.resolve([1,2,3]).asCallback(function(err, result) {\n // err == null\n // result is the array [1,2,3]\n});\n\nPromise.resolve([1,2,3]).asCallback(function(err, a, b, c) {\n // err == null\n // a == 1\n // b == 2\n // c == 3\n}, {spread: true});\n\nPromise.resolve(123).asCallback(function(err, a, b, c) {\n // err == null\n // a == 123\n // b == undefined\n // c == undefined\n}, {spread: true});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n Promise\n\n```\n Essentially like `.then()`, except that the value passed in is the value returned.\n\n This means you can insert `.tap()` into a `.then()` chain without affecting what is passed through the chain. (See example below).\n\n Unlike [`.finally`](finally) this is not called for rejections.\n\n \n```\ngetUser().tap(function(user) {\n //Like in finally, if you return a promise from the handler\n //the promise is awaited for before passing the original value through\n return recordStatsAsync();\n}).then(function(user) {\n //user is the user from getUser(), not recordStatsAsync()\n});\n\n```\n Common case includes adding logging to an existing promise chain:\n\n \n```\ndoSomething()\n .then(...)\n .then(...)\n .then(...)\n .then(...)\n\n```\n\n```\ndoSomething()\n .then(...)\n .then(...)\n .tap(console.log)\n .then(...)\n .then(...)\n\n```\n *Note: in browsers it is necessary to call `.tap` with `console.log.bind(console)` because console methods can not be called as stand-alone functions.* \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n This is a convenience method for doing:\n\n \n```\npromise.then(function(obj) {\n return obj[propertyName];\n});\n\n```\n For example:\n\n \n```\ndb.query(\"...\")\n .get(0)\n .then(function(firstRow) {\n\n });\n\n```\n If `index` is negative, the indexed load will become `obj.length + index`. So that -1 can be used to read last item in the array, -2 to read the second last and so on. For example:\n\n \n```\nPromise.resolve([1,2,3]).get(-1).then(function(value) {\n console.log(value); // 3\n});\n\n```\n If the `index` is still negative after `obj.length + index`, it will be clamped to 0. \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\n.thenReturn(any value) -> Promise\n\n```\n Convenience method for:\n\n \n```\n.then(function() {\n return value;\n});\n\n```\n in the case where `value` doesn't change its value because its binding time is different than when using a closure.\n\n That means `value` is bound at the time of calling [`.return`](return) so this will not work as expected:\n\n \n```\nfunction getData() {\n var data;\n\n return query().then(function(result) {\n data = result;\n }).return(data);\n}\n\n```\n because `data` is `undefined` at the time `.return` is called.\n\n Function that returns the full path of the written file:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\nvar baseDir = process.argv[2] || \".\";\n\nfunction writeFile(path, contents) {\n var fullpath = require(\"path\").join(baseDir, path);\n return fs.writeFileAsync(fullpath, contents).return(fullpath);\n}\n\nwriteFile(\"test.txt\", \"this is text\").then(function(fullPath) {\n console.log(\"Successfully file at: \" + fullPath);\n});\n\n```\n *For compatibility with earlier ECMAScript version, an alias `.thenReturn` is provided for [`.return`](return).* \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n undefined\n\n```\n By default you can only yield Promises and Thenables inside coroutines. You can use this function to add yielding support for arbitrary types.\n\n For example, if you wanted `yield 500` to be same as `yield Promise.delay`:\n\n \n```\nPromise.coroutine.addYieldHandler(function(value) {\n if (typeof value === \"number\") return Promise.delay(value);\n});\n\n```\n Yield handlers are called when you yield something that is not supported by default. The first yield handler to return a promise or a thenable will be used. If no yield handler returns a promise or a thenable then an error is raised.\n\n An example of implementing callback support with `addYieldHandler`:\n\n *This is a demonstration of how powerful the feature is and not the recommended usage. For best performance you need to use `promisifyAll` and yield promises directly.*\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = require(\"fs\");\n\nvar _ = (function() {\n var promise = null;\n Promise.coroutine.addYieldHandler(function(v) {\n if (v === undefined && promise != null) {\n return promise;\n }\n promise = null;\n });\n return function() {\n var def = Promise.defer();\n promise = def.promise;\n return def.callback;\n };\n})();\n\nvar readFileJSON = Promise.coroutine(function* (fileName) {\n var contents = yield fs.readFile(fileName, \"utf8\", _());\n return JSON.parse(contents);\n});\n\n```\n An example of implementing thunks support with `addYieldHandler`:\n\n *This is a demonstration of how powerful the feature is and not the recommended usage. For best performance you need to use `promisifyAll` and yield promises directly.*\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = require(\"fs\");\n\nPromise.coroutine.addYieldHandler(function(v) {\n if (typeof v === \"function\") {\n return Promise.fromCallback(function(cb) {\n v(cb);\n });\n }\n});\n\nvar readFileThunk = function(fileName, encoding) {\n return function(cb) {\n return fs.readFile(fileName, encoding, cb);\n };\n};\n\nvar readFileJSON = Promise.coroutine(function* (fileName) {\n var contents = yield readFileThunk(fileName, \"utf8\");\n return JSON.parse(contents);\n});\n\n```\n An example of handling promises in parallel by adding an `addYieldHandler` for arrays :\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\n\nPromise.coroutine.addYieldHandler(function(yieldedValue) {\n if (Array.isArray(yieldedValue)) return Promise.all(yieldedValue);\n});\n\nvar readFiles = Promise.coroutine(function* (fileNames) {\n return yield fileNames.map(function (fileName) {\n return fs.readFileAsync(fileName, \"utf8\");\n });\n});\n\n```\n A custom yield handler can also be used just for a single call to `Promise.coroutine()`:\n\n \n```\nvar Promise = require(\"bluebird\");\nvar fs = Promise.promisifyAll(require(\"fs\"));\n\nvar readFiles = Promise.coroutine(function* (fileNames) {\n return yield fileNames.map(function (fileName) {\n return fs.readFileAsync(fileName, \"utf8\");\n });\n}, {\n yieldHandler: function(yieldedValue) {\n if (Array.isArray(yieldedValue)) return Promise.all(yieldedValue);\n }\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Like [`.finally`](finally) that is not called for fulfillments.\n\n \n```\ngetUser().tapCatch(function(err) {\n return logErrorToDatabase(err);\n}).then(function(user) {\n //user is the user from getUser(), not logErrorToDatabase()\n});\n\n```\n Common case includes adding logging to an existing promise chain:\n\n #### Rate Limiting\n\n \n```\nPromise.\n try(logIn).\n then(respondWithSuccess).\n tapCatch(countFailuresForRateLimitingPurposes).\n catch(respondWithError);\n\n```\n #### Circuit Breakers\n\n \n```\nPromise.\n try(makeRequest).\n then(respondWithSuccess).\n tapCatch(adjustCircuitBreakerState).\n catch(respondWithError);\n\n```\n #### Logging\n\n \n```\nPromise.\n try(doAThing).\n tapCatch(logErrorsRelatedToThatThing).\n then(respondWithSuccess).\n catch(respondWithError);\n\n```\n *Note: in browsers it is necessary to call `.tapCatch` with `console.log.bind(console)` because console methods can not be called as stand-alone functions.*\n\n ### Filtered `tapCatch`\n\n \n```\n.tapCatch(\n class ErrorClass|function(any error),\n function(any error) handler\n) -> Promise\n\n```\n\n```\n.tapCatch(\n class ErrorClass|function(any error),\n function(any error) handler\n) -> Promise\n\n```\n This is an extension to [`.tapCatch`](tapcatch) to filter exceptions similarly to languages like Java or C#. Instead of manually checking `instanceof` or `.name === \"SomeError\"`, you may specify a number of error constructors which are eligible for this tapCatch handler. The tapCatch handler that is first met that has eligible constructors specified, is the one that will be called.\n\n Usage examples include:\n\n #### Rate Limiting\n\n \n```\nPromise.\n try(logIn).\n then(respondWithSuccess).\n tapCatch(InvalidCredentialsError, countFailuresForRateLimitingPurposes).\n catch(respondWithError);\n\n```\n #### Circuit Breakers\n\n \n```\nPromise.\n try(makeRequest).\n then(respondWithSuccess).\n tapCatch(RequestError, adjustCircuitBreakerState).\n catch(respondWithError);\n\n```\n #### Logging\n\n \n```\nPromise.\n try(doAThing).\n tapCatch(logErrorsRelatedToThatThing).\n then(respondWithSuccess).\n catch(respondWithError);\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n \nLicensed under the MIT License. \n\n Promise\n\n```\n\n```\n.thenThrow(any reason) -> Promise\n\n```\n Convenience method for:\n\n \n```\n.then(function() {\n throw reason;\n});\n\n```\n Same limitations regarding to the binding time of `reason` to apply as with [`.return`](return).\n\n *For compatibility with earlier ECMAScript version, an alias `.thenThrow` is provided for [`.throw`](throw).* \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Convenience method for:\n\n \n```\n.catch(function() {\n return value;\n});\n\n```\n You may optionally prepend one predicate function or ErrorClass to pattern match the error (the generic [`.catch`](catch) methods accepts multiple)\n\n Same limitations regarding to the binding time of `value` to apply as with [`.return`](return). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise\n\n```\n Convenience method for:\n\n \n```\n.catch(function() {\n throw reason;\n});\n\n```\n You may optionally prepend one predicate function or ErrorClass to pattern match the error (the generic [`.catch`](catch) methods accepts multiple)\n\n Same limitations regarding to the binding time of `reason` to apply as with [`.return`](return). \n\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Promise \nLicensed under the MIT License. \n\n Object\n\n```\n Returns a new independent copy of the Bluebird library.\n\n This method should be used before you use any of the methods which would otherwise alter the global `Bluebird` object - to avoid polluting global state.\n\n A basic example:\n\n \n```\nvar Promise = require('bluebird');\nvar Promise2 = Promise.getNewLibraryCopy();\n\nPromise2.x = 123;\n\nconsole.log(Promise2 == Promise); // false\nconsole.log(Promise2.x); // 123\nconsole.log(Promise.x); // undefined\n\n```\n `Promise2` is independent to `Promise`. Any changes to `Promise2` do not affect the copy of Bluebird returned by `require('bluebird')`.\n\n In practice:\n\n \n```\nvar Promise = require('bluebird').getNewLibraryCopy();\n\nPromise.coroutine.addYieldHandler( function() { /* */ } ); // alters behavior of `Promise.coroutine()`\n\n// somewhere in another file or module in same app\nvar Promise = require('bluebird');\n\nPromise.coroutine(function*() {\n // this code is unaffected by the yieldHandler defined above\n // because it was defined on an independent copy of Bluebird\n});\n\n```\n Please enable JavaScript to view the [comments powered by Disqus.](https://disqus.com/?ref_noscript)\n\n © 2013–2018 \nLicensed under the MIT License. \n\n Object\n\n```\n This is relevant to browser environments with no module loader.\n\n Release control of the `Promise` namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else.\n\n \n```\n\n\n\n

Notable traits for IntoIter&lt;T&gt;