diff --git a/404.html b/404.html index 21478363..59d61cdc 100644 --- a/404.html +++ b/404.html @@ -10,13 +10,13 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html index cc9e6b79..9e76a407 100644 --- a/CONTRIBUTING.html +++ b/CONTRIBUTING.html @@ -8,13 +8,13 @@ - - - + + +
-
Skip to main content

Contribution & Tech Stack

Ebook Dasar Pemrograman Rust adalah project open source. Siapapun bebas untuk berkontribusi di sini, bisa dalam bentuk perbaikan typo, update kalimat, maupun submit tulisan baru.

Bagi kawan-kawan yang berminat untuk berkontribusi, silakan fork github.com/novalagung/dasarpemrogramanrust, kemudian langsung saja cek/buat issue kemudian submit relevan pull request untuk issue tersebut 😊

Checkout project

git clone https://github.com/novalagung/dasarpemrogramanrust.git
git submodule update --init --recursive --remote

Maintainer

E-book ini di-inisialisasi dan di-maintain oleh Noval Agung Prayogo.

Contributors

Berikut merupakan hall of fame kontributor yang sudah berbaik hati menyisihkan waktunya untuk membantu pengembangan e-book ini.

  1. Acep Saepudin
  2. Afifurrohman
  3. ardiantovn
  4. Fal
  5. Fredianto
  6. I Putu Saputrayana
  7. Indra Sah Noeldy
  8. Khisby Al Ghofari
  9. Lori
  10. M. Zakiyuddin Munziri
  11. Opa Kholis Majid
  12. Rian
  13. Shandy Siswandi
  14. Theis Andatu
  15. ... anda :-)

Ebook/webhook techstack & architecture

Jika pembaca tertarik untuk membuat konten ebook berbasis web sekaligus versi PDF file-nya, bisa menggunakan link berikut sebagai referensi:

https://medium.com/geekculture/serverless-e-book-web-book-using-docusaurus-v2-github-pages-actions-and-pdf-tools-4fef54847b85

Tools yang digunakan:

Desain arsitektur:

Dasar pemrograman python

- - +
Skip to main content

Contribution & Tech Stack

Ebook Dasar Pemrograman Rust adalah project open source. Siapapun bebas untuk berkontribusi di sini, bisa dalam bentuk perbaikan typo, update kalimat, maupun submit tulisan baru.

Bagi kawan-kawan yang berminat untuk berkontribusi, silakan fork github.com/novalagung/dasarpemrogramanrust, kemudian langsung saja cek/buat issue kemudian submit relevan pull request untuk issue tersebut 😊

Checkout project

git clone https://github.com/novalagung/dasarpemrogramanrust.git
git submodule update --init --recursive --remote

Maintainer

E-book ini di-inisialisasi dan di-maintain oleh Noval Agung Prayogo.

Contributors

Berikut merupakan hall of fame kontributor yang sudah berbaik hati menyisihkan waktunya untuk membantu pengembangan e-book ini.

  1. Acep Saepudin
  2. Afifurrohman
  3. ardiantovn
  4. Fal
  5. Fredianto
  6. I Putu Saputrayana
  7. Indra Sah Noeldy
  8. Khisby Al Ghofari
  9. Lori
  10. M. Zakiyuddin Munziri
  11. Opa Kholis Majid
  12. Rian
  13. Shandy Siswandi
  14. Theis Andatu
  15. ... anda :-)

Ebook/webhook techstack & architecture

Jika pembaca tertarik untuk membuat konten ebook berbasis web sekaligus versi PDF file-nya, bisa menggunakan link berikut sebagai referensi:

https://medium.com/geekculture/serverless-e-book-web-book-using-docusaurus-v2-github-pages-actions-and-pdf-tools-4fef54847b85

Tools yang digunakan:

Desain arsitektur:

Dasar pemrograman python

+ + \ No newline at end of file diff --git a/LICENSE.html b/LICENSE.html index 2a61e766..52d6f960 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -8,13 +8,13 @@ - - - + + +
-
Skip to main content

Lisensi & Distribusi Konten

Ebook Dasar Pemrograman Rust gratis untuk disebarluaskan secara bebas, dengan catatan sesuai dengan aturan lisensi CC BY-SA 4.0 yang kurang lebih sebagai berikut:

  • Diperbolehkan menyebar, mencetak, dan menduplikasi material dalam konten ini ke siapapun.
  • Diperbolehkan memodifikasi, mengubah, atau membuat konten baru menggunakan material yang ada dalam ebook ini untuk keperluan komersil maupun tidak.

Dengan catatan:

  • Harus ada credit sumber aslinya, yaitu Dasar Pemrograman Rust atau novalagung
  • Tidak mengubah lisensi aslinya, yaitu CC BY-SA 4.0
  • Tidak ditambahi restrictions baru
  • Lebih jelasnya silakan cek https://creativecommons.org/licenses/by-sa/4.0/.

FOSSA Status

- - +
Skip to main content

Lisensi & Distribusi Konten

Ebook Dasar Pemrograman Rust gratis untuk disebarluaskan secara bebas, dengan catatan sesuai dengan aturan lisensi CC BY-SA 4.0 yang kurang lebih sebagai berikut:

  • Diperbolehkan menyebar, mencetak, dan menduplikasi material dalam konten ini ke siapapun.
  • Diperbolehkan memodifikasi, mengubah, atau membuat konten baru menggunakan material yang ada dalam ebook ini untuk keperluan komersil maupun tidak.

Dengan catatan:

  • Harus ada credit sumber aslinya, yaitu Dasar Pemrograman Rust atau novalagung
  • Tidak mengubah lisensi aslinya, yaitu CC BY-SA 4.0
  • Tidak ditambahi restrictions baru
  • Lebih jelasnya silakan cek https://creativecommons.org/licenses/by-sa/4.0/.

FOSSA Status

+ + \ No newline at end of file diff --git a/assets/images/operator-tanda-tanya-1-24d0c7ef806198ea77f652c1267d13e9.png b/assets/images/operator-tanda-tanya-1-24d0c7ef806198ea77f652c1267d13e9.png new file mode 100644 index 00000000..4c588c52 Binary files /dev/null and b/assets/images/operator-tanda-tanya-1-24d0c7ef806198ea77f652c1267d13e9.png differ diff --git a/assets/images/operator-tanda-tanya-2-edc32921914c938294f2ee9ded7bcd17.png b/assets/images/operator-tanda-tanya-2-edc32921914c938294f2ee9ded7bcd17.png new file mode 100644 index 00000000..1907b891 Binary files /dev/null and b/assets/images/operator-tanda-tanya-2-edc32921914c938294f2ee9ded7bcd17.png differ diff --git a/assets/images/operator-tanda-tanya-3-186ecf58877055d7fdef25594040d662.png b/assets/images/operator-tanda-tanya-3-186ecf58877055d7fdef25594040d662.png new file mode 100644 index 00000000..d7787456 Binary files /dev/null and b/assets/images/operator-tanda-tanya-3-186ecf58877055d7fdef25594040d662.png differ diff --git a/assets/images/operator-tanda-tanya-4-162dd4d9f23151b811c1f27d7754cc69.png b/assets/images/operator-tanda-tanya-4-162dd4d9f23151b811c1f27d7754cc69.png new file mode 100644 index 00000000..04d2b733 Binary files /dev/null and b/assets/images/operator-tanda-tanya-4-162dd4d9f23151b811c1f27d7754cc69.png differ diff --git a/assets/images/operator-tanda-tanya-6-31dccee9d16f41b3a88637a21ca2e330.png b/assets/images/operator-tanda-tanya-6-31dccee9d16f41b3a88637a21ca2e330.png new file mode 100644 index 00000000..8f211f82 Binary files /dev/null and b/assets/images/operator-tanda-tanya-6-31dccee9d16f41b3a88637a21ca2e330.png differ diff --git a/assets/images/unrecoverable-panic-error-1-2a22152a19c4dfb91d4f55885880fc08.png b/assets/images/unrecoverable-panic-error-1-2a22152a19c4dfb91d4f55885880fc08.png new file mode 100644 index 00000000..b0938a7a Binary files /dev/null and b/assets/images/unrecoverable-panic-error-1-2a22152a19c4dfb91d4f55885880fc08.png differ diff --git a/assets/images/unrecoverable-panic-error-2-1ffea2a5a914b4b95bb2db06c1ac9b53.png b/assets/images/unrecoverable-panic-error-2-1ffea2a5a914b4b95bb2db06c1ac9b53.png new file mode 100644 index 00000000..18914f5a Binary files /dev/null and b/assets/images/unrecoverable-panic-error-2-1ffea2a5a914b4b95bb2db06c1ac9b53.png differ diff --git a/assets/images/unrecoverable-panic-error-3-4d90d454da4c451e1d9b6c9499ba72c6.png b/assets/images/unrecoverable-panic-error-3-4d90d454da4c451e1d9b6c9499ba72c6.png new file mode 100644 index 00000000..99cf66cd Binary files /dev/null and b/assets/images/unrecoverable-panic-error-3-4d90d454da4c451e1d9b6c9499ba72c6.png differ diff --git a/assets/js/2bc2e36b.499a797c.js b/assets/js/2bc2e36b.499a797c.js deleted file mode 100644 index a4634e23..00000000 --- a/assets/js/2bc2e36b.499a797c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[620],{3905:(e,n,a)=>{a.d(n,{Zo:()=>m,kt:()=>s});var t=a(7294);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n=0||(i[a]=e[a]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var u=t.createContext({}),o=function(e){var n=t.useContext(u),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},m=function(e){var n=o(e.components);return t.createElement(u.Provider,{value:n},e.children)},k={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},d=t.forwardRef((function(e,n){var a=e.components,i=e.mdxType,l=e.originalType,u=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),d=o(a),s=i,c=d["".concat(u,".").concat(s)]||d[s]||k[s]||l;return a?t.createElement(c,r(r({ref:n},m),{},{components:a})):t.createElement(c,r({ref:n},m))}));function s(e,n){var a=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=d;var p={};for(var u in n)hasOwnProperty.call(n,u)&&(p[u]=n[u]);p.originalType=e,p.mdxType="string"==typeof e?e:i,r[1]=p;for(var o=2;o{a.r(n),a.d(n,{assets:()=>u,contentTitle:()=>r,default:()=>k,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=a(7462),i=(a(7294),a(3905));const l={sidebar_position:41,title:"A.41. Pattern Matching",sidebar_label:"A.41. Pattern Matching"},r=void 0,p={unversionedId:"basic/pattern-matching",id:"basic/pattern-matching",title:"A.41. Pattern Matching",description:"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih advance dibanding seleksi kondisi biasa.",source:"@site/docs/basic/pattern-matching.md",sourceDirName:"basic",slug:"/basic/pattern-matching",permalink:"/basic/pattern-matching",draft:!1,tags:[],version:"current",sidebarPosition:41,frontMatter:{sidebar_position:41,title:"A.41. Pattern Matching",sidebar_label:"A.41. Pattern Matching"},sidebar:"tutorialSidebar",previous:{title:"A.40. Tipe Data \u279c Result",permalink:"/basic/result-type"},next:{title:"A.42. Static Item",permalink:"/basic/static"}},u={},o=[{value:"A.41.1. Keyword match",id:"a411-keyword-match",level:2},{value:"\u25c9 Menampung nilai balik match",id:"-menampung-nilai-balik-match",level:3},{value:"A.41.2. Pattern matching",id:"a412-pattern-matching",level:2},{value:"\u25c9 Pengecekan nilai enum",id:"-pengecekan-nilai-enum",level:3},{value:"\u25c9 Pattern | dan ..",id:"-pattern--dan-",level:3},{value:"\u25c9 Match guard",id:"-match-guard",level:3},{value:"\u25c9 Binding @",id:"-binding-",level:3},{value:"\u25c9 if let",id:"-if-let",level:3},{value:"A.41.3. Destructuring assignment",id:"a413-destructuring-assignment",level:2},{value:"\u25c9 Struct destructuring",id:"-struct-destructuring",level:3},{value:"\u25c9 Enum destructuring",id:"-enum-destructuring",level:3},{value:"\u25c9 Tuple destructuring",id:"-tuple-destructuring",level:3},{value:"\u25c9 Variabel _",id:"-variabel-_",level:3},{value:"\u25c9 Operator ..",id:"-operator-",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function k(e){let{components:n,...l}=e;return(0,i.kt)("wrapper",(0,t.Z)({},m,l,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih ",(0,i.kt)("em",{parentName:"p"},"advance")," dibanding seleksi kondisi biasa."),(0,i.kt)("p",null,"Dalam pattern matching, pengecekan dilakukan dengan melihat kecocokan suatu pola/pattern."),(0,i.kt)("h2",{id:"a411-keyword-match"},"A.41.1. Keyword ",(0,i.kt)("inlineCode",{parentName:"h2"},"match")),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," digunakan untuk pattern matching. Contoh penerapan versi sederhananya bisa dilihat berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nmatch time {\n "morning" => println!("isuk"),\n "afternoon" => println!("awan"),\n "evening" => println!("bengi"),\n _ => println!("mbuh kapan"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Pattern Matching",src:a(9125).Z,width:"529",height:"90"})),(0,i.kt)("p",null,"Pada contoh di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"time")," dicek nilainya menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan 4 buah klausul:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"morning"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"isuk")),(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"afternoon"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"awan")),(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"evening"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"bengi")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"mbuh kapan"))),(0,i.kt)("p",null,"Contoh di atas adalah ekuivalen dengan seleksi kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nif time == "morning" {\n println!("isuk")\n} else if time == "afternoon" {\n println!("awan")\n} else if time == "evening" {\n println!("bengi")\n} else {\n println!("mbuh kapan")\n}\n')),(0,i.kt)("p",null,"Ada satu syarat yang harus dipenuhi dalam penerapan pattern matching, yaitu semua kondisi yang memungkinkan harus ditulis, harus lengkap. Ibarat ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," yang harus ada block ",(0,i.kt)("inlineCode",{parentName:"p"},"else"),"-nya."),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," digunakan sebagai else-nya block ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Tanpa adanya kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," maka besar kemungkinan block ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," error jika klausulnya tidak lengkap."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Pattern Matching",src:a(9310).Z,width:"755",height:"284"})),(0,i.kt)("h3",{id:"-menampung-nilai-balik-match"},"\u25c9 Menampung nilai balik ",(0,i.kt)("inlineCode",{parentName:"h3"},"match")),(0,i.kt)("p",null,"Block statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," bisa saja menghasilkan return value. Contohnya bisa dilihat berikut ini, hasil dari pattern matching ditampung ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"time_but_in_javanese"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nlet time_but_in_javanese = match time {\n "morning" => "isuk",\n "afternoon" => "awan",\n "evening" => "bengi",\n _ => "mbuh kapan",\n};\n\nprintln!("{time_but_in_javanese}");\n')),(0,i.kt)("h2",{id:"a412-pattern-matching"},"A.41.2. Pattern matching"),(0,i.kt)("p",null,"Contoh di atas bisa dikategorikan sebagai seleksi kondisi biasa meskipun menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Setelah ini kita akan pelajari macam-macam pattern/pola yang di-support dalam pattern matching di Rust."),(0,i.kt)("h3",{id:"-pengecekan-nilai-enum"},"\u25c9 Pengecekan nilai enum"),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("a",{parentName:"p",href:"/basic/option-type"},"Option")," adalah salah satu enum yang paling sering dipakai pada pattern matching. Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," memiliki 2 enum value, ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," yang merepresentasikan sebuah nilai, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," yang berarti tidak ada nilai."),(0,i.kt)("p",null,"Pattern matching pada enum cukup mudah, caranya bisa dilihat pada contoh berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Option::Some(5);\n\nmatch value {\n Some(1) => println!("one"),\n Some(2) => println!("two"),\n Some(x) => println!("{x} greater than two"),\n _ => println!("none"),\n}\n')),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," nilainya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(5)"),". Variabel tersebut dimasukkan ke block ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan 4 buah kondisi pengecekan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(1)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"one")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(2)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"two")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(x)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"{x} greater than two")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"none"))),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," pasti berpotensi berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", tidak mungkin selainnya. Klausul terakhir di contoh di atas (",(0,i.kt)("inlineCode",{parentName:"p"},'_ => println!("none")'),") terpenuhi ketika nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Pada konteks ini mengganti ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," menjadikan klausul pada pattern matching tetap lengkap."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Some(1) => println!("one"),\n Some(2) => println!("two"),\n Some(x) => println!("{x} greater than two"),\n None => println!("none"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/option-type"},"Tipe Data \u279c Option"))),(0,i.kt)("h3",{id:"-pattern--dan-"},"\u25c9 Pattern ",(0,i.kt)("inlineCode",{parentName:"h3"},"|")," dan ",(0,i.kt)("inlineCode",{parentName:"h3"},"..")),(0,i.kt)("p",null,"Klausul pattern matching bisa berisi operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"OR")," maupun ",(0,i.kt)("inlineCode",{parentName:"p"},"IN")," caranya dengan memanfaatkan operator berikut:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Operator ",(0,i.kt)("inlineCode",{parentName:"li"},"|")," digunakan sebagai logika ",(0,i.kt)("inlineCode",{parentName:"li"},"OR")),(0,i.kt)("li",{parentName:"ul"},"Operator ",(0,i.kt)("inlineCode",{parentName:"li"},"..")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"..=")," digunakan sebagai logika ",(0,i.kt)("inlineCode",{parentName:"li"},"IN"))),(0,i.kt)("p",null,"Contoh penerapannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 6;\n\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"1")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"2"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"one or two")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya antara ",(0,i.kt)("inlineCode",{parentName:"li"},"3")," hingga ",(0,i.kt)("inlineCode",{parentName:"li"},"5"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"three through five")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"6"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"six")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"other number"))),(0,i.kt)("p",null,"Pattern di atas juga bisa diterapkan dalam variabel enum value, contohnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Some(5);\n\nmatch value {\n Some(1 | 2) => println!("one or two"),\n Some(3..=5) => println!("three through five"),\n Some(6) => println!("six"),\n Some(x) => println!("{x} greater than six"),\n _ => println!("none"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"|")," memiliki 2 kegunaan:"),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Pada statement biasa, fungsinya adalah untuk ",(0,i.kt)("strong",{parentName:"li"},"bitwise OR"),"."),(0,i.kt)("li",{parentName:"ul"},"Pada pattern matching, fungsinya untuk ",(0,i.kt)("strong",{parentName:"li"},"OR"),", kegunaannya sama seperti ",(0,i.kt)("inlineCode",{parentName:"li"},"||")," pada statement biasa.")),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai bitwise operator dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/bitwise-operation"},"Bitwise Operation"))),(0,i.kt)("h3",{id:"-match-guard"},"\u25c9 Match guard"),(0,i.kt)("p",null,"Match guard adalah teknik menambahkan sub seleksi kondisi pada klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = Some(4);\n\nlet message = match value {\n Some(x) if x % 2 == 0 => format!("number {} is even", x),\n Some(x) => format!("number {} is odd", x),\n None => String::new(),\n};\n\nprintln!("{message}");\n')),(0,i.kt)("p",null,"Klausul pertama di atas, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(x)")," ditambahkan match guard ",(0,i.kt)("inlineCode",{parentName:"p"},"if x % 2 == 0"),"."),(0,i.kt)("h3",{id:"-binding-"},"\u25c9 Binding ",(0,i.kt)("inlineCode",{parentName:"h3"},"@")),(0,i.kt)("p",null,"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"@")," digunakan untuk menampung nilai klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," yang default-nya tidak bisa ditampung. Agar lebih jelas, silakan pelajari pattern matching berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 3;\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("p",null,"Klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"1 | 2")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"3..=5")," nilai by default tidak bisa diakses. Kita hanya tau bahwa nilai pasti antara ",(0,i.kt)("inlineCode",{parentName:"p"},"1")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"2")," untuk klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"1 | 2"),", dan ",(0,i.kt)("inlineCode",{parentName:"p"},"3 / 4 / 5")," untuk klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"3..=5"),"."),(0,i.kt)("p",null,"Nilai pasti klausul tersebut bisa ditampung menggunakan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"@"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 3;\nmatch value {\n n @ (1 | 2) => println!("one or two ({})", n),\n n @ 3..=5 => println!("three through five ({})", n),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Khusus untuk penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"@")," binding pada operator ",(0,i.kt)("inlineCode",{parentName:"p"},"|"),", pada penulisan klausul seleksi kondisinya harus diapit tanda ",(0,i.kt)("inlineCode",{parentName:"p"},"()"),".")),(0,i.kt)("h3",{id:"-if-let"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"if let")),(0,i.kt)("p",null,"Untuk memahami pattern matching menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if let"),", silakan pelajari kode berikut terlebih dahulu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Some(5);\n\nmatch value {\n Some(1) => println!("one"),\n Some(x) => println!("{x} greater than two"),\n _ => println!("none"),\n}\n')),(0,i.kt)("p",null,"Pattern matching di atas cukup mudah dipahami, isinya ada 2 kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," dan 1 buah else (menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"_"),"). "),(0,i.kt)("p",null,"Block kode tersebut jika dikonversi ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," hasilnya seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = Some(5);\n\nif let Some(1) = value {\n println!("one");\n} else if let Some(x) = value {\n println!("{x} greater than two");\n} else {\n println!("none");\n}\n')),(0,i.kt)("p",null,"Dari sini cukup jelas kegunaan dari ",(0,i.kt)("inlineCode",{parentName:"p"},"if let"),". Meskipun menggunakan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"=")," (bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"=="),") block kode seleksi kondisi di atas adalah pattern matching, yang isinya melakukan pengecekan sama persis seperti pattern matching pada kode sebelumnya."),(0,i.kt)("p",null,"Tambahan contoh, 2 block kode berikut adalah juga ekuivalen."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 6;\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n\n// ... vs ...\n\nlet value = Some(5);\nif let Some(1 | 2) = value {\n println!("one or two");\n} else if let Some(3..=5) = value {\n println!("three through five");\n} else if let Some(6) = value {\n println!("six");\n} else {\n println!("other number");\n}\n')),(0,i.kt)("h2",{id:"a413-destructuring-assignment"},"A.41.3. Destructuring assignment"),(0,i.kt)("h3",{id:"-struct-destructuring"},"\u25c9 Struct destructuring"),(0,i.kt)("p",null,"Operasi ",(0,i.kt)("em",{parentName:"p"},"destructuring")," (menampung item suatu tipe) bisa dilakukan menggunakan pattern matching."),(0,i.kt)("p",null,"Pada kode di bawah ini, variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"p")," yang bertipe struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Point { x: i32, y: i32 }")," dimasukkan pada block pattern matching. Item dari struct tersebut di-",(0,i.kt)("em",{parentName:"p"},"destructure")," ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y")," masing-masing klausul pattern matching item-nya ditampung ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'struct Point {\n x: i32,\n y: i32,\n}\n\nlet p = Point { x: 0, y: 7 };\n\nmatch p {\n Point { x, y: 0 } => println!("x axis at {x}"),\n Point { x: 0, y } => println!("y axis at {y}"),\n Point { x, y } => println!("axis: ({x}, {y})")\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"p.y")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"0"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"x axis at {x}")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"p.x")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"0"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"y axis at {y}")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"axis: ({x}, {y})"))),(0,i.kt)("p",null,"Operasi destructuring hasilnya pasti sukses, karena alasan ini keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," boleh tidak digunakan. Contohnya bisa dilihat pada kode berikut, variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"p")," di-",(0,i.kt)("em",{parentName:"p"},"destructure")," ke variabel baru yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let Point { x, y } = p;\n\nprintln!("x: {x}");\nprintln!("y: {y}");\n')),(0,i.kt)("h3",{id:"-enum-destructuring"},"\u25c9 Enum destructuring"),(0,i.kt)("p",null,"Destructuring juga bisa dilakukan pada tipe data enum caranya dengan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," (wajib menggunakan salah satu keyword tersebut)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'enum Color {\n Black,\n White,\n Rgb(i32, i32, i32)\n}\n\nlet color = Color::Rgb(0, 160, 255);\n\nif let Color::Rgb(r, g, b) = color {\n println!("r: {r}");\n println!("g: {g}");\n println!("b: {b}");\n}\n\nmatch color {\n Color::Rgb(r, g, b) => println!("r: {r}, g: {g}, b: {b}"),\n _ => println!("other color")\n}\n')),(0,i.kt)("h3",{id:"-tuple-destructuring"},"\u25c9 Tuple destructuring"),(0,i.kt)("p",null,"Tuple bisa di-destructure secara langsung tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let grades = ("A", "B", "C");\n\nlet (grade_a, grade_b, grade_c) = grades;\nprintln!("grade_a: {grade_a}");\nprintln!("grade_b: {grade_b}");\nprintln!("grade_c: {grade_c}");\n\nmatch grades {\n (grade_a, grade_b, grade_c) => {\n println!("grade_a: {grade_a}");\n println!("grade_b: {grade_b}");\n println!("grade_c: {grade_c}");\n }\n}\n')),(0,i.kt)("h3",{id:"-variabel-_"},"\u25c9 Variabel ",(0,i.kt)("inlineCode",{parentName:"h3"},"_")),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," bisa dimanfaatkan pada statement ",(0,i.kt)("em",{parentName:"p"},"destructuring")," untuk menampung item yang tidak digunakan. Contoh penerapannya bisa dilihat di bawah ini. Tuple ",(0,i.kt)("inlineCode",{parentName:"p"},"numbers")," di-destructure dan hanya diambil elemen ke-2-nya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = (2, 4, 32);\n\nlet (_, second, _) = numbers;\nprintln!("second number: {second}");\n')),(0,i.kt)("h3",{id:"-operator-"},"\u25c9 Operator ",(0,i.kt)("inlineCode",{parentName:"h3"},"..")),(0,i.kt)("p",null,"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"..")," bisa digunakan untuk meng-exclude item dalam range tertentu. Sebagai contoh, tuple ",(0,i.kt)("inlineCode",{parentName:"p"},"numbers")," di-destructure dan hanya diambil nilai elemen ke-1 dan terakhirnya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = (2, 4, 8, 16, 32);\n\nlet (first, .., last) = numbers;\nprintln!("first number: {first}");\nprintln!("last number: {last}");\n')),(0,i.kt)("p",null,"Opeartor ",(0,i.kt)("inlineCode",{parentName:"p"},"..")," hanya bisa digunakan pada statement destructuring di posisi tengah, awal, atau akhir (pilih salah satu). Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let (first, .., last) = numbers;\nprintln!("first number: {first}");\nprintln!("last number: {last}");\n\nlet (first, ..) = numbers;\nprintln!("first number: {first}");\n\nlet (.., last) = numbers;\nprintln!("last number: {last}");\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/pattern_matching"},"github.com/novalagung/dasarpemrogramanrust-example/../pattern_matching")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/seleksi-kondisi-if"},"Seleksi Kondisi \u279c if, else if, else")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tuple"},"Tipe Data \u279c Tuple")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/struct"},"Struct")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/enum"},"Enum")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/option-type"},"Tipe Data \u279c Option"))),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang ",(0,i.kt)("inlineCode",{parentName:"li"},"while let"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/flow_control/match.html"},"https://doc.rust-lang.org/rust-by-example/flow_control/match.html"))))}k.isMDXComponent=!0},9125:(e,n,a)=>{a.d(n,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhEAAABaCAIAAACJ/JPDAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6Tl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jGAD2hqaYdJYXo5+YCr1JNYLiRN0QdWDEQ1Ilji4lqUZEYMMzu6M0QxtOcVIRBM1I2nk9JBoLOJcKiXABYxN9RGQ6mqGtzv6VM2oGRIn+FP1YETCm66fp2yQHM2QI8rOqxk55RyOLZWvGQNGHjTIqZzbXnCYlYcL1wzJ57BCIRXQDHPFEb7FJjVOUTUkTtCD1g5GFJcsaXzdMkhqiCd0NKSYsiU0Q1lOqUzTNCNRXD8yRKSFOF6dFGMI4NI049jLm1mNLnx3Hwop0/lQxXE6adIkV+OsIXHCbqhSMCLx6nKeokHidyQv8fKyLTE2lVVOu0xBhER3xEkXYihqZCGaUGAQN8SX9T1IIgYXwBo147x4cxjN4Fg3D1+eeYP8lJvh1JRTnFeHczUGADSjCP0Myubkc1TUjDME+SldTjTj0hsDoBlvHHdsqqJgCGNTy+0j1OVcmmZ44z2LtvRaGgOgGQAAAGgGAACgGQAAgGYAAACaAQAAaAYAAKAZAAAAaAYAAKAZAACAZgAAAJoBAAAXpxnf/319ff3vx1/ZV/nrx3+jzgMAADQDAAAuXjNGg2YAALwlzWh6/ZZ/v4uHT39ojnRJTr/YmmGcFTcXAAC4QD/DEYTg182wZjSCgcMBAPBWNcMXjYRm/EAwAADermZsTiNN1tR4VDOcVAAA8AY1w9YOIwipsSnJLwEAgDenGd2MhTXd3c929weZ0AAAuHjNsNdHvdpK8Ootm9o4A1HfhXVT7Z/RDQCAS/czAAAAzQAAAEAzAAAAzQAAADQDAADQDAAAQDMAAADNAAAAQDMAAADNAAAANAMAANAMAABYG/8DiOs2Gd7BWQgAAAAASUVORK5CYII="},9310:(e,n,a)=>{a.d(n,{Z:()=>t});const t=a.p+"assets/images/pattern-matching-2-5b5fd279cb60f0d2dc3002667e49a970.png"}}]); \ No newline at end of file diff --git a/assets/js/2bc2e36b.da777af7.js b/assets/js/2bc2e36b.da777af7.js new file mode 100644 index 00000000..9fc9aad1 --- /dev/null +++ b/assets/js/2bc2e36b.da777af7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[620],{3905:(e,n,a)=>{a.d(n,{Zo:()=>m,kt:()=>s});var t=a(7294);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n=0||(i[a]=e[a]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var u=t.createContext({}),o=function(e){var n=t.useContext(u),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},m=function(e){var n=o(e.components);return t.createElement(u.Provider,{value:n},e.children)},k={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},d=t.forwardRef((function(e,n){var a=e.components,i=e.mdxType,l=e.originalType,u=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),d=o(a),s=i,c=d["".concat(u,".").concat(s)]||d[s]||k[s]||l;return a?t.createElement(c,r(r({ref:n},m),{},{components:a})):t.createElement(c,r({ref:n},m))}));function s(e,n){var a=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=d;var p={};for(var u in n)hasOwnProperty.call(n,u)&&(p[u]=n[u]);p.originalType=e,p.mdxType="string"==typeof e?e:i,r[1]=p;for(var o=2;o{a.r(n),a.d(n,{assets:()=>u,contentTitle:()=>r,default:()=>k,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=a(7462),i=(a(7294),a(3905));const l={sidebar_position:42,title:"A.42. Pattern Matching",sidebar_label:"A.42. Pattern Matching"},r=void 0,p={unversionedId:"basic/pattern-matching",id:"basic/pattern-matching",title:"A.42. Pattern Matching",description:"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih advance dibanding seleksi kondisi biasa.",source:"@site/docs/basic/pattern-matching.md",sourceDirName:"basic",slug:"/basic/pattern-matching",permalink:"/basic/pattern-matching",draft:!1,tags:[],version:"current",sidebarPosition:42,frontMatter:{sidebar_position:42,title:"A.42. Pattern Matching",sidebar_label:"A.42. Pattern Matching"},sidebar:"tutorialSidebar",previous:{title:"A.41. Operator ?",permalink:"/basic/operator-tanda-tanya"},next:{title:"A.43. Static Item",permalink:"/basic/static"}},u={},o=[{value:"A.42.1. Keyword match",id:"a421-keyword-match",level:2},{value:"\u25c9 Menampung nilai balik match",id:"-menampung-nilai-balik-match",level:3},{value:"A.42.2. Pattern matching",id:"a422-pattern-matching",level:2},{value:"\u25c9 Pengecekan nilai enum",id:"-pengecekan-nilai-enum",level:3},{value:"\u25c9 Pattern | dan ..",id:"-pattern--dan-",level:3},{value:"\u25c9 Match guard",id:"-match-guard",level:3},{value:"\u25c9 Binding @",id:"-binding-",level:3},{value:"\u25c9 if let",id:"-if-let",level:3},{value:"A.42.3. Destructuring assignment",id:"a423-destructuring-assignment",level:2},{value:"\u25c9 Struct destructuring",id:"-struct-destructuring",level:3},{value:"\u25c9 Enum destructuring",id:"-enum-destructuring",level:3},{value:"\u25c9 Tuple destructuring",id:"-tuple-destructuring",level:3},{value:"\u25c9 Variabel _",id:"-variabel-_",level:3},{value:"\u25c9 Operator ..",id:"-operator-",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function k(e){let{components:n,...l}=e;return(0,i.kt)("wrapper",(0,t.Z)({},m,l,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih ",(0,i.kt)("em",{parentName:"p"},"advance")," dibanding seleksi kondisi biasa."),(0,i.kt)("p",null,"Dalam pattern matching, pengecekan dilakukan dengan melihat kecocokan suatu pola/pattern."),(0,i.kt)("h2",{id:"a421-keyword-match"},"A.42.1. Keyword ",(0,i.kt)("inlineCode",{parentName:"h2"},"match")),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," digunakan untuk pattern matching. Contoh penerapan versi sederhananya bisa dilihat berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nmatch time {\n "morning" => println!("isuk"),\n "afternoon" => println!("awan"),\n "evening" => println!("bengi"),\n _ => println!("mbuh kapan"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Pattern Matching",src:a(9125).Z,width:"529",height:"90"})),(0,i.kt)("p",null,"Pada contoh di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"time")," dicek nilainya menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan 4 buah klausul:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"morning"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"isuk")),(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"afternoon"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"awan")),(0,i.kt)("li",{parentName:"ul"},"Jika value-nya ",(0,i.kt)("inlineCode",{parentName:"li"},"evening"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"bengi")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"mbuh kapan"))),(0,i.kt)("p",null,"Contoh di atas adalah ekuivalen dengan seleksi kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nif time == "morning" {\n println!("isuk")\n} else if time == "afternoon" {\n println!("awan")\n} else if time == "evening" {\n println!("bengi")\n} else {\n println!("mbuh kapan")\n}\n')),(0,i.kt)("p",null,"Ada satu syarat yang harus dipenuhi dalam penerapan pattern matching, yaitu semua kondisi yang memungkinkan harus ditulis, harus lengkap. Ibarat ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," yang harus ada block ",(0,i.kt)("inlineCode",{parentName:"p"},"else"),"-nya."),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," digunakan sebagai else-nya block ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Tanpa adanya kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," maka besar kemungkinan block ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," error jika klausulnya tidak lengkap."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Pattern Matching",src:a(9310).Z,width:"755",height:"284"})),(0,i.kt)("h3",{id:"-menampung-nilai-balik-match"},"\u25c9 Menampung nilai balik ",(0,i.kt)("inlineCode",{parentName:"h3"},"match")),(0,i.kt)("p",null,"Block statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," bisa saja menghasilkan return value. Contohnya bisa dilihat berikut ini, hasil dari pattern matching ditampung ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"time_but_in_javanese"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let time = "morning";\n\nlet time_but_in_javanese = match time {\n "morning" => "isuk",\n "afternoon" => "awan",\n "evening" => "bengi",\n _ => "mbuh kapan",\n};\n\nprintln!("{time_but_in_javanese}");\n')),(0,i.kt)("h2",{id:"a422-pattern-matching"},"A.42.2. Pattern matching"),(0,i.kt)("p",null,"Contoh di atas bisa dikategorikan sebagai seleksi kondisi biasa meskipun menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Setelah ini kita akan pelajari macam-macam pattern/pola yang di-support dalam pattern matching di Rust."),(0,i.kt)("h3",{id:"-pengecekan-nilai-enum"},"\u25c9 Pengecekan nilai enum"),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("a",{parentName:"p",href:"/basic/option-type"},"Option")," adalah salah satu enum yang paling sering dipakai pada pattern matching. Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," memiliki 2 enum value, ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," yang merepresentasikan sebuah nilai, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," yang berarti tidak ada nilai."),(0,i.kt)("p",null,"Pattern matching pada enum cukup mudah, caranya bisa dilihat pada contoh berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Option::Some(5);\n\nmatch value {\n Some(1) => println!("one"),\n Some(2) => println!("two"),\n Some(x) => println!("{x} greater than two"),\n _ => println!("none"),\n}\n')),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," nilainya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(5)"),". Variabel tersebut dimasukkan ke block ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan 4 buah kondisi pengecekan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(1)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"one")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(2)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"two")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(x)"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"{x} greater than two")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"none"))),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," pasti berpotensi berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", tidak mungkin selainnya. Klausul terakhir di contoh di atas (",(0,i.kt)("inlineCode",{parentName:"p"},'_ => println!("none")'),") terpenuhi ketika nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Pada konteks ini mengganti ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," menjadikan klausul pada pattern matching tetap lengkap."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Some(1) => println!("one"),\n Some(2) => println!("two"),\n Some(x) => println!("{x} greater than two"),\n None => println!("none"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/option-type"},"Tipe Data \u279c Option"))),(0,i.kt)("h3",{id:"-pattern--dan-"},"\u25c9 Pattern ",(0,i.kt)("inlineCode",{parentName:"h3"},"|")," dan ",(0,i.kt)("inlineCode",{parentName:"h3"},"..")),(0,i.kt)("p",null,"Klausul pattern matching bisa berisi operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"OR")," maupun ",(0,i.kt)("inlineCode",{parentName:"p"},"IN")," caranya dengan memanfaatkan operator berikut:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Operator ",(0,i.kt)("inlineCode",{parentName:"li"},"|")," digunakan sebagai logika ",(0,i.kt)("inlineCode",{parentName:"li"},"OR")),(0,i.kt)("li",{parentName:"ul"},"Operator ",(0,i.kt)("inlineCode",{parentName:"li"},"..")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"..=")," digunakan sebagai logika ",(0,i.kt)("inlineCode",{parentName:"li"},"IN"))),(0,i.kt)("p",null,"Contoh penerapannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 6;\n\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"1")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"2"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"one or two")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya antara ",(0,i.kt)("inlineCode",{parentName:"li"},"3")," hingga ",(0,i.kt)("inlineCode",{parentName:"li"},"5"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"three through five")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"value")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"6"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"six")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"other number"))),(0,i.kt)("p",null,"Pattern di atas juga bisa diterapkan dalam variabel enum value, contohnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Some(5);\n\nmatch value {\n Some(1 | 2) => println!("one or two"),\n Some(3..=5) => println!("three through five"),\n Some(6) => println!("six"),\n Some(x) => println!("{x} greater than six"),\n _ => println!("none"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"|")," memiliki 2 kegunaan:"),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Pada statement biasa, fungsinya adalah untuk ",(0,i.kt)("strong",{parentName:"li"},"bitwise OR"),"."),(0,i.kt)("li",{parentName:"ul"},"Pada pattern matching, fungsinya untuk ",(0,i.kt)("strong",{parentName:"li"},"OR"),", kegunaannya sama seperti ",(0,i.kt)("inlineCode",{parentName:"li"},"||")," pada statement biasa.")),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai bitwise operator dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/bitwise-operation"},"Bitwise Operation"))),(0,i.kt)("h3",{id:"-match-guard"},"\u25c9 Match guard"),(0,i.kt)("p",null,"Match guard adalah teknik menambahkan sub seleksi kondisi pada klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = Some(4);\n\nlet message = match value {\n Some(x) if x % 2 == 0 => format!("number {} is even", x),\n Some(x) => format!("number {} is odd", x),\n None => String::new(),\n};\n\nprintln!("{message}");\n')),(0,i.kt)("p",null,"Klausul pertama di atas, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(x)")," ditambahkan match guard ",(0,i.kt)("inlineCode",{parentName:"p"},"if x % 2 == 0"),"."),(0,i.kt)("h3",{id:"-binding-"},"\u25c9 Binding ",(0,i.kt)("inlineCode",{parentName:"h3"},"@")),(0,i.kt)("p",null,"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"@")," digunakan untuk menampung nilai klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," yang default-nya tidak bisa ditampung. Agar lebih jelas, silakan pelajari pattern matching berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 3;\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("p",null,"Klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"1 | 2")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"3..=5")," nilai by default tidak bisa diakses. Kita hanya tau bahwa nilai pasti antara ",(0,i.kt)("inlineCode",{parentName:"p"},"1")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"2")," untuk klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"1 | 2"),", dan ",(0,i.kt)("inlineCode",{parentName:"p"},"3 / 4 / 5")," untuk klausul ",(0,i.kt)("inlineCode",{parentName:"p"},"3..=5"),"."),(0,i.kt)("p",null,"Nilai pasti klausul tersebut bisa ditampung menggunakan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"@"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 3;\nmatch value {\n n @ (1 | 2) => println!("one or two ({})", n),\n n @ 3..=5 => println!("three through five ({})", n),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Khusus untuk penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"@")," binding pada operator ",(0,i.kt)("inlineCode",{parentName:"p"},"|"),", pada penulisan klausul seleksi kondisinya harus diapit tanda ",(0,i.kt)("inlineCode",{parentName:"p"},"()"),".")),(0,i.kt)("h3",{id:"-if-let"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"if let")),(0,i.kt)("p",null,"Untuk memahami pattern matching menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if let"),", silakan pelajari kode berikut terlebih dahulu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value: Option = Some(5);\n\nmatch value {\n Some(1) => println!("one"),\n Some(x) => println!("{x} greater than two"),\n _ => println!("none"),\n}\n')),(0,i.kt)("p",null,"Pattern matching di atas cukup mudah dipahami, isinya ada 2 kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," dan 1 buah else (menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"_"),"). "),(0,i.kt)("p",null,"Block kode tersebut jika dikonversi ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," hasilnya seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = Some(5);\n\nif let Some(1) = value {\n println!("one");\n} else if let Some(x) = value {\n println!("{x} greater than two");\n} else {\n println!("none");\n}\n')),(0,i.kt)("p",null,"Dari sini cukup jelas kegunaan dari ",(0,i.kt)("inlineCode",{parentName:"p"},"if let"),". Meskipun menggunakan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"=")," (bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"=="),") block kode seleksi kondisi di atas adalah pattern matching, yang isinya melakukan pengecekan sama persis seperti pattern matching pada kode sebelumnya."),(0,i.kt)("p",null,"Tambahan contoh, 2 block kode berikut adalah juga ekuivalen."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let value = 6;\nmatch value {\n 1 | 2 => println!("one or two"),\n 3..=5 => println!("three through five"),\n 6 => println!("six"),\n _ => println!("other number"),\n}\n\n// ... vs ...\n\nlet value = Some(5);\nif let Some(1 | 2) = value {\n println!("one or two");\n} else if let Some(3..=5) = value {\n println!("three through five");\n} else if let Some(6) = value {\n println!("six");\n} else {\n println!("other number");\n}\n')),(0,i.kt)("h2",{id:"a423-destructuring-assignment"},"A.42.3. Destructuring assignment"),(0,i.kt)("h3",{id:"-struct-destructuring"},"\u25c9 Struct destructuring"),(0,i.kt)("p",null,"Operasi ",(0,i.kt)("em",{parentName:"p"},"destructuring")," (menampung item suatu tipe) bisa dilakukan menggunakan pattern matching."),(0,i.kt)("p",null,"Pada kode di bawah ini, variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"p")," yang bertipe struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Point { x: i32, y: i32 }")," dimasukkan pada block pattern matching. Item dari struct tersebut di-",(0,i.kt)("em",{parentName:"p"},"destructure")," ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y")," masing-masing klausul pattern matching item-nya ditampung ke variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'struct Point {\n x: i32,\n y: i32,\n}\n\nlet p = Point { x: 0, y: 7 };\n\nmatch p {\n Point { x, y: 0 } => println!("x axis at {x}"),\n Point { x: 0, y } => println!("y axis at {y}"),\n Point { x, y } => println!("axis: ({x}, {y})")\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"p.y")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"0"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"x axis at {x}")),(0,i.kt)("li",{parentName:"ul"},"Jika ",(0,i.kt)("inlineCode",{parentName:"li"},"p.x")," nilainya ",(0,i.kt)("inlineCode",{parentName:"li"},"0"),", tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"y axis at {y}")),(0,i.kt)("li",{parentName:"ul"},"Jika tidak ada yang cocok dari klausus di atas, maka tampilkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"axis: ({x}, {y})"))),(0,i.kt)("p",null,"Operasi destructuring hasilnya pasti sukses, karena alasan ini keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," boleh tidak digunakan. Contohnya bisa dilihat pada kode berikut, variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"p")," di-",(0,i.kt)("em",{parentName:"p"},"destructure")," ke variabel baru yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"y"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let Point { x, y } = p;\n\nprintln!("x: {x}");\nprintln!("y: {y}");\n')),(0,i.kt)("h3",{id:"-enum-destructuring"},"\u25c9 Enum destructuring"),(0,i.kt)("p",null,"Destructuring juga bisa dilakukan pada tipe data enum caranya dengan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," (wajib menggunakan salah satu keyword tersebut)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'enum Color {\n Black,\n White,\n Rgb(i32, i32, i32)\n}\n\nlet color = Color::Rgb(0, 160, 255);\n\nif let Color::Rgb(r, g, b) = color {\n println!("r: {r}");\n println!("g: {g}");\n println!("b: {b}");\n}\n\nmatch color {\n Color::Rgb(r, g, b) => println!("r: {r}, g: {g}, b: {b}"),\n _ => println!("other color")\n}\n')),(0,i.kt)("h3",{id:"-tuple-destructuring"},"\u25c9 Tuple destructuring"),(0,i.kt)("p",null,"Tuple bisa di-destructure secara langsung tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let grades = ("A", "B", "C");\n\nlet (grade_a, grade_b, grade_c) = grades;\nprintln!("grade_a: {grade_a}");\nprintln!("grade_b: {grade_b}");\nprintln!("grade_c: {grade_c}");\n\nmatch grades {\n (grade_a, grade_b, grade_c) => {\n println!("grade_a: {grade_a}");\n println!("grade_b: {grade_b}");\n println!("grade_c: {grade_c}");\n }\n}\n')),(0,i.kt)("h3",{id:"-variabel-_"},"\u25c9 Variabel ",(0,i.kt)("inlineCode",{parentName:"h3"},"_")),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"_")," bisa dimanfaatkan pada statement ",(0,i.kt)("em",{parentName:"p"},"destructuring")," untuk menampung item yang tidak digunakan. Contoh penerapannya bisa dilihat di bawah ini. Tuple ",(0,i.kt)("inlineCode",{parentName:"p"},"numbers")," di-destructure dan hanya diambil elemen ke-2-nya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = (2, 4, 32);\n\nlet (_, second, _) = numbers;\nprintln!("second number: {second}");\n')),(0,i.kt)("h3",{id:"-operator-"},"\u25c9 Operator ",(0,i.kt)("inlineCode",{parentName:"h3"},"..")),(0,i.kt)("p",null,"Operator ",(0,i.kt)("inlineCode",{parentName:"p"},"..")," bisa digunakan untuk meng-exclude item dalam range tertentu. Sebagai contoh, tuple ",(0,i.kt)("inlineCode",{parentName:"p"},"numbers")," di-destructure dan hanya diambil nilai elemen ke-1 dan terakhirnya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = (2, 4, 8, 16, 32);\n\nlet (first, .., last) = numbers;\nprintln!("first number: {first}");\nprintln!("last number: {last}");\n')),(0,i.kt)("p",null,"Opeartor ",(0,i.kt)("inlineCode",{parentName:"p"},"..")," hanya bisa digunakan pada statement destructuring di posisi tengah, awal, atau akhir (pilih salah satu). Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let (first, .., last) = numbers;\nprintln!("first number: {first}");\nprintln!("last number: {last}");\n\nlet (first, ..) = numbers;\nprintln!("first number: {first}");\n\nlet (.., last) = numbers;\nprintln!("last number: {last}");\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/pattern_matching"},"github.com/novalagung/dasarpemrogramanrust-example/../pattern_matching")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/seleksi-kondisi-if"},"Seleksi Kondisi \u279c if, else if, else")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tuple"},"Tipe Data \u279c Tuple")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/struct"},"Struct")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/enum"},"Enum")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/option-type"},"Tipe Data \u279c Option"))),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang ",(0,i.kt)("inlineCode",{parentName:"li"},"while let"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/flow_control/match.html"},"https://doc.rust-lang.org/rust-by-example/flow_control/match.html"))))}k.isMDXComponent=!0},9125:(e,n,a)=>{a.d(n,{Z:()=>t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=>t});const t=a.p+"assets/images/pattern-matching-2-5b5fd279cb60f0d2dc3002667e49a970.png"}}]); \ No newline at end of file diff --git a/assets/js/388041ab.66c86ae4.js b/assets/js/388041ab.66c86ae4.js new file mode 100644 index 00000000..41912f06 --- /dev/null +++ b/assets/js/388041ab.66c86ae4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[1494],{3905:(a,e,r)=>{r.d(e,{Zo:()=>s,kt:()=>d});var n=r(7294);function t(a,e,r){return e in a?Object.defineProperty(a,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[e]=r,a}function i(a,e){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.push.apply(r,n)}return r}function l(a){for(var e=1;e=0||(t[r]=a[r]);return t}(a,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(a,r)&&(t[r]=a[r])}return t}var p=n.createContext({}),u=function(a){var e=n.useContext(p),r=e;return a&&(r="function"==typeof a?a(e):l(l({},e),a)),r},s=function(a){var e=u(a.components);return n.createElement(p.Provider,{value:e},a.children)},m={inlineCode:"code",wrapper:function(a){var e=a.children;return n.createElement(n.Fragment,{},e)}},k=n.forwardRef((function(a,e){var r=a.components,t=a.mdxType,i=a.originalType,p=a.parentName,s=o(a,["components","mdxType","originalType","parentName"]),k=u(r),d=t,c=k["".concat(p,".").concat(d)]||k[d]||m[d]||i;return r?n.createElement(c,l(l({ref:e},s),{},{components:r})):n.createElement(c,l({ref:e},s))}));function d(a,e){var r=arguments,t=e&&e.mdxType;if("string"==typeof a||t){var i=r.length,l=new Array(i);l[0]=k;var o={};for(var p in e)hasOwnProperty.call(e,p)&&(o[p]=e[p]);o.originalType=a,o.mdxType="string"==typeof a?a:t,l[1]=o;for(var u=2;u{r.r(e),r.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>o,toc:()=>u});var n=r(7462),t=(r(7294),r(3905));const i={sidebar_position:54,title:"A.54. Error \u279c Unrecoverable Error / Panic",sidebar_label:"A.54. Error \u279c Unrecoverable Error / Panic"},l=void 0,o={unversionedId:"basic/unrecoverable-panic-error",id:"basic/unrecoverable-panic-error",title:"A.54. Error \u279c Unrecoverable Error / Panic",description:"Error handling atau penanganan error adalah salah satu aspek penting dalam pemrograman selalu umum. Rust mengenal 2 jenis error yaitu unrecoverable error (panic error) dan recoverable error. Pembahasan chapter ini fokus pada unrecoverable error atau panic error.",source:"@site/docs/basic/unrecoverable-panic-error.md",sourceDirName:"basic",slug:"/basic/unrecoverable-panic-error",permalink:"/basic/unrecoverable-panic-error",draft:!1,tags:[],version:"current",sidebarPosition:54,frontMatter:{sidebar_position:54,title:"A.54. Error \u279c Unrecoverable Error / Panic",sidebar_label:"A.54. Error \u279c Unrecoverable Error / Panic"},sidebar:"tutorialSidebar",previous:{title:"A.53. File, Path, Directory",permalink:"/basic/file-path-directory"}},p={},u=[{value:"A.54.1. Unrecoverable error (RUNTIME error & COMPILE-TIME error)",id:"a541-unrecoverable-error-runtime-error--compile-time-error",level:2},{value:"\u25c9 Perbedaan panic saat pengaksesan vector dan error saat pengaksesan array",id:"-perbedaan-panic-saat-pengaksesan-vector-dan-error-saat-pengaksesan-array",level:3},{value:"A.54.2. Macro panic!()",id:"a542-macro-panic",level:2},{value:"\u25c9 Statement io::stdout().flush()",id:"-statement-iostdoutflush",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],s={toc:u};function m(a){let{components:e,...i}=a;return(0,t.kt)("wrapper",(0,n.Z)({},s,i,{components:e,mdxType:"MDXLayout"}),(0,t.kt)("p",null,"Error handling atau penanganan error adalah salah satu aspek penting dalam pemrograman selalu umum. Rust mengenal 2 jenis error yaitu ",(0,t.kt)("strong",{parentName:"p"},"unrecoverable error (panic error)")," dan ",(0,t.kt)("strong",{parentName:"p"},"recoverable error"),". Pembahasan chapter ini fokus pada unrecoverable error atau panic error."),(0,t.kt)("h2",{id:"a541-unrecoverable-error-runtime-error--compile-time-error"},"A.54.1. Unrecoverable error (RUNTIME error & COMPILE-TIME error)"),(0,t.kt)("p",null,(0,t.kt)("em",{parentName:"p"},"Unrecoverable error")," adalah error yang tidak bisa ditangani, entah itu karena memang disengaja atau karena ada bug fatal yang menyebabkan program mendapati error jenis ini sehingga program ",(0,t.kt)("em",{parentName:"p"},"crash")," dan berhenti secara paksa."),(0,t.kt)("p",null,"Salah satu operasi yang menyebabkan panic adalah pengaksesan elemen vector menggunakan index di luar kapasitas vector. Contoh:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let data = vec![10, 11, 23];\n\n println!("data index 1: {}", data[1]);\n println!("data index 6: {}", data[6]);\n println!("data index 2: {}", data[2]);\n}\n')),(0,t.kt)("p",null,"Pengaksesan index ke-6 vector ",(0,t.kt)("inlineCode",{parentName:"p"},"data")," menghasilkan panic karena vector tersebut hanya berisi 3 elemen."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Error Handling, Panic, Operator ?",src:r(5767).Z,width:"727",height:"182"})),(0,t.kt)("p",null,"Apa yang bisa dilakukan ketika panic muncul?"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Jika panic muncul ketika program sudah di production, program akan crash karena bug pengaksesan error di atas."),(0,t.kt)("li",{parentName:"ul"},"Jika panic muncul saat pengembangan, maka bisa diperbaiki kodenya, bisa dengan menambahkan pengecekan kapasitas index vector atau lainnya.")),(0,t.kt)("h3",{id:"-perbedaan-panic-saat-pengaksesan-vector-dan-error-saat-pengaksesan-array"},"\u25c9 Perbedaan panic saat pengaksesan vector dan error saat pengaksesan array"),(0,t.kt)("p",null,"Coba ubah kode di atas, tipe data variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"data")," ubah dari vector ke array. Lalu jalankan ulang program."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let data = [10, 11, 23];\n\n println!("data index 1: {}", data[1]);\n println!("data index 6: {}", data[6]);\n println!("data index 2: {}", data[2]);\n}\n')),(0,t.kt)("p",null,"Error masih muncul, tapi pesan error-nya berbeda."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Error Handling, Panic, Operator ?",src:r(5594).Z,width:"764",height:"215"})),(0,t.kt)("p",null,"2 program yang dijalankan keduanya error tapi error-nya sangat berbeda."),(0,t.kt)("table",null,(0,t.kt)("tr",null,(0,t.kt)("td",null,"Pengaksesan elemen vector di luar kapastias memunculkan error saat ",(0,t.kt)("b",null,"RUNTIME"),". Penjelasannya:")),(0,t.kt)("tr",null,(0,t.kt)("td",null,(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("strong",{parentName:"li"},"RUNTIME error")," menandakan kode program sudah berhasil dikompilasi dan program juga berhasil di eksekusi.",(0,t.kt)("ul",{parentName:"li"},(0,t.kt)("li",{parentName:"ul"},"Silakan lihat gambar pertama, ada keterangan ",(0,t.kt)("em",{parentName:"li"},"Finished")," dan ",(0,t.kt)("em",{parentName:"li"},"Running"),"."),(0,t.kt)("li",{parentName:"ul"},"Error ini masuk kategori ",(0,t.kt)("strong",{parentName:"li"},"panic-level error")," atau ",(0,t.kt)("strong",{parentName:"li"},"panic"),"."))),(0,t.kt)("li",{parentName:"ul"},"Error muncul ketika baris kode ",(0,t.kt)("inlineCode",{parentName:"li"},'println!("data index 6: {}", data[6]);')," dieksekusi."),(0,t.kt)("li",{parentName:"ul"},"Kode sebelum baris tersebut masih sempat dieksekusi.",(0,t.kt)("ul",{parentName:"li"},(0,t.kt)("li",{parentName:"ul"},"Silakan lihat gambar pertama, output ",(0,t.kt)("inlineCode",{parentName:"li"},"data index 1: 11")," sempat muncul sebelum error."))),(0,t.kt)("li",{parentName:"ul"},"Tipe data vector tidak tidak mampu mengetahui kapasitas datanya saat kompilasi, inilah kenapa error bisa lolos kompilasi."))))),(0,t.kt)("table",null,(0,t.kt)("tr",null,(0,t.kt)("td",null,"Sedangkan pengaksesan elemen array di luar kapastias memunculkan error saat ",(0,t.kt)("b",null,"COMPILE TIME"),". Penjelasannya:")),(0,t.kt)("tr",null,(0,t.kt)("td",null,(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("strong",{parentName:"li"},"COMPILE TIME error")," menandakan kode program gagal dikompilasi dan tidak sampai dieksekusi.",(0,t.kt)("ul",{parentName:"li"},(0,t.kt)("li",{parentName:"ul"},"Silakan lihat gambar ke-dua, ada keterangan ",(0,t.kt)("em",{parentName:"li"},"Compiling")," diikuti dengan error, dan keterangan ",(0,t.kt)("inlineCode",{parentName:"li"},"could not compile"),"."),(0,t.kt)("li",{parentName:"ul"},"Error ini masuk kategori ",(0,t.kt)("strong",{parentName:"li"},"compile-time-level error")," atau cukup ",(0,t.kt)("strong",{parentName:"li"},"error"),"."))),(0,t.kt)("li",{parentName:"ul"},"Error muncul saat compiler memproses baris kode ",(0,t.kt)("inlineCode",{parentName:"li"},'println!("data index 6: {}", data[6]);'),"."),(0,t.kt)("li",{parentName:"ul"},"Tipe data array kapasitasnya sudah bisa diketahui oleh compiler saat kompilasi, menyebabkan proses kompilasi gagal."))))),(0,t.kt)("h2",{id:"a542-macro-panic"},"A.54.2. Macro ",(0,t.kt)("inlineCode",{parentName:"h2"},"panic!()")),(0,t.kt)("p",null,"Telah kita pelajari bahwa panic muncul karena ",(0,t.kt)("em",{parentName:"p"},"flaw")," atau cacat program, disebabkan oleh bug di kode program. Selain itu, panic bisa dimunculkan dengan sengaja menggunakan macro ",(0,t.kt)("inlineCode",{parentName:"p"},"panic!()"),"."),(0,t.kt)("p",null,"Cara penggunaannya cukup dengan memanggil macro tersebut diikuti dengan argument berisi string keterangan panic errornya."),(0,t.kt)("p",null,"Pada contoh berikut, program sederhana dibuat untuk menangkap inputan nama user untuk kemudian di-print. Jika user tidak menginputkan apapun, maka panic sengaja dimunculkan via pemanggilan macro ",(0,t.kt)("inlineCode",{parentName:"p"},"panic!()"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'use std::io;\nuse std::io::Write;\n\nfn main() {\n print!("enter your name: ");\n let _ = io::stdout().flush();\n\n let name = read_entry();\n if name.is_empty() {\n panic!("unable to continue the program");\n }\n\n println!("hi {}", name);\n}\n\npub fn read_entry() -> String {\n let mut message = String::new();\n let reader_res = io::stdin().read_line(&mut message);\n\n if reader_res.is_err() {\n return message;\n }\n\n message.trim().to_string()\n}\n')),(0,t.kt)("p",null,"Output program:"),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Error Handling, Panic, Operator ?",src:r(4274).Z,width:"719",height:"284"})),(0,t.kt)("p",null,"Program dieksekusi 2 kali:"),(0,t.kt)("ol",null,(0,t.kt)("li",{parentName:"ol"},"Eksekusi pertama, inputan ",(0,t.kt)("inlineCode",{parentName:"li"},"noval agung")," digunakan. Hasilnya program berjalan sesuai desain."),(0,t.kt)("li",{parentName:"ol"},"Pada eksekusi ke-2, tidak ada inputan yang ditulis, dan langsung tekan tombol enter, hasilnya panic sengaja dimunculkan via macro ",(0,t.kt)("inlineCode",{parentName:"li"},"panic!()")," dengan pesan ",(0,t.kt)("inlineCode",{parentName:"li"},"unable to continue the program"),".")),(0,t.kt)("h3",{id:"-statement-iostdoutflush"},"\u25c9 Statement ",(0,t.kt)("inlineCode",{parentName:"h3"},"io::stdout().flush()")),(0,t.kt)("p",null,"Dibanding dengan beberapa chapter sebelumnya yang juga ada praktek menangkap inputan user, kode program yang ditulis kali ini disisipi statement baru yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"io::stdout().flush()"),". Kode tersebut berguna untuk mem-",(0,t.kt)("em",{parentName:"p"},"flush")," output STDOUT yang muncul, karena default output STDOUT adalah di-",(0,t.kt)("em",{parentName:"p"},"buffer")," oleh Rust."),(0,t.kt)("p",null,"Jika tidak di-flush, ada kemungkinan text ",(0,t.kt)("inlineCode",{parentName:"p"},"enter your name: ")," muncul setelah user mengisi inputan lalu menekan tombol ",(0,t.kt)("em",{parentName:"p"},"enter"),"."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Untuk menggunakan stdout flush, path ",(0,t.kt)("inlineCode",{parentName:"p"},"std::io::Write")," harus di-import terlebih dahulu.")),(0,t.kt)("hr",null),(0,t.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,t.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,t.kt)("pre",null,(0,t.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/unrecoverable_panic_error"},"github.com/novalagung/dasarpemrogramanrust-example/../unrecoverable_panic_error")),(0,t.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"#"},"Error \u279c Recoverable Error & Error Handling"))),(0,t.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-with-panic.html"},"https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-with-panic.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch09-03-to-panic-or-not-to-panic.html"},"https://doc.rust-lang.org/book/ch09-03-to-panic-or-not-to-panic.html"))))}m.isMDXComponent=!0},5767:(a,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"assets/images/unrecoverable-panic-error-1-2a22152a19c4dfb91d4f55885880fc08.png"},5594:(a,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"assets/images/unrecoverable-panic-error-2-1ffea2a5a914b4b95bb2db06c1ac9b53.png"},4274:(a,e,r)=>{r.d(e,{Z:()=>n});const n=r.p+"assets/images/unrecoverable-panic-error-3-4d90d454da4c451e1d9b6c9499ba72c6.png"}}]); \ No newline at end of file diff --git a/assets/js/3d2f5b0c.dbd56e0e.js b/assets/js/3d2f5b0c.dbd56e0e.js new file mode 100644 index 00000000..f9c0f1b2 --- /dev/null +++ b/assets/js/3d2f5b0c.dbd56e0e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[676],{3905:(e,a,n)=>{n.d(a,{Zo:()=>u,kt:()=>m});var t=n(7294);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=t.createContext({}),d=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},u=function(e){var a=d(e.components);return t.createElement(o.Provider,{value:a},e.children)},s={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},k=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),k=d(n),m=r,g=k["".concat(o,".").concat(m)]||k[m]||s[m]||i;return n?t.createElement(g,l(l({ref:a},u),{},{components:n})):t.createElement(g,l({ref:a},u))}));function m(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=k;var p={};for(var o in a)hasOwnProperty.call(a,o)&&(p[o]=a[o]);p.originalType=e,p.mdxType="string"==typeof e?e:r,l[1]=p;for(var d=2;d{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>s,frontMatter:()=>i,metadata:()=>p,toc:()=>d});var t=n(7462),r=(n(7294),n(3905));const i={sidebar_position:41,title:"A.41. Operator ?",sidebar_label:"A.41. Operator ?"},l=void 0,p={unversionedId:"basic/operator-tanda-tanya",id:"basic/operator-tanda-tanya",title:"A.41. Operator ?",description:"Operator ? (atau question mark operator) adalah operator yang cukup berguna untuk operasi unwrap nilai dari tipe Result atau Option. Pada chapter ini kita akan belajar tentang operator tersebut.",source:"@site/docs/basic/operator-tanda-tanya.md",sourceDirName:"basic",slug:"/basic/operator-tanda-tanya",permalink:"/basic/operator-tanda-tanya",draft:!1,tags:[],version:"current",sidebarPosition:41,frontMatter:{sidebar_position:41,title:"A.41. Operator ?",sidebar_label:"A.41. Operator ?"},sidebar:"tutorialSidebar",previous:{title:"A.40. Tipe Data \u279c Result",permalink:"/basic/result-type"},next:{title:"A.42. Pattern Matching",permalink:"/basic/pattern-matching"}},o={},d=[{value:"A.41.1. Operator ?",id:"a411-operator-",level:2},{value:"\u25c9 Refactor ke-1",id:"-refactor-ke-1",level:3},{value:"\u25c9 Refactor ke-2",id:"-refactor-ke-2",level:3},{value:"\u25c9 Refactor ke-3",id:"-refactor-ke-3",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],u={toc:d};function s(e){let{components:a,...i}=e;return(0,r.kt)("wrapper",(0,t.Z)({},u,i,{components:a,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," (atau ",(0,r.kt)("em",{parentName:"p"},"question mark operator"),") adalah operator yang cukup berguna untuk operasi ",(0,r.kt)("strong",{parentName:"p"},"unwrap")," nilai dari tipe ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," atau ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),". Pada chapter ini kita akan belajar tentang operator tersebut."),(0,r.kt)("h2",{id:"a411-operator-"},"A.41.1. Operator ?"),(0,r.kt)("p",null,"Operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," digunakan untuk operasi ",(0,r.kt)("strong",{parentName:"p"},"unwrap")," value dari tipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," (dan ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),")."),(0,r.kt)("p",null,"Penggunaannya terhadap tipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," cukup umum untuk keperluan penanganan error (atau ",(0,r.kt)("em",{parentName:"p"},"error propagation"),"). Ketika suatu object dengan tipe tersebut di-unwrap menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?"),", maka:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Jika nilai object adalah bertipe ",(0,r.kt)("inlineCode",{parentName:"li"},"T"),", maka yang dikembalikan adalah nilai ",(0,r.kt)("inlineCode",{parentName:"li"},"T")),(0,r.kt)("li",{parentName:"ul"},"Jika nilai object adalah bertipe ",(0,r.kt)("inlineCode",{parentName:"li"},"E"),", maka yang dikembalikan adalah nilai ",(0,r.kt)("inlineCode",{parentName:"li"},"E")," atau error.")),(0,r.kt)("p",null,"Agar lebih mudah memahami kegunaan dari operator ini, pembelajaran lebih baik dimulai dengan praktik kode yang didalamnya ada penerapan tipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," (atau ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),"). Di contoh berikut, tipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," kita pilih untuk praktek."),(0,r.kt)("p",null,"Silakan tulis kode berikut, pelajari, kemudian jalankan."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n do_some_math();\n}\n\nfn do_some_math() {\n let result1 = divider(10.0, 5.0);\n match result1 {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n }\n \n let result2 = divider(10.0, 0.0);\n match result2 {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n }\n \n let result3 = divider(10.0, 2.0);\n match result3 {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n }\n}\n\nfn divider(a: f64, b: f64) -> Result {\n if b == 0.0 {\n return Err("division by zero error");\n }\n\n let result = a / b;\n return Ok(result);\n}\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Pada contoh di atas, operasi aritmatika ditempatkan dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," dan tidak langsung dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"main()"),". Ini disengaja karena berhubungan dengan contoh berikutnya. ")),(0,r.kt)("p",null,"Fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"divider()")," dibuat dengan kegunaan sangat spesifik, yaitu melakukan operasi aritmatika pembagian. Fungsi tersebut menghasilkan error jika ditemukan nilai pembagi adalah angka ",(0,r.kt)("inlineCode",{parentName:"p"},"0"),"."),(0,r.kt)("p",null,"Output program:"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(8889).Z,width:"530",height:"149"})),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Hasil statement ",(0,r.kt)("inlineCode",{parentName:"li"},"divider(10.0, 5.0)")," memenuhi kriteria ",(0,r.kt)("inlineCode",{parentName:"li"},"Ok(r)"),", maka outputnya adalah ",(0,r.kt)("inlineCode",{parentName:"li"},"result: 2.00")),(0,r.kt)("li",{parentName:"ul"},"Hasil statement ",(0,r.kt)("inlineCode",{parentName:"li"},"divider(10.0, 0.0)")," memenuhi kriteria ",(0,r.kt)("inlineCode",{parentName:"li"},"Err(m)"),", maka outputnya adalah ",(0,r.kt)("inlineCode",{parentName:"li"},'ERROR! "division by zero error"')),(0,r.kt)("li",{parentName:"ul"},"Hasil statement ",(0,r.kt)("inlineCode",{parentName:"li"},"divider(10.0, 2.0)")," memenuhi kriteria ",(0,r.kt)("inlineCode",{parentName:"li"},"Ok(r)"),", maka outputnya adalah ",(0,r.kt)("inlineCode",{parentName:"li"},"result: 5.00"))),(0,r.kt)("p",null,"Sampai sini penulis rasa cukup jelas. Selanjutnya kode tersebut akan di-refactor, beberapa statement disederhanakan menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?"),"."),(0,r.kt)("h3",{id:"-refactor-ke-1"},"\u25c9 Refactor ke-1"),(0,r.kt)("p",null,"Ubah fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," menjadi seperti ini:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_some_math() {\n let r1 = divider(10.0, 5.0)?;\n println!("result: {r1:.2}");\n \n let r2 = divider(10.0, 0.0)?;\n println!("result: {r2:.2}");\n \n let r3 = divider(10.0, 2.0)?;\n println!("result: {r3:.2}");\n}\n')),(0,r.kt)("p",null,"Sekilas perbandingan fungsi sebelum dan setelah dimodifikasi bisa dilihat pada dua gambar berikut."),(0,r.kt)("table",null,(0,r.kt)("tr",null,(0,r.kt)("td",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(9692).Z,width:"1292",height:"1402"}))),(0,r.kt)("td",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(7725).Z,width:"1032",height:"916"}))))),(0,r.kt)("p",null,"Implementasi operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," dilakukan dengan cukup menuliskannya setelah memanggil fungsi yang memiliki tipe nilai balik ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," (atau ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),") yang pada contoh ini adalah fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"divider()"),". Operator tersebut meng-unwrap nilai balik fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"divider()")," yang bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," dengan ketentuan:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"Jila nilai balik ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," berisi nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"Ok(f64)"),", maka nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"f64")," dikembalikan."),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Statement ",(0,r.kt)("inlineCode",{parentName:"li"},"let r1 = divider(10.0, 5.0)?;"),", variabel ",(0,r.kt)("inlineCode",{parentName:"li"},"r1")," berisi nilai bertipe ",(0,r.kt)("inlineCode",{parentName:"li"},"f64"),"."),(0,r.kt)("li",{parentName:"ul"},"Statement ",(0,r.kt)("inlineCode",{parentName:"li"},"let r3 = divider(10.0, 2.0)?;"),", variabel ",(0,r.kt)("inlineCode",{parentName:"li"},"r3")," berisi nilai bertipe ",(0,r.kt)("inlineCode",{parentName:"li"},"f64"),"."))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"Jila nilai balik ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," berisi nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"Err(&'static str)"),", maka nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"&'static str")," dikembalikan."),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},"Statement ",(0,r.kt)("inlineCode",{parentName:"li"},"let r2 = divider(10.0, 0.0)?;"),", variabel ",(0,r.kt)("inlineCode",{parentName:"li"},"r2")," berisi nilai bertipe ",(0,r.kt)("inlineCode",{parentName:"li"},"&'static str"),".")))),(0,r.kt)("p",null,"Sampai sini semoga cukup jelas."),(0,r.kt)("p",null,"Namun tunggu, kode baru yang telah ditulis sebenarnya tidak valid. Kode penulis buat untuk mempermudah mempelajari perbedaan cara konvensional vs menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?"),". Ada beberapa hal lagi yang harus dilakukan sebelum kode benar-benar bisa digunakan."),(0,r.kt)("h3",{id:"-refactor-ke-2"},"\u25c9 Refactor ke-2"),(0,r.kt)("p",null,"Rust mewajibkan penggunaan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," pada statement untuk diterapkan di dalam fungsi yang mengembalikan nilai balik bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," (atau ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),") tergantung tipe apa yang digunakan pada kode-kode di dalam blok fungsi tersebut. Bahkan meskipun nilai tidak digunakan, aturan tersebut tetap harus dipatuhi. Syarat ini hukumnya wajib."),(0,r.kt)("p",null,"Kembali ke contoh kode yang telah ditulis, kode tersebut harus dimodifikasi lagi menjadi seperti berikut:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_some_math() -> Result {\n let r1 = divider(10.0, 5.0)?;\n println!("result: {r1:.2}");\n \n let r2 = divider(10.0, 0.0)?;\n println!("result: {r2:.2}");\n \n let r3 = divider(10.0, 2.0)?;\n println!("result: {r3:.2}");\n\n return Ok(0.0)\n}\n')),(0,r.kt)("p",null,"Fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," dimodifikasi dengan ditambahi nilai balik bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"Result"),". Karena sebenarnya kita tidak memerlukan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," untuk menghasilkan nilai balik, maka penulis hardcode saja nilai baliknya dengan nilai apapun yang penting valid, misalnya ",(0,r.kt)("inlineCode",{parentName:"p"},"Ok(0.0)"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Silakan gunakan nilai lainnya seperti ",(0,r.kt)("inlineCode",{parentName:"p"},"Ok(r1)"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"Ok(r2)")," atau lainnya, bebas karena nilai ini ditulis di kode hanya agar syarat penerapan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," terpenuhi.")),(0,r.kt)("p",null,"Perbandingan terbaru fungsi sebelum dan setelah dimodifikasi bisa dilihat di bawah ini."),(0,r.kt)("table",null,(0,r.kt)("tr",null,(0,r.kt)("td",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(9692).Z,width:"1292",height:"1402"}))),(0,r.kt)("td",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(456).Z,width:"1358",height:"1024"}))))),(0,r.kt)("p",null,"Sekarang coba jalankan program, dan lihat outputnya."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(7136).Z,width:"618",height:"97"})),(0,r.kt)("p",null,"Output yang muncul hanya nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"r2"),". Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"let r2 = divider(10.0, 0.0)?;")," dan seterusnya tidak menghasilkan output apapun, hal ini karena ketika proses unwrap nilai menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," menghasilkan nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"E"),", fungsi langsung terhenti eksekusinya dan nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"Err(E)")," dikembalikan. Menandai akhir pemanggilan ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," dengan informasi error pemanggilan statement ",(0,r.kt)("inlineCode",{parentName:"p"},"let r2 = divider(10.0, 0.0)?;")," langsung dikembalikan."),(0,r.kt)("h3",{id:"-refactor-ke-3"},"\u25c9 Refactor ke-3"),(0,r.kt)("p",null,"Sebenarnya aturan di atas (kenapa fungsi yang didalamnya ada penerapan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"?")," diwajibkan untuk mengembalikan nilai balik bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"Result")," (atau ",(0,r.kt)("inlineCode",{parentName:"p"},"Option"),")) bukan hanya sebatas syarat, tapi memang benar-benar diperlukan."),(0,r.kt)("p",null,"Ketika operasi menghasilkan error, eksekusi blok fungsi menjadi terhenti dan error otomatis dikembalikan sebagai nilai balik fungsi. Hal ini berguna agar kita bisa melakukan pengecekan tambahan untuk mengidentifikasi apakah eksekusi fungsi menghasilkan error atau sukses."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Inilah bagaimana penanganan error di Rust dilakukan."),(0,r.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai ",(0,r.kt)("em",{parentName:"p"},"error propagation")," atau ",(0,r.kt)("em",{parentName:"p"},"error propagation")," dibahas pada chapter ",(0,r.kt)("a",{parentName:"p",href:"#"},"Error \u279c Recoverable Error & Error Handling"),".")),(0,r.kt)("p",null,"Coba sekarang ubah lagi kode yang sudah ditulis, kita coba cek error apa yang muncul saat pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()"),". Ubah isi fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"main()")," dengan menambahkan keyword ",(0,r.kt)("inlineCode",{parentName:"p"},"match")," untuk mengecek nilai balik eksekusi fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()"),". Kode setelah diubah:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n match do_some_math() {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(_) => {},\n }\n}\n\nfn do_some_math() -> Result {\n let r1 = divider(10.0, 5.0)?;\n println!("result: {r1:.2}");\n \n let r2 = divider(10.0, 0.0)?;\n println!("result: {r2:.2}");\n \n let r3 = divider(10.0, 2.0)?;\n println!("result: {r3:.2}");\n\n return Ok(0.0)\n}\n\nfn divider(a: f64, b: f64) -> Result {\n if b == 0.0 {\n return Err("division by zero error");\n }\n\n let result = a / b;\n return Ok(result);\n}\n')),(0,r.kt)("p",null,"Outputnya bisa dilihat di bawah ini. Pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_some_math()")," memang menghasilkan error, yaitu saat eksekusi statement ",(0,r.kt)("inlineCode",{parentName:"p"},"let r2 = divider(10.0, 0.0)?;"),". Informasi errornya bisa dilihat via blok ",(0,r.kt)("inlineCode",{parentName:"p"},'Err(m) => println!("ERROR! {:?}", m)'),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Operator ? / tanda tanya / question mark",src:n(2880).Z,width:"534",height:"118"})),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Pada kode di atas terdapat penerapan statement ",(0,r.kt)("inlineCode",{parentName:"p"},"Ok(_) => {},"),", pembahasan mengenai statement tersebut dibahas di chapter selanjutnya, yaitu ",(0,r.kt)("a",{parentName:"p",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,r.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,r.kt)("pre",null,(0,r.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/operator_tanda_tanya"},"github.com/novalagung/dasarpemrogramanrust-example/../operator_tanda_tanya")),(0,r.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#"},"Error \u279c Recoverable Error & Error Handling"))),(0,r.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Contoh menggunakan tipe ",(0,r.kt)("inlineCode",{parentName:"li"},"Option"))),(0,r.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/result/index.html"},"https://doc.rust-lang.org/std/result/index.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-question-mark-operator"},"https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-question-mark-operator")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html"},"https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html"))))}s.isMDXComponent=!0},8889:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/operator-tanda-tanya-1-24d0c7ef806198ea77f652c1267d13e9.png"},9692:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/operator-tanda-tanya-2-edc32921914c938294f2ee9ded7bcd17.png"},7725:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/operator-tanda-tanya-3-186ecf58877055d7fdef25594040d662.png"},456:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/operator-tanda-tanya-4-162dd4d9f23151b811c1f27d7754cc69.png"},7136:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmoAAABhCAYAAABmio2VAAAACXBIWXMAAA7EAAAO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kTp92LOR5MPq+QGVg2TqxUxzPgWYiV8TrF8WCrdiciqLcWxYXyMWoAMHZuDvbr9chLdsN7yaW4aPCXTLt93ogKFyQIgiAIwgXY7R1cO3eUGwlqq85Bqg4IiM2Br2YKHt+vx+O8awd6agEwI2Ah+eVcenvdtmEdBZMjMbsIcWGteDc126pRL3fv2cha34J3U3Uo6mWmQxM1lyXTvjshPp1KEARBEMTPEycO4zBxZ0W9wqn5a+KRDzZ2LBN7NwNPv6g+Z4WJf9PgeN7zovfCp+NsB3rRjRre9cx0aAc6zg6KpjXStCdBEARBEGY4ZdXn5aoKtHZNwcO5K2WvHRzTgM5u098Cg+cB4MdwWUfr1W6T6VU+7v3pKCjXo2SXvEwsQ07acuQKLCAIiGamMMv2beLqZO7dB/c8m405HszCifRFobh27qhkGsWnEQRBEARhjiYoKMigNLNU8L7lyk5mivPpF29Y/M5fncnfu2ygpxZH6n+Jhf6VePi5by3ymeeVWmlq66pP9vpgsxUOAz21eGU5MwXKyurF+01IDv7UrlQaQRAEQRAEH7scNYIgCIIgCMJ50Ia3BEEQBEEQKoUcNYIgCIIgCJVCjhpBEARBEIRKIUeNIAiCIAhCpZCjRhAEQRAEoVLIUSMIgiAIglAp5KgRBEEQBEGoFHLUCIIgCIIgVAo5agRBEARBECqFHDWCIAiCIAiVQo4aQRAEQRCESiFHjSAIgiAIQqWQo0YQBEEQBKFS/h+2ra3MqCJw9gAAAABJRU5ErkJggg=="},2880:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/operator-tanda-tanya-6-31dccee9d16f41b3a88637a21ca2e330.png"}}]); \ No newline at end of file diff --git a/assets/js/4513d9f5.e143be2a.js b/assets/js/4513d9f5.e143be2a.js deleted file mode 100644 index 1bd84b55..00000000 --- a/assets/js/4513d9f5.e143be2a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[5729],{3905:(a,e,t)=>{t.d(e,{Zo:()=>p,kt:()=>u});var i=t(7294);function n(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function l(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,i)}return t}function r(a){for(var e=1;e=0||(n[t]=a[t]);return n}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(n[t]=a[t])}return n}var c=i.createContext({}),s=function(a){var e=i.useContext(c),t=e;return a&&(t="function"==typeof a?a(e):r(r({},e),a)),t},p=function(a){var e=s(a.components);return i.createElement(c.Provider,{value:e},a.children)},d={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},o=i.forwardRef((function(a,e){var t=a.components,n=a.mdxType,l=a.originalType,c=a.parentName,p=m(a,["components","mdxType","originalType","parentName"]),o=s(t),u=n,k=o["".concat(c,".").concat(u)]||o[u]||d[u]||l;return t?i.createElement(k,r(r({ref:e},p),{},{components:t})):i.createElement(k,r({ref:e},p))}));function u(a,e){var t=arguments,n=e&&e.mdxType;if("string"==typeof a||n){var l=t.length,r=new Array(l);r[0]=o;var m={};for(var c in e)hasOwnProperty.call(e,c)&&(m[c]=e[c]);m.originalType=a,m.mdxType="string"==typeof a?a:n,r[1]=m;for(var s=2;s{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>m,toc:()=>s});var i=t(7462),n=(t(7294),t(3905));const l={sidebar_position:44,title:"A.44. Slice Memory Management",sidebar_label:"A.44. Slice Memory Management"},r=void 0,m={unversionedId:"basic/slice-memory-management",id:"basic/slice-memory-management",title:"A.44. Slice Memory Management",description:"Kita telah mempelajari tipe data Array dan Vector, serta sudah beberapa kali menggunakan tipe data string slice (String). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice.",source:"@site/docs/basic/slice-memory-management.md",sourceDirName:"basic",slug:"/basic/slice-memory-management",permalink:"/basic/slice-memory-management",draft:!1,tags:[],version:"current",sidebarPosition:44,frontMatter:{sidebar_position:44,title:"A.44. Slice Memory Management",sidebar_label:"A.44. Slice Memory Management"},sidebar:"tutorialSidebar",previous:{title:"A.43. Lifetime",permalink:"/basic/lifetime"},next:{title:"A.45. String Literal (&str) vs. String Custom Type",permalink:"/basic/string-slice-vs-string-literal"}},c={},s=[{value:"A.44.1. Konsep slice",id:"a441-konsep-slice",level:2},{value:"A.44.2. Memory management pada slice",id:"a442-memory-management-pada-slice",level:2},{value:"A.44.2. Mutable slice",id:"a442-mutable-slice",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],p={toc:s};function d(a){let{components:e,...l}=a;return(0,n.kt)("wrapper",(0,i.Z)({},p,l,{components:e,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"Kita telah mempelajari tipe data ",(0,n.kt)("a",{parentName:"p",href:"/basic/array"},"Array")," dan ",(0,n.kt)("a",{parentName:"p",href:"/basic/vector"},"Vector"),", serta sudah beberapa kali menggunakan tipe data string slice (",(0,n.kt)("inlineCode",{parentName:"p"},"String"),"). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Ciri khas dari tipe data yang termasuk dalam kategori slice adalah jika diakses reference-nya menghasilkan data bertipe ",(0,n.kt)("inlineCode",{parentName:"p"},"&[T]")," yang mana ",(0,n.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data elemen.")),(0,n.kt)("p",null,"Pada chapter ini, kita akan bahas lebih dalam lagi tentang apa itu slice terutama bagian memory management-nya."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Perbedaan chapter ini dengan chapter ini dengan chapter ",(0,n.kt)("a",{parentName:"p",href:"/basic/slice"},"Slice (Basic)")," adalah di sini fokusnya lebih banyak di memory management.")),(0,n.kt)("h2",{id:"a441-konsep-slice"},"A.44.1. Konsep slice"),(0,n.kt)("p",null,"Slice adalah representasi ",(0,n.kt)("em",{parentName:"p"},"block of memory")," berbentuk pointer dan memiliki size yang dinamis, dengan isi adalah koleksi element data. Slice merupakan reference atau data pinjaman (borrow)."),(0,n.kt)("p",null,"Pada program berikut, beberapa variabel dideklarasikan menggunakan tiga tipe data di atas, kemudian masing-masing data dipinjam kemudian di-print."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_arr = [1, 2, 3];\nprintln!("data_arr: {} {:?}", data_arr.len(), data_arr);\nlet slice1 = &data_arr[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_arr[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n\nlet data_vec = vec![1, 2, 3];\nprintln!("data_vec: {} {:?}", data_vec.len(), data_vec);\nlet slice1 = &data_vec[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_vec[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n\nlet data_str = String::from("sesuk prei jarene, mosokk");\nprintln!("data_str: {} {:?}", data_str.len(), data_str);\nlet slice1 = &data_str[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_str[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n')),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(456).Z,width:"302",height:"205"})),(0,n.kt)("p",null,"Terlihat kemiripan-nya, slice bisa terbentuk dari ketiga jenis data di atas."),(0,n.kt)("p",null,"Penulis ingatkan lagi, bahwa slice adalah tipe data reference yang berarti isi adalah data pinjaman (borrow). Tipe data slice selalu ",(0,n.kt)("inlineCode",{parentName:"p"},"&[T]")," yang mana ",(0,n.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data element."),(0,n.kt)("p",null,"Karena slice adalah data borrow, maka operasi standar borrowing termasuk mutable borrowing bisa dilakukan di slice."),(0,n.kt)("h2",{id:"a442-memory-management-pada-slice"},"A.44.2. Memory management pada slice"),(0,n.kt)("p",null,"Sekarang lanjut ke pembahasan tentang bagaimana data bertipe slice di-manage di memory. Sebagai bahan belajar, kita perlu memilih satu dari 3 tipe data slice yang ada. Bebas sebenarnya mau pilih yang mana. Penulis memilih ",(0,n.kt)("inlineCode",{parentName:"p"},"String")," untuk memulai pembahasan."),(0,n.kt)("p",null,"Silakan perhatikan statement sederhana berikut:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_str = String::from("sesuk preiii");\n')),(0,n.kt)("p",null,"Ada sebuah data ",(0,n.kt)("inlineCode",{parentName:"p"},"String")," dideklarasikan, value-nya adalah ",(0,n.kt)("inlineCode",{parentName:"p"},"sesuk preiii"),", dan owner-nya adalah variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),". Data variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str")," disimpan di memory pada 2 tempat, yaitu ",(0,n.kt)("strong",{parentName:"p"},"heap")," dan ",(0,n.kt)("strong",{parentName:"p"},"stack"),"."),(0,n.kt)("p",null,"Selanjutnya, 2 buah slice tercipta hasil operasi slicing pada variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),"."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_str = String::from("sesuk preiii"); // "sesuk preiii"\nlet slice1 = &data_str[8..]; // "eiii"\nlet slice2 = &data_str[..5]; // "sesuk"\n')),(0,n.kt)("p",null,"Slice adalah data borrow, artinya jika ada beberapa variabel baru dibuat hasil dari operasi slicing, maka isi variabel tersebut merupakan reference yang mengarah ke data sebenarnya. Di heap memory tidak ada perubahan, namun di stack memory ada beberapa data baru. Lebih jelasnya silakan perhatikan ilustrasi berikut."),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(2236).Z,width:"739",height:"713"})),(0,n.kt)("p",null,"Sekarang di stack memory ada 3 buah metadata informasi disimpan, yaitu ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str")," (yang merupakan owner sebenarnya data), dan ",(0,n.kt)("inlineCode",{parentName:"p"},"slice1")," & ",(0,n.kt)("inlineCode",{parentName:"p"},"slice2"),". Sedangkan untuk data-nya sendiri tetap berada di heap memory tanpa ada perubahan."),(0,n.kt)("p",null,"Tiga variabel di atas kesemuanya mengakses reference yang sama, yang membedakan adalah elemen-nya saja. Owner (yaitu ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),") bisa mengakses seluruh data, selain itu juga tau informasi kapasitas data. Sedangkan borrower hanya bisa mengakses data yang dia pinjam sesuai dengan operasi slicing-nya. Borrower tidak mengetahui kapasitas data, namun ia tau size dari elemen yang ia pinjam."),(0,n.kt)("h2",{id:"a442-mutable-slice"},"A.44.2. Mutable slice"),(0,n.kt)("p",null,"Bagaimana dengan ",(0,n.kt)("em",{parentName:"p"},"mutability")," pada slice, apa yang terjadi di belakang layar ketika elemen slice nilainya diubah?"),(0,n.kt)("p",null,"Ok, mari kita bahas dengan contoh. Pada kode berikut ada sebuah data mutable array bertipe ",(0,n.kt)("inlineCode",{parentName:"p"},"[i32; 6]")," dengan owner bernama ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers"),". Dari variabel tersebut, dilakukan operasi mutable borrowing untuk disimpan pada variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"n1"),"."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let mut numbers = [24, 12, 8, 7, 9, 2];\nprintln!("numbers: {:?}", numbers);\nlet n1 = &mut numbers[2..];\nprintln!("n1 : {:?}", n1);\nn1[0] = 3022;\nprintln!("numbers: {:?}", numbers);\n')),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(743).Z,width:"409",height:"147"})),(0,n.kt)("p",null,"Salah satu elemen ",(0,n.kt)("inlineCode",{parentName:"p"},"n1")," diubah nilainya, maka efeknya juga berpengaruh pada owner. Ketika variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers")," di-print, element indeks ",(0,n.kt)("inlineCode",{parentName:"p"},"2")," berubah nilainya dari yang sebelumnya ",(0,n.kt)("inlineCode",{parentName:"p"},"8")," sekarang ",(0,n.kt)("inlineCode",{parentName:"p"},"3022"),"."),(0,n.kt)("p",null,"Visualisasi memory management-nya kurang lebih seperti ini:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(7609).Z,width:"718",height:"1088"})),(0,n.kt)("p",null,"Variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers")," dan ",(0,n.kt)("inlineCode",{parentName:"p"},"n1")," sama-sama mengarah ke reference yang sama. Itulah kenapa perubahan data pada peminjam membawa efek ke owner."),(0,n.kt)("hr",null),(0,n.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,n.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,n.kt)("pre",null,(0,n.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/slice_memory_management"},"github.com/novalagung/dasarpemrogramanrust-example/../slice_memory_management")),(0,n.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/array"},"Array")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/slice"},"Slice (Basic)")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/vector"},"Vector")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/basic-memory-management"},"Basic Memory Management")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/tipe-data-custom-type-string-slice"},"Tipe Data \u279c String Custom Type")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type"))),(0,n.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch04-03-slices.html"},"https://doc.rust-lang.org/book/ch04-03-slices.html")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://users.rust-lang.org/t/why-rust-slice-has-not-ownership/27356"},"https://users.rust-lang.org/t/why-rust-slice-has-not-ownership/27356"))))}d.isMDXComponent=!0},456:(a,e,t)=>{t.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS4AAADNCAIAAACJhQqMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAF32lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4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puKQlhYPoB1iopew7g9oEJFooSJEp6jojbXNI6KyTnaOSsYwbKg+FxswTyXKGGihOeqaLrlkNZyhEla6v5z8L1iZnm+ZoJKlDBRwsNVFGMrxWBTNQJVCss1BLDWHG1l6HCP13UQJWzaO1HCXUZFuMRPXkQJ3xJURMVL6nDrKGFURMWq6TZRwqgIgIoAgIoAqAgAn6Tit4QON0ajTUqKCl8/KnYOHW6IlRm1I1SEj1Wx5cu0iN7uIpp31BgYOik/MXyLinNCh8MPVDneFDpcM6p2iX8FuGDo8PVVtCcYBuit4sTQ4Z+Jj1rV7cieYBig873i7NDheY92NWQOtyUYBhixbDM8dHjai/467cieYBigp4pjQ4d76NEjdLjmhPBrBQxXcVrocC6it5uKjTuyJxgGGDUqAgAqAqAiAKAiACoCACoCoCIAoCIAKgIAKgKgIgCgIgCgIsBV+A89TcdB11uFfAAAAABJRU5ErkJggg=="},2236:(a,e,t)=>{t.d(e,{Z:()=>i});const i=t.p+"assets/images/slice-memory-management-2-97ee1868013eb53b825e4c59489aa236.png"},743:(a,e,t)=>{t.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZkAAACTCAIAAADTK/NLAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtc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C2/Ppe1xU7UOCQIctnRuYwahwRBLjs+l1HjkCDIZXvistr1MmocEgS5LPpFkaZ3rK7HZXfUOCSIW+Syw6NoiZ4ahwRBLjs4l1HjkCDIZTvnMp7HJAhyGUEQBLmMIAiCXEYQBEEuIwiCXLYYrr+zxt9hOhG4xUHcNpehI9jm+6qVrCeOd1q6iSUD9y09bZFehQW1lE7JSYJctnsuM+QMu9q+1utfxOKUtm5iqRWH24ODoFOmsKDlSqfkJHEKLoNajOhg00Xy4ecQ1bwMf8cvk9vxY7cnnemL8XIYIYQO3HCGSRmkw/ir0fLJilO269eCAlBxsKCFSq8lP0pOEjvhMqnFqHDZW/L3VzJnm7wycM95PA6EN4kkypLkFGZBLpuKbNBHXIvLpiqFdQvttSaXUXKSOA+XwbPlgMsiKpi5bHa7zi27P4ErBjfEkhXTKfYmvzXGUVjinGwFLqud5M0x6TytnGPXwOhmQW1TTEpOEuQyyWXdJ21dWRs00wS1WvpQ1fpK5rfNQQTksnY6njNOYjFpXbyZUV86JScJcpkSl/36qblijkMqwwuYbaICJpR0Knce5cg35cbKJ3pSSHL8BAtqLp2Sk8QNcFmwBvbm47JoEQwu6pgeDwRh69bLMiM8uaHkLY2kimpBxW9+TJwSZjmXVkZklJwkyGXzh2me2G9amlyGXlEC1xGXxdPRyH9bflPOfHMKCtH6FRbHPM2CivOE75eFry0sXTolJ4mzcdnh0bSH1jK53TzPzUqn5CRBLjsaly0jkbh+npuVTslJglx2RS7jeczzdSa5jLg5LiMIglxGEARBLiMIgiCXEQRBkMsIgiCXEQRBkMsIgiDIZQRBEOQygiDIZQRBEOQygiAIchlBEEQV/gfiH8m6S53t7QAAAABJRU5ErkJggg=="},7609:(a,e,t)=>{t.d(e,{Z:()=>i});const i=t.p+"assets/images/slice-memory-management-4-25a4c7b54f07cac6f773e2ff178a6d32.png"}}]); \ No newline at end of file diff --git a/assets/js/4513d9f5.f786dcf5.js b/assets/js/4513d9f5.f786dcf5.js new file mode 100644 index 00000000..a46918be --- /dev/null +++ b/assets/js/4513d9f5.f786dcf5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[5729],{3905:(a,e,t)=>{t.d(e,{Zo:()=>p,kt:()=>u});var i=t(7294);function n(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function l(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,i)}return t}function r(a){for(var e=1;e=0||(n[t]=a[t]);return n}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(n[t]=a[t])}return n}var c=i.createContext({}),s=function(a){var e=i.useContext(c),t=e;return a&&(t="function"==typeof a?a(e):r(r({},e),a)),t},p=function(a){var e=s(a.components);return i.createElement(c.Provider,{value:e},a.children)},d={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},o=i.forwardRef((function(a,e){var t=a.components,n=a.mdxType,l=a.originalType,c=a.parentName,p=m(a,["components","mdxType","originalType","parentName"]),o=s(t),u=n,k=o["".concat(c,".").concat(u)]||o[u]||d[u]||l;return t?i.createElement(k,r(r({ref:e},p),{},{components:t})):i.createElement(k,r({ref:e},p))}));function u(a,e){var t=arguments,n=e&&e.mdxType;if("string"==typeof a||n){var l=t.length,r=new Array(l);r[0]=o;var m={};for(var c in e)hasOwnProperty.call(e,c)&&(m[c]=e[c]);m.originalType=a,m.mdxType="string"==typeof a?a:n,r[1]=m;for(var s=2;s{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>m,toc:()=>s});var i=t(7462),n=(t(7294),t(3905));const l={sidebar_position:45,title:"A.45. Slice Memory Management",sidebar_label:"A.45. Slice Memory Management"},r=void 0,m={unversionedId:"basic/slice-memory-management",id:"basic/slice-memory-management",title:"A.45. Slice Memory Management",description:"Kita telah mempelajari tipe data Array dan Vector, serta sudah beberapa kali menggunakan tipe data string slice (String). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice.",source:"@site/docs/basic/slice-memory-management.md",sourceDirName:"basic",slug:"/basic/slice-memory-management",permalink:"/basic/slice-memory-management",draft:!1,tags:[],version:"current",sidebarPosition:45,frontMatter:{sidebar_position:45,title:"A.45. Slice Memory Management",sidebar_label:"A.45. Slice Memory Management"},sidebar:"tutorialSidebar",previous:{title:"A.44. Lifetime",permalink:"/basic/lifetime"},next:{title:"A.46. String Literal (&str) vs. String Custom Type",permalink:"/basic/string-slice-vs-string-literal"}},c={},s=[{value:"A.45.1. Konsep slice",id:"a451-konsep-slice",level:2},{value:"A.45.2. Memory management pada slice",id:"a452-memory-management-pada-slice",level:2},{value:"A.45.2. Mutable slice",id:"a452-mutable-slice",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],p={toc:s};function d(a){let{components:e,...l}=a;return(0,n.kt)("wrapper",(0,i.Z)({},p,l,{components:e,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"Kita telah mempelajari tipe data ",(0,n.kt)("a",{parentName:"p",href:"/basic/array"},"Array")," dan ",(0,n.kt)("a",{parentName:"p",href:"/basic/vector"},"Vector"),", serta sudah beberapa kali menggunakan tipe data string slice (",(0,n.kt)("inlineCode",{parentName:"p"},"String"),"). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Ciri khas dari tipe data yang termasuk dalam kategori slice adalah jika diakses reference-nya menghasilkan data bertipe ",(0,n.kt)("inlineCode",{parentName:"p"},"&[T]")," yang mana ",(0,n.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data elemen.")),(0,n.kt)("p",null,"Pada chapter ini, kita akan bahas lebih dalam lagi tentang apa itu slice terutama bagian memory management-nya."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Perbedaan chapter ini dengan chapter ini dengan chapter ",(0,n.kt)("a",{parentName:"p",href:"/basic/slice"},"Slice (Basic)")," adalah di sini fokusnya lebih banyak di memory management.")),(0,n.kt)("h2",{id:"a451-konsep-slice"},"A.45.1. Konsep slice"),(0,n.kt)("p",null,"Slice adalah representasi ",(0,n.kt)("em",{parentName:"p"},"block of memory")," berbentuk pointer dan memiliki size yang dinamis, dengan isi adalah koleksi element data. Slice merupakan reference atau data pinjaman (borrow)."),(0,n.kt)("p",null,"Pada program berikut, beberapa variabel dideklarasikan menggunakan tiga tipe data di atas, kemudian masing-masing data dipinjam kemudian di-print."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_arr = [1, 2, 3];\nprintln!("data_arr: {} {:?}", data_arr.len(), data_arr);\nlet slice1 = &data_arr[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_arr[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n\nlet data_vec = vec![1, 2, 3];\nprintln!("data_vec: {} {:?}", data_vec.len(), data_vec);\nlet slice1 = &data_vec[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_vec[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n\nlet data_str = String::from("sesuk prei jarene, mosokk");\nprintln!("data_str: {} {:?}", data_str.len(), data_str);\nlet slice1 = &data_str[1..];\nprintln!("slice1 : {} {:?}", slice1.len(), slice1);\nlet slice2 = &data_str[..2];\nprintln!("slice2 : {} {:?}", slice2.len(), slice2);\n')),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(4505).Z,width:"302",height:"205"})),(0,n.kt)("p",null,"Terlihat kemiripan-nya, slice bisa terbentuk dari ketiga jenis data di atas."),(0,n.kt)("p",null,"Penulis ingatkan lagi, bahwa slice adalah tipe data reference yang berarti isi adalah data pinjaman (borrow). Tipe data slice selalu ",(0,n.kt)("inlineCode",{parentName:"p"},"&[T]")," yang mana ",(0,n.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data element."),(0,n.kt)("p",null,"Karena slice adalah data borrow, maka operasi standar borrowing termasuk mutable borrowing bisa dilakukan di slice."),(0,n.kt)("h2",{id:"a452-memory-management-pada-slice"},"A.45.2. Memory management pada slice"),(0,n.kt)("p",null,"Sekarang lanjut ke pembahasan tentang bagaimana data bertipe slice di-manage di memory. Sebagai bahan belajar, kita perlu memilih satu dari 3 tipe data slice yang ada. Bebas sebenarnya mau pilih yang mana. Penulis memilih ",(0,n.kt)("inlineCode",{parentName:"p"},"String")," untuk memulai pembahasan."),(0,n.kt)("p",null,"Silakan perhatikan statement sederhana berikut:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_str = String::from("sesuk preiii");\n')),(0,n.kt)("p",null,"Ada sebuah data ",(0,n.kt)("inlineCode",{parentName:"p"},"String")," dideklarasikan, value-nya adalah ",(0,n.kt)("inlineCode",{parentName:"p"},"sesuk preiii"),", dan owner-nya adalah variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),". Data variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str")," disimpan di memory pada 2 tempat, yaitu ",(0,n.kt)("strong",{parentName:"p"},"heap")," dan ",(0,n.kt)("strong",{parentName:"p"},"stack"),"."),(0,n.kt)("p",null,"Selanjutnya, 2 buah slice tercipta hasil operasi slicing pada variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),"."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let data_str = String::from("sesuk preiii"); // "sesuk preiii"\nlet slice1 = &data_str[8..]; // "eiii"\nlet slice2 = &data_str[..5]; // "sesuk"\n')),(0,n.kt)("p",null,"Slice adalah data borrow, artinya jika ada beberapa variabel baru dibuat hasil dari operasi slicing, maka isi variabel tersebut merupakan reference yang mengarah ke data sebenarnya. Di heap memory tidak ada perubahan, namun di stack memory ada beberapa data baru. Lebih jelasnya silakan perhatikan ilustrasi berikut."),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(2236).Z,width:"739",height:"713"})),(0,n.kt)("p",null,"Sekarang di stack memory ada 3 buah metadata informasi disimpan, yaitu ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str")," (yang merupakan owner sebenarnya data), dan ",(0,n.kt)("inlineCode",{parentName:"p"},"slice1")," & ",(0,n.kt)("inlineCode",{parentName:"p"},"slice2"),". Sedangkan untuk data-nya sendiri tetap berada di heap memory tanpa ada perubahan."),(0,n.kt)("p",null,"Tiga variabel di atas kesemuanya mengakses reference yang sama, yang membedakan adalah elemen-nya saja. Owner (yaitu ",(0,n.kt)("inlineCode",{parentName:"p"},"data_str"),") bisa mengakses seluruh data, selain itu juga tau informasi kapasitas data. Sedangkan borrower hanya bisa mengakses data yang dia pinjam sesuai dengan operasi slicing-nya. Borrower tidak mengetahui kapasitas data, namun ia tau size dari elemen yang ia pinjam."),(0,n.kt)("h2",{id:"a452-mutable-slice"},"A.45.2. Mutable slice"),(0,n.kt)("p",null,"Bagaimana dengan ",(0,n.kt)("em",{parentName:"p"},"mutability")," pada slice, apa yang terjadi di belakang layar ketika elemen slice nilainya diubah?"),(0,n.kt)("p",null,"Ok, mari kita bahas dengan contoh. Pada kode berikut ada sebuah data mutable array bertipe ",(0,n.kt)("inlineCode",{parentName:"p"},"[i32; 6]")," dengan owner bernama ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers"),". Dari variabel tersebut, dilakukan operasi mutable borrowing untuk disimpan pada variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"n1"),"."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-rust"},'let mut numbers = [24, 12, 8, 7, 9, 2];\nprintln!("numbers: {:?}", numbers);\nlet n1 = &mut numbers[2..];\nprintln!("n1 : {:?}", n1);\nn1[0] = 3022;\nprintln!("numbers: {:?}", numbers);\n')),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(743).Z,width:"409",height:"147"})),(0,n.kt)("p",null,"Salah satu elemen ",(0,n.kt)("inlineCode",{parentName:"p"},"n1")," diubah nilainya, maka efeknya juga berpengaruh pada owner. Ketika variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers")," di-print, element indeks ",(0,n.kt)("inlineCode",{parentName:"p"},"2")," berubah nilainya dari yang sebelumnya ",(0,n.kt)("inlineCode",{parentName:"p"},"8")," sekarang ",(0,n.kt)("inlineCode",{parentName:"p"},"3022"),"."),(0,n.kt)("p",null,"Visualisasi memory management-nya kurang lebih seperti ini:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Slice memory management",src:t(7609).Z,width:"718",height:"1088"})),(0,n.kt)("p",null,"Variabel ",(0,n.kt)("inlineCode",{parentName:"p"},"numbers")," dan ",(0,n.kt)("inlineCode",{parentName:"p"},"n1")," sama-sama mengarah ke reference yang sama. Itulah kenapa perubahan data pada peminjam membawa efek ke owner."),(0,n.kt)("hr",null),(0,n.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,n.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,n.kt)("pre",null,(0,n.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/slice_memory_management"},"github.com/novalagung/dasarpemrogramanrust-example/../slice_memory_management")),(0,n.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/array"},"Array")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/slice"},"Slice (Basic)")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/vector"},"Vector")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/basic-memory-management"},"Basic Memory Management")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/tipe-data-custom-type-string-slice"},"Tipe Data \u279c String Custom Type")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type"))),(0,n.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch04-03-slices.html"},"https://doc.rust-lang.org/book/ch04-03-slices.html")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://users.rust-lang.org/t/why-rust-slice-has-not-ownership/27356"},"https://users.rust-lang.org/t/why-rust-slice-has-not-ownership/27356"))))}d.isMDXComponent=!0},4505:(a,e,t)=>{t.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS4AAADNCAIAAACJhQqMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAF32lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvM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IC6JJxLFGiNiMB6ZlCx/HrL3eV8UrHie78pwSJUyU8OB7xcTQJ/4p3Cg9mJEJYD1FRfdh4PIKECVMlPAUFZV2M6gontxcAOusuZp7Uo9a1KhIlDBRwlNWUMWIXpuKQlhYPoB1iopew7g9oEJFooSJEp6jojbXNI6KyTnaOSsYwbKg+FxswTyXKGGihOeqaLrlkNZyhEla6v5z8L1iZnm+ZoJKlDBRwsNVFGMrxWBTNQJVCss1BLDWHG1l6HCP13UQJWzaO1HCXUZFuMRPXkQJ3xJURMVL6nDrKGFURMWq6TZRwqgIgIoAgIoAqAgAn6Tit4QON0ajTUqKCl8/KnYOHW6IlRm1I1SEj1Wx5cu0iN7uIpp31BgYOik/MXyLinNCh8MPVDneFDpcM6p2iX8FuGDo8PVVtCcYBuit4sTQ4Z+Jj1rV7cieYBig873i7NDheY92NWQOtyUYBhixbDM8dHjai/467cieYBigp4pjQ4d76NEjdLjmhPBrBQxXcVrocC6it5uKjTuyJxgGGDUqAgAqAqAiAKAiACoCACoCoCIAoCIAKgIAKgKgIgCgIgCgIsBV+A89TcdB11uFfAAAAABJRU5ErkJggg=="},2236:(a,e,t)=>{t.d(e,{Z:()=>i});const i=t.p+"assets/images/slice-memory-management-2-97ee1868013eb53b825e4c59489aa236.png"},743:(a,e,t)=>{t.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZkAAACTCAIAAADTK/NLAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHh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/slice-memory-management-4-25a4c7b54f07cac6f773e2ff178a6d32.png"}}]); \ No newline at end of file diff --git a/assets/js/5f289fb7.c249cabf.js b/assets/js/5f289fb7.1391b360.js similarity index 97% rename from assets/js/5f289fb7.c249cabf.js rename to assets/js/5f289fb7.1391b360.js index 938c6d6c..d3a542b2 100644 --- a/assets/js/5f289fb7.c249cabf.js +++ b/assets/js/5f289fb7.1391b360.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2870],{3905:(a,e,n)=>{n.d(e,{Zo:()=>m,kt:()=>s});var t=n(7294);function i(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function r(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,t)}return n}function l(a){for(var e=1;e=0||(i[n]=a[n]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(i[n]=a[n])}return i}var p=t.createContext({}),d=function(a){var e=t.useContext(p),n=e;return a&&(n="function"==typeof a?a(e):l(l({},e),a)),n},m=function(a){var e=d(a.components);return t.createElement(p.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return t.createElement(t.Fragment,{},e)}},o=t.forwardRef((function(a,e){var n=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,m=u(a,["components","mdxType","originalType","parentName"]),o=d(n),s=i,g=o["".concat(p,".").concat(s)]||o[s]||k[s]||r;return n?t.createElement(g,l(l({ref:e},m),{},{components:n})):t.createElement(g,l({ref:e},m))}));function s(a,e){var n=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=n.length,l=new Array(r);l[0]=o;var u={};for(var p in e)hasOwnProperty.call(e,p)&&(u[p]=e[p]);u.originalType=a,u.mdxType="string"==typeof a?a:i,l[1]=u;for(var d=2;d{n.r(e),n.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>u,toc:()=>d});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:50,title:"A.50. Attributes",sidebar_label:"A.50. Attributes"},l=void 0,u={unversionedId:"basic/attributes",id:"basic/attributes",title:"A.50. Attributes",description:"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti #[derive(Debug)]. Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya.",source:"@site/docs/basic/attributes.md",sourceDirName:"basic",slug:"/basic/attributes",permalink:"/basic/attributes",draft:!1,tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50,title:"A.50. Attributes",sidebar_label:"A.50. Attributes"},sidebar:"tutorialSidebar",previous:{title:"A.49. Trait \u279c Iterator",permalink:"/basic/trait-iterator"},next:{title:"A.51. Date Time",permalink:"/basic/datetime"}},p={},d=[{value:"A.50.1. Konsep attributes",id:"a501-konsep-attributes",level:2},{value:"A.50.2. Attribute derive",id:"a502-attribute-derive",level:2},{value:"A.50.3. Attribute cfg / configuration",id:"a503-attribute-cfg--configuration",level:2},{value:"\u25c9 Configuration target_os",id:"-configuration-target_os",level:3},{value:"\u25c9 Configuration target_arch",id:"-configuration-target_arch",level:3},{value:"\u25c9 Macro cfg!() dan conditional compilation",id:"-macro-cfg-dan-conditional-compilation",level:3},{value:"\u25c9 Configuration debug_assertions",id:"-configuration-debug_assertions",level:3},{value:"\u25c9 Other configuration",id:"-other-configuration",level:3},{value:"A.50.4. Attribute linting & diagnostic",id:"a504-attribute-linting--diagnostic",level:2},{value:"A.50.5. Attribute type system",id:"a505-attribute-type-system",level:2},{value:"A.50.6. Attribute modules",id:"a506-attribute-modules",level:2},{value:"A.50.7. Attribute testing",id:"a507-attribute-testing",level:2},{value:"A.50.8. Attribute macros",id:"a508-attribute-macros",level:2},{value:"A.50.9 Attribute lainnya",id:"a509-attribute-lainnya",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:d};function k(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,t.Z)({},m,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"#[derive(Debug)]"),". Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya."),(0,i.kt)("h2",{id:"a501-konsep-attributes"},"A.50.1. Konsep attributes"),(0,i.kt)("p",null,"Attributes adalah metadata yang didefinisikan untuk suatu crate, module, atau module item. Kegunaan dari attributes berbeda satu sama lain, tergantung attribute apa yang dipakai (kita akan bahas satu per satu)."),(0,i.kt)("p",null,"Attribute dikategorikan menjadi 2:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Outer attributes"),(0,i.kt)("li",{parentName:"ul"},"Inner attributes")),(0,i.kt)("p",null,"Keduanya memiliki kegunaan yang sama, pembedanya adalah posisi di mana attribute harus dituliskan."),(0,i.kt)("p",null,"Outer attribute dituliskan tepat sebelum target (crate, module, module item, atau lainnya) dengan notasi penulisan seperti berikut:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute = "value"]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute(key = "value")]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[attribute(value)]")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute(not(key = "value"))]')," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[attribute(not(value))]")," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT"))),(0,i.kt)("p",null,"Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[derive(Debug)]\nstruct LegoSet {\n code: i32,\n name: String,\n category: String,\n age_minimum: i32,\n}\n")),(0,i.kt)("p",null,"Sedikit berbeda dengan inner attribute, penulisannya berada di dalam target (crate, module, module item, atau lainnya). Notasi penulisannya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute = "value"]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute(key = "value")]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#![attribute(value)]")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute(not(key = "value"))]')," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#![attribute(not(value))]")," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT"))),(0,i.kt)("p",null,"Rust mengenal beberapa jenis attributes, dan kita akan membahasnya satu per satu."),(0,i.kt)("h2",{id:"a502-attribute-derive"},"A.50.2. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"derive")),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," digunakan untuk mempermudah implementasi suatu trait ke tipe data."),(0,i.kt)("p",null,"Kita telah mempelajari cara implementasi trait pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/traits"},"Traits")," yaitu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"impl")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"for"),", kemudian diikuti dengan method serta implementasinya."),(0,i.kt)("p",null,"Dengan memanfaatkan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," kita tidak perlu menggunakan cara tersebut. Cukup tulis saja attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," beserta trait yang ingin diimplementasikan."),(0,i.kt)("p",null,"Agar lebih jelas, silakan pelajari contoh berikut terlebih dahulu:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const SuperheroSuperman: &str = "superman";\nconst SuperheroOmniMan: &str = "omniman";\nconst SuperheroHyperion: &str = "hyperion";\n\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nfn main() {\n let value: Superhero = Superhero::Superman;\n\n if value == Superhero::Superman {\n println!("hello superman!");\n }\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(253).Z,width:"958",height:"719"})),(0,i.kt)("p",null,"Kode di atas menghasilkan error karena enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero")," tidak mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq")," yang mana trait ini diperlukan dalam seleksi kondisi menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," dan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"=="),"."),(0,i.kt)("p",null,"Cara mengatasi error tersebut adalah dengan mengimplementasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq")," secara eksplisit. Sekarang coba tambahkan kode berikut pada deklarasi enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero"),", maka error akan hilang."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"enum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nimpl PartialEq for Superhero {\n\n fn eq(&self, other: &Self) -> bool {\n match (self, other) {\n (Superhero::Superman, Superhero::Superman) => true,\n (Superhero::OmniMan, Superhero::OmniMan) => true,\n (Superhero::Hyperion, Superhero::Hyperion) => true,\n _ => false,\n }\n }\n}\n")),(0,i.kt)("p",null,"Cara lain untuk mengatasi error di atas, selain menggunakan teknik implementasi trait secara eksplisit, adalah dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," disertai trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq"),". Kurang lebih penulisan cara ini bisa dilihat di bawah ini. Cukup hapus block kode ",(0,i.kt)("inlineCode",{parentName:"p"},"impl")," lalu tambahkan attribute pada deklarasi enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[derive(PartialEq)]\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n")),(0,i.kt)("p",null,"Cukup mudah bukan?"),(0,i.kt)("p",null,"Contoh lainnya, misalnya variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," ingin di-print seperti pada kode berikut ini, pasti hasilnya error."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let value: Superhero = Superhero::Superman;\n\n if value == Superhero::Superman {\n println!("hello superman!");\n }\n\n println!("{value} (via `Display` trait)");\n println!("{value:#?} (via `Debug` trait)");\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7095).Z,width:"900",height:"461"})),(0,i.kt)("p",null,"Cara ",(0,i.kt)("em",{parentName:"p"},"resolve")," error di atas adalah dengan mengimplementasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Display")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Debug")," secara eksplisit. Atau, bisa juga menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," yang pastinya lebih praktis."),(0,i.kt)("p",null,"Kabar buruknya, hanya trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Debug")," yang menyediakan fitur implementasi trait menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive"),". Untuk trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Display")," kita perlu melakukan implementasi secara eksplisit."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Untuk tau mana trait yang bisa di-",(0,i.kt)("em",{parentName:"p"},"derive")," atau tidak, cukup lihat saja ",(0,i.kt)("em",{parentName:"p"},"highlight")," error yang muncul saat penulisan kode atau kompilasi.")),(0,i.kt)("p",null,"Ok, kita implementasikan saja keduanya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(PartialEq, Debug)]\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nimpl std::fmt::Display for Superhero {\n\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n write!(f, "{self:?}")\n }\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(635).Z,width:"537",height:"127"})),(0,i.kt)("p",null,"Bisa dilihat, hasilnya program tereksekusi tanpa error. Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero")," kini mengadopsi 3 trait:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"PartialEq")," via attribute ",(0,i.kt)("inlineCode",{parentName:"li"},"derive")),(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Debug")," via attribute ",(0,i.kt)("inlineCode",{parentName:"li"},"derive")),(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Display")," via implementasi eksplisit")),(0,i.kt)("h2",{id:"a503-attribute-cfg--configuration"},"A.50.3. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"cfg")," / ",(0,i.kt)("em",{parentName:"h2"},"configuration")),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," digunakan untuk operasi-operasi yang berhubungan dengan target arsitekture hardware/prosesor, misalnya seperti conditional compilation ketika OS adalah linux, dan lainnya."),(0,i.kt)("p",null,"Salah satu contoh penerapannya bisa dilihat pada kode berikut. Ada 2 buah module yang namanya sama persis, perbedaannya adalah satu didefinisikan khusus untuk platform ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),", dan satunya lagi untuk platform ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),". Hal seperti ini bisa dilakukan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," dengan key ",(0,i.kt)("inlineCode",{parentName:"p"},"target_os"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_os = "linux")]\nmod util {\n\n pub fn say_hello() {\n println!("hello (from linux)")\n }\n}\n\n#[cfg(target_os = "windows")]\nmod util {\n\n pub fn say_hello() {\n println!("hello (from windows)")\n }\n\n pub fn say_something() {\n println!("how are you")\n }\n}\n')),(0,i.kt)("p",null,"Bisa dilihat cara penulisannya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg()")," kemudian diisi key ",(0,i.kt)("inlineCode",{parentName:"p"},"target_os")," dengan value adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"windows")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),"."),(0,i.kt)("p",null,"Dengan kondisi kode seperti di atas, ketika berada di sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),", item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," bisa diakses. Sedangkan pada sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),", item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_something")," bisa diakses."),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg(target_os)")," juga bisa diterapkan pada block kode. Contohnya seperti pada kode berikut. Item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," dipanggil di fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main"),". Dan khusus untuk sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),", block kode berisi pemanggilan ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_something")," juga dipanggil."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n util::say_hello();\n\n #[cfg(target_os = "windows")]\n {\n util::say_something();\n }\n}\n')),(0,i.kt)("p",null,"Ada beberapa key yang tersedia pada attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg"),", di antaranya:"),(0,i.kt)("h3",{id:"-configuration-target_os"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"target_os")),(0,i.kt)("p",null,"Digunakan untuk menandai bahwa item atau statement di bawah definisi attribute ini dikhususkan untuk sistem operasi tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_os = "value")]\n')),(0,i.kt)("p",null,"Opsi value yang tersedia:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"windows")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"macos")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ios")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"linux")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"android")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"freebsd")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"dragonfly")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"openbsd")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"netbsd"))),(0,i.kt)("h3",{id:"-configuration-target_arch"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"target_arch")),(0,i.kt)("p",null,"Digunakan untuk menandai bahwa item atau statement di bawah definisi attribute ini dikhususkan untuk arsitektur CPU tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_arch = "value")]\n')),(0,i.kt)("p",null,"Opsi value yang tersedia:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"x86")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"x86_64")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"mips")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"powerpc")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"powerpc64")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"arm")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"aarch64"))),(0,i.kt)("h3",{id:"-macro-cfg-dan-conditional-compilation"},"\u25c9 Macro ",(0,i.kt)("inlineCode",{parentName:"h3"},"cfg!()")," dan conditional compilation"),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," juga tersedia versi macro-nya, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()"),". Macro ini kegunaannya sama seperti attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg"),", perbedaannya macro ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()")," mengembalikan nilai boolean, yang darinya bisa dikombinasikan dengan seleksi kondisi untuk keperluan conditional compilation. Contoh penggunaan macro ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n #[cfg(target_os = "linux")]\n {\n println!("hello linux. from attribute cfg")\n }\n\n #[cfg(target_os = "windows")]\n {\n println!("hello windows. from attribute cfg")\n }\n\n if cfg!(target_os = "linux") {\n println!("hello linux. from macro cfg!()");\n } else if cfg!(target_os = "windows") {\n println!("hello windows. from macro cfg!()");\n }\n}\n')),(0,i.kt)("p",null,"Penjelasan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kode block ",(0,i.kt)("inlineCode",{parentName:"li"},'#[cfg(target_os = "linux")]')," hanya dieksekusi ketika program dijalankan di Linux."),(0,i.kt)("li",{parentName:"ul"},"Kode block ",(0,i.kt)("inlineCode",{parentName:"li"},'#[cfg(target_os = "windows")]')," hanya dieksekusi ketika program dijalankan di Windows."),(0,i.kt)("li",{parentName:"ul"},"Seleksi kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},"cfg!(target_os = ...)")," merupakan alternatif penulisan 2 kode sebelumnya yang digabung menjadi 1 rantai seleksi kondisi.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},'cfg!(target_os = "linux")')," terpenuhi ketika program dijalankan di Linux"),(0,i.kt)("li",{parentName:"ul"},"Kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},'cfg!(target_os = "windows")')," terpenuhi ketika program dijalankan di Windows")))),(0,i.kt)("p",null,"Output program ketika dijalankan di komputer penulis yang menggunakan Windows:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(2329).Z,width:"467",height:"108"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai macro akan dibahas di chapter terpisah.")),(0,i.kt)("h3",{id:"-configuration-debug_assertions"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"debug_assertions")),(0,i.kt)("p",null,"By default, Rust menggunakan profil kompilasi ",(0,i.kt)("strong",{parentName:"p"},"debug")," saat eksekusi command ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run"),". Di kode program, penanda apakah profil kompilasi debug digunakan atau tidak bisa dilihat dari nilai konfigurasi ",(0,i.kt)("inlineCode",{parentName:"p"},"#[cfg(debug_assertions)]")," via attribute, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!(debug_assertions)")," via macro."),(0,i.kt)("p",null,"Nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!(debug_assertions)")," selalu bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," kecuali command yang digunakan saat eksekusi program adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run --release"),". Flag ",(0,i.kt)("inlineCode",{parentName:"p"},"--release")," saat eksekusi program membuat nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"debug_assertions")," menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,i.kt)("p",null,"Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n #[cfg(debug_assertions)]\n {\n println!("debug mode. from attribute cfg")\n }\n\n #[cfg(not(debug_assertions))]\n {\n println!("release mode. from attribute cfg")\n }\n\n if cfg!(debug_assertions) {\n println!("debug mode. from macro cfg!()");\n } else {\n println!("release mode. from macro cfg!()");\n }\n}\n')),(0,i.kt)("p",null,"Output eksekusi program menggunakan command ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run")," vs ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run --release"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7964).Z,width:"499",height:"200"})),(0,i.kt)("p",null,"Pada profil release, kode program dikompilasi sekaligus dioptimisasi. Penggunaan profil ini dianjurkan untuk distribusi production binary. "),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Di beberapa bahasa pemrograman lain deteksi profile dilakukan mengunakan kombinasi keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," dan nilai environment variable (",(0,i.kt)("inlineCode",{parentName:"p"},"ENV"),"). Dari situ bisa dilihat apakah environment yang digunakan adalah production, staging, atau local.")),(0,i.kt)("h3",{id:"-other-configuration"},"\u25c9 Other configuration"),(0,i.kt)("p",null,"Ada beberapa key konfigurasi lainnya yang tersedia. Lebih detailnya silakan lihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/conditional-compilation.html"},"https://doc.rust-lang.org/reference/conditional-compilation.html")),(0,i.kt)("h2",{id:"a504-attribute-linting--diagnostic"},"A.50.4. Attribute ",(0,i.kt)("em",{parentName:"h2"},"linting")," & ",(0,i.kt)("em",{parentName:"h2"},"diagnostic")),(0,i.kt)("p",null,"Ada beberapa attribute name yang bisa digunakan untuk meng-override ",(0,i.kt)("em",{parentName:"p"},"default linting")," milik Rust ataupun menandai indikator ",(0,i.kt)("em",{parentName:"p"},"diagnostic")," lainnya, seperti warning yang muncul karena ada kode yang tidak digunakan, dll; Warning sejenis ini bisa di-override menggunakan attribute."),(0,i.kt)("p",null,"Contoh kasus yang berhubungan dengan ",(0,i.kt)("em",{parentName:"p"},"linting")," bisa dilihat pada kode berikut."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7812).Z,width:"351",height:"363"})),(0,i.kt)("p",null,"Kode di atas tidak menghasilkan error. Kode akan dieksekusi tanpa error. Namun ada 3 buah warning yang muncul karena beberapa baris kode tidak digunakan atau sia-sia."),(0,i.kt)("p",null,"Cara agar warning tidak muncul bisa dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"#[allow(value)]"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[allow(unused_imports)]\nuse std::fmt::Display;\n\nfn say_hello() {\n println!("hello")\n}\n\n#[allow(dead_code)]\nfn say_something() {\n println!("how are you")\n}\n\npub mod m1 {\n #[allow(missing_docs)]\n pub fn undocumented_one() -> i32 { 1 }\n\n #[warn(missing_docs)]\n pub fn undocumented_too() -> i32 { 2 }\n\n // #[deny(missing_docs)]\n // pub fn undocumented_end() -> i32 { 3 }\n}\n\nfn main() {\n #[allow(unused_variables)]\n let name = "noval agung";\n\n say_hello();\n}\n')),(0,i.kt)("p",null,"Pada kode di atas, ada beberapa attribute yang digunakan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(unused_imports)]")," digunakan untuk antisipasi error yang muncul ketika module item di-import namun tidak digunakan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(dead_code)]")," digunakan untuk membolehkan kode yang tidak digunakan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(unused_variables)]")," digunakan untuk membolehkan variabel yang didefinisikan tapi tidak dimanfaatkan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(missing_docs)]")," membolehkan kode di bawahnya untuk tidak memiliki komentar/dokumentasi."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[warn(missing_docs)]")," memunculkan warning jika kode di bawahnya tidak memiliki komentar/dokumentasi."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[deny(missing_docs)]")," memunculkan error jika kode di bawahnya tidak memiliki komentar/dokumentasi. Kode ini sengaja di-remark agar eksekusi program tidak menghasilkan error.")),(0,i.kt)("p",null,"Dengan penambahan 3 attribute di atas program akan tereksekusi tanpa warning."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(2259).Z,width:"463",height:"107"})),(0,i.kt)("p",null,"Ada beberapa attribute ",(0,i.kt)("em",{parentName:"p"},"key")," yang bisa digunakan untuk override ",(0,i.kt)("em",{parentName:"p"},"lint")," warning:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[allow(lint_rule)]")," untuk membolehkan suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule"),".",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[warn(lint_rule)]")," untuk memunculkan warning untuk suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya tidak memunculkan warning.",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[deny(lint_rule)]")," untuk melarang suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya adalah diperbolehkan.",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[forbid(lint_rule)]")," untuk melarang suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya adalah diperbolehkan ",(0,i.kt)("strong",{parentName:"p"},"dengan catatan kode beserta isi yang dituju lint tersebut tidak bisa diubah menjadi ",(0,i.kt)("em",{parentName:"strong"},"lint rule"),"-nya menjadi ",(0,i.kt)("inlineCode",{parentName:"strong"},"allow")," lagi"),". Penjelasan detailnya ada di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/attributes/diagnostics.html"},"https://doc.rust-lang.org/reference/attributes/diagnostics.html")),(0,i.kt)("p",{parentName:"li"}," Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[forbid(missing_docs)]\npub mod m3 {\n #[allow(missing_docs)]\n pub fn undocumented_too() -> i32 { 2 }\n}\n")),(0,i.kt)("p",{parentName:"li"}," Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"#[forbid(missing_docs)]")," pada module ",(0,i.kt)("inlineCode",{parentName:"p"},"m3")," menjadikan seluruh isi block module tersebut harus memiliki dokumentasi, mirip seperti penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"#[deny(missing_docs)]"),"."),(0,i.kt)("p",{parentName:"li"}," Penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"allow")," di dalam block tersebut membuat eksekusi program menghasilkan error, karena meskipun attribute tersebut ditujukan untuk fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"undocumented_too()")," pada parent block (yaitu module ",(0,i.kt)("inlineCode",{parentName:"p"},"m3"),") sudah ditentukan aturannya menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"forbid"),"."))),(0,i.kt)("p",null,"Selain 3 attribute di atas, ada juga beberapa attribute lainnya untuk keperluan ",(0,i.kt)("em",{parentName:"p"},"diagnostic"),", di antaranya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[deprecated]")," digunakan untuk menandai bahwa kode di bawahnya adalah ",(0,i.kt)("em",{parentName:"li"},"deprecated"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[must_use]")," digunakan untuk mendandai bahwa kode di bawahnya harus digunakan, jika tidak maka akan muncul error.")),(0,i.kt)("h2",{id:"a505-attribute-type-system"},"A.50.5. Attribute ",(0,i.kt)("em",{parentName:"h2"},"type system")),(0,i.kt)("p",null,"Ada sebuah attribute bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," gunanya untuk mem-",(0,i.kt)("em",{parentName:"p"},"bypass")," error yang muncul karena ada pattern matching yang tidak meng-cover semua kondisi, atau untuk mengantisipasi error yang muncul saat deklarasi variabel bertipe struct tapi value property-nya tidak diisi."),(0,i.kt)("p",null,"Salah satu contoh error yang dimaksud bisa dilihat pada kode berikut. Error ini muncul karena enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero::Superhero")," tidak ter-cover dalam pattern matching."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7483).Z,width:"671",height:"669"})),(0,i.kt)("p",null,"Solusi untuk mengatasi error di atas bisa dengan cukup menambahkan case kondisi yang belum ter-cover:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n Superhero::Hyperion => println!("stronk"),\n}\n')),(0,i.kt)("p",null,"Atau dengan memanfaatkan kondisi ",(0,i.kt)("em",{parentName:"p"},"other")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"_"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n _ => println!("stronk"),\n}\n')),(0,i.kt)("p",null,"Atau, bisa dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[non_exhaustive]\npub enum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nfn main() {\n let value = Superhero::Superman;\n\n match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n }\n}\n')),(0,i.kt)("p",null,"Sayangnya dalam penggunaan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," ini, efeknya ",(0,i.kt)("strong",{parentName:"p"},"hanya bisa dirasakan jika digunakan pada enum atau struct yang berbeda crate"),"."),(0,i.kt)("p",null,"Pada contoh di atas, tempat di mana enum dideklarasikan dan digunakan adalah masih dalam satu crate yang sama, jadi kode tetap menghasilkan error."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," ini jika digunakan pada struct efeknya saat deklarasi variabel boleh tidak menuliskan value property.")),(0,i.kt)("h2",{id:"a506-attribute-modules"},"A.50.6. Attribute ",(0,i.kt)("em",{parentName:"h2"},"modules")),(0,i.kt)("p",null,"Aturan manajemen di Rust cukup ketat, dan sudah dibahas secara mendetal pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/module-basic"},"Module System \u279c Module"),", yang intinya adalah ada dua cara pembuatan module:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Cara ke-1: dengan mendefinisikan module pada file bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"nama_module.rs")),(0,i.kt)("li",{parentName:"ul"},"Cara ke-2: dengan mendefinisikan module pada file bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"nama_module/mod.rs"))),(0,i.kt)("p",null,"Rust memiliki sebuah attribute bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," yang berguna untuk meng-override 2 aturan di atas secara paksa. Dengan memanfaatkan attribute ini kita bisa menulis module dengan nama sesuka hati."),(0,i.kt)("p",null,"Mari kita praktekan agar lebih jelas. Silakan buat package baru dengan struktur seperti berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 main.rs\n \u2502\u2500\u2500\u2500 util1.rs\n \u2502\u2500\u2500\u2500 util2\n \u2502 \u2514\u2500\u2500\u2500 mod.rs\n \u2514\u2500\u2500\u2500 util3_mymodule.rs\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util1.rs"',title:'"util1.rs"'},'pub fn say_hello() {\n println!("hello (from util1)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util2/mod.rs"',title:'"util2/mod.rs"'},'pub fn say_hello() {\n println!("hello (from util2)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util3_mymodule.rs"',title:'"util3_mymodule.rs"'},'pub fn say_hello() {\n println!("hello (from util3_mymodule)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="main.rs"',title:'"main.rs"'},'mod util1;\nmod util2;\n\n#[path = "util3_mymodule.rs"]\nmod util3;\n\nfn main() {\n util1::say_hello();\n util2::say_hello();\n util3::say_hello();\n}\n')),(0,i.kt)("p",null,"Pada kode di atas bisa dilihat, module ",(0,i.kt)("inlineCode",{parentName:"p"},"util1")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"util2")," patuh mengikuti aturan deklarasi module system. Berbeda dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," yang sebenarnya dideklarasikan dengan nama ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule")," (karena filename-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule.rs"),"). Nama module satu ini diubah menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," lalu dengan memanfaatkan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," kita arahkan isi module ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," adalah berada di ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule.rs"),"."),(0,i.kt)("p",null,"Jialankan program, harusnya tidak ada error."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(6245).Z,width:"456",height:"147"})),(0,i.kt)("h2",{id:"a507-attribute-testing"},"A.50.7. Attribute ",(0,i.kt)("em",{parentName:"h2"},"testing")),(0,i.kt)("p",null,"Lebih detailnya mengenai attribute testing dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/testing"},"Testing"),"."),(0,i.kt)("h2",{id:"a508-attribute-macros"},"A.50.8. Attribute ",(0,i.kt)("em",{parentName:"h2"},"macros")),(0,i.kt)("p",null,"Lebih detailnya mengenai attribute macros dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/macro"},"Macro"),"."),(0,i.kt)("h2",{id:"a509-attribute-lainnya"},"A.50.9 Attribute lainnya"),(0,i.kt)("p",null,"Rust memiliki cukup banyak attribute yang list-nya bisa dilihat pada link ini ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/attributes.html"},"https://doc.rust-lang.org/reference/attributes.html"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/attributes"},"github.com/novalagung/dasarpemrogramanrust-example/../attributes")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/module-basic"},"Module System \u279c Module")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/enum"},"Enum")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/attributes.html"},"https://doc.rust-lang.org/reference/attributes.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/items/implementations.html"},"https://doc.rust-lang.org/reference/items/implementations.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rustc/lints/index.html"},"https://doc.rust-lang.org/rustc/lints/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/attributes/diagnostics.html"},"https://doc.rust-lang.org/reference/attributes/diagnostics.html"))))}k.isMDXComponent=!0},253:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-1-c3fd3abaf784b196c8b4da4512bb8abd.png"},7095:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-2-935bd54d9113cbcfb6a5c07a7ebd9f68.png"},635:(a,e,n)=>{n.d(e,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhkAAAB/CAIAAADNSkeyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE72lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGl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BQsLEQjiWaAyugcro1P5cdb7VLl0RsVxqktStpykYn6s9vpT6yh7GMLSn4pV3Pjkodyoh0wyUKsMcTq2qpiTO19EszA6C/YaIojn4nlvUiAeh60q5mRPxfTUH5q/drxmW1lGVE2JaJMvgngiOOZF5GACKubKjTvfzOoj73F4j27adTzldAFqnyOTBIy8CIIgcoOrDQiCIHKDkRdBEERuMPIiCILIDUZeBEEQucHIiyAIIjcYeREEQeQGIy+CIIjc/DecT72QQDsWUAAAAABJRU5ErkJggg=="},7964:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-5-b485867d9d43b989698d4f1a231cfb4b.png"},7812:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-6-0ae9faf44e5f0113b2599d985a7f331d.png"},2259:(a,e,n)=>{n.d(e,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc8AAABrCAIAAACe4J4wAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE72lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA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nNzU7SDIAgi+Uy6JmH3p1ZffDzxZOv3/9EGff4XYOvZ12JfqdNCXIIgrjETj213n38Lz354Op5L6Csvvn0O5ioFeFyvP4b2q+rTFrbx+6dVeFF/Wq8/BQBov6rSkgSCIK419KYcgiCIOKCnGwiCIOKAeluCIIg4oN6WIAgiDqi3JQiCiAPqbQmCIOKAeluCIIg4oN6WIAgiDqi3JQiCiAPqbQmCIOKAeluCIIg4oN6WIAgiDv4f9cqCOM6DZ8gAAAAASUVORK5CYII="},7483:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-8-edad9c816a2c847561bcc988d0905b16.png"},6245:(a,e,n)=>{n.d(e,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAACTCAIAAACF/R49AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFf2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmU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4JYrYh0fWURdelyrbL60Wia4KYbUh0PU1yu3vbIuL1ItE1Qcw0JLqeGrndvbIE+ujaDomuCWKmIdE1F6GLro1eFb1eRqJrgphtSHTNEWb4omuQpQXQHdcAYL8pgkTXBDHjzJDdikTXBEHMBjP0gACJrgmCmA1mqGP9Eh5LItE1QVwHZmgpgCAIYjaYqRErQRDELEAdK0EQRMhQx0oQBBEyJLoOnVFE11PA++4usnQTxBCQ6Hp4RhFdWzyG0exvdYIcOLJ0E4RO+B3r2NBE1xW36DpiDyk9L8v+DTJ3yu1em96o9uxJpqI83c3VrkEwBDECJLqeiujaQu3H03KGHTXSTvkwqWyDWUGpomyDvA+MiNAkWw6cbiVDwmSHwDzuZOkmCCDR9fRF147A3LjaqWllBvLa0oYIjTfonjVG7JYDJ+83AjRWr9HjuJOlmyBIdA1TE13rPw3KtjhoHI6rnbu554qZrdKG6NzDjAiNPbe7ZR64IfA+7mTpJggSXU+NwWuvcrt7yt7dYDc01A7rT8sbJYDnpQ2xcSjXAFjLCaHH7nfcydJNECS6njq1w/pTKWhPZPSspQ2x8abstedYYvc67mTpJggSXXMRuujaQkmWFoK/wrv27LAhbu1tLXsuZKCx1348NZZoc7t7g7u+gBGmq2bv406WboIg0TVPmOGLrq0bhx32P3/T2N5eVr2ue+3m0CTXyvsbijaZb+xX1K2nzDBz6IHDjrvRCrJ0E8RM2a2+FNE1N1E0YkexTQQxcWbIFfBFiK75KVV87yeYNGTpJgiNGRqxAsA1HhFZn3G1gC0T6LtGRI1gQq4AgtCZtY6VIAgi8szQUgBBEMRsQB0rQRBEyFDHShAEETLUsRIEQYQMdawEQRAhQx0rQRBEyFDHShAEETLUsRIEQYQMdawEQRAhQx0rQRBEyFDHShAEETL/D9VV2vf3UVXEAAAAAElFTkSuQmCC"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2870],{3905:(a,e,n)=>{n.d(e,{Zo:()=>m,kt:()=>s});var t=n(7294);function i(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function r(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,t)}return n}function l(a){for(var e=1;e=0||(i[n]=a[n]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(i[n]=a[n])}return i}var p=t.createContext({}),d=function(a){var e=t.useContext(p),n=e;return a&&(n="function"==typeof a?a(e):l(l({},e),a)),n},m=function(a){var e=d(a.components);return t.createElement(p.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return t.createElement(t.Fragment,{},e)}},o=t.forwardRef((function(a,e){var n=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,m=u(a,["components","mdxType","originalType","parentName"]),o=d(n),s=i,g=o["".concat(p,".").concat(s)]||o[s]||k[s]||r;return n?t.createElement(g,l(l({ref:e},m),{},{components:n})):t.createElement(g,l({ref:e},m))}));function s(a,e){var n=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=n.length,l=new Array(r);l[0]=o;var u={};for(var p in e)hasOwnProperty.call(e,p)&&(u[p]=e[p]);u.originalType=a,u.mdxType="string"==typeof a?a:i,l[1]=u;for(var d=2;d{n.r(e),n.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>u,toc:()=>d});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:51,title:"A.51. Attributes",sidebar_label:"A.51. Attributes"},l=void 0,u={unversionedId:"basic/attributes",id:"basic/attributes",title:"A.51. Attributes",description:"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti #[derive(Debug)]. Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya.",source:"@site/docs/basic/attributes.md",sourceDirName:"basic",slug:"/basic/attributes",permalink:"/basic/attributes",draft:!1,tags:[],version:"current",sidebarPosition:51,frontMatter:{sidebar_position:51,title:"A.51. Attributes",sidebar_label:"A.51. Attributes"},sidebar:"tutorialSidebar",previous:{title:"A.50. Trait \u279c Iterator",permalink:"/basic/trait-iterator"},next:{title:"A.52. Date Time",permalink:"/basic/datetime"}},p={},d=[{value:"A.51.1. Konsep attributes",id:"a511-konsep-attributes",level:2},{value:"A.51.2. Attribute derive",id:"a512-attribute-derive",level:2},{value:"A.51.3. Attribute cfg / configuration",id:"a513-attribute-cfg--configuration",level:2},{value:"\u25c9 Configuration target_os",id:"-configuration-target_os",level:3},{value:"\u25c9 Configuration target_arch",id:"-configuration-target_arch",level:3},{value:"\u25c9 Macro cfg!() dan conditional compilation",id:"-macro-cfg-dan-conditional-compilation",level:3},{value:"\u25c9 Configuration debug_assertions",id:"-configuration-debug_assertions",level:3},{value:"\u25c9 Other configuration",id:"-other-configuration",level:3},{value:"A.51.4. Attribute linting & diagnostic",id:"a514-attribute-linting--diagnostic",level:2},{value:"A.51.5. Attribute type system",id:"a515-attribute-type-system",level:2},{value:"A.51.6. Attribute modules",id:"a516-attribute-modules",level:2},{value:"A.51.7. Attribute testing",id:"a517-attribute-testing",level:2},{value:"A.51.8. Attribute macros",id:"a518-attribute-macros",level:2},{value:"A.51.9 Attribute lainnya",id:"a519-attribute-lainnya",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:d};function k(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,t.Z)({},m,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"#[derive(Debug)]"),". Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya."),(0,i.kt)("h2",{id:"a511-konsep-attributes"},"A.51.1. Konsep attributes"),(0,i.kt)("p",null,"Attributes adalah metadata yang didefinisikan untuk suatu crate, module, atau module item. Kegunaan dari attributes berbeda satu sama lain, tergantung attribute apa yang dipakai (kita akan bahas satu per satu)."),(0,i.kt)("p",null,"Attribute dikategorikan menjadi 2:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Outer attributes"),(0,i.kt)("li",{parentName:"ul"},"Inner attributes")),(0,i.kt)("p",null,"Keduanya memiliki kegunaan yang sama, pembedanya adalah posisi di mana attribute harus dituliskan."),(0,i.kt)("p",null,"Outer attribute dituliskan tepat sebelum target (crate, module, module item, atau lainnya) dengan notasi penulisan seperti berikut:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute = "value"]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute(key = "value")]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[attribute(value)]")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#[attribute(not(key = "value"))]')," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[attribute(not(value))]")," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT"))),(0,i.kt)("p",null,"Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[derive(Debug)]\nstruct LegoSet {\n code: i32,\n name: String,\n category: String,\n age_minimum: i32,\n}\n")),(0,i.kt)("p",null,"Sedikit berbeda dengan inner attribute, penulisannya berada di dalam target (crate, module, module item, atau lainnya). Notasi penulisannya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute = "value"]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute(key = "value")]')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#![attribute(value)]")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'#![attribute(not(key = "value"))]')," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#![attribute(not(value))]")," untuk operasi ",(0,i.kt)("strong",{parentName:"li"},"NOT"))),(0,i.kt)("p",null,"Rust mengenal beberapa jenis attributes, dan kita akan membahasnya satu per satu."),(0,i.kt)("h2",{id:"a512-attribute-derive"},"A.51.2. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"derive")),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," digunakan untuk mempermudah implementasi suatu trait ke tipe data."),(0,i.kt)("p",null,"Kita telah mempelajari cara implementasi trait pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/traits"},"Traits")," yaitu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"impl")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"for"),", kemudian diikuti dengan method serta implementasinya."),(0,i.kt)("p",null,"Dengan memanfaatkan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," kita tidak perlu menggunakan cara tersebut. Cukup tulis saja attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," beserta trait yang ingin diimplementasikan."),(0,i.kt)("p",null,"Agar lebih jelas, silakan pelajari contoh berikut terlebih dahulu:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const SuperheroSuperman: &str = "superman";\nconst SuperheroOmniMan: &str = "omniman";\nconst SuperheroHyperion: &str = "hyperion";\n\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nfn main() {\n let value: Superhero = Superhero::Superman;\n\n if value == Superhero::Superman {\n println!("hello superman!");\n }\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(253).Z,width:"958",height:"719"})),(0,i.kt)("p",null,"Kode di atas menghasilkan error karena enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero")," tidak mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq")," yang mana trait ini diperlukan dalam seleksi kondisi menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," dan operator ",(0,i.kt)("inlineCode",{parentName:"p"},"=="),"."),(0,i.kt)("p",null,"Cara mengatasi error tersebut adalah dengan mengimplementasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq")," secara eksplisit. Sekarang coba tambahkan kode berikut pada deklarasi enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero"),", maka error akan hilang."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"enum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nimpl PartialEq for Superhero {\n\n fn eq(&self, other: &Self) -> bool {\n match (self, other) {\n (Superhero::Superman, Superhero::Superman) => true,\n (Superhero::OmniMan, Superhero::OmniMan) => true,\n (Superhero::Hyperion, Superhero::Hyperion) => true,\n _ => false,\n }\n }\n}\n")),(0,i.kt)("p",null,"Cara lain untuk mengatasi error di atas, selain menggunakan teknik implementasi trait secara eksplisit, adalah dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," disertai trait ",(0,i.kt)("inlineCode",{parentName:"p"},"PartialEq"),". Kurang lebih penulisan cara ini bisa dilihat di bawah ini. Cukup hapus block kode ",(0,i.kt)("inlineCode",{parentName:"p"},"impl")," lalu tambahkan attribute pada deklarasi enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[derive(PartialEq)]\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n")),(0,i.kt)("p",null,"Cukup mudah bukan?"),(0,i.kt)("p",null,"Contoh lainnya, misalnya variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"value")," ingin di-print seperti pada kode berikut ini, pasti hasilnya error."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let value: Superhero = Superhero::Superman;\n\n if value == Superhero::Superman {\n println!("hello superman!");\n }\n\n println!("{value} (via `Display` trait)");\n println!("{value:#?} (via `Debug` trait)");\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7095).Z,width:"900",height:"461"})),(0,i.kt)("p",null,"Cara ",(0,i.kt)("em",{parentName:"p"},"resolve")," error di atas adalah dengan mengimplementasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Display")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Debug")," secara eksplisit. Atau, bisa juga menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive")," yang pastinya lebih praktis."),(0,i.kt)("p",null,"Kabar buruknya, hanya trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Debug")," yang menyediakan fitur implementasi trait menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive"),". Untuk trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Display")," kita perlu melakukan implementasi secara eksplisit."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Untuk tau mana trait yang bisa di-",(0,i.kt)("em",{parentName:"p"},"derive")," atau tidak, cukup lihat saja ",(0,i.kt)("em",{parentName:"p"},"highlight")," error yang muncul saat penulisan kode atau kompilasi.")),(0,i.kt)("p",null,"Ok, kita implementasikan saja keduanya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(PartialEq, Debug)]\nenum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nimpl std::fmt::Display for Superhero {\n\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n write!(f, "{self:?}")\n }\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(635).Z,width:"537",height:"127"})),(0,i.kt)("p",null,"Bisa dilihat, hasilnya program tereksekusi tanpa error. Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero")," kini mengadopsi 3 trait:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"PartialEq")," via attribute ",(0,i.kt)("inlineCode",{parentName:"li"},"derive")),(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Debug")," via attribute ",(0,i.kt)("inlineCode",{parentName:"li"},"derive")),(0,i.kt)("li",{parentName:"ul"},"Trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Display")," via implementasi eksplisit")),(0,i.kt)("h2",{id:"a513-attribute-cfg--configuration"},"A.51.3. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"cfg")," / ",(0,i.kt)("em",{parentName:"h2"},"configuration")),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," digunakan untuk operasi-operasi yang berhubungan dengan target arsitekture hardware/prosesor, misalnya seperti conditional compilation ketika OS adalah linux, dan lainnya."),(0,i.kt)("p",null,"Salah satu contoh penerapannya bisa dilihat pada kode berikut. Ada 2 buah module yang namanya sama persis, perbedaannya adalah satu didefinisikan khusus untuk platform ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),", dan satunya lagi untuk platform ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),". Hal seperti ini bisa dilakukan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," dengan key ",(0,i.kt)("inlineCode",{parentName:"p"},"target_os"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_os = "linux")]\nmod util {\n\n pub fn say_hello() {\n println!("hello (from linux)")\n }\n}\n\n#[cfg(target_os = "windows")]\nmod util {\n\n pub fn say_hello() {\n println!("hello (from windows)")\n }\n\n pub fn say_something() {\n println!("how are you")\n }\n}\n')),(0,i.kt)("p",null,"Bisa dilihat cara penulisannya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg()")," kemudian diisi key ",(0,i.kt)("inlineCode",{parentName:"p"},"target_os")," dengan value adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"windows")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),"."),(0,i.kt)("p",null,"Dengan kondisi kode seperti di atas, ketika berada di sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"linux"),", item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," bisa diakses. Sedangkan pada sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),", item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_something")," bisa diakses."),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg(target_os)")," juga bisa diterapkan pada block kode. Contohnya seperti pada kode berikut. Item ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_hello")," dipanggil di fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main"),". Dan khusus untuk sistem operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"windows"),", block kode berisi pemanggilan ",(0,i.kt)("inlineCode",{parentName:"p"},"util::say_something")," juga dipanggil."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n util::say_hello();\n\n #[cfg(target_os = "windows")]\n {\n util::say_something();\n }\n}\n')),(0,i.kt)("p",null,"Ada beberapa key yang tersedia pada attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg"),", di antaranya:"),(0,i.kt)("h3",{id:"-configuration-target_os"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"target_os")),(0,i.kt)("p",null,"Digunakan untuk menandai bahwa item atau statement di bawah definisi attribute ini dikhususkan untuk sistem operasi tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_os = "value")]\n')),(0,i.kt)("p",null,"Opsi value yang tersedia:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"windows")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"macos")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ios")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"linux")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"android")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"freebsd")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"dragonfly")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"openbsd")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"netbsd"))),(0,i.kt)("h3",{id:"-configuration-target_arch"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"target_arch")),(0,i.kt)("p",null,"Digunakan untuk menandai bahwa item atau statement di bawah definisi attribute ini dikhususkan untuk arsitektur CPU tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[cfg(target_arch = "value")]\n')),(0,i.kt)("p",null,"Opsi value yang tersedia:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"x86")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"x86_64")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"mips")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"powerpc")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"powerpc64")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"arm")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"aarch64"))),(0,i.kt)("h3",{id:"-macro-cfg-dan-conditional-compilation"},"\u25c9 Macro ",(0,i.kt)("inlineCode",{parentName:"h3"},"cfg!()")," dan conditional compilation"),(0,i.kt)("p",null,"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg")," juga tersedia versi macro-nya, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()"),". Macro ini kegunaannya sama seperti attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg"),", perbedaannya macro ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()")," mengembalikan nilai boolean, yang darinya bisa dikombinasikan dengan seleksi kondisi untuk keperluan conditional compilation. Contoh penggunaan macro ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!()"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n #[cfg(target_os = "linux")]\n {\n println!("hello linux. from attribute cfg")\n }\n\n #[cfg(target_os = "windows")]\n {\n println!("hello windows. from attribute cfg")\n }\n\n if cfg!(target_os = "linux") {\n println!("hello linux. from macro cfg!()");\n } else if cfg!(target_os = "windows") {\n println!("hello windows. from macro cfg!()");\n }\n}\n')),(0,i.kt)("p",null,"Penjelasan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kode block ",(0,i.kt)("inlineCode",{parentName:"li"},'#[cfg(target_os = "linux")]')," hanya dieksekusi ketika program dijalankan di Linux."),(0,i.kt)("li",{parentName:"ul"},"Kode block ",(0,i.kt)("inlineCode",{parentName:"li"},'#[cfg(target_os = "windows")]')," hanya dieksekusi ketika program dijalankan di Windows."),(0,i.kt)("li",{parentName:"ul"},"Seleksi kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},"cfg!(target_os = ...)")," merupakan alternatif penulisan 2 kode sebelumnya yang digabung menjadi 1 rantai seleksi kondisi.",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},'cfg!(target_os = "linux")')," terpenuhi ketika program dijalankan di Linux"),(0,i.kt)("li",{parentName:"ul"},"Kondisi ",(0,i.kt)("inlineCode",{parentName:"li"},'cfg!(target_os = "windows")')," terpenuhi ketika program dijalankan di Windows")))),(0,i.kt)("p",null,"Output program ketika dijalankan di komputer penulis yang menggunakan Windows:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(2329).Z,width:"467",height:"108"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai macro akan dibahas di chapter terpisah.")),(0,i.kt)("h3",{id:"-configuration-debug_assertions"},"\u25c9 Configuration ",(0,i.kt)("inlineCode",{parentName:"h3"},"debug_assertions")),(0,i.kt)("p",null,"By default, Rust menggunakan profil kompilasi ",(0,i.kt)("strong",{parentName:"p"},"debug")," saat eksekusi command ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run"),". Di kode program, penanda apakah profil kompilasi debug digunakan atau tidak bisa dilihat dari nilai konfigurasi ",(0,i.kt)("inlineCode",{parentName:"p"},"#[cfg(debug_assertions)]")," via attribute, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!(debug_assertions)")," via macro."),(0,i.kt)("p",null,"Nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"cfg!(debug_assertions)")," selalu bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," kecuali command yang digunakan saat eksekusi program adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run --release"),". Flag ",(0,i.kt)("inlineCode",{parentName:"p"},"--release")," saat eksekusi program membuat nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"debug_assertions")," menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,i.kt)("p",null,"Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n #[cfg(debug_assertions)]\n {\n println!("debug mode. from attribute cfg")\n }\n\n #[cfg(not(debug_assertions))]\n {\n println!("release mode. from attribute cfg")\n }\n\n if cfg!(debug_assertions) {\n println!("debug mode. from macro cfg!()");\n } else {\n println!("release mode. from macro cfg!()");\n }\n}\n')),(0,i.kt)("p",null,"Output eksekusi program menggunakan command ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run")," vs ",(0,i.kt)("inlineCode",{parentName:"p"},"cargo run --release"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7964).Z,width:"499",height:"200"})),(0,i.kt)("p",null,"Pada profil release, kode program dikompilasi sekaligus dioptimisasi. Penggunaan profil ini dianjurkan untuk distribusi production binary. "),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Di beberapa bahasa pemrograman lain deteksi profile dilakukan mengunakan kombinasi keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," dan nilai environment variable (",(0,i.kt)("inlineCode",{parentName:"p"},"ENV"),"). Dari situ bisa dilihat apakah environment yang digunakan adalah production, staging, atau local.")),(0,i.kt)("h3",{id:"-other-configuration"},"\u25c9 Other configuration"),(0,i.kt)("p",null,"Ada beberapa key konfigurasi lainnya yang tersedia. Lebih detailnya silakan lihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/conditional-compilation.html"},"https://doc.rust-lang.org/reference/conditional-compilation.html")),(0,i.kt)("h2",{id:"a514-attribute-linting--diagnostic"},"A.51.4. Attribute ",(0,i.kt)("em",{parentName:"h2"},"linting")," & ",(0,i.kt)("em",{parentName:"h2"},"diagnostic")),(0,i.kt)("p",null,"Ada beberapa attribute name yang bisa digunakan untuk meng-override ",(0,i.kt)("em",{parentName:"p"},"default linting")," milik Rust ataupun menandai indikator ",(0,i.kt)("em",{parentName:"p"},"diagnostic")," lainnya, seperti warning yang muncul karena ada kode yang tidak digunakan, dll; Warning sejenis ini bisa di-override menggunakan attribute."),(0,i.kt)("p",null,"Contoh kasus yang berhubungan dengan ",(0,i.kt)("em",{parentName:"p"},"linting")," bisa dilihat pada kode berikut."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7812).Z,width:"351",height:"363"})),(0,i.kt)("p",null,"Kode di atas tidak menghasilkan error. Kode akan dieksekusi tanpa error. Namun ada 3 buah warning yang muncul karena beberapa baris kode tidak digunakan atau sia-sia."),(0,i.kt)("p",null,"Cara agar warning tidak muncul bisa dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"#[allow(value)]"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[allow(unused_imports)]\nuse std::fmt::Display;\n\nfn say_hello() {\n println!("hello")\n}\n\n#[allow(dead_code)]\nfn say_something() {\n println!("how are you")\n}\n\npub mod m1 {\n #[allow(missing_docs)]\n pub fn undocumented_one() -> i32 { 1 }\n\n #[warn(missing_docs)]\n pub fn undocumented_too() -> i32 { 2 }\n\n // #[deny(missing_docs)]\n // pub fn undocumented_end() -> i32 { 3 }\n}\n\nfn main() {\n #[allow(unused_variables)]\n let name = "noval agung";\n\n say_hello();\n}\n')),(0,i.kt)("p",null,"Pada kode di atas, ada beberapa attribute yang digunakan:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(unused_imports)]")," digunakan untuk antisipasi error yang muncul ketika module item di-import namun tidak digunakan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(dead_code)]")," digunakan untuk membolehkan kode yang tidak digunakan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(unused_variables)]")," digunakan untuk membolehkan variabel yang didefinisikan tapi tidak dimanfaatkan."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[allow(missing_docs)]")," membolehkan kode di bawahnya untuk tidak memiliki komentar/dokumentasi."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[warn(missing_docs)]")," memunculkan warning jika kode di bawahnya tidak memiliki komentar/dokumentasi."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[deny(missing_docs)]")," memunculkan error jika kode di bawahnya tidak memiliki komentar/dokumentasi. Kode ini sengaja di-remark agar eksekusi program tidak menghasilkan error.")),(0,i.kt)("p",null,"Dengan penambahan 3 attribute di atas program akan tereksekusi tanpa warning."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(2259).Z,width:"463",height:"107"})),(0,i.kt)("p",null,"Ada beberapa attribute ",(0,i.kt)("em",{parentName:"p"},"key")," yang bisa digunakan untuk override ",(0,i.kt)("em",{parentName:"p"},"lint")," warning:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[allow(lint_rule)]")," untuk membolehkan suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule"),".",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[warn(lint_rule)]")," untuk memunculkan warning untuk suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya tidak memunculkan warning.",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[deny(lint_rule)]")," untuk melarang suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya adalah diperbolehkan.",(0,i.kt)("br",null),"List ",(0,i.kt)("inlineCode",{parentName:"p"},"lint_rule")," bisa dilihat di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html"},"https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html"),".")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"#[forbid(lint_rule)]")," untuk melarang suatu ",(0,i.kt)("em",{parentName:"p"},"lint rule")," yang ",(0,i.kt)("em",{parentName:"p"},"default"),"-nya adalah diperbolehkan ",(0,i.kt)("strong",{parentName:"p"},"dengan catatan kode beserta isi yang dituju lint tersebut tidak bisa diubah menjadi ",(0,i.kt)("em",{parentName:"strong"},"lint rule"),"-nya menjadi ",(0,i.kt)("inlineCode",{parentName:"strong"},"allow")," lagi"),". Penjelasan detailnya ada di ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/attributes/diagnostics.html"},"https://doc.rust-lang.org/reference/attributes/diagnostics.html")),(0,i.kt)("p",{parentName:"li"}," Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"#[forbid(missing_docs)]\npub mod m3 {\n #[allow(missing_docs)]\n pub fn undocumented_too() -> i32 { 2 }\n}\n")),(0,i.kt)("p",{parentName:"li"}," Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"#[forbid(missing_docs)]")," pada module ",(0,i.kt)("inlineCode",{parentName:"p"},"m3")," menjadikan seluruh isi block module tersebut harus memiliki dokumentasi, mirip seperti penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"#[deny(missing_docs)]"),"."),(0,i.kt)("p",{parentName:"li"}," Penggunaan ",(0,i.kt)("inlineCode",{parentName:"p"},"allow")," di dalam block tersebut membuat eksekusi program menghasilkan error, karena meskipun attribute tersebut ditujukan untuk fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"undocumented_too()")," pada parent block (yaitu module ",(0,i.kt)("inlineCode",{parentName:"p"},"m3"),") sudah ditentukan aturannya menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"forbid"),"."))),(0,i.kt)("p",null,"Selain 3 attribute di atas, ada juga beberapa attribute lainnya untuk keperluan ",(0,i.kt)("em",{parentName:"p"},"diagnostic"),", di antaranya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[deprecated]")," digunakan untuk menandai bahwa kode di bawahnya adalah ",(0,i.kt)("em",{parentName:"li"},"deprecated"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"#[must_use]")," digunakan untuk mendandai bahwa kode di bawahnya harus digunakan, jika tidak maka akan muncul error.")),(0,i.kt)("h2",{id:"a515-attribute-type-system"},"A.51.5. Attribute ",(0,i.kt)("em",{parentName:"h2"},"type system")),(0,i.kt)("p",null,"Ada sebuah attribute bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," gunanya untuk mem-",(0,i.kt)("em",{parentName:"p"},"bypass")," error yang muncul karena ada pattern matching yang tidak meng-cover semua kondisi, atau untuk mengantisipasi error yang muncul saat deklarasi variabel bertipe struct tapi value property-nya tidak diisi."),(0,i.kt)("p",null,"Salah satu contoh error yang dimaksud bisa dilihat pada kode berikut. Error ini muncul karena enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Superhero::Superhero")," tidak ter-cover dalam pattern matching."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(7483).Z,width:"671",height:"669"})),(0,i.kt)("p",null,"Solusi untuk mengatasi error di atas bisa dengan cukup menambahkan case kondisi yang belum ter-cover:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n Superhero::Hyperion => println!("stronk"),\n}\n')),(0,i.kt)("p",null,"Atau dengan memanfaatkan kondisi ",(0,i.kt)("em",{parentName:"p"},"other")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"_"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n _ => println!("stronk"),\n}\n')),(0,i.kt)("p",null,"Atau, bisa dengan menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[non_exhaustive]\npub enum Superhero {\n Superman,\n OmniMan,\n Hyperion,\n}\n\nfn main() {\n let value = Superhero::Superman;\n\n match value {\n Superhero::Superman => println!("stronk"),\n Superhero::OmniMan => println!("stronk"),\n }\n}\n')),(0,i.kt)("p",null,"Sayangnya dalam penggunaan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," ini, efeknya ",(0,i.kt)("strong",{parentName:"p"},"hanya bisa dirasakan jika digunakan pada enum atau struct yang berbeda crate"),"."),(0,i.kt)("p",null,"Pada contoh di atas, tempat di mana enum dideklarasikan dan digunakan adalah masih dalam satu crate yang sama, jadi kode tetap menghasilkan error."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"non_exhaustive")," ini jika digunakan pada struct efeknya saat deklarasi variabel boleh tidak menuliskan value property.")),(0,i.kt)("h2",{id:"a516-attribute-modules"},"A.51.6. Attribute ",(0,i.kt)("em",{parentName:"h2"},"modules")),(0,i.kt)("p",null,"Aturan manajemen di Rust cukup ketat, dan sudah dibahas secara mendetal pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/module-basic"},"Module System \u279c Module"),", yang intinya adalah ada dua cara pembuatan module:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Cara ke-1: dengan mendefinisikan module pada file bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"nama_module.rs")),(0,i.kt)("li",{parentName:"ul"},"Cara ke-2: dengan mendefinisikan module pada file bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"nama_module/mod.rs"))),(0,i.kt)("p",null,"Rust memiliki sebuah attribute bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," yang berguna untuk meng-override 2 aturan di atas secara paksa. Dengan memanfaatkan attribute ini kita bisa menulis module dengan nama sesuka hati."),(0,i.kt)("p",null,"Mari kita praktekan agar lebih jelas. Silakan buat package baru dengan struktur seperti berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 main.rs\n \u2502\u2500\u2500\u2500 util1.rs\n \u2502\u2500\u2500\u2500 util2\n \u2502 \u2514\u2500\u2500\u2500 mod.rs\n \u2514\u2500\u2500\u2500 util3_mymodule.rs\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util1.rs"',title:'"util1.rs"'},'pub fn say_hello() {\n println!("hello (from util1)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util2/mod.rs"',title:'"util2/mod.rs"'},'pub fn say_hello() {\n println!("hello (from util2)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="util3_mymodule.rs"',title:'"util3_mymodule.rs"'},'pub fn say_hello() {\n println!("hello (from util3_mymodule)")\n}\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="main.rs"',title:'"main.rs"'},'mod util1;\nmod util2;\n\n#[path = "util3_mymodule.rs"]\nmod util3;\n\nfn main() {\n util1::say_hello();\n util2::say_hello();\n util3::say_hello();\n}\n')),(0,i.kt)("p",null,"Pada kode di atas bisa dilihat, module ",(0,i.kt)("inlineCode",{parentName:"p"},"util1")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"util2")," patuh mengikuti aturan deklarasi module system. Berbeda dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," yang sebenarnya dideklarasikan dengan nama ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule")," (karena filename-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule.rs"),"). Nama module satu ini diubah menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," lalu dengan memanfaatkan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," kita arahkan isi module ",(0,i.kt)("inlineCode",{parentName:"p"},"util3")," adalah berada di ",(0,i.kt)("inlineCode",{parentName:"p"},"util3_mymodule.rs"),"."),(0,i.kt)("p",null,"Jialankan program, harusnya tidak ada error."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Attribute",src:n(6245).Z,width:"456",height:"147"})),(0,i.kt)("h2",{id:"a517-attribute-testing"},"A.51.7. Attribute ",(0,i.kt)("em",{parentName:"h2"},"testing")),(0,i.kt)("p",null,"Lebih detailnya mengenai attribute testing dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/testing"},"Testing"),"."),(0,i.kt)("h2",{id:"a518-attribute-macros"},"A.51.8. Attribute ",(0,i.kt)("em",{parentName:"h2"},"macros")),(0,i.kt)("p",null,"Lebih detailnya mengenai attribute macros dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/macro"},"Macro"),"."),(0,i.kt)("h2",{id:"a519-attribute-lainnya"},"A.51.9 Attribute lainnya"),(0,i.kt)("p",null,"Rust memiliki cukup banyak attribute yang list-nya bisa dilihat pada link ini ",(0,i.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/reference/attributes.html"},"https://doc.rust-lang.org/reference/attributes.html"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/attributes"},"github.com/novalagung/dasarpemrogramanrust-example/../attributes")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/module-basic"},"Module System \u279c Module")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/enum"},"Enum")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/attributes.html"},"https://doc.rust-lang.org/reference/attributes.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/items/implementations.html"},"https://doc.rust-lang.org/reference/items/implementations.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rustc/lints/index.html"},"https://doc.rust-lang.org/rustc/lints/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/attributes/diagnostics.html"},"https://doc.rust-lang.org/reference/attributes/diagnostics.html"))))}k.isMDXComponent=!0},253:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-1-c3fd3abaf784b196c8b4da4512bb8abd.png"},7095:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-2-935bd54d9113cbcfb6a5c07a7ebd9f68.png"},635:(a,e,n)=>{n.d(e,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhkAAAB/CAIAAADNSkeyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE72lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0i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t++rFzTxVpPqrQAMCNC+f754cafzqy/d0lB372b59UgNleAupBARYqOdFoyLT84gVvvXO+5PVXKypeHRu8+Nm5/owwSeviy0YqVh5+oxC2lRWZliakUt75cvuXzeXmKxgOXBRCEGfDRUZGutoHBLGZ8CXbS14P+cS0ghG+ZHvJ64+ex11liIeAug2IRyJYE1/ylNLPEc9gEUQecMyLeCqvvF1OVvABwM4HvwgiMxh5EQRB5AZXGxAEQeQGIy+CIIjcYORFEASRG1RGdyIPs5I3Y9nJZUZtHeXGnXwre49uKi1/Z2IyGgjihqAyurN4mJW87S97+JLtv1wXUb3jx+R9wrGp+46dK3v+vTeaJdQyEcSz8LzVhrGp+zbnalYXuHsPJEreNQ+lkredZef06a9uXTQsUiz7oiO1eNtyx7iIIC4FldE9WBlduZGe8vyIUC6dnCtWHGd0ycJNziEq5gJxsnlF+Uqvi79647TA1v6DF5a8nlfodxr37SKeDiqje7YyOjWlWC4daIrjNrlExX4VcyI5Jsg2J2kur11pDlHeIUJICOLRoDK6ZyujU1OK5dKpiuPsLlHrwUkq5pw+/TsRHFWil4RpVEBHJgGojO7ZyuhUxHLpFhTHJ+ySk1TMSbZ9Er+29gwsDVcCnLbuH4K4MaiM7sHK6FR2HH9u13GhXDq74ji7S45SMX/7lVz2bGNnBgzcbWCyiiBuDCqjWzHk/sroVARy6eyK4+xt5BAVc7I723zHt4UlBQsLEQjiWaAyugcro1P5cdb7VLl0RsVxqktStpykYn6s9vpT6yh7GMLSn4pV3Pjkodyoh0wyUKsMcTq2qpiTO19EszA6C/YaIojn4nlvUiAeh60q5mRPxfTUH5q/drxmW1lGVE2JaJMvgngiOOZF5GACKubKjTvfzOoj73F4j27adTzldAFqnyOTBIy8CIIgcoOrDQiCIHKDkRdBEERuMPIiCILIDUZeBEEQucHIiyAIIjcYeREEQeQGIy+CIIjc/DecT72QQDsWUAAAAABJRU5ErkJggg=="},7964:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-5-b485867d9d43b989698d4f1a231cfb4b.png"},7812:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/attribute-6-0ae9faf44e5f0113b2599d985a7f331d.png"},2259:(a,e,n)=>{n.d(e,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc8AAABrCAIAAACe4J4wAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE72lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCAyNC4xIChXaW5kb3dzKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDEtMzBUMjI6MDU6NTIrMDc6MDAiIHhtcDpNb2RpZnlEY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KGHTXSTvkwqWyDWUGpomyDvA+MiNAkWw6cbiVDwmSHwDzuZOkmCCDR9fRF147A3LjaqWllBvLa0oYIjTfonjVG7JYDJ+83AjRWr9HjuJOlmyBIdA1TE13rPw3KtjhoHI6rnbu554qZrdKG6NzDjAiNPbe7ZR64IfA+7mTpJggSXU+NwWuvcrt7yt7dYDc01A7rT8sbJYDnpQ2xcSjXAFjLCaHH7nfcydJNECS6njq1w/pTKWhPZPSspQ2x8abstedYYvc67mTpJggSXXMRuujaQkmWFoK/wrv27LAhbu1tLXsuZKCx1348NZZoc7t7g7u+gBGmq2bv406WboIg0TVPmOGLrq0bhx32P3/T2N5eVr2ue+3m0CTXyvsbijaZb+xX1K2nzDBz6IHDjrvRCrJ0E8RM2a2+FNE1N1E0YkexTQQxcWbIFfBFiK75KVV87yeYNGTpJgiNGRqxAsA1HhFZn3G1gC0T6LtGRI1gQq4AgtCZtY6VIAgi8szQUgBBEMRsQB0rQRBEyFDHShAEETLUsRIEQYQMdawEQRAhQx0rQRBEyFDHShAEETLUsRIEQYQMdawEQRAhQx0rQRBEyFDHShAEETL/D9VV2vf3UVXEAAAAAElFTkSuQmCC"}}]); \ No newline at end of file diff --git a/assets/js/68ec37cc.c5ae0e4d.js b/assets/js/68ec37cc.eb57c627.js similarity index 89% rename from assets/js/68ec37cc.c5ae0e4d.js rename to assets/js/68ec37cc.eb57c627.js index 1e886b81..fb2af8fd 100644 --- a/assets/js/68ec37cc.c5ae0e4d.js +++ b/assets/js/68ec37cc.eb57c627.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2959],{3905:(a,e,t)=>{t.d(e,{Zo:()=>m,kt:()=>d});var n=t(7294);function i(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function r(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,n)}return t}function l(a){for(var e=1;e=0||(i[t]=a[t]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(i[t]=a[t])}return i}var p=n.createContext({}),o=function(a){var e=n.useContext(p),t=e;return a&&(t="function"==typeof a?a(e):l(l({},e),a)),t},m=function(a){var e=o(a.components);return n.createElement(p.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return n.createElement(n.Fragment,{},e)}},u=n.forwardRef((function(a,e){var t=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,m=s(a,["components","mdxType","originalType","parentName"]),u=o(t),d=i,c=u["".concat(p,".").concat(d)]||u[d]||k[d]||r;return t?n.createElement(c,l(l({ref:e},m),{},{components:t})):n.createElement(c,l({ref:e},m))}));function d(a,e){var t=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=t.length,l=new Array(r);l[0]=u;var s={};for(var p in e)hasOwnProperty.call(e,p)&&(s[p]=e[p]);s.originalType=a,s.mdxType="string"==typeof a?a:i,l[1]=s;for(var o=2;o{t.r(e),t.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>s,toc:()=>o});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:42,title:"A.42. Static Item",sidebar_label:"A.42. Static Item"},l=void 0,s={unversionedId:"basic/static",id:"basic/static",title:"A.42. Static Item",description:"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta.",source:"@site/docs/basic/static.md",sourceDirName:"basic",slug:"/basic/static",permalink:"/basic/static",draft:!1,tags:[],version:"current",sidebarPosition:42,frontMatter:{sidebar_position:42,title:"A.42. Static Item",sidebar_label:"A.42. Static Item"},sidebar:"tutorialSidebar",previous:{title:"A.41. Pattern Matching",permalink:"/basic/pattern-matching"},next:{title:"A.43. Lifetime",permalink:"/basic/lifetime"}},p={},o=[{value:"A.42.1. Sekilas tentang lifetime",id:"a421-sekilas-tentang-lifetime",level:2},{value:"A.42.2. Static item",id:"a422-static-item",level:2},{value:"A.42.3. Keyword static",id:"a423-keyword-static",level:2},{value:"A.42.4. Lifetime 'static",id:"a424-lifetime-static",level:2},{value:"A.42.5. Static item data literal",id:"a425-static-item-data-literal",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function k(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,n.Z)({},m,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta."),(0,i.kt)("p",null,"Namun sebelum masuk ke inti pembahasan, mari kita sedikit belajar tentang apa itu ",(0,i.kt)("em",{parentName:"p"},"lifetime")," dalam Rust programming."),(0,i.kt)("h2",{id:"a421-sekilas-tentang-lifetime"},"A.42.1. Sekilas tentang ",(0,i.kt)("em",{parentName:"h2"},"lifetime")),(0,i.kt)("p",null,"Di Rust ada yang disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"lifetime"),". Lifetime merupakan sebuah identifier yang digunakan compiler untuk memantau berapa lama reference valid."),(0,i.kt)("p",null,"Di balik layar, Rust compiler (lebih tepatnya Rust borrow checker) menggunakan sebuah anotasi dalam penerapan lifetime. Penulisan anotasinya diawali tanda petik satu ",(0,i.kt)("inlineCode",{parentName:"p"},"'"),", contohnya ",(0,i.kt)("inlineCode",{parentName:"p"},"'a"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"'b"),", dan ",(0,i.kt)("inlineCode",{parentName:"p"},"'c"),"."),(0,i.kt)("p",null,"Untuk sekarang, silakan dipahami bahwa sebuah syntax yang diawali dengan tanda ",(0,i.kt)("inlineCode",{parentName:"p"},"'")," (contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"'a"),") adalah lifetime."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Pembahasan detail mengenai lifetime dibahas pada chapter selanjutnya, yaitu ",(0,i.kt)("a",{parentName:"p",href:"/basic/lifetime"},"Lifetime"),".")),(0,i.kt)("h2",{id:"a422-static-item"},"A.42.2. Static item"),(0,i.kt)("p",null,"Ok, sekarang kembali ke topik utama, yaitu static. Static adalah item yang mirip dengan ",(0,i.kt)("a",{parentName:"p",href:"/basic/konstanta"},"Konstanta"),", tapi memiliki perbedaan yaitu alamat memory yang dialokasikan untuk menampung data static item adalah fix/jelas. Semua reference terhadap static item mengarah ke alamat memory yang sama."),(0,i.kt)("p",null,"Dengan karakteristik yang seperti itu, static tepat diterapkan pada data yang sifatnya shared atau bisa diakses secara global."),(0,i.kt)("p",null,"Ada dua cara membuat static item:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"li"},"static")," pada pendefinisian konstanta"),(0,i.kt)("li",{parentName:"ul"},"Menggunakan lifetime ",(0,i.kt)("inlineCode",{parentName:"li"},"'static")," pada tipe data string literal (",(0,i.kt)("inlineCode",{parentName:"li"},"&str"),")")),(0,i.kt)("h2",{id:"a423-keyword-static"},"A.42.3. Keyword ",(0,i.kt)("inlineCode",{parentName:"h2"},"static")),(0,i.kt)("p",null,"Ok, kita terapkan cara pertama, penerapan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," untuk pembuatan konstanta."),(0,i.kt)("p",null,"Pada deklarasi konstanta static, harus ditulis juga tipe datanya secara eksplisit."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'static PI: f64 = 3.14;\n\nfn main() {\n println!("PI: {:?}", PI);\n}\n')),(0,i.kt)("p",null,"Cukup mudah bukan?"),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Konstanta static bisa saja didefinisikan mutable, tetapi dengan konsekuensi item tersebut akan menjadi ",(0,i.kt)("em",{parentName:"p"},"unsafe"),"."),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai topik ini akan dibahas nantinya pada chapter terpisah, yaitu ",(0,i.kt)("a",{parentName:"p",href:"#/wip/safe-unsafe"},"Safe & Unsafe"),".")),(0,i.kt)("p",null,"Ok, sekarang kita coba terapkan keyword static pada tipe lainnya, contohnya ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Static string",src:t(5207).Z,width:"765",height:"259"})),(0,i.kt)("p",null,"Hmm, malah error."),(0,i.kt)("p",null,"Perlu diketahui bahwa keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," bisa digunakan pada semua tipe data primitif. Selain itu bisa juga diterapkan dalam ",(0,i.kt)("em",{parentName:"p"},"constants function")," (yang nantinya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/constant-evaluation"},"Constant Evaluation"),"), ",(0,i.kt)("a",{parentName:"p",href:"/basic/struct#a247-tuple-struct"},"Tuple Struct"),", dan juga variant ",(0,i.kt)("a",{parentName:"p",href:"/basic/tuple"},"Tuple")," lainnya, tetapi tidak bisa digunakan untuk custom type seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Lalu bagaimana jika ada kebutuhan membuat konstanta bertipe string? Solusinya dengan menggunakan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str")," yang sebentar lagi akan kita bahas."),(0,i.kt)("h2",{id:"a424-lifetime-static"},"A.42.4. Lifetime ",(0,i.kt)("inlineCode",{parentName:"h2"},"'static")),(0,i.kt)("p",null,"Lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," digunakan untuk deklarasi reference sebagai static item. Data yang memiliki lifetime ini tidak akan pernah di-dealokasi kecuali eksekusi program selesai."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Karena alasan di atas, ada baiknya data dengan lifetime static dideklarasikan secara global."),(0,i.kt)("p",{parentName:"blockquote"},"Dimisalkan ada variabel dengan lifetime ini dideklarasikan dalam suatu block, variabel tersebut tidak akan di-dealokasi meskipun eksekusi block selesai nantinya.")),(0,i.kt)("p",null,"Lifetime ini biasa dikombinasikan dengan tipe data pointer, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," jika dikombinasikan dengan lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," jadinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &\'static str = "v1.2.3";\n')),(0,i.kt)("p",null,"Sebelumnya telah dijelaskan bahwa custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," tidak bisa digunakan untuk menyimpan data string sebagai static item, dan cara di atas ini adalah solusinya."),(0,i.kt)("p",null,"Penulisannya agak kurang friendly memang (",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"), namun kabar baiknya semenjak Rust versi 1.17 rilis di tahun 2017, by default semua item yang dideklarasikan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"const")," otomatis memiliki ",(0,i.kt)("inlineCode",{parentName:"p"},"'static lifetime"),". Jadi sekarang cukup tulis saja:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &str = "v1.2.3";\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &\'static str = "v1.2.3";\n')),(0,i.kt)("h2",{id:"a425-static-item-data-literal"},"A.42.5. Static item data literal"),(0,i.kt)("p",null,"Pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing#a347-owner-dan-borrower-data-literal"},"Borrowing")," sempat kita bahas sedikit tentang siapa owner dan borrower data literal."),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah salah satu tipe data yang tidak memiliki owner (atau boleh disimpulkan owner-nya adalah program). Pada variabel yang bertipe ini, yang ia tampung adalah data pinjaman, jadi variabel tersebut bukan owner. Contohnya pada kode berikut konstanta ",(0,i.kt)("inlineCode",{parentName:"p"},"VERSION")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"BUILD_COUNTER")," di atas adalah borrower."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &str = "v1.2.3";\nconst BUILD_COUNTER: &i32 = &15;\n')),(0,i.kt)("p",null,"Yang penting untuk diperhatikan bukan siapa owner-nya, tapi bagaimana kita memastikan data pinjaman tersebut tidak di-dealokasi. Inilah kenapa lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," dan/atau keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," & ",(0,i.kt)("inlineCode",{parentName:"p"},"const")," dipergunakan. Dengan adanya lifetime tersebut, data borrow tidak akan pernah di-dealokasi."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/static_example"},"github.com/novalagung/dasarpemrogramanrust-example/../static_example")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/items/static-items.html"},"https://doc.rust-lang.org/reference/items/static-items.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/custom_types/constants.html"},"https://doc.rust-lang.org/beta/rust-by-example/custom_types/constants.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html"},"https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/49684657/what-is-the-difference-between-str-and-static-str-in-a-static-or-const"},"https://stackoverflow.com/questions/49684657/what-is-the-difference-between-str-and-static-str-in-a-static-or-const"))))}k.isMDXComponent=!0},5207:(a,e,t)=>{t.d(e,{Z:()=>n});const n=t.p+"assets/images/static-1-095ee9ad8503b55f94f1fb79ef51dbca.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2959],{3905:(a,e,t)=>{t.d(e,{Zo:()=>m,kt:()=>d});var n=t(7294);function i(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function r(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,n)}return t}function l(a){for(var e=1;e=0||(i[t]=a[t]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(i[t]=a[t])}return i}var p=n.createContext({}),o=function(a){var e=n.useContext(p),t=e;return a&&(t="function"==typeof a?a(e):l(l({},e),a)),t},m=function(a){var e=o(a.components);return n.createElement(p.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return n.createElement(n.Fragment,{},e)}},u=n.forwardRef((function(a,e){var t=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,m=s(a,["components","mdxType","originalType","parentName"]),u=o(t),d=i,c=u["".concat(p,".").concat(d)]||u[d]||k[d]||r;return t?n.createElement(c,l(l({ref:e},m),{},{components:t})):n.createElement(c,l({ref:e},m))}));function d(a,e){var t=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=t.length,l=new Array(r);l[0]=u;var s={};for(var p in e)hasOwnProperty.call(e,p)&&(s[p]=e[p]);s.originalType=a,s.mdxType="string"==typeof a?a:i,l[1]=s;for(var o=2;o{t.r(e),t.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>s,toc:()=>o});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:43,title:"A.43. Static Item",sidebar_label:"A.43. Static Item"},l=void 0,s={unversionedId:"basic/static",id:"basic/static",title:"A.43. Static Item",description:"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta.",source:"@site/docs/basic/static.md",sourceDirName:"basic",slug:"/basic/static",permalink:"/basic/static",draft:!1,tags:[],version:"current",sidebarPosition:43,frontMatter:{sidebar_position:43,title:"A.43. Static Item",sidebar_label:"A.43. Static Item"},sidebar:"tutorialSidebar",previous:{title:"A.42. Pattern Matching",permalink:"/basic/pattern-matching"},next:{title:"A.44. Lifetime",permalink:"/basic/lifetime"}},p={},o=[{value:"A.43.1. Sekilas tentang lifetime",id:"a431-sekilas-tentang-lifetime",level:2},{value:"A.43.2. Static item",id:"a432-static-item",level:2},{value:"A.43.3. Keyword static",id:"a433-keyword-static",level:2},{value:"A.43.4. Lifetime 'static",id:"a434-lifetime-static",level:2},{value:"A.43.5. Static item data literal",id:"a435-static-item-data-literal",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function k(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,n.Z)({},m,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta."),(0,i.kt)("p",null,"Namun sebelum masuk ke inti pembahasan, mari kita sedikit belajar tentang apa itu ",(0,i.kt)("em",{parentName:"p"},"lifetime")," dalam Rust programming."),(0,i.kt)("h2",{id:"a431-sekilas-tentang-lifetime"},"A.43.1. Sekilas tentang ",(0,i.kt)("em",{parentName:"h2"},"lifetime")),(0,i.kt)("p",null,"Di Rust ada yang disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"lifetime"),". Lifetime merupakan sebuah identifier yang digunakan compiler untuk memantau berapa lama reference valid."),(0,i.kt)("p",null,"Di balik layar, Rust compiler (lebih tepatnya Rust borrow checker) menggunakan sebuah anotasi dalam penerapan lifetime. Penulisan anotasinya diawali tanda petik satu ",(0,i.kt)("inlineCode",{parentName:"p"},"'"),", contohnya ",(0,i.kt)("inlineCode",{parentName:"p"},"'a"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"'b"),", dan ",(0,i.kt)("inlineCode",{parentName:"p"},"'c"),"."),(0,i.kt)("p",null,"Untuk sekarang, silakan dipahami bahwa sebuah syntax yang diawali dengan tanda ",(0,i.kt)("inlineCode",{parentName:"p"},"'")," (contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"'a"),") adalah lifetime."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Pembahasan detail mengenai lifetime dibahas pada chapter selanjutnya, yaitu ",(0,i.kt)("a",{parentName:"p",href:"/basic/lifetime"},"Lifetime"),".")),(0,i.kt)("h2",{id:"a432-static-item"},"A.43.2. Static item"),(0,i.kt)("p",null,"Ok, sekarang kembali ke topik utama, yaitu static. Static adalah item yang mirip dengan ",(0,i.kt)("a",{parentName:"p",href:"/basic/konstanta"},"Konstanta"),", tapi memiliki perbedaan yaitu alamat memory yang dialokasikan untuk menampung data static item adalah fix/jelas. Semua reference terhadap static item mengarah ke alamat memory yang sama."),(0,i.kt)("p",null,"Dengan karakteristik yang seperti itu, static tepat diterapkan pada data yang sifatnya shared atau bisa diakses secara global."),(0,i.kt)("p",null,"Ada dua cara membuat static item:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"li"},"static")," pada pendefinisian konstanta"),(0,i.kt)("li",{parentName:"ul"},"Menggunakan lifetime ",(0,i.kt)("inlineCode",{parentName:"li"},"'static")," pada tipe data string literal (",(0,i.kt)("inlineCode",{parentName:"li"},"&str"),")")),(0,i.kt)("h2",{id:"a433-keyword-static"},"A.43.3. Keyword ",(0,i.kt)("inlineCode",{parentName:"h2"},"static")),(0,i.kt)("p",null,"Ok, kita terapkan cara pertama, penerapan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," untuk pembuatan konstanta."),(0,i.kt)("p",null,"Pada deklarasi konstanta static, harus ditulis juga tipe datanya secara eksplisit."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'static PI: f64 = 3.14;\n\nfn main() {\n println!("PI: {:?}", PI);\n}\n')),(0,i.kt)("p",null,"Cukup mudah bukan?"),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Konstanta static bisa saja didefinisikan mutable, tetapi dengan konsekuensi item tersebut akan menjadi ",(0,i.kt)("em",{parentName:"p"},"unsafe"),"."),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai topik ini akan dibahas nantinya pada chapter terpisah, yaitu ",(0,i.kt)("a",{parentName:"p",href:"#/wip/safe-unsafe"},"Safe & Unsafe"),".")),(0,i.kt)("p",null,"Ok, sekarang kita coba terapkan keyword static pada tipe lainnya, contohnya ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Static string",src:t(5207).Z,width:"765",height:"259"})),(0,i.kt)("p",null,"Hmm, malah error."),(0,i.kt)("p",null,"Perlu diketahui bahwa keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," bisa digunakan pada semua tipe data primitif. Selain itu bisa juga diterapkan dalam ",(0,i.kt)("em",{parentName:"p"},"constants function")," (yang nantinya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/constant-evaluation"},"Constant Evaluation"),"), ",(0,i.kt)("a",{parentName:"p",href:"/basic/struct#a247-tuple-struct"},"Tuple Struct"),", dan juga variant ",(0,i.kt)("a",{parentName:"p",href:"/basic/tuple"},"Tuple")," lainnya, tetapi tidak bisa digunakan untuk custom type seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Lalu bagaimana jika ada kebutuhan membuat konstanta bertipe string? Solusinya dengan menggunakan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str")," yang sebentar lagi akan kita bahas."),(0,i.kt)("h2",{id:"a434-lifetime-static"},"A.43.4. Lifetime ",(0,i.kt)("inlineCode",{parentName:"h2"},"'static")),(0,i.kt)("p",null,"Lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," digunakan untuk deklarasi reference sebagai static item. Data yang memiliki lifetime ini tidak akan pernah di-dealokasi kecuali eksekusi program selesai."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Karena alasan di atas, ada baiknya data dengan lifetime static dideklarasikan secara global."),(0,i.kt)("p",{parentName:"blockquote"},"Dimisalkan ada variabel dengan lifetime ini dideklarasikan dalam suatu block, variabel tersebut tidak akan di-dealokasi meskipun eksekusi block selesai nantinya.")),(0,i.kt)("p",null,"Lifetime ini biasa dikombinasikan dengan tipe data pointer, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," jika dikombinasikan dengan lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," jadinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &\'static str = "v1.2.3";\n')),(0,i.kt)("p",null,"Sebelumnya telah dijelaskan bahwa custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," tidak bisa digunakan untuk menyimpan data string sebagai static item, dan cara di atas ini adalah solusinya."),(0,i.kt)("p",null,"Penulisannya agak kurang friendly memang (",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"), namun kabar baiknya semenjak Rust versi 1.17 rilis di tahun 2017, by default semua item yang dideklarasikan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"const")," otomatis memiliki ",(0,i.kt)("inlineCode",{parentName:"p"},"'static lifetime"),". Jadi sekarang cukup tulis saja:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &str = "v1.2.3";\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &\'static str = "v1.2.3";\n')),(0,i.kt)("h2",{id:"a435-static-item-data-literal"},"A.43.5. Static item data literal"),(0,i.kt)("p",null,"Pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing#a347-owner-dan-borrower-data-literal"},"Borrowing")," sempat kita bahas sedikit tentang siapa owner dan borrower data literal."),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah salah satu tipe data yang tidak memiliki owner (atau boleh disimpulkan owner-nya adalah program). Pada variabel yang bertipe ini, yang ia tampung adalah data pinjaman, jadi variabel tersebut bukan owner. Contohnya pada kode berikut konstanta ",(0,i.kt)("inlineCode",{parentName:"p"},"VERSION")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"BUILD_COUNTER")," di atas adalah borrower."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'const VERSION: &str = "v1.2.3";\nconst BUILD_COUNTER: &i32 = &15;\n')),(0,i.kt)("p",null,"Yang penting untuk diperhatikan bukan siapa owner-nya, tapi bagaimana kita memastikan data pinjaman tersebut tidak di-dealokasi. Inilah kenapa lifetime ",(0,i.kt)("inlineCode",{parentName:"p"},"'static")," dan/atau keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"static")," & ",(0,i.kt)("inlineCode",{parentName:"p"},"const")," dipergunakan. Dengan adanya lifetime tersebut, data borrow tidak akan pernah di-dealokasi."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/static_example"},"github.com/novalagung/dasarpemrogramanrust-example/../static_example")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/items/static-items.html"},"https://doc.rust-lang.org/reference/items/static-items.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/custom_types/constants.html"},"https://doc.rust-lang.org/beta/rust-by-example/custom_types/constants.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html"},"https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/49684657/what-is-the-difference-between-str-and-static-str-in-a-static-or-const"},"https://stackoverflow.com/questions/49684657/what-is-the-difference-between-str-and-static-str-in-a-static-or-const"))))}k.isMDXComponent=!0},5207:(a,e,t)=>{t.d(e,{Z:()=>n});const n=t.p+"assets/images/static-1-095ee9ad8503b55f94f1fb79ef51dbca.png"}}]); \ No newline at end of file diff --git a/assets/js/742a9bdc.4e4caa82.js b/assets/js/742a9bdc.7a41a927.js similarity index 96% rename from assets/js/742a9bdc.4e4caa82.js rename to assets/js/742a9bdc.7a41a927.js index 01d6a3e9..ae3011df 100644 --- a/assets/js/742a9bdc.4e4caa82.js +++ b/assets/js/742a9bdc.7a41a927.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[7988],{3905:(a,e,n)=>{n.d(e,{Zo:()=>d,kt:()=>k});var t=n(7294);function i(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function r(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,t)}return n}function l(a){for(var e=1;e=0||(i[n]=a[n]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(i[n]=a[n])}return i}var s=t.createContext({}),u=function(a){var e=t.useContext(s),n=e;return a&&(n="function"==typeof a?a(e):l(l({},e),a)),n},d=function(a){var e=u(a.components);return t.createElement(s.Provider,{value:e},a.children)},m={inlineCode:"code",wrapper:function(a){var e=a.children;return t.createElement(t.Fragment,{},e)}},o=t.forwardRef((function(a,e){var n=a.components,i=a.mdxType,r=a.originalType,s=a.parentName,d=p(a,["components","mdxType","originalType","parentName"]),o=u(n),k=i,c=o["".concat(s,".").concat(k)]||o[k]||m[k]||r;return n?t.createElement(c,l(l({ref:e},d),{},{components:n})):t.createElement(c,l({ref:e},d))}));function k(a,e){var n=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=n.length,l=new Array(r);l[0]=o;var p={};for(var s in e)hasOwnProperty.call(e,s)&&(p[s]=e[s]);p.originalType=a,p.mdxType="string"==typeof a?a:i,l[1]=p;for(var u=2;u{n.r(e),n.d(e,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>p,toc:()=>u});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:37,title:"A.37. Traits \u279c Advanced",sidebar_label:"A.37. Traits \u279c Advanced"},l=void 0,p={unversionedId:"basic/advanced-traits",id:"basic/advanced-traits",title:"A.37. Traits \u279c Advanced",description:"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya.",source:"@site/docs/basic/advanced-traits.md",sourceDirName:"basic",slug:"/basic/advanced-traits",permalink:"/basic/advanced-traits",draft:!1,tags:[],version:"current",sidebarPosition:37,frontMatter:{sidebar_position:37,title:"A.37. Traits \u279c Advanced",sidebar_label:"A.37. Traits \u279c Advanced"},sidebar:"tutorialSidebar",previous:{title:"A.36. Traits",permalink:"/basic/traits"},next:{title:"A.38. Generics",permalink:"/basic/generics"}},s={},u=[{value:"A.37.1. Membuat custom trait (local trait)",id:"a371-membuat-custom-trait-local-trait",level:2},{value:"\u25c9 Method pow untuk operasi pangkat",id:"-method-pow-untuk-operasi-pangkat",level:3},{value:"\u25c9 Keyword as untuk casting tipe data",id:"-keyword-as-untuk-casting-tipe-data",level:3},{value:"A.37.2. Trait sebagai tipe parameter",id:"a372-trait-sebagai-tipe-parameter",level:2},{value:"A.37.3. Parameter bertipe lebih dari 1 trait",id:"a373-parameter-bertipe-lebih-dari-1-trait",level:2},{value:"A.37.4. Trait bound syntax",id:"a374-trait-bound-syntax",level:2},{value:"A.37.5. Trait where clause",id:"a375-trait-where-clause",level:2},{value:"A.37.6. Trait sebagai return type",id:"a376-trait-sebagai-return-type",level:2},{value:"A.37.7. Associated types pada trait",id:"a377-associated-types-pada-trait",level:2},{value:"A.37.8. Attribute derive",id:"a378-attribute-derive",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:u};function m(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,t.Z)({},d,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya."),(0,i.kt)("p",null,"Pembahasan lanjutan mengenai traits ini cukup panjang. Makin mendekati akhir pembahasan, makin berat topik yang dibahas. Penulis anjurkan jika diperlukan, silakan mengulang-ulang chapter ini, atau bisa lanjut ke chapter berikutnya dan nanti kembali lagi ke sini ketika sudah siap."),(0,i.kt)("h2",{id:"a371-membuat-custom-trait-local-trait"},"A.37.1. Membuat custom trait (local trait)"),(0,i.kt)("p",null,"Pada bagian ini kita akan belajar tentang cara membuat definisi trait di local crate dalam project yang sedang dikerjakan."),(0,i.kt)("p",null,"Masih sama dengan sebelum-sebelumnya, pembelajaran dilakukan dengan praktik. Kita gunakan skenario praktik berikut pada program selanjutnya:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Buat struct bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Circle"),"."),(0,i.kt)("li",{parentName:"ol"},"Buat struct bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Square"),"."),(0,i.kt)("li",{parentName:"ol"},"Buat trait bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Area")," dengan isi satu buah method untuk menghitung luas bangun datar (method ",(0,i.kt)("inlineCode",{parentName:"li"},"calculate_area()"),")."),(0,i.kt)("li",{parentName:"ol"},"Implementasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Area")," ke dua struct tersebut.")),(0,i.kt)("p",null,"Ok, mari mulai praktikkan skenario di atas. Pertama siapkan project dengan struktur berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 calculation_spec.rs\n \u2502\u2500\u2500\u2500 two_dimensional.rs\n \u2514\u2500\u2500\u2500 main.rs\n")),(0,i.kt)("p",null,"Module ",(0,i.kt)("inlineCode",{parentName:"p"},"calculation_spec")," berisi definisi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),". Trait ini punya visibility akses publik, isinya hanya satu buah definisi method header bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()"),". Trait ini nantinya diimplementasikan ke struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan juga ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),", agar nantinya kedua struct tersebut memiliki method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," yang berguna untuk kalkulasi luas bangun datar 2d."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/calculation_spec.rs"',title:'"src/calculation_spec.rs"'},"pub trait Area {\n fn calculate_area(&self) -> f64;\n}\n")),(0,i.kt)("p",null,"Kemudian siapkan file ",(0,i.kt)("inlineCode",{parentName:"p"},"two_dimensional"),", isinya dua buah struct: ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),". Pada file yang sama, siapkan juga block kode implementasi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),". Dengan ini maka kedua struct tersebut wajib untuk memiliki method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," dengan isi adalah operasi perhitungan aritmatika untuk mencari luas bangun datar."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/two_dimensional.rs"',title:'"src/two_dimensional.rs"'},"pub struct Circle {\n pub radius: i32,\n}\n\nimpl crate::calculation_spec::Area for Circle {\n fn calculate_area(&self) -> f64 {\n // PI * (r ^ 2)\n // ada operasi casting ke tipe f64 karena self.radius bertipe i32\n 3.14 * (self.radius.pow(2) as f64)\n }\n}\n\npub struct Square {\n pub length: i32,\n}\n\nimpl crate::calculation_spec::Area for Square {\n fn calculate_area(&self) -> f64 {\n // (s ^ 2)\n // ada operasi casting ke tipe f64 karena self.length bertipe i32\n self.length.pow(2) as f64\n }\n}\n")),(0,i.kt)("p",null,"Bisa dilihat pada kode di atas, deklarasi struct beserta property memiliki visibility publik. Idealnya, saat sturct tersebut digunakan di fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," nantinya tidak akan ada error terkait visibility akses."),(0,i.kt)("p",null,"Selanjutnya, pada file ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," siapkan kode yang isinya registrasi module ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_spec")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"two_dimensional"),", juga definisi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan isi statement pembuatan 2 variabel object untuk masing-masing tipe data struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod calculation_spec;\nmod two_dimensional;\n\nfn main() {\n let circle_one = two_dimensional::Circle{ radius: 10 };\n println!("circle area: {}", circle_one.calculate_area());\n\n let square_one = two_dimensional::Square{ length: 5 };\n println!("square area: {}", square_one.calculate_area());\n}\n')),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," milik object bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," diakses untuk kemudian di-print."),(0,i.kt)("p",null,"Coba jalankan program."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait",src:n(4176).Z,width:"655",height:"756"})),(0,i.kt)("p",null,"Hmm, error. Padahal trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," sudah publik, dan struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," & ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," beserta property-nya juga sudah publik. Tapi masih error."),(0,i.kt)("p",null,"Error ini disebabkan oleh trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," yang belum di-import di crate root (main). Meskipun kita tidak mengakses trait tersebut secara langsung (melainkan via method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," milik struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),"), diharuskan untuk meng-import-nya juga."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Detail error beserta solusi dari error ini sebenarnya bisa dilihat di error message. Bagaimana Rust menginformasikan error sangat luar biasa informatif.")),(0,i.kt)("p",null,"Ok, sekarang ubah isi file ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," menjadi seperti ini, kemudian jalankan ulang program. Hasilnya tidak ada error."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod calculation_spec;\nmod two_dimensional;\n\nuse crate::calculation_spec::Area; // <------- tambahkan statement import module\n\nfn main() {\n let circle_one = two_dimensional::Circle{ radius: 10 };\n println!("circle area: {}", circle_one.calculate_area());\n\n let square_one = two_dimensional::Square{ length: 5 };\n println!("square area: {}", square_one.calculate_area());\n}\n')),(0,i.kt)("p",null,"O iya, ada beberapa hal baru pada penerapan kode di atas, berikut adalah pembahasannya:"),(0,i.kt)("h3",{id:"-method-pow-untuk-operasi-pangkat"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"pow")," untuk operasi pangkat"),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"pow")," adalah item milik tipe data numerik (",(0,i.kt)("inlineCode",{parentName:"p"},"i8"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"i16"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", ...) yang fungsinya untuk operasi pangkat."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"3.pow(2); // ===> 3 pangkat 2\n8.pow(5); // ===> 8 pangkat 5\n")),(0,i.kt)("h3",{id:"-keyword-as-untuk-casting-tipe-data"},"\u25c9 Keyword ",(0,i.kt)("inlineCode",{parentName:"h3"},"as")," untuk casting tipe data"),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"as")," digunakan untuk casting tipe data. Keyword ini bisa diterapkan pada beberapa jenis tipe data, salah satunya adalah semua tipe data numerik."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"1024 as f32; // ===> 1024 dikonversi ke tipe f32, hasinya adalah 1024.0\n3.14 as i32; // ===> 3.14 dikonversi ke tipe i32, hasinya 3 karena ada pembulatan\n")),(0,i.kt)("h2",{id:"a372-trait-sebagai-tipe-parameter"},"A.37.2. Trait sebagai tipe parameter"),(0,i.kt)("p",null,"Trait bisa digunakan sebagai tipe data parameter sebuah fungsi, contoh notasi penulisannya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result(name: String, item: &impl Area) {\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("p",null,"Manfaat penerapan trait sebagai tipe data parameter fungsi adalah saat pemanggilan fungsi, parameter tersebut bisa diisi dengan argument data bertipe apapun dengan catatan tipe dari data tersebut mengimplementasikan trait yang sama dengan yang digunakan pada parameter."),(0,i.kt)("p",null,"Contohnya seperti pada fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_and_print_result")," di atas yang parameter ke-2 bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area"),", nantinya saat fungsi tersebut dipanggil, kita bisa sisipi parameter ke-2 dengan object ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_one")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_two"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let circle_one = two_dimensional::Circle{ radius: 10 };\ncalculate_and_print_result("circle".to_string(), &circle_one);\n\nlet square_one = two_dimensional::Square{ length: 5 };\ncalculate_and_print_result("square".to_string(), &square_one);\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area")," ini tipe data pointer ya, tipe non-pointer-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"impl Area"),". Di sini digunakan tipe data pointer untuk antisipasi ",(0,i.kt)("em",{parentName:"p"},"move semantics")," pada tipe data custom type (borrowing).")),(0,i.kt)("h2",{id:"a373-parameter-bertipe-lebih-dari-1-trait"},"A.37.3. Parameter bertipe lebih dari 1 trait"),(0,i.kt)("p",null,"Bagaimana jika, parameter fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"item")," di atas tipenya bisa lebih dari 1 trait, misalnya trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Circumference"),", apakah bisa? Jawabannya bisa."),(0,i.kt)("p",null,"Mari praktekan. Lakukan modifikasi berikut pada beberapa kode yang telah di tulis."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/calculation_spec.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\n// tambahkan \u2b07\ufe0f\n\npub trait Circumference {\n fn calculate_circumference(&self) -> f64;\n}\n"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/two_dimensional.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\n// tambahkan \u2b07\ufe0f\n\nimpl crate::calculation_spec::Circumference for Circle {\n fn calculate_circumference(&self) -> f64 {\n 2.0 * 3.14 * (self.radius) as f64\n }\n}\n\nimpl crate::calculation_spec::Circumference for Square {\n fn calculate_circumference(&self) -> f64 {\n 4.0 * (self.length) as f64\n }\n}\n"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/main.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// ...\n\n// tambahkan \u2b07\ufe0f\n\nuse crate::calculation_spec::Circumference;\n\n// ...\n\nfn calculate_and_print_result(name: String, item: &(impl Area + Circumference)) {\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')))),(0,i.kt)("p",null,"Dengan perubahan kode yang telah dilakukan di atas, parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"item")," milik fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_and_print_result()")," bisa diisi dengan nilai argument apapun asalkan memenuhi kriteria tipe yang ditentukan, yaitu: haruse meng-implement trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," dan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Circumference"),"."),(0,i.kt)("p",null,"Notasi penulisan tipe-datanya ",(0,i.kt)("inlineCode",{parentName:"p"},"&(impl Trait1 + Trait2 + Trait3 + ...)"),"."),(0,i.kt)("h2",{id:"a374-trait-bound-syntax"},"A.37.4. Trait bound syntax"),(0,i.kt)("p",null,"Penerapan trait sebagai parameter fungsi juga bisa dituliskan dalam notasi yang memanfaatkan generic. Teknik penulisan ini disebut dengan ",(0,i.kt)("em",{parentName:"p"},"trait bound syntax"),"."),(0,i.kt)("p",null,"Contohnya bisa dilihat pada kode berikut. Ada generic bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," yang merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),", kemudian pada definisi parameter ke-2 fungsi (yaitu parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"item"),") tipenya menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"&T"),". Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&T")," di sini adalah ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result2(name: String, item: &T) {\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("p",null,"Jika ada lebih dari satu trait yang digunakan sebagai tipe data paramater, maka penulisannya seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result3(name: String, item: &T) {\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')),(0,i.kt)("p",null,"Satu tambahan contoh lagi untuk ilustrasi yang lebih kompleks:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"fn some_function(t: &T, u: &U) -> i32 {\n // ...\n}\n")),(0,i.kt)("p",null,"Pada contoh di atas fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"some_function()")," memiliki 2 generics param, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"U"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Display")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Clone")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"U")," merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Clone")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Debug"))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai generics dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/generics"},"Generics"))),(0,i.kt)("h2",{id:"a375-trait-where-clause"},"A.37.5. Trait ",(0,i.kt)("inlineCode",{parentName:"h2"},"where")," clause"),(0,i.kt)("p",null,"Ada lagi alternatif penulisan trait bound syntax, yaitu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"where"),". Contoh pengaplikasiannya bisa dilihat pada kode berikut. Semua definisi fungsi di bawah ini adalah ekuivalen."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result4(name: String, item: &T) where T: Area + Circumference {\n println!("{} area: {}", name, item.calculate_area());\n}\n\nfn calculate_and_print_result5(name: String, item: &T)\nwhere\n T: Area + Circumference,\n // ... other generic params if exists\n{\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai generics dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/generics"},"Generics"))),(0,i.kt)("h2",{id:"a376-trait-sebagai-return-type"},"A.37.6. Trait sebagai return type"),(0,i.kt)("p",null,"Trait bisa juga digunakan sebagai tipe data return value. Caranya gunakan notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"impl NamaTrait")," sebagai tipe data."),(0,i.kt)("p",null,"Contohnya bisa dilihat pada kode berikut. Ada dua fungsi baru dideklarasikan:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Fungsi ",(0,i.kt)("inlineCode",{parentName:"li"},"new_circle")," dengan return type adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"impl Area"),", dan data yang dikembalikan adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"li"},"two_dimensional::Circle"),"."),(0,i.kt)("li",{parentName:"ol"},"Fungsi ",(0,i.kt)("inlineCode",{parentName:"li"},"new_square")," dengan return type adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"impl Area + Circumference"),", dan data yang dikembalikan adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"li"},"two_dimensional::Square"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let circle_one = new_circle(5);\n calculate_and_print_result6("circle".to_string(), &circle_one);\n\n let square_one = new_square(10);\n calculate_and_print_result7("square".to_string(), &square_one);\n}\n\nfn new_circle(radius: i32) -> impl Area {\n let data = two_dimensional::Circle{\n radius\n };\n data\n}\n\nfn new_square(length: i32) -> impl Area + Circumference {\n two_dimensional::Square{\n length\n }\n}\n\nfn calculate_and_print_result6(name: String, item: &T)\nwhere\n T: Area,\n{\n println!("{} area: {}", name, item.calculate_area());\n}\n\nfn calculate_and_print_result7(name: String, item: &T)\nwhere\n T: Area + Circumference,\n{\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')),(0,i.kt)("p",null,"Salah satu konsekuensi dalam penerapan trait sebagai return type adalah: tipe data milik nilai yang dikembalikan terdeteksi sebagai tipe trait. Contohnya variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_one")," di atas, tipe data-nya bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle"),", melainkan ",(0,i.kt)("inlineCode",{parentName:"p"},"impl Area"),"."),(0,i.kt)("p",null,"Tipe data aslinya tetap bisa diakses, tapi butuh tambahan effort. Lebih jelasnya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/trait-conversion-from-into"},"Trait \u279c Conversion (From & Into)"),"."),(0,i.kt)("h2",{id:"a377-associated-types-pada-trait"},"A.37.7. ",(0,i.kt)("em",{parentName:"h2"},"Associated types")," pada trait"),(0,i.kt)("p",null,"Associated types adalah tipe data yang didefinisikan di dalam suatu trait. Associated types tidak tidak memiliki tipe data konkret saat didefinisikan, namun ketika trait di-implementasikan maka tipe tersebut harus ditentukan tipe data konkritnya."),(0,i.kt)("p",null,"Lebih jelas silakan perhatikan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"trait Shape {\n type Area;\n\n fn area(&self) -> Self::Area;\n}\n")),(0,i.kt)("p",null,"Pada definisi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," di atas, yang disebut dengan associated types adalah tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," yang definisinya berada dalam block trait. Tipe didefinisikan tanpa assignment operator, jadi tidak ada tipe data konkretnya."),(0,i.kt)("p",null,"Associated types ini sering digunakan pada Rust programming."),(0,i.kt)("p",null,"Lanjut skenario praktek berikutnya. Silakan siapkan package/project baru dengan struktur seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 shape.rs\n \u2502\u2500\u2500\u2500 circle.rs\n \u2502\u2500\u2500\u2500 square.rs\n \u2514\u2500\u2500\u2500 main.rs\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Disiapkan suatu trait bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),".",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Trait ini memiliki satu associated types bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Area"),"."),(0,i.kt)("li",{parentName:"ul"},"Dan memiliki sebuah definisi method header ",(0,i.kt)("inlineCode",{parentName:"li"},"area")," yang gunanya untuk menghitung luas bangun datar (",(0,i.kt)("em",{parentName:"li"},"shape"),")."))),(0,i.kt)("li",{parentName:"ul"},"Disiapkan struct ",(0,i.kt)("inlineCode",{parentName:"li"},"circle::Circle")," yang mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),"."),(0,i.kt)("li",{parentName:"ul"},"Disiapkan struct ",(0,i.kt)("inlineCode",{parentName:"li"},"square::Square")," yang mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/shape.rs"',title:'"src/shape.rs"'},"pub trait Shape {\n type Area;\n\n fn area(&self) -> Self::Area;\n}\n")),(0,i.kt)("p",null,"Trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," di atas spesifikasinya mirip seperti pada contoh sebelumnya, hanya saja kali ini trait-nya di set public agar bisa diakses dari ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," nantinya."),(0,i.kt)("p",null,"Trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," kemudian di-implementasikan ke struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),", kode-nya bisa dilihat berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/circle.rs"',title:'"src/circle.rs"'},"pub struct Circle {\n pub radius: f64,\n}\n\nimpl crate::shape::Shape for Circle {\n type Area = f64;\n\n fn area(&self) -> Self::Area {\n std::f64::consts::PI * self.radius * self.radius\n }\n}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/square.rs"',title:'"src/square.rs"'},"pub struct Square {\n pub side: i64,\n}\n\nimpl crate::shape::Shape for Square {\n type Area = i64;\n\n fn area(&self) -> Self::Area {\n self.side * self.side\n }\n}\n")),(0,i.kt)("p",null,"Bisa dilihat pada kedua implementasi di atas, associated type ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," diisi dengan tipe concrete, yaitu:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"f64")," sebagai tipe concrete ",(0,i.kt)("inlineCode",{parentName:"li"},"circle:Circle:Area")),(0,i.kt)("li",{parentName:"ul"},"Tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"i64")," sebagai tipe concrete ",(0,i.kt)("inlineCode",{parentName:"li"},"square:Square:Area"))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Contoh di atas adalah cara pengaplikasian associated types.")),(0,i.kt)("p",null,"Lalu pada ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs"),", tipe data struct ",(0,i.kt)("inlineCode",{parentName:"p"},"circle::Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"square::Square")," digunakan untuk membuat variabel baru, yang kemudian dari variabel tersebut, method ",(0,i.kt)("inlineCode",{parentName:"p"},".area()")," milik diakses."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod shape;\nmod circle;\nmod square;\n\nuse crate::shape::Shape;\n\nfn main() {\n let obj1 = circle::Circle{ radius: 10.0 };\n println!("area of circle: {:.2}", obj1.area());\n\n let obj2 = square::Square{ side: 10 };\n println!("area of square: {:}", obj2.area());\n}\n')),(0,i.kt)("p",null,"Silakan jalankan program dan lihat hasilnya."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait",src:n(6254).Z,width:"469",height:"130"})),(0,i.kt)("p",null,"O iya, pada ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs"),", module item ",(0,i.kt)("inlineCode",{parentName:"p"},"shape::Shape")," perlu di-import meskipun kita tidak menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"trait")," tersebut secara langsung. Jika tidak di-import, maka method ",(0,i.kt)("inlineCode",{parentName:"p"},".area()")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," tidak bisa diakses."),(0,i.kt)("h2",{id:"a378-attribute-derive"},"A.37.8. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"derive")),(0,i.kt)("p",null,"Ada cara lain untuk mengimplementasikan suatu trait ke dalam tipe data selain dengan menuliskan implementasinya secara eksplist, caranya menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive"),"."),(0,i.kt)("p",null,"Lebih detailnya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/attributes"},"Attributes"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/advanced_traits"},"github.com/novalagung/dasarpemrogramanrust-example/../advanced_traits")),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang trait bounds untuk implementasi method kondisional"),(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang trait overloading")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch10-02-traits.html"},"https://doc.rust-lang.org/book/ch10-02-traits.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/primitive.i32.html"},"https://doc.rust-lang.org/std/primitive.i32.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/fmt/trait.Debug.html"},"https://doc.rust-lang.org/std/fmt/trait.Debug.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/fmt/trait.Display.html"},"https://doc.rust-lang.org/std/fmt/trait.Display.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/string/struct.String.html"},"https://doc.rust-lang.org/std/string/struct.String.html"))))}m.isMDXComponent=!0},4176:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/traits-5-29be804051729f23db8dd64e978e2398.png"},6254:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/traits-6-8165525fc9f8604bf115634eeb974230.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[7988],{3905:(a,e,n)=>{n.d(e,{Zo:()=>d,kt:()=>k});var t=n(7294);function i(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function r(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,t)}return n}function l(a){for(var e=1;e=0||(i[n]=a[n]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(i[n]=a[n])}return i}var s=t.createContext({}),u=function(a){var e=t.useContext(s),n=e;return a&&(n="function"==typeof a?a(e):l(l({},e),a)),n},d=function(a){var e=u(a.components);return t.createElement(s.Provider,{value:e},a.children)},m={inlineCode:"code",wrapper:function(a){var e=a.children;return t.createElement(t.Fragment,{},e)}},o=t.forwardRef((function(a,e){var n=a.components,i=a.mdxType,r=a.originalType,s=a.parentName,d=p(a,["components","mdxType","originalType","parentName"]),o=u(n),k=i,c=o["".concat(s,".").concat(k)]||o[k]||m[k]||r;return n?t.createElement(c,l(l({ref:e},d),{},{components:n})):t.createElement(c,l({ref:e},d))}));function k(a,e){var n=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=n.length,l=new Array(r);l[0]=o;var p={};for(var s in e)hasOwnProperty.call(e,s)&&(p[s]=e[s]);p.originalType=a,p.mdxType="string"==typeof a?a:i,l[1]=p;for(var u=2;u{n.r(e),n.d(e,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>p,toc:()=>u});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:37,title:"A.37. Traits \u279c Advanced",sidebar_label:"A.37. Traits \u279c Advanced"},l=void 0,p={unversionedId:"basic/advanced-traits",id:"basic/advanced-traits",title:"A.37. Traits \u279c Advanced",description:"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya.",source:"@site/docs/basic/advanced-traits.md",sourceDirName:"basic",slug:"/basic/advanced-traits",permalink:"/basic/advanced-traits",draft:!1,tags:[],version:"current",sidebarPosition:37,frontMatter:{sidebar_position:37,title:"A.37. Traits \u279c Advanced",sidebar_label:"A.37. Traits \u279c Advanced"},sidebar:"tutorialSidebar",previous:{title:"A.36. Traits",permalink:"/basic/traits"},next:{title:"A.38. Generics",permalink:"/basic/generics"}},s={},u=[{value:"A.37.1. Membuat custom trait (local trait)",id:"a371-membuat-custom-trait-local-trait",level:2},{value:"\u25c9 Method pow untuk operasi pangkat",id:"-method-pow-untuk-operasi-pangkat",level:3},{value:"\u25c9 Keyword as untuk casting tipe data",id:"-keyword-as-untuk-casting-tipe-data",level:3},{value:"A.37.2. Trait sebagai tipe parameter",id:"a372-trait-sebagai-tipe-parameter",level:2},{value:"A.37.3. Parameter bertipe lebih dari 1 trait",id:"a373-parameter-bertipe-lebih-dari-1-trait",level:2},{value:"A.37.4. Trait bound syntax",id:"a374-trait-bound-syntax",level:2},{value:"A.37.5. Trait where clause",id:"a375-trait-where-clause",level:2},{value:"A.37.6. Trait sebagai return type",id:"a376-trait-sebagai-return-type",level:2},{value:"A.37.7. Associated types pada trait",id:"a377-associated-types-pada-trait",level:2},{value:"A.37.8. Attribute derive",id:"a378-attribute-derive",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:u};function m(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,t.Z)({},d,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya."),(0,i.kt)("p",null,"Pembahasan lanjutan mengenai traits ini cukup panjang. Makin mendekati akhir pembahasan, makin berat topik yang dibahas. Penulis anjurkan jika diperlukan, silakan mengulang-ulang chapter ini, atau bisa lanjut ke chapter berikutnya dan nanti kembali lagi ke sini ketika sudah siap."),(0,i.kt)("h2",{id:"a371-membuat-custom-trait-local-trait"},"A.37.1. Membuat custom trait (local trait)"),(0,i.kt)("p",null,"Pada bagian ini kita akan belajar tentang cara membuat definisi trait di local crate dalam project yang sedang dikerjakan."),(0,i.kt)("p",null,"Masih sama dengan sebelum-sebelumnya, pembelajaran dilakukan dengan praktik. Kita gunakan skenario praktik berikut pada program selanjutnya:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Buat struct bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Circle"),"."),(0,i.kt)("li",{parentName:"ol"},"Buat struct bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Square"),"."),(0,i.kt)("li",{parentName:"ol"},"Buat trait bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Area")," dengan isi satu buah method untuk menghitung luas bangun datar (method ",(0,i.kt)("inlineCode",{parentName:"li"},"calculate_area()"),")."),(0,i.kt)("li",{parentName:"ol"},"Implementasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Area")," ke dua struct tersebut.")),(0,i.kt)("p",null,"Ok, mari mulai praktikkan skenario di atas. Pertama siapkan project dengan struktur berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 calculation_spec.rs\n \u2502\u2500\u2500\u2500 two_dimensional.rs\n \u2514\u2500\u2500\u2500 main.rs\n")),(0,i.kt)("p",null,"Module ",(0,i.kt)("inlineCode",{parentName:"p"},"calculation_spec")," berisi definisi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),". Trait ini punya visibility akses publik, isinya hanya satu buah definisi method header bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()"),". Trait ini nantinya diimplementasikan ke struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan juga ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),", agar nantinya kedua struct tersebut memiliki method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," yang berguna untuk kalkulasi luas bangun datar 2d."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/calculation_spec.rs"',title:'"src/calculation_spec.rs"'},"pub trait Area {\n fn calculate_area(&self) -> f64;\n}\n")),(0,i.kt)("p",null,"Kemudian siapkan file ",(0,i.kt)("inlineCode",{parentName:"p"},"two_dimensional"),", isinya dua buah struct: ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),". Pada file yang sama, siapkan juga block kode implementasi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),". Dengan ini maka kedua struct tersebut wajib untuk memiliki method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," dengan isi adalah operasi perhitungan aritmatika untuk mencari luas bangun datar."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/two_dimensional.rs"',title:'"src/two_dimensional.rs"'},"pub struct Circle {\n pub radius: i32,\n}\n\nimpl crate::calculation_spec::Area for Circle {\n fn calculate_area(&self) -> f64 {\n // PI * (r ^ 2)\n // ada operasi casting ke tipe f64 karena self.radius bertipe i32\n 3.14 * (self.radius.pow(2) as f64)\n }\n}\n\npub struct Square {\n pub length: i32,\n}\n\nimpl crate::calculation_spec::Area for Square {\n fn calculate_area(&self) -> f64 {\n // (s ^ 2)\n // ada operasi casting ke tipe f64 karena self.length bertipe i32\n self.length.pow(2) as f64\n }\n}\n")),(0,i.kt)("p",null,"Bisa dilihat pada kode di atas, deklarasi struct beserta property memiliki visibility publik. Idealnya, saat sturct tersebut digunakan di fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," nantinya tidak akan ada error terkait visibility akses."),(0,i.kt)("p",null,"Selanjutnya, pada file ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," siapkan kode yang isinya registrasi module ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_spec")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"two_dimensional"),", juga definisi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan isi statement pembuatan 2 variabel object untuk masing-masing tipe data struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod calculation_spec;\nmod two_dimensional;\n\nfn main() {\n let circle_one = two_dimensional::Circle{ radius: 10 };\n println!("circle area: {}", circle_one.calculate_area());\n\n let square_one = two_dimensional::Square{ length: 5 };\n println!("square area: {}", square_one.calculate_area());\n}\n')),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," milik object bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," diakses untuk kemudian di-print."),(0,i.kt)("p",null,"Coba jalankan program."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait",src:n(4176).Z,width:"655",height:"756"})),(0,i.kt)("p",null,"Hmm, error. Padahal trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," sudah publik, dan struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," & ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," beserta property-nya juga sudah publik. Tapi masih error."),(0,i.kt)("p",null,"Error ini disebabkan oleh trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," yang belum di-import di crate root (main). Meskipun kita tidak mengakses trait tersebut secara langsung (melainkan via method ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_area()")," milik struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),"), diharuskan untuk meng-import-nya juga."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Detail error beserta solusi dari error ini sebenarnya bisa dilihat di error message. Bagaimana Rust menginformasikan error sangat luar biasa informatif.")),(0,i.kt)("p",null,"Ok, sekarang ubah isi file ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," menjadi seperti ini, kemudian jalankan ulang program. Hasilnya tidak ada error."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod calculation_spec;\nmod two_dimensional;\n\nuse crate::calculation_spec::Area; // <------- tambahkan statement import module\n\nfn main() {\n let circle_one = two_dimensional::Circle{ radius: 10 };\n println!("circle area: {}", circle_one.calculate_area());\n\n let square_one = two_dimensional::Square{ length: 5 };\n println!("square area: {}", square_one.calculate_area());\n}\n')),(0,i.kt)("p",null,"O iya, ada beberapa hal baru pada penerapan kode di atas, berikut adalah pembahasannya:"),(0,i.kt)("h3",{id:"-method-pow-untuk-operasi-pangkat"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"pow")," untuk operasi pangkat"),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"pow")," adalah item milik tipe data numerik (",(0,i.kt)("inlineCode",{parentName:"p"},"i8"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"i16"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", ...) yang fungsinya untuk operasi pangkat."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"3.pow(2); // ===> 3 pangkat 2\n8.pow(5); // ===> 8 pangkat 5\n")),(0,i.kt)("h3",{id:"-keyword-as-untuk-casting-tipe-data"},"\u25c9 Keyword ",(0,i.kt)("inlineCode",{parentName:"h3"},"as")," untuk casting tipe data"),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"as")," digunakan untuk casting tipe data. Keyword ini bisa diterapkan pada beberapa jenis tipe data, salah satunya adalah semua tipe data numerik."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"1024 as f32; // ===> 1024 dikonversi ke tipe f32, hasinya adalah 1024.0\n3.14 as i32; // ===> 3.14 dikonversi ke tipe i32, hasinya 3 karena ada pembulatan\n")),(0,i.kt)("h2",{id:"a372-trait-sebagai-tipe-parameter"},"A.37.2. Trait sebagai tipe parameter"),(0,i.kt)("p",null,"Trait bisa digunakan sebagai tipe data parameter sebuah fungsi, contoh notasi penulisannya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result(name: String, item: &impl Area) {\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("p",null,"Manfaat penerapan trait sebagai tipe data parameter fungsi adalah saat pemanggilan fungsi, parameter tersebut bisa diisi dengan argument data bertipe apapun dengan catatan tipe dari data tersebut mengimplementasikan trait yang sama dengan yang digunakan pada parameter."),(0,i.kt)("p",null,"Contohnya seperti pada fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_and_print_result")," di atas yang parameter ke-2 bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area"),", nantinya saat fungsi tersebut dipanggil, kita bisa sisipi parameter ke-2 dengan object ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_one")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_two"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let circle_one = two_dimensional::Circle{ radius: 10 };\ncalculate_and_print_result("circle".to_string(), &circle_one);\n\nlet square_one = two_dimensional::Square{ length: 5 };\ncalculate_and_print_result("square".to_string(), &square_one);\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area")," ini tipe data pointer ya, tipe non-pointer-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"impl Area"),". Di sini digunakan tipe data pointer untuk antisipasi ",(0,i.kt)("em",{parentName:"p"},"move semantics")," pada tipe data custom type (borrowing).")),(0,i.kt)("h2",{id:"a373-parameter-bertipe-lebih-dari-1-trait"},"A.37.3. Parameter bertipe lebih dari 1 trait"),(0,i.kt)("p",null,"Bagaimana jika, parameter fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"item")," di atas tipenya bisa lebih dari 1 trait, misalnya trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Circumference"),", apakah bisa? Jawabannya bisa."),(0,i.kt)("p",null,"Mari praktekan. Lakukan modifikasi berikut pada beberapa kode yang telah di tulis."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/calculation_spec.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\n// tambahkan \u2b07\ufe0f\n\npub trait Circumference {\n fn calculate_circumference(&self) -> f64;\n}\n"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/two_dimensional.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\n// tambahkan \u2b07\ufe0f\n\nimpl crate::calculation_spec::Circumference for Circle {\n fn calculate_circumference(&self) -> f64 {\n 2.0 * 3.14 * (self.radius) as f64\n }\n}\n\nimpl crate::calculation_spec::Circumference for Square {\n fn calculate_circumference(&self) -> f64 {\n 4.0 * (self.length) as f64\n }\n}\n"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"File ",(0,i.kt)("inlineCode",{parentName:"p"},"src/main.rs")),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// ...\n\n// tambahkan \u2b07\ufe0f\n\nuse crate::calculation_spec::Circumference;\n\n// ...\n\nfn calculate_and_print_result(name: String, item: &(impl Area + Circumference)) {\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')))),(0,i.kt)("p",null,"Dengan perubahan kode yang telah dilakukan di atas, parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"item")," milik fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"calculate_and_print_result()")," bisa diisi dengan nilai argument apapun asalkan memenuhi kriteria tipe yang ditentukan, yaitu: haruse meng-implement trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," dan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Circumference"),"."),(0,i.kt)("p",null,"Notasi penulisan tipe-datanya ",(0,i.kt)("inlineCode",{parentName:"p"},"&(impl Trait1 + Trait2 + Trait3 + ...)"),"."),(0,i.kt)("h2",{id:"a374-trait-bound-syntax"},"A.37.4. Trait bound syntax"),(0,i.kt)("p",null,"Penerapan trait sebagai parameter fungsi juga bisa dituliskan dalam notasi yang memanfaatkan generic. Teknik penulisan ini disebut dengan ",(0,i.kt)("em",{parentName:"p"},"trait bound syntax"),"."),(0,i.kt)("p",null,"Contohnya bisa dilihat pada kode berikut. Ada generic bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," yang merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Area"),", kemudian pada definisi parameter ke-2 fungsi (yaitu parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"item"),") tipenya menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"&T"),". Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&T")," di sini adalah ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"&impl Area"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result2(name: String, item: &T) {\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("p",null,"Jika ada lebih dari satu trait yang digunakan sebagai tipe data paramater, maka penulisannya seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result3(name: String, item: &T) {\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')),(0,i.kt)("p",null,"Satu tambahan contoh lagi untuk ilustrasi yang lebih kompleks:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"fn some_function(t: &T, u: &U) -> i32 {\n // ...\n}\n")),(0,i.kt)("p",null,"Pada contoh di atas fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"some_function()")," memiliki 2 generics param, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"U"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Display")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Clone")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"U")," merepresentasikan trait ",(0,i.kt)("inlineCode",{parentName:"li"},"Clone")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Debug"))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai generics dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/generics"},"Generics"))),(0,i.kt)("h2",{id:"a375-trait-where-clause"},"A.37.5. Trait ",(0,i.kt)("inlineCode",{parentName:"h2"},"where")," clause"),(0,i.kt)("p",null,"Ada lagi alternatif penulisan trait bound syntax, yaitu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"where"),". Contoh pengaplikasiannya bisa dilihat pada kode berikut. Semua definisi fungsi di bawah ini adalah ekuivalen."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn calculate_and_print_result4(name: String, item: &T) where T: Area + Circumference {\n println!("{} area: {}", name, item.calculate_area());\n}\n\nfn calculate_and_print_result5(name: String, item: &T)\nwhere\n T: Area + Circumference,\n // ... other generic params if exists\n{\n println!("{} area: {}", name, item.calculate_area());\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai generics dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/generics"},"Generics"))),(0,i.kt)("h2",{id:"a376-trait-sebagai-return-type"},"A.37.6. Trait sebagai return type"),(0,i.kt)("p",null,"Trait bisa juga digunakan sebagai tipe data return value. Caranya gunakan notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"impl NamaTrait")," sebagai tipe data."),(0,i.kt)("p",null,"Contohnya bisa dilihat pada kode berikut. Ada dua fungsi baru dideklarasikan:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Fungsi ",(0,i.kt)("inlineCode",{parentName:"li"},"new_circle")," dengan return type adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"impl Area"),", dan data yang dikembalikan adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"li"},"two_dimensional::Circle"),"."),(0,i.kt)("li",{parentName:"ol"},"Fungsi ",(0,i.kt)("inlineCode",{parentName:"li"},"new_square")," dengan return type adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"impl Area + Circumference"),", dan data yang dikembalikan adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"li"},"two_dimensional::Square"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let circle_one = new_circle(5);\n calculate_and_print_result6("circle".to_string(), &circle_one);\n\n let square_one = new_square(10);\n calculate_and_print_result7("square".to_string(), &square_one);\n}\n\nfn new_circle(radius: i32) -> impl Area {\n let data = two_dimensional::Circle{\n radius\n };\n data\n}\n\nfn new_square(length: i32) -> impl Area + Circumference {\n two_dimensional::Square{\n length\n }\n}\n\nfn calculate_and_print_result6(name: String, item: &T)\nwhere\n T: Area,\n{\n println!("{} area: {}", name, item.calculate_area());\n}\n\nfn calculate_and_print_result7(name: String, item: &T)\nwhere\n T: Area + Circumference,\n{\n println!("{} area: {}", name, item.calculate_area());\n println!("{} circumference: {}", name, item.calculate_circumference());\n}\n')),(0,i.kt)("p",null,"Salah satu konsekuensi dalam penerapan trait sebagai return type adalah: tipe data milik nilai yang dikembalikan terdeteksi sebagai tipe trait. Contohnya variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"circle_one")," di atas, tipe data-nya bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle"),", melainkan ",(0,i.kt)("inlineCode",{parentName:"p"},"impl Area"),"."),(0,i.kt)("p",null,"Tipe data aslinya tetap bisa diakses, tapi butuh tambahan effort. Lebih jelasnya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/trait-conversion-from-into"},"Trait \u279c Conversion (From & Into)"),"."),(0,i.kt)("h2",{id:"a377-associated-types-pada-trait"},"A.37.7. ",(0,i.kt)("em",{parentName:"h2"},"Associated types")," pada trait"),(0,i.kt)("p",null,"Associated types adalah tipe data yang didefinisikan di dalam suatu trait. Associated types tidak tidak memiliki tipe data konkret saat didefinisikan, namun ketika trait di-implementasikan maka tipe tersebut harus ditentukan tipe data konkritnya."),(0,i.kt)("p",null,"Lebih jelas silakan perhatikan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"trait Shape {\n type Area;\n\n fn area(&self) -> Self::Area;\n}\n")),(0,i.kt)("p",null,"Pada definisi trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," di atas, yang disebut dengan associated types adalah tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," yang definisinya berada dalam block trait. Tipe didefinisikan tanpa assignment operator, jadi tidak ada tipe data konkretnya."),(0,i.kt)("p",null,"Associated types ini sering digunakan pada Rust programming."),(0,i.kt)("p",null,"Lanjut skenario praktek berikutnya. Silakan siapkan package/project baru dengan struktur seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash",metastring:'title="package source code structure"',title:'"package',source:!0,code:!0,'structure"':!0},"my_package\n\u2502\u2500\u2500\u2500 Cargo.toml\n\u2514\u2500\u2500\u2500 src\n \u2502\u2500\u2500\u2500 shape.rs\n \u2502\u2500\u2500\u2500 circle.rs\n \u2502\u2500\u2500\u2500 square.rs\n \u2514\u2500\u2500\u2500 main.rs\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Disiapkan suatu trait bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),".",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Trait ini memiliki satu associated types bernama ",(0,i.kt)("inlineCode",{parentName:"li"},"Area"),"."),(0,i.kt)("li",{parentName:"ul"},"Dan memiliki sebuah definisi method header ",(0,i.kt)("inlineCode",{parentName:"li"},"area")," yang gunanya untuk menghitung luas bangun datar (",(0,i.kt)("em",{parentName:"li"},"shape"),")."))),(0,i.kt)("li",{parentName:"ul"},"Disiapkan struct ",(0,i.kt)("inlineCode",{parentName:"li"},"circle::Circle")," yang mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),"."),(0,i.kt)("li",{parentName:"ul"},"Disiapkan struct ",(0,i.kt)("inlineCode",{parentName:"li"},"square::Square")," yang mengadopsi trait ",(0,i.kt)("inlineCode",{parentName:"li"},"shape::Shape"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/shape.rs"',title:'"src/shape.rs"'},"pub trait Shape {\n type Area;\n\n fn area(&self) -> Self::Area;\n}\n")),(0,i.kt)("p",null,"Trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," di atas spesifikasinya mirip seperti pada contoh sebelumnya, hanya saja kali ini trait-nya di set public agar bisa diakses dari ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," nantinya."),(0,i.kt)("p",null,"Trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Shape")," kemudian di-implementasikan ke struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square"),", kode-nya bisa dilihat berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/circle.rs"',title:'"src/circle.rs"'},"pub struct Circle {\n pub radius: f64,\n}\n\nimpl crate::shape::Shape for Circle {\n type Area = f64;\n\n fn area(&self) -> Self::Area {\n std::f64::consts::PI * self.radius * self.radius\n }\n}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/square.rs"',title:'"src/square.rs"'},"pub struct Square {\n pub side: i64,\n}\n\nimpl crate::shape::Shape for Square {\n type Area = i64;\n\n fn area(&self) -> Self::Area {\n self.side * self.side\n }\n}\n")),(0,i.kt)("p",null,"Bisa dilihat pada kedua implementasi di atas, associated type ",(0,i.kt)("inlineCode",{parentName:"p"},"Area")," diisi dengan tipe concrete, yaitu:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"f64")," sebagai tipe concrete ",(0,i.kt)("inlineCode",{parentName:"li"},"circle:Circle:Area")),(0,i.kt)("li",{parentName:"ul"},"Tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"i64")," sebagai tipe concrete ",(0,i.kt)("inlineCode",{parentName:"li"},"square:Square:Area"))),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Contoh di atas adalah cara pengaplikasian associated types.")),(0,i.kt)("p",null,"Lalu pada ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs"),", tipe data struct ",(0,i.kt)("inlineCode",{parentName:"p"},"circle::Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"square::Square")," digunakan untuk membuat variabel baru, yang kemudian dari variabel tersebut, method ",(0,i.kt)("inlineCode",{parentName:"p"},".area()")," milik diakses."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="src/main.rs"',title:'"src/main.rs"'},'mod shape;\nmod circle;\nmod square;\n\nuse crate::shape::Shape;\n\nfn main() {\n let obj1 = circle::Circle{ radius: 10.0 };\n println!("area of circle: {:.2}", obj1.area());\n\n let obj2 = square::Square{ side: 10 };\n println!("area of square: {:}", obj2.area());\n}\n')),(0,i.kt)("p",null,"Silakan jalankan program dan lihat hasilnya."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait",src:n(6254).Z,width:"469",height:"130"})),(0,i.kt)("p",null,"O iya, pada ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs"),", module item ",(0,i.kt)("inlineCode",{parentName:"p"},"shape::Shape")," perlu di-import meskipun kita tidak menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"trait")," tersebut secara langsung. Jika tidak di-import, maka method ",(0,i.kt)("inlineCode",{parentName:"p"},".area()")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Circle")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Square")," tidak bisa diakses."),(0,i.kt)("h2",{id:"a378-attribute-derive"},"A.37.8. Attribute ",(0,i.kt)("inlineCode",{parentName:"h2"},"derive")),(0,i.kt)("p",null,"Ada cara lain untuk mengimplementasikan suatu trait ke dalam tipe data selain dengan menuliskan implementasinya secara eksplist, caranya menggunakan attribute ",(0,i.kt)("inlineCode",{parentName:"p"},"derive"),"."),(0,i.kt)("p",null,"Lebih detailnya dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/attributes"},"Attributes"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/advanced_traits"},"github.com/novalagung/dasarpemrogramanrust-example/../advanced_traits")),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang trait bounds untuk implementasi method kondisional"),(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang trait overloading"),(0,i.kt)("li",{parentName:"ul"},"orphan rules")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch10-02-traits.html"},"https://doc.rust-lang.org/book/ch10-02-traits.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/primitive.i32.html"},"https://doc.rust-lang.org/std/primitive.i32.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/fmt/trait.Debug.html"},"https://doc.rust-lang.org/std/fmt/trait.Debug.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/fmt/trait.Display.html"},"https://doc.rust-lang.org/std/fmt/trait.Display.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/string/struct.String.html"},"https://doc.rust-lang.org/std/string/struct.String.html"))))}m.isMDXComponent=!0},4176:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/traits-5-29be804051729f23db8dd64e978e2398.png"},6254:(a,e,n)=>{n.d(e,{Z:()=>t});const t=n.p+"assets/images/traits-6-8165525fc9f8604bf115634eeb974230.png"}}]); \ No newline at end of file diff --git a/assets/js/7794a932.101ed56d.js b/assets/js/7794a932.101ed56d.js new file mode 100644 index 00000000..befe953e --- /dev/null +++ b/assets/js/7794a932.101ed56d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8358],{3905:(e,a,n)=>{n.d(a,{Zo:()=>u,kt:()=>s});var t=n(7294);function i(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(i[n]=e[n]);return i}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=t.createContext({}),o=function(e){var a=t.useContext(d),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},u=function(e){var a=o(e.components);return t.createElement(d.Provider,{value:a},e.children)},k={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,i=e.mdxType,r=e.originalType,d=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),m=o(n),s=i,c=m["".concat(d,".").concat(s)]||m[s]||k[s]||r;return n?t.createElement(c,l(l({ref:a},u),{},{components:n})):t.createElement(c,l({ref:a},u))}));function s(e,a){var n=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=m;var p={};for(var d in a)hasOwnProperty.call(a,d)&&(p[d]=a[d]);p.originalType=e,p.mdxType="string"==typeof e?e:i,l[1]=p;for(var o=2;o{n.r(a),n.d(a,{assets:()=>d,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>p,toc:()=>o});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:40,title:"A.40. Tipe Data \u279c Result",sidebar_label:"A.40. Tipe Data \u279c Result"},l=void 0,p={unversionedId:"basic/result-type",id:"basic/result-type",title:"A.40. Tipe Data \u279c Result",description:"Chapter ini membahas tentang tipe data Result, yaitu tipe data yang digunakan untuk menampung nilai yang isinya bisa berupa penanda operasi sukses (Ok) dan data, atau error (Err) beserta keterangan errornya.",source:"@site/docs/basic/result-type.md",sourceDirName:"basic",slug:"/basic/result-type",permalink:"/basic/result-type",draft:!1,tags:[],version:"current",sidebarPosition:40,frontMatter:{sidebar_position:40,title:"A.40. Tipe Data \u279c Result",sidebar_label:"A.40. Tipe Data \u279c Result"},sidebar:"tutorialSidebar",previous:{title:"A.39. Tipe Data \u279c Option",permalink:"/basic/option-type"},next:{title:"A.41. Operator ?",permalink:"/basic/operator-tanda-tanya"}},d={},o=[{value:"A.40.1. Konsep Result",id:"a401-konsep-result",level:2},{value:"A.40.2. Pattern matching pada tipe Result",id:"a402-pattern-matching-pada-tipe-result",level:2},{value:"\u25c9 Tips pattern matching",id:"-tips-pattern-matching",level:3},{value:"A.40.3. Method tipe data Result",id:"a403-method-tipe-data-result",level:2},{value:"\u25c9 Method is_ok & unwrap",id:"-method-is_ok--unwrap",level:3},{value:"\u25c9 Method as_ref",id:"-method-as_ref",level:3},{value:"\u25c9 Method is_err & err",id:"-method-is_err--err",level:3},{value:"\u25c9 Method ok",id:"-method-ok",level:3},{value:"\u25c9 Method unwrap_or_default",id:"-method-unwrap_or_default",level:3},{value:"\u25c9 Method unwrap_or",id:"-method-unwrap_or",level:3},{value:"\u25c9 Method unwrap_or_else",id:"-method-unwrap_or_else",level:3},{value:"A.40.4. Operator ? pada tipe Result",id:"a404-operator--pada-tipe-result",level:2},{value:"A.40.5. Error handling",id:"a405-error-handling",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],u={toc:o};function k(e){let{components:a,...r}=e;return(0,i.kt)("wrapper",(0,t.Z)({},u,r,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini membahas tentang tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),", yaitu tipe data yang digunakan untuk menampung nilai yang isinya bisa berupa penanda operasi sukses (",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),") dan data, atau error (",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),") beserta keterangan errornya."),(0,i.kt)("p",null,"Rust menyediakan panic-level error, tapi penggunaannya untuk menandai operasi error sangat tidak dianjurkan. Selain itu, Rust tidak mengenal konsep ",(0,i.kt)("em",{parentName:"p"},"exception"),"."),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," ini adalah tipe yang paling umum dan direkomendasikan untuk digunakan dalam penanganan error."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai penanganan error dibahas di chapter ",(0,i.kt)("a",{parentName:"p",href:"#"},"Error \u279c Recoverable Error & Error Handling"))),(0,i.kt)("h2",{id:"a401-konsep-result"},"A.40.1. Konsep ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," adalah enum dengan isi 2 buah enum value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Result::Ok")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok"),"), digunakan untuk menandai bahwa data isinya adalah kabar baik (oke / mantab / jos / sukses)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Result::Err")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Err"),"), digunakan untuk menandai bawah data berisi kabar buruk.")),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"E")," merupakan parameter generic. Lebih jelasnya mengenai generic dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics"),"."))),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," memiliki notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," digunakan pada enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," digunakan enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),"."),(0,i.kt)("p",null,"Cara penerapan tipe data ini bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(Debug)]\nenum MathError {\n DivisionByZero,\n InfinityNumber,\n OtherError,\n}\n\nfn main() {\n let result1 = divider(10.0, 5.0);\n println!("result: {:?}", result1);\n\n let result2: Result = divider(10.0, 0.0);\n println!("result: {:?}", result2);\n}\n\nfn divider(a: f64, b: f64) -> Result {\n if b == 0.0 {\n return Err(MathError::DivisionByZero);\n }\n\n let result = a / b;\n return Ok(result);\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," di atas tugasnya adalah melakukan operasi aritmatika pembagian angka numerik ",(0,i.kt)("inlineCode",{parentName:"p"},"f64"),", parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"a")," dibagi ",(0,i.kt)("inlineCode",{parentName:"p"},"b"),"."),(0,i.kt)("p",null,"Pada fungsi tersebut terdapat pengecekan apabila nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", maka yang dikembalikan adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," berisi pesan error, selainnya maka hasil operasi pembagian dikembalikan dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),"."),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Dari tipe data yang digunakan nantinya bisa diprediksi pasti akan ada 2 potensi value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Return value adalah enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Err"),", muncul ketika nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"0")),(0,i.kt)("li",{parentName:"ul"},"Return value adalah nilai hasil numerik yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok"))),(0,i.kt)("p",null,"Output program di atas saat di-run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Result type",src:n(1463).Z,width:"454",height:"112"})),(0,i.kt)("h2",{id:"a402-pattern-matching-pada-tipe-result"},"A.40.2. Pattern matching pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Dalam penerapannya, ketika ada data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," artinya data tersebut berpotensi untuk berisi nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", pasti antara 2 nilai tersebut."),(0,i.kt)("p",null,"Umumnya penggunaan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," selalu diikuti dengan pattern matching menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Selain itu keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," sebenarnya juga bisa diterapkan pada pattern matching tipe data ini, namun kurang dianjurkan."),(0,i.kt)("p",null,"Mari kita praktikkan. Ubah isi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(2565).Z,width:"450",height:"89"})),(0,i.kt)("p",null,"Bisa dilihat pada kode di atas mudahnya pengambilan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"m")," dari ",(0,i.kt)("inlineCode",{parentName:"p"},"Err(m)")," dan juga ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," dari ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok(r)"),". Penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk seleksi kondisi biasa disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"pattern matching")," dan teknik ini sangat fleksibel dan advance."),(0,i.kt)("p",null,"Sebagai contoh, dengan penerapan match yang seperti ini kita bisa meng-handle 5 skenario seleksi kondisi:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(MathError::DivisionByZero) => println!("ERROR! unable to divide number by 0"),\n Err(MathError::InfinityNumber) => println!("ERROR! result is infinity number (\u221e)"),\n Err(_) => println!("ERROR! unknown error"),\n Ok(2.0) => println!("the result is 2"),\n Ok(x) => println!("result: {x:.2}"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::DivisionByZero)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! unable to divide number by 0"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-2: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::InfinityNumber)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! result is infinity number (\u221e)"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-3: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::DivisionByZero)")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::InfinityNumber)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! unknown error"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-4: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok(2.0)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"the result is 2"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-5: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok(2.0)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"result: {x:.2}"),".")),(0,i.kt)("h3",{id:"-tips-pattern-matching"},"\u25c9 Tips pattern matching"),(0,i.kt)("p",null,"Silakan perhatikan kode yang sudah kita praktikkan berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n}\n')),(0,i.kt)("p",null,"Penerapan pattern matching seperti contoh di atas memiliki konsekuensi, yaitu variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," hanya bisa diakses pada block ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok(r)")," saja."),(0,i.kt)("p",null,"Adakalanya kita butuh untuk mengeluarkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," ke luar block. Hal seperti ini mudah untuk dilakukan, dan ada beberapa cara yang bisa dipilih, namun menurut penulis yang paling elegan adalah cara berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result: f64 = match divider(10.0, 5.0) {\n Err(m) => {\n println!("ERROR! {:?}", m);\n 0.0\n },\n Ok(r) => r,\n };\n\n println!("result: {:?}", result);\n}\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10.0, 5.0)")," mengembalikan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Data tersebut digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," seperti biasa. Namun pada contoh di atas ada yang berbeda, yaitu return value dari statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," ditampung ke variabel (",(0,i.kt)("inlineCode",{parentName:"p"},"result"),")."),(0,i.kt)("p",null,"Isi dari pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," sendiri ada dua:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(m)")," match, error di-print kemudian nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"0.0")," dijadikan return statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),"."),(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok")," match, data ",(0,i.kt)("inlineCode",{parentName:"li"},"r")," dijadikan return value statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),".")),(0,i.kt)("p",null,"Dengan penerapan pattern matching seperti di atas, maka variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," akan selalu berisi data hasil operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10.0, 5.0)"),". Dengan pengecualian ketika ada error, pesan errornya dimunculkan kemudian hasil operasi pembagian di-set sebagai ",(0,i.kt)("inlineCode",{parentName:"p"},"0.0"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h2",{id:"a403-method-tipe-data-result"},"A.40.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("h3",{id:"-method-is_ok--unwrap"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_ok")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap")),(0,i.kt)("p",null,"Isi dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok")," bisa diakses tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan cara memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Sebelum mengakses method tersebut sangat dianjurkan untuk mengecek apakah data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok atau tidak"),", karena jika data adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," menghasilkan error."),(0,i.kt)("p",null,"Pengecekan nilai ok atau tidak bisa dilakukan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_ok"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nif result.is_ok() {\n let number = result.unwrap();\n println!("result: {}", number);\n // result: 2\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Result type",src:n(5086).Z,width:"447",height:"88"})),(0,i.kt)("h3",{id:"-method-as_ref"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"as_ref")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," digunakan untuk mengakses reference ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," pada ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Method ini sering kali dibutuhkan untuk menghindari terjadinya ",(0,i.kt)("em",{parentName:"p"},"move semantics")," pada owner data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),"."),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," mengembalikan data dalam tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result<&T, &E>"),". Jadi reference yang dipinjam bukan milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),"-nya melainkan milik ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let result: Result = divider(10.0, 0.0);\nlet result_borrow: Result<&f64, &MathError> = result.as_ref();\n")),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,i.kt)("em",{parentName:"p"},"move semantics")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/ownership#a334-copy-semantics-vs-move-semantics"},"Ownership"))),(0,i.kt)("h3",{id:"-method-is_err--err"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_err")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"err")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"err")," mengembalikan data dalam tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),". Pada pengaksesan method ini, pastikan untuk mengecek apakah ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," berisi data error atau ok dengan via method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_err"),". Selain itu, wajib untuk menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," sebelum method ",(0,i.kt)("inlineCode",{parentName:"p"},"err")," agar ownership data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," tidak berpindah (",(0,i.kt)("em",{parentName:"p"},"move semantics"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nif result.is_err() {\n let err = result.as_ref().err();\n let message = err.unwrap();\n println!("error: {:?}", message);\n // error: DivisionByZero\n}\n')),(0,i.kt)("h3",{id:"-method-ok"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"ok")),(0,i.kt)("p",null,"Aturan yang sama juga berlaku pada pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"ok")," yang mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),". Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," harus diakses terlebih dahulu sebelum memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"ok")," agar tidak terjadi ",(0,i.kt)("em",{parentName:"p"},"move semantics"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nif result.is_ok() {\n let data = result.as_ref().ok();\n let number = data.unwrap();\n println!("result: {:?}", number);\n // result: 2\n}\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_default"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_default")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or_default();\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah argument pemanggilan method tersebut."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or(0.0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_else"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_else")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah hasil eksekusi closure yang disisipkan saat memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_else"),". Contoh pengaplikasiannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or_else(|_| 0.0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Closure harus dalam notasi ",(0,i.kt)("inlineCode",{parentName:"p"},"FnOnce(E) -> T")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," pada konteks ini adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"f64"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai closure dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/closures"},"Closures"),".")),(0,i.kt)("h2",{id:"a404-operator--pada-tipe-result"},"A.40.4. Operator ",(0,i.kt)("inlineCode",{parentName:"h2"},"?")," pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," bisa digunakan pada operator ",(0,i.kt)("inlineCode",{parentName:"p"},"?"),". Penjelasannya ada di chapter terpisah di ",(0,i.kt)("a",{parentName:"p",href:"/basic/operator-tanda-tanya"},"Operator ?"),"."),(0,i.kt)("h2",{id:"a405-error-handling"},"A.40.5. Error handling"),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," banyak digunakan pada fungsi-fungsi yang disediakan Rust standard library, selain itu tipe tersebut juga akan sering kita gunakan dalam ",(0,i.kt)("em",{parentName:"p"},"real life")," project."),(0,i.kt)("p",null,"Tipe ini dimanfaatkan untuk error handling di Rust. Lebih jelasnya mengenai topik tersebut dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#"},"Error \u279c Recoverable Error & Error Handling"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/result_type"},"github.com/novalagung/dasarpemrogramanrust-example/../result_type")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/operator-tanda-tanya"},"Operator ?")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#"},"Error \u279c Recoverable Error & Error Handling"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/result/index.html"},"https://doc.rust-lang.org/std/result/index.html"))))}k.isMDXComponent=!0},1463:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAABwCAIAAAAL5EeiAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCAyMi41IChXaW5kb3dzKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjItMTItMTlUMTg6MDI6MzArMDc6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIyLTEyLTIxVDE1OjAzOjM4KzA3OjAwIiB4b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IoivSkKIoiPSmKokhPiqIo0pOiKIoiPSmKokhPiqIo0pOiKIr0pCiKuhL9DzCR83RW6DQ7AAAAAElFTkSuQmCC"}}]); \ No newline at end of file diff --git a/assets/js/7794a932.6d4b5171.js b/assets/js/7794a932.6d4b5171.js deleted file mode 100644 index b0a5fcb4..00000000 --- a/assets/js/7794a932.6d4b5171.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8358],{3905:(e,a,n)=>{n.d(a,{Zo:()=>u,kt:()=>s});var t=n(7294);function i(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(i[n]=e[n]);return i}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=t.createContext({}),o=function(e){var a=t.useContext(d),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},u=function(e){var a=o(e.components);return t.createElement(d.Provider,{value:a},e.children)},k={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,i=e.mdxType,r=e.originalType,d=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),m=o(n),s=i,c=m["".concat(d,".").concat(s)]||m[s]||k[s]||r;return n?t.createElement(c,l(l({ref:a},u),{},{components:n})):t.createElement(c,l({ref:a},u))}));function s(e,a){var n=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=m;var p={};for(var d in a)hasOwnProperty.call(a,d)&&(p[d]=a[d]);p.originalType=e,p.mdxType="string"==typeof e?e:i,l[1]=p;for(var o=2;o{n.r(a),n.d(a,{assets:()=>d,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>p,toc:()=>o});var t=n(7462),i=(n(7294),n(3905));const r={sidebar_position:40,title:"A.40. Tipe Data \u279c Result",sidebar_label:"A.40. Tipe Data \u279c Result"},l=void 0,p={unversionedId:"basic/result-type",id:"basic/result-type",title:"A.40. Tipe Data \u279c Result",description:"Chapter ini membahas tentang tipe data Result. Tipe data ini digunakan untuk menampung nilai hasil suatu proses yang isinya adalah bisa sukses (Ok) atau error (Err).",source:"@site/docs/basic/result-type.md",sourceDirName:"basic",slug:"/basic/result-type",permalink:"/basic/result-type",draft:!1,tags:[],version:"current",sidebarPosition:40,frontMatter:{sidebar_position:40,title:"A.40. Tipe Data \u279c Result",sidebar_label:"A.40. Tipe Data \u279c Result"},sidebar:"tutorialSidebar",previous:{title:"A.39. Tipe Data \u279c Option",permalink:"/basic/option-type"},next:{title:"A.41. Pattern Matching",permalink:"/basic/pattern-matching"}},d={},o=[{value:"A.40.1. Konsep Result",id:"a401-konsep-result",level:2},{value:"A.40.2. Pattern matching pada tipe Result",id:"a402-pattern-matching-pada-tipe-result",level:2},{value:"\u25c9 Tips pattern matching",id:"-tips-pattern-matching",level:3},{value:"A.40.3. Method tipe data Result",id:"a403-method-tipe-data-result",level:2},{value:"\u25c9 Method is_ok & unwrap",id:"-method-is_ok--unwrap",level:3},{value:"\u25c9 Method as_ref",id:"-method-as_ref",level:3},{value:"\u25c9 Method is_err & err",id:"-method-is_err--err",level:3},{value:"\u25c9 Method ok",id:"-method-ok",level:3},{value:"\u25c9 Method unwrap_or_default",id:"-method-unwrap_or_default",level:3},{value:"\u25c9 Method unwrap_or",id:"-method-unwrap_or",level:3},{value:"\u25c9 Method unwrap_or_else",id:"-method-unwrap_or_else",level:3},{value:"A.40.4. Error handling tipe Result",id:"a404-error-handling-tipe-result",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],u={toc:o};function k(e){let{components:a,...r}=e;return(0,i.kt)("wrapper",(0,t.Z)({},u,r,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Chapter ini membahas tentang tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Tipe data ini digunakan untuk menampung nilai hasil suatu proses yang isinya adalah bisa sukses (",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),") atau error (",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),")."),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," biasa digunakan untuk menampung hasil eksekusi proses dan error handling."),(0,i.kt)("h2",{id:"a401-konsep-result"},"A.40.1. Konsep ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," adalah enum dengan isi 2 buah enum value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Result::Ok")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok"),"), digunakan untuk menandai bahwa data isinya adalah kabar baik (oke / mantab / jos / sukses)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Result::Err")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Err"),"), digunakan untuk menandai bawah data berisi kabar buruk.")),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"E")," merupakan parameter generic. Lebih jelasnya mengenai generic dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics"),"."))),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," memiliki notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," digunakan pada enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," digunakan enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),"."),(0,i.kt)("p",null,"Cara penerapan tipe data ini bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(Debug)]\nenum MathError {\n DivisionByZero,\n InfinityNumber,\n OtherError,\n}\n\nfn main() {\n let result1 = divider(10.0, 5.0);\n println!("result: {:?}", result1);\n\n let result2: Result = divider(10.0, 0.0);\n println!("result: {:?}", result2);\n}\n\nfn divider(a: f64, b: f64) -> Result {\n if b == 0.0 {\n return Err(MathError::DivisionByZero);\n }\n\n let result = a / b;\n return Ok(result);\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," di atas tugasnya adalah melakukan operasi aritmatika pembagian angka numerik ",(0,i.kt)("inlineCode",{parentName:"p"},"f64"),", parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"a")," dibagi ",(0,i.kt)("inlineCode",{parentName:"p"},"b"),"."),(0,i.kt)("p",null,"Pada fungsi tersebut terdapat pengecekan apabila nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", maka yang dikembalikan adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," berisi pesan error, selainnya maka hasil operasi pembagian dikembalikan dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),"."),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Dari tipe data yang digunakan nantinya bisa diprediksi pasti akan ada 2 potensi value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Return value adalah enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Err"),", muncul ketika nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"0")),(0,i.kt)("li",{parentName:"ul"},"Return value adalah nilai hasil numerik yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok"))),(0,i.kt)("p",null,"Output program di atas saat di-run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Result type",src:n(1463).Z,width:"454",height:"112"})),(0,i.kt)("h2",{id:"a402-pattern-matching-pada-tipe-result"},"A.40.2. Pattern matching pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Dalam penerapannya, ketika ada data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," artinya data tersebut berpotensi untuk berisi nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", pasti antara 2 nilai tersebut."),(0,i.kt)("p",null,"Umumnya penggunaan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," selalu diikuti dengan pattern matching menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Selain itu keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," sebenarnya juga bisa diterapkan pada pattern matching tipe data ini, namun kurang dianjurkan."),(0,i.kt)("p",null,"Mari kita praktikkan. Ubah isi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(2565).Z,width:"450",height:"89"})),(0,i.kt)("p",null,"Bisa dilihat pada kode di atas mudahnya pengambilan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"m")," dari ",(0,i.kt)("inlineCode",{parentName:"p"},"Err(m)")," dan juga ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," dari ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok(r)"),". Penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk seleksi kondisi biasa disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"pattern matching")," dan teknik ini sangat fleksibel dan advance."),(0,i.kt)("p",null,"Sebagai contoh, dengan penerapan match yang seperti ini kita bisa meng-handle 5 skenario seleksi kondisi:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(MathError::DivisionByZero) => println!("ERROR! unable to divide number by 0"),\n Err(MathError::InfinityNumber) => println!("ERROR! result is infinity number (\u221e)"),\n Err(_) => println!("ERROR! unknown error"),\n Ok(2.0) => println!("the result is 2"),\n Ok(x) => println!("result: {x:.2}"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::DivisionByZero)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! unable to divide number by 0"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-2: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::InfinityNumber)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! result is infinity number (\u221e)"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-3: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Err")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::DivisionByZero)")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(MathError::InfinityNumber)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"ERROR! unknown error"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-4: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok(2.0)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"the result is 2"),"."),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-5: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok(2.0)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"result: {x:.2}"),".")),(0,i.kt)("h3",{id:"-tips-pattern-matching"},"\u25c9 Tips pattern matching"),(0,i.kt)("p",null,"Silakan perhatikan kode yang sudah kita praktikkan berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nmatch result {\n Err(m) => println!("ERROR! {:?}", m),\n Ok(r) => println!("result: {r:.2}"),\n}\n')),(0,i.kt)("p",null,"Penerapan pattern matching seperti contoh di atas memiliki konsekuensi, yaitu variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," hanya bisa diakses pada block ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok(r)")," saja."),(0,i.kt)("p",null,"Adakalanya kita butuh untuk mengeluarkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"r")," ke luar block. Hal seperti ini mudah untuk dilakukan, dan ada beberapa cara yang bisa dipilih, namun menurut penulis yang paling elegan adalah cara berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result: f64 = match divider(10.0, 5.0) {\n Err(m) => {\n println!("ERROR! {:?}", m);\n 0.0\n },\n Ok(r) => r,\n };\n\n println!("result: {:?}", result);\n}\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10.0, 5.0)")," mengembalikan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Data tersebut digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," seperti biasa. Namun pada contoh di atas ada yang berbeda, yaitu return value dari statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," ditampung ke variabel (",(0,i.kt)("inlineCode",{parentName:"p"},"result"),")."),(0,i.kt)("p",null,"Isi dari pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," sendiri ada dua:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Err(m)")," match, error di-print kemudian nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"0.0")," dijadikan return statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),"."),(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Ok")," match, data ",(0,i.kt)("inlineCode",{parentName:"li"},"r")," dijadikan return value statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),".")),(0,i.kt)("p",null,"Dengan penerapan pattern matching seperti di atas, maka variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," akan selalu berisi data hasil operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10.0, 5.0)"),". Dengan pengecualian ketika ada error, pesan errornya dimunculkan kemudian hasil operasi pembagian di-set sebagai ",(0,i.kt)("inlineCode",{parentName:"p"},"0.0"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h2",{id:"a403-method-tipe-data-result"},"A.40.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("h3",{id:"-method-is_ok--unwrap"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_ok")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap")),(0,i.kt)("p",null,"Isi dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok")," bisa diakses tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan cara memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Sebelum mengakses method tersebut sangat dianjurkan untuk mengecek apakah data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok atau tidak"),", karena jika data adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," menghasilkan error."),(0,i.kt)("p",null,"Pengecekan nilai ok atau tidak bisa dilakukan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_ok"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nif result.is_ok() {\n let number = result.unwrap();\n println!("result: {}", number);\n // result: 2\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Result type",src:n(5086).Z,width:"447",height:"88"})),(0,i.kt)("h3",{id:"-method-as_ref"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"as_ref")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," digunakan untuk mengakses reference ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E")," pada ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Method ini sering kali dibutuhkan untuk menghindari terjadinya ",(0,i.kt)("em",{parentName:"p"},"move semantics")," pada owner data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),"."),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," mengembalikan data dalam tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result<&T, &E>"),". Jadi reference yang dipinjam bukan milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),"-nya melainkan milik ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"E"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let result: Result = divider(10.0, 0.0);\nlet result_borrow: Result<&f64, &MathError> = result.as_ref();\n")),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,i.kt)("em",{parentName:"p"},"move semantics")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/ownership#a334-copy-semantics-vs-move-semantics"},"Ownership"))),(0,i.kt)("h3",{id:"-method-is_err--err"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_err")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"err")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"err")," mengembalikan data dalam tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Err"),". Pada pengaksesan method ini, pastikan untuk mengecek apakah ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," berisi data error atau ok dengan via method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_err"),". Selain itu, wajib untuk menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," sebelum method ",(0,i.kt)("inlineCode",{parentName:"p"},"err")," agar ownership data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," tidak berpindah (",(0,i.kt)("em",{parentName:"p"},"move semantics"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nif result.is_err() {\n let err = result.as_ref().err();\n let message = err.unwrap();\n println!("error: {:?}", message);\n // error: DivisionByZero\n}\n')),(0,i.kt)("h3",{id:"-method-ok"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"ok")),(0,i.kt)("p",null,"Aturan yang sama juga berlaku pada pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"ok")," yang mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),". Method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_ref")," harus diakses terlebih dahulu sebelum memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"ok")," agar tidak terjadi ",(0,i.kt)("em",{parentName:"p"},"move semantics"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 5.0);\nif result.is_ok() {\n let data = result.as_ref().ok();\n let number = data.unwrap();\n println!("result: {:?}", number);\n // result: 2\n}\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_default"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_default")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or_default();\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah argument pemanggilan method tersebut."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or(0.0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_else"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_else")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Ok"),", namun jika data isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Err")," maka yang dikembalikan adalah hasil eksekusi closure yang disisipkan saat memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_else"),". Contoh pengaplikasiannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10.0, 0.0);\nlet number = result.unwrap_or_else(|_| 0.0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Closure harus dalam notasi ",(0,i.kt)("inlineCode",{parentName:"p"},"FnOnce(E) -> T")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," pada konteks ini adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"f64"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai closure dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/closures"},"Closures"),".")),(0,i.kt)("h2",{id:"a404-error-handling-tipe-result"},"A.40.4. Error handling tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Result")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," banyak digunakan pada fungsi milik Rust standard library, dan kita selaku programmer pastinya juga akan menggunakannya dalam ",(0,i.kt)("em",{parentName:"p"},"real life")," project."),(0,i.kt)("p",null,"Tipe ini dipakai salah satunya untuk manajemen error. Lebih jelasnya mengenai topik tersebut dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/error-handling-panic"},"Error Handling & Panic")),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/result_type"},"github.com/novalagung/dasarpemrogramanrust-example/../result_type")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures"))),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Operator ",(0,i.kt)("inlineCode",{parentName:"li"},"?"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/result/index.html"},"https://doc.rust-lang.org/std/result/index.html"))))}k.isMDXComponent=!0},1463:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAABwCAIAAAAL5EeiAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCAyMi41IChXaW5kb3dzKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjItMTItMTlUMTg6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DRKTyu1z+JkQEl0UhS1fnr6s/d+2TPcMe8O//zxvcFlMPOHu/Z5e+7dmoG/mEBRFLUMPSmKoijSk6IoivSkKIoiPSmKokhPiqIo0pOiKIoiPSmKokhPiqIo0pOiKIr0pCiKuhL9DzCR83RW6DQ7AAAAAElFTkSuQmCC"}}]); \ No newline at end of file diff --git a/assets/js/82a9b669.c1b472d9.js b/assets/js/82a9b669.fc893c5a.js similarity index 98% rename from assets/js/82a9b669.c1b472d9.js rename to assets/js/82a9b669.fc893c5a.js index 0427990c..73111f35 100644 --- a/assets/js/82a9b669.c1b472d9.js +++ b/assets/js/82a9b669.fc893c5a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[3257],{3905:(e,a,t)=>{t.d(a,{Zo:()=>m,kt:()=>c});var n=t(7294);function i(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function r(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a=0||(i[t]=e[t]);return i}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=n.createContext({}),o=function(e){var a=n.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},m=function(e){var a=o(e.components);return n.createElement(p.Provider,{value:a},e.children)},A={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},k=n.forwardRef((function(e,a){var t=e.components,i=e.mdxType,r=e.originalType,p=e.parentName,m=d(e,["components","mdxType","originalType","parentName"]),k=o(t),c=i,u=k["".concat(p,".").concat(c)]||k[c]||A[c]||r;return t?n.createElement(u,l(l({ref:a},m),{},{components:t})):n.createElement(u,l({ref:a},m))}));function c(e,a){var t=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var r=t.length,l=new Array(r);l[0]=k;var d={};for(var p in a)hasOwnProperty.call(a,p)&&(d[p]=a[p]);d.originalType=e,d.mdxType="string"==typeof e?e:i,l[1]=d;for(var o=2;o{t.r(a),t.d(a,{assets:()=>p,contentTitle:()=>l,default:()=>A,frontMatter:()=>r,metadata:()=>d,toc:()=>o});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:49,title:"A.49. Trait \u279c Iterator",sidebar_label:"A.49. Trait \u279c Iterator"},l=void 0,d={unversionedId:"basic/trait-iterator",id:"basic/trait-iterator",title:"A.49. Trait \u279c Iterator",description:"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator.",source:"@site/docs/basic/trait-iterator.md",sourceDirName:"basic",slug:"/basic/trait-iterator",permalink:"/basic/trait-iterator",draft:!1,tags:[],version:"current",sidebarPosition:49,frontMatter:{sidebar_position:49,title:"A.49. Trait \u279c Iterator",sidebar_label:"A.49. Trait \u279c Iterator"},sidebar:"tutorialSidebar",previous:{title:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)",permalink:"/basic/trait-function"},next:{title:"A.50. Attributes",permalink:"/basic/attributes"}},p={},o=[{value:"A.49.1. Iterator & IntoIterator",id:"a491-iterator--intoiterator",level:2},{value:"\u25c9 Trait Iterator & IntoIterator",id:"-trait-iterator--intoiterator",level:3},{value:"\u25c9 Struct Iterator",id:"-struct-iterator",level:3},{value:"A.49.2. Pemanfaatan tipe data Iterator",id:"a492-pemanfaatan-tipe-data-iterator",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2",level:3},{value:"A.49.3. Method tipe data Iterator",id:"a493-method-tipe-data-iterator",level:2},{value:"\u25c9 Method iter, iter_mut, into_iter",id:"-method-iter-iter_mut-into_iter",level:3},{value:"\u25c9 Method collect",id:"-method-collect",level:3},{value:"\u25c9 Method map",id:"-method-map",level:3},{value:"\u25c9 Method rev",id:"-method-rev",level:3},{value:"\u25c9 Method filter",id:"-method-filter",level:3},{value:"\u25c9 Method cloned",id:"-method-cloned",level:3},{value:"\u25c9 Method copied",id:"-method-copied",level:3},{value:"\u25c9 Method cmp",id:"-method-cmp",level:3},{value:"\u25c9 Method count",id:"-method-count",level:3},{value:"\u25c9 Method eq, ne, gt, ge, lt, le",id:"-method-eq-ne-gt-ge-lt-le",level:3},{value:"\u25c9 Method find",id:"-method-find",level:3},{value:"\u25c9 Method last",id:"-method-last",level:3},{value:"\u25c9 Method fold",id:"-method-fold",level:3},{value:"\u25c9 Method inspect",id:"-method-inspect",level:3},{value:"\u25c9 Method sum",id:"-method-sum",level:3},{value:"\u25c9 Method reduce",id:"-method-reduce",level:3},{value:"\u25c9 Method min, max",id:"-method-min-max",level:3},{value:"A.49.4. Method lainnya",id:"a494-method-lainnya",level:2},{value:"\u25c9 Method sort milik Vec<T>",id:"-method-sort-milik-vect",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function A(e){let{components:a,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},m,r,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator."),(0,i.kt)("h2",{id:"a491-iterator--intoiterator"},"A.49.1. ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")," & ",(0,i.kt)("inlineCode",{parentName:"h2"},"IntoIterator")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," adalah sebuah nama yang dipakai sebagai nama module item dalam ",(0,i.kt)("strong",{parentName:"p"},"Rust Standard Library")," maupun ",(0,i.kt)("strong",{parentName:"p"},"Rust Core Library"),", digunakan untuk iterasi data dan operasi lain yang berhubungan dengannya."),(0,i.kt)("p",null,"Iterator sendiri merupakan istilah untuk object atau trait yang bisa diiterasi, baik menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in")," ataupun menggunakan method iterator seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each")," (yang juga akan kita bahas di sini)."),(0,i.kt)("h3",{id:"-trait-iterator--intoiterator"},"\u25c9 Trait ",(0,i.kt)("inlineCode",{parentName:"h3"},"Iterator")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"IntoIterator")),(0,i.kt)("p",null,"Dalam perulangan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", tipe data variabel yang digunakan harus memiliki trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),". Jika tidak, pasti error muncul."),(0,i.kt)("p",null,"Tipe data slice di Rust by default mengadopsi trait bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"IntoIterator"),", yang trait ini digunakan untuk konversi data bertipe slice ke bentuk iterator."),(0,i.kt)("p",null,"Dalam praktiknya, tidak perlu mengakses method tertentu untuk mendapatkan object iterator suatu data. Cukup gunakan variabel tipe data slice pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", maka proses konversi ke bentuk iterator akan dilakukan oleh Rust secara otomatis dibalik layar."),(0,i.kt)("p",null,"Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// array\nlet data_arr = ["a", "b", "c", "d"];\nfor e in &data_arr {\n print!("{e:?} ")\n}\n\nprintln!();\n\n// vector\nlet data_vec = vec!["a", "b", "c", "d"];\nfor e in &data_vec {\n print!("{e:?} ")\n}\n\nprintln!();\n\n// slice\nlet data_vec = vec!["a", "b", "c", "d"];\nlet data_slice_vec = &data_vec[..];\nfor e in data_slice_vec {\n print!("{e:?} ")\n}\n')),(0,i.kt)("p",null,"Dianjurkan untuk selalu menggunakan teknik ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing")," dalam penggunaan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in")," pada tipe data yang karakteristiknya adalah ",(0,i.kt)("a",{parentName:"p",href:"/basic/ownership#a344-copy-semantics-vs-move-semantics"},"Move Semantics"),", hal ini karena dalam penerapan keyword tersebut, terjadi proses konversi tipe data dengan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"IntoIterator")," ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),"."),(0,i.kt)("p",null,"Jika data yang digunakan bukan data borrow, maka pasti owner berpindah."),(0,i.kt)("h3",{id:"-struct-iterator"},"\u25c9 Struct ",(0,i.kt)("inlineCode",{parentName:"h3"},"Iterator")),(0,i.kt)("p",null,"Selain trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", ada juga tipe data struct bernama sama, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),". Perbedaan antara trait vs struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," adalah tipe struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," memiliki beberapa method untuk keperluan iterasi object. Jadi dengan memanfaatkan method-method tersebut, kita bisa melakukan iterasi data dan operasi sejenisnya tanpa menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),"."),(0,i.kt)("p",null,"Semua tipe data slice bisa dikonversi ke tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", caranya dengan mengakses method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," (atau method ",(0,i.kt)("inlineCode",{parentName:"p"},"chars")," khusus untuk tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),")."),(0,i.kt)("p",null,"Dari object iterator tersebut, perulangan bisa dilakukan via keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", atau dengan memanfaatkan method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),". Perbedaannya pada iterasi menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),", block perulangan dituliskan dalam bentuk closure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// array\nlet data_arr = ["a", "b", "c", "d"];\nlet iterator_arr = data_arr.iter();\niterator_arr.for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// vector\nlet data_vec = vec!["a", "b", "c", "d"];\ndata_vec.iter().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// slice from vector\nlet data_vec = vec!["a", "b", "c", "d"];\nlet data_slice_vec = &data_vec[..];\ndata_slice_vec.iter().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// slice from String\nlet data_str = "abcd".to_string();\nlet data_borrow_str = &data_str;\ndata_borrow_str.chars().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n')),(0,i.kt)("p",null,"Bisa dilihat pada contoh di atas, data slice diambil objek Iterator-nya menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," (atau ",(0,i.kt)("inlineCode",{parentName:"p"},"chars")," khusus untuk tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"), kemudian di-iterasi menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(3753).Z,width:"456",height:"149"})),(0,i.kt)("h2",{id:"a492-pemanfaatan-tipe-data-iterator"},"A.49.2. Pemanfaatan tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," memiliki cukup banyak method untuk keperluan operasi data iterator, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"map"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"filter"),", dan lainnya."),(0,i.kt)("h3",{id:"-praktik-ke-1"},"\u25c9 Praktik ke-1"),(0,i.kt)("p",null,"Sebagai contoh, kita akan buat sebuah program sederhana yang melakukan operasi kuadrat pada elemen tiap-tiap array."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_arr = [1, 3, 5];\n\nlet doubles: Vec = data_arr\n .iter()\n .map(|e| e * e)\n .collect();\n\nprintln!("{doubles:?}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(9339).Z,width:"447",height:"121"})),(0,i.kt)("p",null,"Penjelasan:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"data_arr")," yang bertipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"[i32; 3]")," dikonversi ke tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"iter"),"."),(0,i.kt)("li",{parentName:"ol"},"Object ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," kemudian di-iterasi menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"map")," dan nilai baliknya dijadikan ",(0,i.kt)("em",{parentName:"li"},"replacement")," data elemen tersebut."),(0,i.kt)("li",{parentName:"ol"},"Object ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," kemudian di-collect data-nya ke bentuk ",(0,i.kt)("inlineCode",{parentName:"li"},"Vec")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"collect"),".")),(0,i.kt)("h3",{id:"-praktik-ke-2"},"\u25c9 Praktik ke-2"),(0,i.kt)("p",null,"Contoh lain penerapan method iterator bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec!["1", "2", "3", "4", "a"];\n\nlet numbers: Vec = data_vec\n .iter()\n .map(|e| -> i32 {\n match e.parse::() {\n Ok(n) => n,\n Err(_) => 0,\n }\n })\n .filter(|e| *e > 0 && *e % 2 == 0)\n .rev()\n .collect::>();\n\nprintln!("{numbers:?}");\n')),(0,i.kt)("p",null,"Program di atas melakukan beberapa hal:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," yang merupakan koleksi string di-konversi menjadi object ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter"),".")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Kemudian method ",(0,i.kt)("inlineCode",{parentName:"p"},"map")," diakses. Setiap elemen ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," di-iterasi, kemudian dikonversi dari ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", lalu dijadikan ",(0,i.kt)("em",{parentName:"p"},"replacement")," data elemen tersebut. Jika proses konversi gagal, maka angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," digunakan sebagai data element tersebut."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},'["1", "2", "3", "4", "a"]')," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[1, 2, 3, 4, 0]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Selanjutnya, dilakukan proses filtering menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"filter")," dengan kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"*e > 0 && *e % 2 == 0")," yang kurang lebih artinya, jika nilai ",(0,i.kt)("em",{parentName:"p"},"dereference")," ",(0,i.kt)("inlineCode",{parentName:"p"},"e")," lebih besar dari ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," dan nilai tersebut adalah genap, maka filter bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true"),"."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},"[1, 2, 3, 4, 0]")," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[2, 4]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Kemudian, data kolektif tersebut dibalik urutan elemennya menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"rev"),"."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},"[2, 4]")," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[4, 2]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Terakhir data di-collect menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," dengan ditentukan tipe data masing-masing elemen adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),"."))),(0,i.kt)("p",null,"Hasilnya ketika di run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(6644).Z,width:"447",height:"118"})),(0,i.kt)("h2",{id:"a493-method-tipe-data-iterator"},"A.49.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")),(0,i.kt)("h3",{id:"-method-iter-iter_mut-into_iter"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"iter"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"iter_mut"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"into_iter")),(0,i.kt)("p",null,"Ketiga method ini berguna untuk konversi data slice ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", perbedannya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang isinya adalah reference (",(0,i.kt)("inlineCode",{parentName:"p"},"&T"),") setiap element. Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\ndata_vec.iter().for_each(|d| {\n println!("{}", *d * 2)\n});\n\nfor d in &data_vec {\n println!("{}", *d * 2)\n}\n'))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter_mut")," mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang isinya adalah mutable reference (",(0,i.kt)("inlineCode",{parentName:"p"},"&mut T"),") setiap element. Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut data_vec = vec![1, 2, 3, 4];\n\ndata_vec.iter_mut().for_each(|d| {\n *d = *d * 2;\n});\nprintln!("{:?}", data_vec);\n\nfor d in &mut data_vec {\n *d = *d * 2;\n}\nprintln!("{:?}", data_vec);\n'))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"into_iter")," mengkonversi data slice ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," (",(0,i.kt)("em",{parentName:"p"},"move semantics"),")."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\ndata_vec.into_iter().for_each(|d| {\n println!("{}", d * 2)\n});\n\n// statement di bawah ini menghasilkan error,\n// karena ownership `data_vec` telah berpindah setelah method `into_iter` dipanggil\n\n// println!("{}", data_vec)\n')))),(0,i.kt)("h3",{id:"-method-collect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"collect")),(0,i.kt)("p",null,"Method ini digunakan untuk ",(0,i.kt)("em",{parentName:"p"},"collecting")," data Iterator ke bentuk tertentu. Contoh penerapannya bisa dilihat pada kode berikut ini."),(0,i.kt)("p",null,"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," yang merupakan vektor bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec")," dikonversi ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," kemudian di-collect datanya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec: Vec = vec![1, 2, 3, 4];\n\nlet result: Vec<&i32> = data_vec.iter().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," menghasilkan object ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang menampung reference ",(0,i.kt)("inlineCode",{parentName:"p"},"&T")," setiap element slice. Hal ini membuat penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," menghasilkan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec<&i32>")," (bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),")."),(0,i.kt)("h3",{id:"-method-map"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"map")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"map")," digunakan untuk mapping element setiap data iterator ke nilai baru."),(0,i.kt)("p",null,"Sebelumnya kita telah mempelajari method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," yang keduanya jika dikombinasikan dan digunakan pada tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec")," hasilnya adalah data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec<&i32>"),". Dengan memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"map"),", tipe data setiap element bisa di-mapping ke nilai baru dengan tipe data berbeda, misalnya menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec: Vec = vec![1, 2, 3, 4];\n\nlet result1: Vec<&i32> = data_vec.iter().collect();\nprintln!("{:?}", result1);\n// [1, 2, 3, 4]\n\nlet result2: Vec = data_vec\n .iter()\n .map(|d: &i32| -> i32 { *d })\n .collect();\nprintln!("{:?}", result2);\n// [1, 2, 3, 4]\n')),(0,i.kt)("p",null,"Contoh lainnya bisa dilihat pada ",(0,i.kt)("em",{parentName:"p"},"section")," ",(0,i.kt)("a",{parentName:"p",href:"/basic/trait-iterator#a482-pemanfaatan-tipe-data-iterator"},"A.49.2. Pemanfaatan tipe data ",(0,i.kt)("inlineCode",{parentName:"a"},"Iterator")),", di situ terdapat operasi mapping data slice numerik ke bentuk yang sama tapi nilai setiap element adalah kuadrat, dan ke bentuk lain dengan tipe data berbeda."),(0,i.kt)("h3",{id:"-method-rev"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"rev")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rev")," kependekan dari ",(0,i.kt)("em",{parentName:"p"},"reverse"),", digunakan untuk membalikan urutan data slice."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nprintln!("{:?}", data_vec);\n// [1, 2, 3, 4]\n\nlet result: Vec<&i32> = data_vec.iter().rev().collect();\nprintln!("{:?}", result);\n// [4, 3, 2, 1]\n')),(0,i.kt)("h3",{id:"-method-filter"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"filter")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"filter")," digunakan untuk memfilter element data slice. Data kolektif diiterasi kemudian dicek menggunakan closure, jika nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," maka elemen tersebut masuk dalam dalam hasil filter, selebihnya maka dianggap tidak memenuhi kondisi filter dan elemen di-",(0,i.kt)("em",{parentName:"p"},"exclude"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet odd: Vec<&i32> = data_vec.iter().filter(|d| *d % 2 != 0).collect();\nprintln!("odd numbers: {:?}", odd);\n// odd numbers: [1, 3]\n\nlet even: Vec<&i32> = data_vec.iter().filter(|d| *d % 2 == 0).collect();\nprintln!("even numbers: {:?}", even);\n// odd numbers: [2, 4]\n')),(0,i.kt)("h3",{id:"-method-cloned"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"cloned")),(0,i.kt)("p",null,"Digunakan untuk ",(0,i.kt)("em",{parentName:"p"},"cloning")," data slice secara keseluruhan tanpa mengubah tipe data. Hasilnya adalah data dengan skema sama persis (dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),") tapi berbeda owner."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: Vec = data_vec.iter().cloned().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("h3",{id:"-method-copied"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"copied")),(0,i.kt)("p",null,"Secara ",(0,i.kt)("em",{parentName:"p"},"high-level")," ",(0,i.kt)("inlineCode",{parentName:"p"},"copied")," menghasilkan output yang sama dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"cloned"),". Namun jika dibahas dari sisi management memory-nya, ada perbedaan yang cukup besar."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: Vec = data_vec.iter().copied().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai clone vs copy akan dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/copy-clone-move-drop"},"Copy, Clone, Move, Drop"))),(0,i.kt)("h3",{id:"-method-cmp"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"cmp")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"cmp")," kependekan dari ",(0,i.kt)("em",{parentName:"p"},"compare"),", digunakan untuk membandingkan 2 buah data iterasi dengan nilai balik bertipe enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering"),". Dari tipe data enum tersebut nantinya bisa dicek apakah 2 buah data slice tersebut sama (secara ",(0,i.kt)("em",{parentName:"p"},"Lexicographical"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().cmp(data_vec2.iter());\nprintln!("{:?}", result.is_eq());\n// true\n')),(0,i.kt)("p",null,"Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering")," memiliki beberapa method, salah satunya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"is_eq")," yang mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika dua buah data slice tersebut adalah sama."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering")," akan dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/enum-ordering"},"Enum Ordering"))),(0,i.kt)("h3",{id:"-method-count"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"count")),(0,i.kt)("p",null,"Digunakan untuk melihat size dari elemen Iterator."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet length = data_vec.iter().count();\nprintln!("{:?}", length);\n// 4\n')),(0,i.kt)("h3",{id:"-method-eq-ne-gt-ge-lt-le"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"eq"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"ne"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"gt"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"ge"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"lt"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"le")),(0,i.kt)("p",null,"6 Method ini digunakan untuk komparasi dua buah slice. Penggunakan 6 method ini merupakan alternatif selain menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"cmp"),"."),(0,i.kt)("p",null,"Sebagai contoh, penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"eq")," berikut untuk untuk mengecek apakah 2 buah data slice adalah sama (secara ",(0,i.kt)("em",{parentName:"p"},"Lexicographical"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().eq(data_vec2.iter());\nprintln!("{:?}", result);\n// true\n')),(0,i.kt)("p",null,"Kode di atas adalah ekuivalen dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().cmp(data_vec2.iter());\nprintln!("{:?}", result.is_eq());\n// true\n')),(0,i.kt)("p",null,"Berikut merupakan kegunaan tiap-tiap method di atas:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"eq")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"ne")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"not equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"gt")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"greater than lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"ge")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"greater than or equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"lt")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"lower than lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"le")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"lower than or equal lexicographical comparison"))),(0,i.kt)("h3",{id:"-method-find"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"find")),(0,i.kt)("p",null,"Digunakan untuk mencari apakah suatu elemen ada atau tidak dengan kondisi pencarian dituliskan dalam bentuk closure. Nilai balik method ini bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("p",null,"Sebagai contoh, perhatikan kode berikut. Method ",(0,i.kt)("inlineCode",{parentName:"p"},"find")," digunakan untuk mencari elemen yang nilainya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"4"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result = match data_vec.iter().find(|d: &&i32| **d == 4) {\n Some(d) => *d,\n None => 0\n};\nprintln!("{:?}", result);\n// 4\n')),(0,i.kt)("h3",{id:"-method-last"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"last")),(0,i.kt)("p",null,"Digunakan untuk mengambil elemen terakhir data Iterator. Method ",(0,i.kt)("inlineCode",{parentName:"p"},"last")," ini mengembalikan nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: &i32 = data_vec.iter().last().unwrap();\nprintln!("{:?}", result);\n// 4\n')),(0,i.kt)("p",null,"Satu hal yang unik perihal notasi closure method ",(0,i.kt)("inlineCode",{parentName:"p"},"find"),", parameter closure adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&&T"),". Dari tipe tersebut, untuk mengambil ",(0,i.kt)("em",{parentName:"p"},"underlying value")," gunakan operator ",(0,i.kt)("em",{parentName:"p"},"dereference")," dua kali. Contohnya pada kode di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"d")," bertipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&&i32"),", untuk mengambil nilai sebenarnya digunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"**d"),"."),(0,i.kt)("h3",{id:"-method-fold"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"fold")),(0,i.kt)("p",null,"Method ini digunakan untuk mengkonversi setiap element ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," menjadi sebuah akumulator yang direpresentasikan oleh 1 buah variabel."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"konsep ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," milik Rust mirip seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"reduce")," pada bahasa pemrograman lain")),(0,i.kt)("p",null,"Pada contoh berikut, kita coba terapkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," untuk grouping data vector ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," menjadi 1 buah data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"NumberCategory"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Data numerik genap elemen ",(0,i.kt)("inlineCode",{parentName:"li"},"data_vec")," masuk ke property ",(0,i.kt)("inlineCode",{parentName:"li"},"even")," milik ",(0,i.kt)("inlineCode",{parentName:"li"},"NumberCategory"),"."),(0,i.kt)("li",{parentName:"ul"},"Data numerik ganjil elemen ",(0,i.kt)("inlineCode",{parentName:"li"},"data_vec")," masuk ke property ",(0,i.kt)("inlineCode",{parentName:"li"},"odd")," milik ",(0,i.kt)("inlineCode",{parentName:"li"},"NumberCategory"),".")),(0,i.kt)("p",null,"Dalam penerapannnya, parameter pertama method ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," diisi dengan ",(0,i.kt)("em",{parentName:"p"},"initial value"),", dan parameter ke-2 isinya closure untuk akumulasi data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(Debug)]\nstruct NumberCategory {\n even: Vec,\n odd: Vec,\n}\n\nlet data_vec = vec![1, 2, 3, 4];\n\nlet data_grouped = data_vec.iter().fold(\n NumberCategory{ even: Vec::new(), odd: Vec::new() }, \n |mut group, each| {\n if *each % 2 == 0 {\n group.even.push(*each)\n } else {\n group.odd.push(*each)\n }\n group\n }\n);\n\nprintln!("{:?}", data_grouped);\n')),(0,i.kt)("p",null,"Pada kode di atas, data ",(0,i.kt)("inlineCode",{parentName:"p"},"each")," di-cek nilainya, jika genap maka dimasukan dalam ",(0,i.kt)("inlineCode",{parentName:"p"},"group.even"),", dan sisanya masuk ",(0,i.kt)("inlineCode",{parentName:"p"},"group.odd"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(2986).Z,width:"454",height:"122"})),(0,i.kt)("h3",{id:"-method-inspect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"inspect")),(0,i.kt)("p",null,"Biasanya digunakan sewaktu debugging, untuk inspeksi flow pemanggilan method-method milik Iterator. Contoh penerapannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet result = data_vec.iter()\n .cloned()\n .inspect(|x| println!("about to filter: {x}"))\n .filter(|x| x % 2 == 0)\n .inspect(|x| println!("made it through filter: {x}"))\n .fold(0, |sum, i| sum + i);\n\nprintln!("sum: {:?}", result);\n// sum: 10\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(4695).Z,width:"449",height:"222"})),(0,i.kt)("h3",{id:"-method-sum"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"sum")),(0,i.kt)("p",null,"Digunakan untuk mencari total/summary data slice numerik."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1.1, 2.2, 3.3, 4.5];\nlet result: f64 = data_vec.iter().sum();\nprintln!("sum: {:?}", result);\n// sum: 11.1\n')),(0,i.kt)("h3",{id:"-method-reduce"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"reduce")),(0,i.kt)("p",null,"Method ini digunakan untuk mengiterasi setiap element array dengan setiap iterasi menampilkan data element ke-",(0,i.kt)("inlineCode",{parentName:"p"},"n")," dan element ke-",(0,i.kt)("inlineCode",{parentName:"p"},"n+1"),"."),(0,i.kt)("p",null,"Contoh penerapan sederhananya pada pencarian angka numerik terbesar, yang kode-nya bisa dilihat berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet max_number = data_vec.iter().reduce(|left, right| {\n print!("left ({left}) vs right ({right})");\n\n if *left >= *right { \n println!(" -> left ({left}) is greater");\n left\n } else {\n println!(" -> right ({right}) is greater");\n right\n }\n});\n\nmatch max_number {\n Some(n) => println!("max_number: {:?}", n),\n None => println!("no data found"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(1611).Z,width:"449",height:"170"})),(0,i.kt)("h3",{id:"-method-min-max"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"min"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"max")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"min")," digunakan untuk mencari elemen terkecil pada Iterator, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"max")," untuk mencari elemen terbesar. Keduanya mengembalikan nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet min = data_vec.iter().min().unwrap();\nprintln!("min: {min}");\n// min: 1\n\nlet max = data_vec.iter().max().unwrap();\nprintln!("max: {max}");\n// max: 4\n')),(0,i.kt)("h2",{id:"a494-method-lainnya"},"A.49.4. Method lainnya"),(0,i.kt)("h3",{id:"-method-sort-milik-vect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"sort")," milik ",(0,i.kt)("inlineCode",{parentName:"h3"},"Vec")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"sort")," bukanlah property Iterator, melainkan milik tipe data vector. Kegunaan method ini adalah untuk sorting urutan elemen vector."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut data_vec = vec![2, 3, 1, 4];\nprintln!("before: {data_vec:?}");\n// before: [2, 3, 1, 4]\n\ndata_vec.sort();\nprintln!("after: {data_vec:?}");\n// after: [1, 2, 3, 4]\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/trait_iterator"},"github.com/novalagung/dasarpemrogramanrust-example/../trait_iterator")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/vector"},"Vector"))),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Desugar iterator")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/iter/index.html"},"https://doc.rust-lang.org/std/iter/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/iter/trait.Iterator.html"},"https://doc.rust-lang.org/std/iter/trait.Iterator.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://becomebetterprogrammer.com/rust-iter-vs-iter_mut-vs-into_iter/"},"https://becomebetterprogrammer.com/rust-iter-vs-iter_mut-vs-into_iter/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://blog.thoughtram.io/iterators-in-rust/"},"https://blog.thoughtram.io/iterators-in-rust/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://blog.logrocket.com/rust-iterators-closures-deep-dive/"},"https://blog.logrocket.com/rust-iterators-closures-deep-dive/"))))}A.isMDXComponent=!0},3753:(e,a,t)=>{t.d(a,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgA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y2G5qa4FEgFZGxA8mGE/GlrZgzn1yR17MA8l/xC8fe7Vg7l2QNBQaK+hm3gwFzrsntSD+aoisrnAPXowrwkIHsywjYZu4MG8xGH3jB7MrqkvHsyVAoIHM3TW0J4ezKscds/nwTwfK5Vyhx7MVQKCBzP01dDuHszaQtjdeTAHX1fJcZibu57Cg3l9QJTd8GCG1hraz4M53dHvyoM5sgIUlqPvyoO5VkDwYIbOc/l+HszJou/bg7nqeugZPJjrrYdaewgezGiodYlsMw/mKpbDZ/JgTlbuHj2YVwYED2bolYf2AsthAnKcgODBjIYeV0WxHCYg2wcED2Y0dKdgOUxADhIQPJjRUAAAQEMBANBQAAA0FAAADd0vvBgMAGjogTQ08vcFADQUDS053Q/eCAGABRp6eczu5ZqGfXfTsdA7NvBNSxpYjAYgnhev/CKgdHbRyvchqFLepNbisHErVPT3BQA01KShv65qdvv/RUtk79jJuCJtYid78SoaGp09mFpPpyo0qbVpaMrfFwDQUIuGehqS8cYZ/v2Sm2uL3hOKhkZnF91+G5nUpv19AQANXaqhines7aXhqho6+oS3MKnN+fsCABq6RENz3rHfc24PtfPQny8tTGqz/r4AgIYu11DBO3banPHMUTXUWeP8ZdNQbzm1xKTWek+pghgDABoa/F/wjvVFafir0PJ8KnRMZZMaKtg/l5nUoqEA0EFDAQAADQUAOJyGindluC8DAGgoAAAaCgAAaCgAABoKAICGAgCgoQAAgIYCAKChAABoKAAAGgoAgIYCAAAaCgCAhgIAoKEAAKfnf8MuIu6Tpsk4AAAAAElFTkSuQmCC"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[3257],{3905:(e,a,t)=>{t.d(a,{Zo:()=>m,kt:()=>c});var n=t(7294);function i(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function r(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a=0||(i[t]=e[t]);return i}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=n.createContext({}),o=function(e){var a=n.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},m=function(e){var a=o(e.components);return n.createElement(p.Provider,{value:a},e.children)},A={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},k=n.forwardRef((function(e,a){var t=e.components,i=e.mdxType,r=e.originalType,p=e.parentName,m=d(e,["components","mdxType","originalType","parentName"]),k=o(t),c=i,u=k["".concat(p,".").concat(c)]||k[c]||A[c]||r;return t?n.createElement(u,l(l({ref:a},m),{},{components:t})):n.createElement(u,l({ref:a},m))}));function c(e,a){var t=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var r=t.length,l=new Array(r);l[0]=k;var d={};for(var p in a)hasOwnProperty.call(a,p)&&(d[p]=a[p]);d.originalType=e,d.mdxType="string"==typeof e?e:i,l[1]=d;for(var o=2;o{t.r(a),t.d(a,{assets:()=>p,contentTitle:()=>l,default:()=>A,frontMatter:()=>r,metadata:()=>d,toc:()=>o});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:50,title:"A.50. Trait \u279c Iterator",sidebar_label:"A.50. Trait \u279c Iterator"},l=void 0,d={unversionedId:"basic/trait-iterator",id:"basic/trait-iterator",title:"A.50. Trait \u279c Iterator",description:"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator.",source:"@site/docs/basic/trait-iterator.md",sourceDirName:"basic",slug:"/basic/trait-iterator",permalink:"/basic/trait-iterator",draft:!1,tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50,title:"A.50. Trait \u279c Iterator",sidebar_label:"A.50. Trait \u279c Iterator"},sidebar:"tutorialSidebar",previous:{title:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)",permalink:"/basic/trait-function"},next:{title:"A.51. Attributes",permalink:"/basic/attributes"}},p={},o=[{value:"A.50.1. Iterator & IntoIterator",id:"a501-iterator--intoiterator",level:2},{value:"\u25c9 Trait Iterator & IntoIterator",id:"-trait-iterator--intoiterator",level:3},{value:"\u25c9 Struct Iterator",id:"-struct-iterator",level:3},{value:"A.50.2. Pemanfaatan tipe data Iterator",id:"a502-pemanfaatan-tipe-data-iterator",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2",level:3},{value:"A.50.3. Method tipe data Iterator",id:"a503-method-tipe-data-iterator",level:2},{value:"\u25c9 Method iter, iter_mut, into_iter",id:"-method-iter-iter_mut-into_iter",level:3},{value:"\u25c9 Method collect",id:"-method-collect",level:3},{value:"\u25c9 Method map",id:"-method-map",level:3},{value:"\u25c9 Method rev",id:"-method-rev",level:3},{value:"\u25c9 Method filter",id:"-method-filter",level:3},{value:"\u25c9 Method cloned",id:"-method-cloned",level:3},{value:"\u25c9 Method copied",id:"-method-copied",level:3},{value:"\u25c9 Method cmp",id:"-method-cmp",level:3},{value:"\u25c9 Method count",id:"-method-count",level:3},{value:"\u25c9 Method eq, ne, gt, ge, lt, le",id:"-method-eq-ne-gt-ge-lt-le",level:3},{value:"\u25c9 Method find",id:"-method-find",level:3},{value:"\u25c9 Method last",id:"-method-last",level:3},{value:"\u25c9 Method fold",id:"-method-fold",level:3},{value:"\u25c9 Method inspect",id:"-method-inspect",level:3},{value:"\u25c9 Method sum",id:"-method-sum",level:3},{value:"\u25c9 Method reduce",id:"-method-reduce",level:3},{value:"\u25c9 Method min, max",id:"-method-min-max",level:3},{value:"A.50.4. Method lainnya",id:"a504-method-lainnya",level:2},{value:"\u25c9 Method sort milik Vec<T>",id:"-method-sort-milik-vect",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function A(e){let{components:a,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},m,r,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator."),(0,i.kt)("h2",{id:"a501-iterator--intoiterator"},"A.50.1. ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")," & ",(0,i.kt)("inlineCode",{parentName:"h2"},"IntoIterator")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," adalah sebuah nama yang dipakai sebagai nama module item dalam ",(0,i.kt)("strong",{parentName:"p"},"Rust Standard Library")," maupun ",(0,i.kt)("strong",{parentName:"p"},"Rust Core Library"),", digunakan untuk iterasi data dan operasi lain yang berhubungan dengannya."),(0,i.kt)("p",null,"Iterator sendiri merupakan istilah untuk object atau trait yang bisa diiterasi, baik menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in")," ataupun menggunakan method iterator seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each")," (yang juga akan kita bahas di sini)."),(0,i.kt)("h3",{id:"-trait-iterator--intoiterator"},"\u25c9 Trait ",(0,i.kt)("inlineCode",{parentName:"h3"},"Iterator")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"IntoIterator")),(0,i.kt)("p",null,"Dalam perulangan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", tipe data variabel yang digunakan harus memiliki trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),". Jika tidak, pasti error muncul."),(0,i.kt)("p",null,"Tipe data slice di Rust by default mengadopsi trait bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"IntoIterator"),", yang trait ini digunakan untuk konversi data bertipe slice ke bentuk iterator."),(0,i.kt)("p",null,"Dalam praktiknya, tidak perlu mengakses method tertentu untuk mendapatkan object iterator suatu data. Cukup gunakan variabel tipe data slice pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", maka proses konversi ke bentuk iterator akan dilakukan oleh Rust secara otomatis dibalik layar."),(0,i.kt)("p",null,"Contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// array\nlet data_arr = ["a", "b", "c", "d"];\nfor e in &data_arr {\n print!("{e:?} ")\n}\n\nprintln!();\n\n// vector\nlet data_vec = vec!["a", "b", "c", "d"];\nfor e in &data_vec {\n print!("{e:?} ")\n}\n\nprintln!();\n\n// slice\nlet data_vec = vec!["a", "b", "c", "d"];\nlet data_slice_vec = &data_vec[..];\nfor e in data_slice_vec {\n print!("{e:?} ")\n}\n')),(0,i.kt)("p",null,"Dianjurkan untuk selalu menggunakan teknik ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing")," dalam penggunaan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in")," pada tipe data yang karakteristiknya adalah ",(0,i.kt)("a",{parentName:"p",href:"/basic/ownership#a344-copy-semantics-vs-move-semantics"},"Move Semantics"),", hal ini karena dalam penerapan keyword tersebut, terjadi proses konversi tipe data dengan trait ",(0,i.kt)("inlineCode",{parentName:"p"},"IntoIterator")," ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),"."),(0,i.kt)("p",null,"Jika data yang digunakan bukan data borrow, maka pasti owner berpindah."),(0,i.kt)("h3",{id:"-struct-iterator"},"\u25c9 Struct ",(0,i.kt)("inlineCode",{parentName:"h3"},"Iterator")),(0,i.kt)("p",null,"Selain trait ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", ada juga tipe data struct bernama sama, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),". Perbedaan antara trait vs struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," adalah tipe struct ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," memiliki beberapa method untuk keperluan iterasi object. Jadi dengan memanfaatkan method-method tersebut, kita bisa melakukan iterasi data dan operasi sejenisnya tanpa menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),"."),(0,i.kt)("p",null,"Semua tipe data slice bisa dikonversi ke tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", caranya dengan mengakses method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," (atau method ",(0,i.kt)("inlineCode",{parentName:"p"},"chars")," khusus untuk tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),")."),(0,i.kt)("p",null,"Dari object iterator tersebut, perulangan bisa dilakukan via keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for in"),", atau dengan memanfaatkan method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),". Perbedaannya pada iterasi menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),", block perulangan dituliskan dalam bentuk closure."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// array\nlet data_arr = ["a", "b", "c", "d"];\nlet iterator_arr = data_arr.iter();\niterator_arr.for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// vector\nlet data_vec = vec!["a", "b", "c", "d"];\ndata_vec.iter().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// slice from vector\nlet data_vec = vec!["a", "b", "c", "d"];\nlet data_slice_vec = &data_vec[..];\ndata_slice_vec.iter().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n\n// slice from String\nlet data_str = "abcd".to_string();\nlet data_borrow_str = &data_str;\ndata_borrow_str.chars().for_each(|e| {\n print!("{e:?} ")\n});\n\nprintln!();\n')),(0,i.kt)("p",null,"Bisa dilihat pada contoh di atas, data slice diambil objek Iterator-nya menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," (atau ",(0,i.kt)("inlineCode",{parentName:"p"},"chars")," khusus untuk tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"), kemudian di-iterasi menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(3753).Z,width:"456",height:"149"})),(0,i.kt)("h2",{id:"a502-pemanfaatan-tipe-data-iterator"},"A.50.2. Pemanfaatan tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," memiliki cukup banyak method untuk keperluan operasi data iterator, contohnya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"for_each"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"map"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"filter"),", dan lainnya."),(0,i.kt)("h3",{id:"-praktik-ke-1"},"\u25c9 Praktik ke-1"),(0,i.kt)("p",null,"Sebagai contoh, kita akan buat sebuah program sederhana yang melakukan operasi kuadrat pada elemen tiap-tiap array."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_arr = [1, 3, 5];\n\nlet doubles: Vec = data_arr\n .iter()\n .map(|e| e * e)\n .collect();\n\nprintln!("{doubles:?}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(9339).Z,width:"447",height:"121"})),(0,i.kt)("p",null,"Penjelasan:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"data_arr")," yang bertipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"[i32; 3]")," dikonversi ke tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"iter"),"."),(0,i.kt)("li",{parentName:"ol"},"Object ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," kemudian di-iterasi menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"map")," dan nilai baliknya dijadikan ",(0,i.kt)("em",{parentName:"li"},"replacement")," data elemen tersebut."),(0,i.kt)("li",{parentName:"ol"},"Object ",(0,i.kt)("inlineCode",{parentName:"li"},"Iterator")," kemudian di-collect data-nya ke bentuk ",(0,i.kt)("inlineCode",{parentName:"li"},"Vec")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"collect"),".")),(0,i.kt)("h3",{id:"-praktik-ke-2"},"\u25c9 Praktik ke-2"),(0,i.kt)("p",null,"Contoh lain penerapan method iterator bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec!["1", "2", "3", "4", "a"];\n\nlet numbers: Vec = data_vec\n .iter()\n .map(|e| -> i32 {\n match e.parse::() {\n Ok(n) => n,\n Err(_) => 0,\n }\n })\n .filter(|e| *e > 0 && *e % 2 == 0)\n .rev()\n .collect::>();\n\nprintln!("{numbers:?}");\n')),(0,i.kt)("p",null,"Program di atas melakukan beberapa hal:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," yang merupakan koleksi string di-konversi menjadi object ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter"),".")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Kemudian method ",(0,i.kt)("inlineCode",{parentName:"p"},"map")," diakses. Setiap elemen ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," di-iterasi, kemudian dikonversi dari ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", lalu dijadikan ",(0,i.kt)("em",{parentName:"p"},"replacement")," data elemen tersebut. Jika proses konversi gagal, maka angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," digunakan sebagai data element tersebut."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},'["1", "2", "3", "4", "a"]')," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[1, 2, 3, 4, 0]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Selanjutnya, dilakukan proses filtering menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"filter")," dengan kondisi ",(0,i.kt)("inlineCode",{parentName:"p"},"*e > 0 && *e % 2 == 0")," yang kurang lebih artinya, jika nilai ",(0,i.kt)("em",{parentName:"p"},"dereference")," ",(0,i.kt)("inlineCode",{parentName:"p"},"e")," lebih besar dari ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," dan nilai tersebut adalah genap, maka filter bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true"),"."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},"[1, 2, 3, 4, 0]")," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[2, 4]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Kemudian, data kolektif tersebut dibalik urutan elemennya menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"rev"),"."),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Sampai sini, data yang sebelumnya ",(0,i.kt)("inlineCode",{parentName:"li"},"[2, 4]")," sekarang menjadi ",(0,i.kt)("inlineCode",{parentName:"li"},"[4, 2]"),"."))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Terakhir data di-collect menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," dengan ditentukan tipe data masing-masing elemen adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),"."))),(0,i.kt)("p",null,"Hasilnya ketika di run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(6644).Z,width:"447",height:"118"})),(0,i.kt)("h2",{id:"a503-method-tipe-data-iterator"},"A.50.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Iterator")),(0,i.kt)("h3",{id:"-method-iter-iter_mut-into_iter"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"iter"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"iter_mut"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"into_iter")),(0,i.kt)("p",null,"Ketiga method ini berguna untuk konversi data slice ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),", perbedannya:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang isinya adalah reference (",(0,i.kt)("inlineCode",{parentName:"p"},"&T"),") setiap element. Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\ndata_vec.iter().for_each(|d| {\n println!("{}", *d * 2)\n});\n\nfor d in &data_vec {\n println!("{}", *d * 2)\n}\n'))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter_mut")," mengembalikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang isinya adalah mutable reference (",(0,i.kt)("inlineCode",{parentName:"p"},"&mut T"),") setiap element. Contoh penerapan:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut data_vec = vec![1, 2, 3, 4];\n\ndata_vec.iter_mut().for_each(|d| {\n *d = *d * 2;\n});\nprintln!("{:?}", data_vec);\n\nfor d in &mut data_vec {\n *d = *d * 2;\n}\nprintln!("{:?}", data_vec);\n'))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"into_iter")," mengkonversi data slice ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," (",(0,i.kt)("em",{parentName:"p"},"move semantics"),")."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\ndata_vec.into_iter().for_each(|d| {\n println!("{}", d * 2)\n});\n\n// statement di bawah ini menghasilkan error,\n// karena ownership `data_vec` telah berpindah setelah method `into_iter` dipanggil\n\n// println!("{}", data_vec)\n')))),(0,i.kt)("h3",{id:"-method-collect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"collect")),(0,i.kt)("p",null,"Method ini digunakan untuk ",(0,i.kt)("em",{parentName:"p"},"collecting")," data Iterator ke bentuk tertentu. Contoh penerapannya bisa dilihat pada kode berikut ini."),(0,i.kt)("p",null,"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," yang merupakan vektor bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec")," dikonversi ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," kemudian di-collect datanya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec: Vec = vec![1, 2, 3, 4];\n\nlet result: Vec<&i32> = data_vec.iter().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," menghasilkan object ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," yang menampung reference ",(0,i.kt)("inlineCode",{parentName:"p"},"&T")," setiap element slice. Hal ini membuat penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," menghasilkan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec<&i32>")," (bukan ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),")."),(0,i.kt)("h3",{id:"-method-map"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"map")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"map")," digunakan untuk mapping element setiap data iterator ke nilai baru."),(0,i.kt)("p",null,"Sebelumnya kita telah mempelajari method ",(0,i.kt)("inlineCode",{parentName:"p"},"iter")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"collect")," yang keduanya jika dikombinasikan dan digunakan pada tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec")," hasilnya adalah data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec<&i32>"),". Dengan memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"map"),", tipe data setiap element bisa di-mapping ke nilai baru dengan tipe data berbeda, misalnya menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec: Vec = vec![1, 2, 3, 4];\n\nlet result1: Vec<&i32> = data_vec.iter().collect();\nprintln!("{:?}", result1);\n// [1, 2, 3, 4]\n\nlet result2: Vec = data_vec\n .iter()\n .map(|d: &i32| -> i32 { *d })\n .collect();\nprintln!("{:?}", result2);\n// [1, 2, 3, 4]\n')),(0,i.kt)("p",null,"Contoh lainnya bisa dilihat pada ",(0,i.kt)("em",{parentName:"p"},"section")," ",(0,i.kt)("a",{parentName:"p",href:"/basic/trait-iterator#a482-pemanfaatan-tipe-data-iterator"},"A.50.2. Pemanfaatan tipe data ",(0,i.kt)("inlineCode",{parentName:"a"},"Iterator")),", di situ terdapat operasi mapping data slice numerik ke bentuk yang sama tapi nilai setiap element adalah kuadrat, dan ke bentuk lain dengan tipe data berbeda."),(0,i.kt)("h3",{id:"-method-rev"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"rev")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"rev")," kependekan dari ",(0,i.kt)("em",{parentName:"p"},"reverse"),", digunakan untuk membalikan urutan data slice."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nprintln!("{:?}", data_vec);\n// [1, 2, 3, 4]\n\nlet result: Vec<&i32> = data_vec.iter().rev().collect();\nprintln!("{:?}", result);\n// [4, 3, 2, 1]\n')),(0,i.kt)("h3",{id:"-method-filter"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"filter")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"filter")," digunakan untuk memfilter element data slice. Data kolektif diiterasi kemudian dicek menggunakan closure, jika nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," maka elemen tersebut masuk dalam dalam hasil filter, selebihnya maka dianggap tidak memenuhi kondisi filter dan elemen di-",(0,i.kt)("em",{parentName:"p"},"exclude"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet odd: Vec<&i32> = data_vec.iter().filter(|d| *d % 2 != 0).collect();\nprintln!("odd numbers: {:?}", odd);\n// odd numbers: [1, 3]\n\nlet even: Vec<&i32> = data_vec.iter().filter(|d| *d % 2 == 0).collect();\nprintln!("even numbers: {:?}", even);\n// odd numbers: [2, 4]\n')),(0,i.kt)("h3",{id:"-method-cloned"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"cloned")),(0,i.kt)("p",null,"Digunakan untuk ",(0,i.kt)("em",{parentName:"p"},"cloning")," data slice secara keseluruhan tanpa mengubah tipe data. Hasilnya adalah data dengan skema sama persis (dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator"),") tapi berbeda owner."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: Vec = data_vec.iter().cloned().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("h3",{id:"-method-copied"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"copied")),(0,i.kt)("p",null,"Secara ",(0,i.kt)("em",{parentName:"p"},"high-level")," ",(0,i.kt)("inlineCode",{parentName:"p"},"copied")," menghasilkan output yang sama dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"cloned"),". Namun jika dibahas dari sisi management memory-nya, ada perbedaan yang cukup besar."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: Vec = data_vec.iter().copied().collect();\nprintln!("{:?}", result);\n// [1, 2, 3, 4]\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai clone vs copy akan dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/copy-clone-move-drop"},"Copy, Clone, Move, Drop"))),(0,i.kt)("h3",{id:"-method-cmp"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"cmp")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"cmp")," kependekan dari ",(0,i.kt)("em",{parentName:"p"},"compare"),", digunakan untuk membandingkan 2 buah data iterasi dengan nilai balik bertipe enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering"),". Dari tipe data enum tersebut nantinya bisa dicek apakah 2 buah data slice tersebut sama (secara ",(0,i.kt)("em",{parentName:"p"},"Lexicographical"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().cmp(data_vec2.iter());\nprintln!("{:?}", result.is_eq());\n// true\n')),(0,i.kt)("p",null,"Enum ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering")," memiliki beberapa method, salah satunya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"is_eq")," yang mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika dua buah data slice tersebut adalah sama."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai ",(0,i.kt)("inlineCode",{parentName:"p"},"Ordering")," akan dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"#/wip/enum-ordering"},"Enum Ordering"))),(0,i.kt)("h3",{id:"-method-count"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"count")),(0,i.kt)("p",null,"Digunakan untuk melihat size dari elemen Iterator."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet length = data_vec.iter().count();\nprintln!("{:?}", length);\n// 4\n')),(0,i.kt)("h3",{id:"-method-eq-ne-gt-ge-lt-le"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"eq"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"ne"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"gt"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"ge"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"lt"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"le")),(0,i.kt)("p",null,"6 Method ini digunakan untuk komparasi dua buah slice. Penggunakan 6 method ini merupakan alternatif selain menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"cmp"),"."),(0,i.kt)("p",null,"Sebagai contoh, penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"eq")," berikut untuk untuk mengecek apakah 2 buah data slice adalah sama (secara ",(0,i.kt)("em",{parentName:"p"},"Lexicographical"),")."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().eq(data_vec2.iter());\nprintln!("{:?}", result);\n// true\n')),(0,i.kt)("p",null,"Kode di atas adalah ekuivalen dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec1 = vec![1, 2, 3, 4];\nlet data_vec2 = vec![1, 2, 3, 4];\nlet result = data_vec1.iter().cmp(data_vec2.iter());\nprintln!("{:?}", result.is_eq());\n// true\n')),(0,i.kt)("p",null,"Berikut merupakan kegunaan tiap-tiap method di atas:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"eq")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"ne")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"not equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"gt")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"greater than lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"ge")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"greater than or equal lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"lt")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"lower than lexicographical comparison")),(0,i.kt)("li",{parentName:"ul"},"Method ",(0,i.kt)("inlineCode",{parentName:"li"},"le")," digunakan untuk ",(0,i.kt)("em",{parentName:"li"},"lower than or equal lexicographical comparison"))),(0,i.kt)("h3",{id:"-method-find"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"find")),(0,i.kt)("p",null,"Digunakan untuk mencari apakah suatu elemen ada atau tidak dengan kondisi pencarian dituliskan dalam bentuk closure. Nilai balik method ini bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("p",null,"Sebagai contoh, perhatikan kode berikut. Method ",(0,i.kt)("inlineCode",{parentName:"p"},"find")," digunakan untuk mencari elemen yang nilainya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"4"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result = match data_vec.iter().find(|d: &&i32| **d == 4) {\n Some(d) => *d,\n None => 0\n};\nprintln!("{:?}", result);\n// 4\n')),(0,i.kt)("h3",{id:"-method-last"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"last")),(0,i.kt)("p",null,"Digunakan untuk mengambil elemen terakhir data Iterator. Method ",(0,i.kt)("inlineCode",{parentName:"p"},"last")," ini mengembalikan nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\nlet result: &i32 = data_vec.iter().last().unwrap();\nprintln!("{:?}", result);\n// 4\n')),(0,i.kt)("p",null,"Satu hal yang unik perihal notasi closure method ",(0,i.kt)("inlineCode",{parentName:"p"},"find"),", parameter closure adalah bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&&T"),". Dari tipe tersebut, untuk mengambil ",(0,i.kt)("em",{parentName:"p"},"underlying value")," gunakan operator ",(0,i.kt)("em",{parentName:"p"},"dereference")," dua kali. Contohnya pada kode di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"d")," bertipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&&i32"),", untuk mengambil nilai sebenarnya digunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"**d"),"."),(0,i.kt)("h3",{id:"-method-fold"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"fold")),(0,i.kt)("p",null,"Method ini digunakan untuk mengkonversi setiap element ",(0,i.kt)("inlineCode",{parentName:"p"},"Iterator")," menjadi sebuah akumulator yang direpresentasikan oleh 1 buah variabel."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"konsep ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," milik Rust mirip seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"reduce")," pada bahasa pemrograman lain")),(0,i.kt)("p",null,"Pada contoh berikut, kita coba terapkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," untuk grouping data vector ",(0,i.kt)("inlineCode",{parentName:"p"},"data_vec")," menjadi 1 buah data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"NumberCategory"),"."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Data numerik genap elemen ",(0,i.kt)("inlineCode",{parentName:"li"},"data_vec")," masuk ke property ",(0,i.kt)("inlineCode",{parentName:"li"},"even")," milik ",(0,i.kt)("inlineCode",{parentName:"li"},"NumberCategory"),"."),(0,i.kt)("li",{parentName:"ul"},"Data numerik ganjil elemen ",(0,i.kt)("inlineCode",{parentName:"li"},"data_vec")," masuk ke property ",(0,i.kt)("inlineCode",{parentName:"li"},"odd")," milik ",(0,i.kt)("inlineCode",{parentName:"li"},"NumberCategory"),".")),(0,i.kt)("p",null,"Dalam penerapannnya, parameter pertama method ",(0,i.kt)("inlineCode",{parentName:"p"},"fold")," diisi dengan ",(0,i.kt)("em",{parentName:"p"},"initial value"),", dan parameter ke-2 isinya closure untuk akumulasi data."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'#[derive(Debug)]\nstruct NumberCategory {\n even: Vec,\n odd: Vec,\n}\n\nlet data_vec = vec![1, 2, 3, 4];\n\nlet data_grouped = data_vec.iter().fold(\n NumberCategory{ even: Vec::new(), odd: Vec::new() }, \n |mut group, each| {\n if *each % 2 == 0 {\n group.even.push(*each)\n } else {\n group.odd.push(*each)\n }\n group\n }\n);\n\nprintln!("{:?}", data_grouped);\n')),(0,i.kt)("p",null,"Pada kode di atas, data ",(0,i.kt)("inlineCode",{parentName:"p"},"each")," di-cek nilainya, jika genap maka dimasukan dalam ",(0,i.kt)("inlineCode",{parentName:"p"},"group.even"),", dan sisanya masuk ",(0,i.kt)("inlineCode",{parentName:"p"},"group.odd"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(2986).Z,width:"454",height:"122"})),(0,i.kt)("h3",{id:"-method-inspect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"inspect")),(0,i.kt)("p",null,"Biasanya digunakan sewaktu debugging, untuk inspeksi flow pemanggilan method-method milik Iterator. Contoh penerapannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet result = data_vec.iter()\n .cloned()\n .inspect(|x| println!("about to filter: {x}"))\n .filter(|x| x % 2 == 0)\n .inspect(|x| println!("made it through filter: {x}"))\n .fold(0, |sum, i| sum + i);\n\nprintln!("sum: {:?}", result);\n// sum: 10\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(4695).Z,width:"449",height:"222"})),(0,i.kt)("h3",{id:"-method-sum"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"sum")),(0,i.kt)("p",null,"Digunakan untuk mencari total/summary data slice numerik."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1.1, 2.2, 3.3, 4.5];\nlet result: f64 = data_vec.iter().sum();\nprintln!("sum: {:?}", result);\n// sum: 11.1\n')),(0,i.kt)("h3",{id:"-method-reduce"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"reduce")),(0,i.kt)("p",null,"Method ini digunakan untuk mengiterasi setiap element array dengan setiap iterasi menampilkan data element ke-",(0,i.kt)("inlineCode",{parentName:"p"},"n")," dan element ke-",(0,i.kt)("inlineCode",{parentName:"p"},"n+1"),"."),(0,i.kt)("p",null,"Contoh penerapan sederhananya pada pencarian angka numerik terbesar, yang kode-nya bisa dilihat berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet max_number = data_vec.iter().reduce(|left, right| {\n print!("left ({left}) vs right ({right})");\n\n if *left >= *right { \n println!(" -> left ({left}) is greater");\n left\n } else {\n println!(" -> right ({right}) is greater");\n right\n }\n});\n\nmatch max_number {\n Some(n) => println!("max_number: {:?}", n),\n None => println!("no data found"),\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Trait iterator",src:t(1611).Z,width:"449",height:"170"})),(0,i.kt)("h3",{id:"-method-min-max"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"min"),", ",(0,i.kt)("inlineCode",{parentName:"h3"},"max")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"min")," digunakan untuk mencari elemen terkecil pada Iterator, dan ",(0,i.kt)("inlineCode",{parentName:"p"},"max")," untuk mencari elemen terbesar. Keduanya mengembalikan nilai balik bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let data_vec = vec![1, 2, 3, 4];\n\nlet min = data_vec.iter().min().unwrap();\nprintln!("min: {min}");\n// min: 1\n\nlet max = data_vec.iter().max().unwrap();\nprintln!("max: {max}");\n// max: 4\n')),(0,i.kt)("h2",{id:"a504-method-lainnya"},"A.50.4. Method lainnya"),(0,i.kt)("h3",{id:"-method-sort-milik-vect"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"sort")," milik ",(0,i.kt)("inlineCode",{parentName:"h3"},"Vec")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"sort")," bukanlah property Iterator, melainkan milik tipe data vector. Kegunaan method ini adalah untuk sorting urutan elemen vector."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut data_vec = vec![2, 3, 1, 4];\nprintln!("before: {data_vec:?}");\n// before: [2, 3, 1, 4]\n\ndata_vec.sort();\nprintln!("after: {data_vec:?}");\n// after: [1, 2, 3, 4]\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/trait_iterator"},"github.com/novalagung/dasarpemrogramanrust-example/../trait_iterator")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/vector"},"Vector"))),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Desugar iterator")),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/iter/index.html"},"https://doc.rust-lang.org/std/iter/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/iter/trait.Iterator.html"},"https://doc.rust-lang.org/std/iter/trait.Iterator.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://becomebetterprogrammer.com/rust-iter-vs-iter_mut-vs-into_iter/"},"https://becomebetterprogrammer.com/rust-iter-vs-iter_mut-vs-into_iter/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://blog.thoughtram.io/iterators-in-rust/"},"https://blog.thoughtram.io/iterators-in-rust/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://blog.logrocket.com/rust-iterators-closures-deep-dive/"},"https://blog.logrocket.com/rust-iterators-closures-deep-dive/"))))}A.isMDXComponent=!0},3753:(e,a,t)=>{t.d(a,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAACVCAYAAADcxmp3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAByhSURBVHhe7Z3LrSS5sYZlyYwG8kBGyIeGgHFhLBAa0FYmHGAc6IVs6IV2vbkWnZt8B4MRwUcxs7Kq/8WH7kqSwWAwyL8yT2XmX3755ZdPAAAAANRAIAEAAAABCCQAAAAgAIEEAAAABCCQAAAAgAAEEgAAABCAQAIAAAACEEgAAABAAAIJAAAACEAgAQAAAAEIJAAAACAAgQQAAAAEIJAAAACAAAQSAAAAEIBAAgAAAAKPCeTXb58/vn98fvGfv3x+fP/x+e0rq3MqXz+//fj2+VUsew2+fvvx+f3ji1i2xvo87PJl/5iupx2Dy7UfJN/7rMXhjHUUbGq+zPj5DnMLzuPdcmldIL98fH7/8f3z40s69gyB/OXzy8f3qU0rb3SUb1/N8u6Y3BcF1mZ44l0cNf+rLyCjPDAPli8OP+fH+Do+nZ/49hzt6L+1MS+QVjydfeq/I/R3vUB2553wCpsaOB81D94slxYFUlpwzxFIx1ygw0ZX/Ax+B5HsbCQaXiDJ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PQny8tTGqz/r4AgIYu11DBO3banPHMUTXUWeP8ZdNQbzm1xKTWek+pghgDABoa/F/wjvVFafir0PJ8KnRMZZMaKtg/l5nUoqEA0EFDAQAADQUAOJyGindluC8DAGgoAAAaCgAAaCgAABoKAICGAgCgoQAAgIYCAKChAABoKAAAGgoAgIYCAAAaCgCAhgIAoKEAAKfnf8MuIu6Tpsk4AAAAAElFTkSuQmCC"}}]); \ No newline at end of file diff --git a/assets/js/8b55bf27.6638890c.js b/assets/js/8b55bf27.b92b9eb6.js similarity index 93% rename from assets/js/8b55bf27.6638890c.js rename to assets/js/8b55bf27.b92b9eb6.js index e172b872..092815c0 100644 --- a/assets/js/8b55bf27.6638890c.js +++ b/assets/js/8b55bf27.b92b9eb6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[9886],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>k});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=a.createContext({}),o=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=o(e.components);return a.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,p=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),u=o(n),k=i,c=u["".concat(p,".").concat(k)]||u[k]||m[k]||r;return n?a.createElement(c,l(l({ref:t},d),{},{components:n})):a.createElement(c,l({ref:t},d))}));function k(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=u;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:i,l[1]=s;for(var o=2;o{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>o});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:46,title:"A.46. Tipe Data \u279c String Custom Type",sidebar_label:"A.46. Tipe Data \u279c String Custom Type"},l=void 0,s={unversionedId:"basic/tipe-data-custom-type-string-slice",id:"basic/tipe-data-custom-type-string-slice",title:"A.46. Tipe Data \u279c String Custom Type",description:"Pembahasan kali ini lingkupnya masih dalam topik custom type String.",source:"@site/docs/basic/tipe-data-custom-type-string-slice.md",sourceDirName:"basic",slug:"/basic/tipe-data-custom-type-string-slice",permalink:"/basic/tipe-data-custom-type-string-slice",draft:!1,tags:[],version:"current",sidebarPosition:46,frontMatter:{sidebar_position:46,title:"A.46. Tipe Data \u279c String Custom Type",sidebar_label:"A.46. Tipe Data \u279c String Custom Type"},sidebar:"tutorialSidebar",previous:{title:"A.45. String Literal (&str) vs. String Custom Type",permalink:"/basic/string-slice-vs-string-literal"},next:{title:"A.47. Closures",permalink:"/basic/closures"}},p={},o=[{value:"A.46.1. Pembuatan string slice",id:"a461-pembuatan-string-slice",level:2},{value:"\u25c9 Method to_string milik &str",id:"-method-to_string-milik-str",level:3},{value:"\u25c9 String::from",id:"-stringfrom",level:3},{value:"\u25c9 String::new",id:"-stringnew",level:3},{value:"\u25c9 String::from_utf8",id:"-stringfrom_utf8",level:3},{value:"A.46.2. String mutability",id:"a462-string-mutability",level:2},{value:"\u25c9 Keyword mut",id:"-keyword-mut",level:3},{value:"\u25c9 Replace string / method replace",id:"-replace-string--method-replace",level:3},{value:"\u25c9 Prepend string / method insert_str",id:"-prepend-string--method-insert_str",level:3},{value:"\u25c9 Prepend char / method insert",id:"-prepend-char--method-insert",level:3},{value:"\u25c9 Append string / method push_str",id:"-append-string--method-push_str",level:3},{value:"\u25c9 Append char / method push",id:"-append-char--method-push",level:3},{value:"\u25c9 Clear string / method clear",id:"-clear-string--method-clear",level:3},{value:"A.46.3. Operasi string lainnya",id:"a463-operasi-string-lainnya",level:2},{value:"\u25c9 Cek substring / method contains",id:"-cek-substring--method-contains",level:3},{value:"\u25c9 Concat strings / slice join",id:"-concat-strings--slice-join",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:o};function m(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pembahasan kali ini lingkupnya masih dalam topik custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Penulis rasa 2 chapter terakhir sudah cukup banyak menjelaskan perihal apa itu tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", apa perbedaannya dibanding ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),", dan kapan harus menggunakannya."),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Pembahasan mengenai perbedaan ",(0,i.kt)("inlineCode",{parentName:"li"},"String")," vs ",(0,i.kt)("inlineCode",{parentName:"li"},"&str")," bisa dilihat pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type")),(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang bagaimana data pada string slice di-manage di memory bisa dilihat pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")))),(0,i.kt)("p",null,"Chapter ini akan lebih fokus ke fitur yang tersedia pada tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("h2",{id:"a461-pembuatan-string-slice"},"A.46.1. Pembuatan string slice"),(0,i.kt)("p",null,"Ada banyak cara yang bisa digunakan dalam membuat data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", di antaranya:"),(0,i.kt)("h3",{id:"-method-to_string-milik-str"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"to_string")," milik ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," mengkonversi string literal menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str2 = "iPhone 8".to_string();\nprintln!("{str2}"); // iPhone 8\n')),(0,i.kt)("h3",{id:"-stringfrom"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::from")),(0,i.kt)("p",null,"Associated function ",(0,i.kt)("inlineCode",{parentName:"p"},"String::from")," digunakan untuk mengkonversi ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),". Kita sudah cukup sering menggunakan fungsi ini."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Nokia 3310");\nprintln!("{str1}"); // Nokia 3310\n')),(0,i.kt)("h3",{id:"-stringnew"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::new")),(0,i.kt)("p",null,"Associated function ",(0,i.kt)("inlineCode",{parentName:"p"},"String::new")," menghasilkan data string kosong."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str3 = String::new();\nprintln!("{str3}"); // ""\n')),(0,i.kt)("h3",{id:"-stringfrom_utf8"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::from_utf8")),(0,i.kt)("p",null,"Berguna untuk mengkonversi data bytes ke tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),". Fungsi ini nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),", maka dalam penerapannya harus di-chain dengan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," untuk mendapatkan data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"-nya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str4 = String::from_utf8(vec![78, 55, 51]).unwrap();\nprintln!("{str4}"); // N73\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h2",{id:"a462-string-mutability"},"A.46.2. String mutability"),(0,i.kt)("h3",{id:"-keyword-mut"},"\u25c9 Keyword ",(0,i.kt)("inlineCode",{parentName:"h3"},"mut")),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"mut")," bisa digunakan untuk mengganti/replace data string dengan data baru. Sebagai contoh, ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," berikut yang awalnya adalah string kosong di-replace dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"Pixel 5"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5 = String::new();\nprintln!("{str5}");\n// ""\n\nstr5 = String::from("Pixel 5");\nprintln!("{str5}");\n// Pixel 5\n')),(0,i.kt)("h3",{id:"-replace-string--method-replace"},"\u25c9 Replace string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"replace")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"replace")," digunakan untuk mengganti suatu substring dengan string lain. Method ini menghasilkan object ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," baru dan tidak mengubah data string aslinya. Karena alasan itu juga kenapa tidak perlu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"mut")," dalam penerapannya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str9 = String::from("my phone is Pixel 6");\nlet str10 = str9.replace("Pixel 6", "Nokia 3310");\n\nprintln!("str9: {str9}"); // my phone is Pixel 6\nprintln!("str10: {str10}"); // my phone is Nokia 3310\n')),(0,i.kt)("h3",{id:"-prepend-string--method-insert_str"},"\u25c9 Prepend string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"insert_str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," digunakan untuk menyisipkan substring pada posisi tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str6 = String::from("Pixel 6");\nprintln!("{str6}");\n// Pixel 6\n\nstr6.insert_str(0, "my phone");\nprintln!("{str6}");\n// my phonePixel 6\n\nstr6.insert_str(8, " is ");\nprintln!("{str6}");\n// my phone is Pixel 6\n')),(0,i.kt)("p",null,"Parameter pertama menentukan posisi indeks string yang disisipkan."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"String ",(0,i.kt)("inlineCode",{parentName:"li"},"Pixel 6")," pada indeks 0 disisipi string ",(0,i.kt)("inlineCode",{parentName:"li"},"my phone"),", hasilnya ",(0,i.kt)("inlineCode",{parentName:"li"},"my phonePixel 6")),(0,i.kt)("li",{parentName:"ul"},"String ",(0,i.kt)("inlineCode",{parentName:"li"},"my phonePixel 6")," pada indeks 8 disisipi string ",(0,i.kt)("inlineCode",{parentName:"li"},"is"),", hasilnya ",(0,i.kt)("inlineCode",{parentName:"li"},"my phone is Pixel 6"))),(0,i.kt)("h3",{id:"-prepend-char--method-insert"},"\u25c9 Prepend char / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"insert")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert")," kegunaannya sama seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," yaitu untuk menyisipkan string pada posisi tertentu. Perbedaannya, pada method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert")," parameter kedua diisi dengan char."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let mut str7 = String::from(\"3310\");\n\nstr7.insert(0, 'N'); // N3310\nstr7.insert(1, 'o'); // No3310\nstr7.insert(2, 'k'); // Nok3310\nstr7.insert(3, 'i'); // Noki3310\nstr7.insert(4, 'a'); // Nokia3310\nstr7.insert(5, ' '); // Nokia 3310\n")),(0,i.kt)("h3",{id:"-append-string--method-push_str"},"\u25c9 Append string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"push_str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str")," digunakan untuk menambahkan string di akhir."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str8 = String::from("Pixel 6"); // Pixel 6\nstr8.push_str(" is a good phone"); // Pixel 6 is a good phone\n')),(0,i.kt)("h3",{id:"-append-char--method-push"},"\u25c9 Append char / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"push")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"push")," sama kegunaannya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str"),", namun untuk penambahan data ",(0,i.kt)("inlineCode",{parentName:"p"},"char"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str8 = String::from("Pixel");\n\nstr8.push(\' \'); // "Pixel "\nstr8.push(\'7\'); // "Pixel 7"\n')),(0,i.kt)("h3",{id:"-clear-string--method-clear"},"\u25c9 Clear string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"clear")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"clear")," digunakan untuk mengosongkan data string."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str11 = String::from("Nokia 3310");\nstr11.clear();\nprintln!("{str11}"); // ""\n')),(0,i.kt)("h2",{id:"a463-operasi-string-lainnya"},"A.46.3. Operasi string lainnya"),(0,i.kt)("h3",{id:"-cek-substring--method-contains"},"\u25c9 Cek substring / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"contains")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"contains")," digunakan untuk mengecek apakah suatu substring yang dicari ada atau tidak. Method ini mengembalikan nilai bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str11 = String::from("Nokia 3310");\n\nlet is_exists = str11.contains("3310");\nprintln!("{is_exists}"); // true\n\nlet is_exists = str11.contains("3315");\nprintln!("{is_exists}"); // false\n')),(0,i.kt)("h3",{id:"-concat-strings--slice-join"},"\u25c9 Concat strings / slice ",(0,i.kt)("inlineCode",{parentName:"h3"},"join")),(0,i.kt)("p",null,"Operasi concat string bisa dilakukan memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str"),". Selain itu juga bisa dengan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},".join")," milik slice. Caranya, jadikan string yang ingin di-gabung sebagai element array, kemudian akses method ",(0,i.kt)("inlineCode",{parentName:"p"},".join"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str12 = String::from("iPhone");\nlet str13 = String::from("12");\nlet str14 = String::from("Pro");\n\nlet str: String = [str12, str13, str14].join(" ");\n\nprintln!("{str}"); // iPhone 12 Pro\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/tipe_data_custom_type_string_slice"},"github.com/novalagung/dasarpemrogramanrust-example/../tipe_data_custom_type_string_slice")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-string-literal"},"Tipe Data \u279c String Literal (&str)")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/static"},"Static Item")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/lifetime"},"Lifetime")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/string/struct.String.html"},"https://doc.rust-lang.org/std/string/struct.String.html"))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[9886],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>k});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=a.createContext({}),o=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=o(e.components);return a.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,p=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),u=o(n),k=i,c=u["".concat(p,".").concat(k)]||u[k]||m[k]||r;return n?a.createElement(c,l(l({ref:t},d),{},{components:n})):a.createElement(c,l({ref:t},d))}));function k(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=u;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:i,l[1]=s;for(var o=2;o{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>o});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:47,title:"A.47. Tipe Data \u279c String Custom Type",sidebar_label:"A.47. Tipe Data \u279c String Custom Type"},l=void 0,s={unversionedId:"basic/tipe-data-custom-type-string-slice",id:"basic/tipe-data-custom-type-string-slice",title:"A.47. Tipe Data \u279c String Custom Type",description:"Pembahasan kali ini lingkupnya masih dalam topik custom type String.",source:"@site/docs/basic/tipe-data-custom-type-string-slice.md",sourceDirName:"basic",slug:"/basic/tipe-data-custom-type-string-slice",permalink:"/basic/tipe-data-custom-type-string-slice",draft:!1,tags:[],version:"current",sidebarPosition:47,frontMatter:{sidebar_position:47,title:"A.47. Tipe Data \u279c String Custom Type",sidebar_label:"A.47. Tipe Data \u279c String Custom Type"},sidebar:"tutorialSidebar",previous:{title:"A.46. String Literal (&str) vs. String Custom Type",permalink:"/basic/string-slice-vs-string-literal"},next:{title:"A.48. Closures",permalink:"/basic/closures"}},p={},o=[{value:"A.47.1. Pembuatan string slice",id:"a471-pembuatan-string-slice",level:2},{value:"\u25c9 Method to_string milik &str",id:"-method-to_string-milik-str",level:3},{value:"\u25c9 String::from",id:"-stringfrom",level:3},{value:"\u25c9 String::new",id:"-stringnew",level:3},{value:"\u25c9 String::from_utf8",id:"-stringfrom_utf8",level:3},{value:"A.47.2. String mutability",id:"a472-string-mutability",level:2},{value:"\u25c9 Keyword mut",id:"-keyword-mut",level:3},{value:"\u25c9 Replace string / method replace",id:"-replace-string--method-replace",level:3},{value:"\u25c9 Prepend string / method insert_str",id:"-prepend-string--method-insert_str",level:3},{value:"\u25c9 Prepend char / method insert",id:"-prepend-char--method-insert",level:3},{value:"\u25c9 Append string / method push_str",id:"-append-string--method-push_str",level:3},{value:"\u25c9 Append char / method push",id:"-append-char--method-push",level:3},{value:"\u25c9 Clear string / method clear",id:"-clear-string--method-clear",level:3},{value:"A.47.3. Operasi string lainnya",id:"a473-operasi-string-lainnya",level:2},{value:"\u25c9 Cek substring / method contains",id:"-cek-substring--method-contains",level:3},{value:"\u25c9 Concat strings / slice join",id:"-concat-strings--slice-join",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:o};function m(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pembahasan kali ini lingkupnya masih dalam topik custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Penulis rasa 2 chapter terakhir sudah cukup banyak menjelaskan perihal apa itu tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", apa perbedaannya dibanding ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),", dan kapan harus menggunakannya."),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Pembahasan mengenai perbedaan ",(0,i.kt)("inlineCode",{parentName:"li"},"String")," vs ",(0,i.kt)("inlineCode",{parentName:"li"},"&str")," bisa dilihat pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type")),(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang bagaimana data pada string slice di-manage di memory bisa dilihat pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")))),(0,i.kt)("p",null,"Chapter ini akan lebih fokus ke fitur yang tersedia pada tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("h2",{id:"a471-pembuatan-string-slice"},"A.47.1. Pembuatan string slice"),(0,i.kt)("p",null,"Ada banyak cara yang bisa digunakan dalam membuat data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", di antaranya:"),(0,i.kt)("h3",{id:"-method-to_string-milik-str"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"to_string")," milik ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," mengkonversi string literal menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str2 = "iPhone 8".to_string();\nprintln!("{str2}"); // iPhone 8\n')),(0,i.kt)("h3",{id:"-stringfrom"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::from")),(0,i.kt)("p",null,"Associated function ",(0,i.kt)("inlineCode",{parentName:"p"},"String::from")," digunakan untuk mengkonversi ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),". Kita sudah cukup sering menggunakan fungsi ini."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Nokia 3310");\nprintln!("{str1}"); // Nokia 3310\n')),(0,i.kt)("h3",{id:"-stringnew"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::new")),(0,i.kt)("p",null,"Associated function ",(0,i.kt)("inlineCode",{parentName:"p"},"String::new")," menghasilkan data string kosong."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str3 = String::new();\nprintln!("{str3}"); // ""\n')),(0,i.kt)("h3",{id:"-stringfrom_utf8"},"\u25c9 ",(0,i.kt)("inlineCode",{parentName:"h3"},"String::from_utf8")),(0,i.kt)("p",null,"Berguna untuk mengkonversi data bytes ke tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),". Fungsi ini nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),", maka dalam penerapannya harus di-chain dengan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," untuk mendapatkan data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"-nya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str4 = String::from_utf8(vec![78, 55, 51]).unwrap();\nprintln!("{str4}"); // N73\n')),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h2",{id:"a472-string-mutability"},"A.47.2. String mutability"),(0,i.kt)("h3",{id:"-keyword-mut"},"\u25c9 Keyword ",(0,i.kt)("inlineCode",{parentName:"h3"},"mut")),(0,i.kt)("p",null,"Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"mut")," bisa digunakan untuk mengganti/replace data string dengan data baru. Sebagai contoh, ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," berikut yang awalnya adalah string kosong di-replace dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"Pixel 5"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5 = String::new();\nprintln!("{str5}");\n// ""\n\nstr5 = String::from("Pixel 5");\nprintln!("{str5}");\n// Pixel 5\n')),(0,i.kt)("h3",{id:"-replace-string--method-replace"},"\u25c9 Replace string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"replace")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"replace")," digunakan untuk mengganti suatu substring dengan string lain. Method ini menghasilkan object ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," baru dan tidak mengubah data string aslinya. Karena alasan itu juga kenapa tidak perlu menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"mut")," dalam penerapannya."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str9 = String::from("my phone is Pixel 6");\nlet str10 = str9.replace("Pixel 6", "Nokia 3310");\n\nprintln!("str9: {str9}"); // my phone is Pixel 6\nprintln!("str10: {str10}"); // my phone is Nokia 3310\n')),(0,i.kt)("h3",{id:"-prepend-string--method-insert_str"},"\u25c9 Prepend string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"insert_str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," digunakan untuk menyisipkan substring pada posisi tertentu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str6 = String::from("Pixel 6");\nprintln!("{str6}");\n// Pixel 6\n\nstr6.insert_str(0, "my phone");\nprintln!("{str6}");\n// my phonePixel 6\n\nstr6.insert_str(8, " is ");\nprintln!("{str6}");\n// my phone is Pixel 6\n')),(0,i.kt)("p",null,"Parameter pertama menentukan posisi indeks string yang disisipkan."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"String ",(0,i.kt)("inlineCode",{parentName:"li"},"Pixel 6")," pada indeks 0 disisipi string ",(0,i.kt)("inlineCode",{parentName:"li"},"my phone"),", hasilnya ",(0,i.kt)("inlineCode",{parentName:"li"},"my phonePixel 6")),(0,i.kt)("li",{parentName:"ul"},"String ",(0,i.kt)("inlineCode",{parentName:"li"},"my phonePixel 6")," pada indeks 8 disisipi string ",(0,i.kt)("inlineCode",{parentName:"li"},"is"),", hasilnya ",(0,i.kt)("inlineCode",{parentName:"li"},"my phone is Pixel 6"))),(0,i.kt)("h3",{id:"-prepend-char--method-insert"},"\u25c9 Prepend char / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"insert")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert")," kegunaannya sama seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," yaitu untuk menyisipkan string pada posisi tertentu. Perbedaannya, pada method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert")," parameter kedua diisi dengan char."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let mut str7 = String::from(\"3310\");\n\nstr7.insert(0, 'N'); // N3310\nstr7.insert(1, 'o'); // No3310\nstr7.insert(2, 'k'); // Nok3310\nstr7.insert(3, 'i'); // Noki3310\nstr7.insert(4, 'a'); // Nokia3310\nstr7.insert(5, ' '); // Nokia 3310\n")),(0,i.kt)("h3",{id:"-append-string--method-push_str"},"\u25c9 Append string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"push_str")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str")," digunakan untuk menambahkan string di akhir."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str8 = String::from("Pixel 6"); // Pixel 6\nstr8.push_str(" is a good phone"); // Pixel 6 is a good phone\n')),(0,i.kt)("h3",{id:"-append-char--method-push"},"\u25c9 Append char / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"push")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"push")," sama kegunaannya seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str"),", namun untuk penambahan data ",(0,i.kt)("inlineCode",{parentName:"p"},"char"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str8 = String::from("Pixel");\n\nstr8.push(\' \'); // "Pixel "\nstr8.push(\'7\'); // "Pixel 7"\n')),(0,i.kt)("h3",{id:"-clear-string--method-clear"},"\u25c9 Clear string / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"clear")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"clear")," digunakan untuk mengosongkan data string."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str11 = String::from("Nokia 3310");\nstr11.clear();\nprintln!("{str11}"); // ""\n')),(0,i.kt)("h2",{id:"a473-operasi-string-lainnya"},"A.47.3. Operasi string lainnya"),(0,i.kt)("h3",{id:"-cek-substring--method-contains"},"\u25c9 Cek substring / method ",(0,i.kt)("inlineCode",{parentName:"h3"},"contains")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"contains")," digunakan untuk mengecek apakah suatu substring yang dicari ada atau tidak. Method ini mengembalikan nilai bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str11 = String::from("Nokia 3310");\n\nlet is_exists = str11.contains("3310");\nprintln!("{is_exists}"); // true\n\nlet is_exists = str11.contains("3315");\nprintln!("{is_exists}"); // false\n')),(0,i.kt)("h3",{id:"-concat-strings--slice-join"},"\u25c9 Concat strings / slice ",(0,i.kt)("inlineCode",{parentName:"h3"},"join")),(0,i.kt)("p",null,"Operasi concat string bisa dilakukan memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"insert_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"push_str"),". Selain itu juga bisa dengan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},".join")," milik slice. Caranya, jadikan string yang ingin di-gabung sebagai element array, kemudian akses method ",(0,i.kt)("inlineCode",{parentName:"p"},".join"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str12 = String::from("iPhone");\nlet str13 = String::from("12");\nlet str14 = String::from("Pro");\n\nlet str: String = [str12, str13, str14].join(" ");\n\nprintln!("{str}"); // iPhone 12 Pro\n')),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/tipe_data_custom_type_string_slice"},"github.com/novalagung/dasarpemrogramanrust-example/../tipe_data_custom_type_string_slice")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-string-literal"},"Tipe Data \u279c String Literal (&str)")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/static"},"Static Item")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/lifetime"},"Lifetime")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/string-slice-vs-string-literal"},"String Literal (&str) vs. String Custom Type"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/string/struct.String.html"},"https://doc.rust-lang.org/std/string/struct.String.html"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.1918f1a8.js b/assets/js/935f2afb.1918f1a8.js deleted file mode 100644 index eb2827b2..00000000 --- a/assets/js/935f2afb.1918f1a8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[53],{1109:a=>{a.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Dasar Pemrograman Rust","href":"/","docId":"index"},{"type":"link","label":"Pengenalan Rust Programming","href":"/pengelanan-rust-programming","docId":"pengelanan-rust-programming"},{"type":"link","label":"Contribution & Tech Stack","href":"/CONTRIBUTING","docId":"CONTRIBUTING"},{"type":"link","label":"Download versi PDF","href":"/download-pdf","docId":"download-pdf"},{"type":"link","label":"Lisensi & Distribusi Konten","href":"/LICENSE","docId":"LICENSE"},{"type":"category","label":"Persiapan dan Instalasi","collapsible":false,"collapsed":false,"items":[{"type":"link","label":"Instalasi Rust","href":"/installation/instalasi-rust","docId":"installation/instalasi-rust"},{"type":"link","label":"Rust Editor & Plugin","href":"/installation/rust-editor-plugin","docId":"installation/rust-editor-plugin"}]},{"type":"category","label":"Pemrograman Rust Dasar","collapsible":false,"collapsed":false,"items":[{"type":"link","label":"A.1. Program Pertama \u279c Hello Rust","href":"/basic/hello-rust","docId":"basic/hello-rust"},{"type":"link","label":"A.2. Build dan Run Program Rust","href":"/basic/build-dan-run-program-rust","docId":"basic/build-dan-run-program-rust"},{"type":"link","label":"A.3. Komentar","href":"/basic/komentar","docId":"basic/komentar"},{"type":"link","label":"A.4. Variabel","href":"/basic/variabel","docId":"basic/variabel"},{"type":"link","label":"A.5. Tipe Data \u279c Primitive Scalar","href":"/basic/tipe-data-primitive-scalar","docId":"basic/tipe-data-primitive-scalar"},{"type":"link","label":"A.6. Tipe Data \u279c String Literal (&str)","href":"/basic/tipe-data-string-literal","docId":"basic/tipe-data-string-literal"},{"type":"link","label":"A.7. Konstanta","href":"/basic/konstanta","docId":"basic/konstanta"},{"type":"link","label":"A.8. Operator","href":"/basic/operator","docId":"basic/operator"},{"type":"link","label":"A.9. Seleksi Kondisi \u279c if, else if, else","href":"/basic/seleksi-kondisi-if","docId":"basic/seleksi-kondisi-if"},{"type":"link","label":"A.10. Perulangan \u279c while","href":"/basic/perulangan-while","docId":"basic/perulangan-while"},{"type":"link","label":"A.11. Perulangan \u279c loop, break, continue, label","href":"/basic/perulangan-loop-break-continue-label","docId":"basic/perulangan-loop-break-continue-label"},{"type":"link","label":"A.12. Perulangan \u279c for in","href":"/basic/perulangan-for-in","docId":"basic/perulangan-for-in"},{"type":"link","label":"A.13. Array","href":"/basic/array","docId":"basic/array"},{"type":"link","label":"A.14. Slice (Basic)","href":"/basic/slice","docId":"basic/slice"},{"type":"link","label":"A.15. Tuple","href":"/basic/tuple","docId":"basic/tuple"},{"type":"link","label":"A.16. Vector","href":"/basic/vector","docId":"basic/vector"},{"type":"link","label":"A.17. Function","href":"/basic/function","docId":"basic/function"},{"type":"link","label":"A.18. Module System \u279c Path & Item","href":"/basic/path-item","docId":"basic/path-item"},{"type":"link","label":"A.19. Module System \u279c Package & Crate","href":"/basic/package-crate","docId":"basic/package-crate"},{"type":"link","label":"A.20. Module System \u279c Module","href":"/basic/module-basic","docId":"basic/module-basic"},{"type":"link","label":"A.21. Module System \u279c Inline Module","href":"/basic/module-inline","docId":"basic/module-inline"},{"type":"link","label":"A.22. Module System \u279c Scope & Akses Item","href":"/basic/module-scope-item-access","docId":"basic/module-scope-item-access"},{"type":"link","label":"A.23. Struct","href":"/basic/struct","docId":"basic/struct"},{"type":"link","label":"A.24. Associated Function","href":"/basic/associated-function","docId":"basic/associated-function"},{"type":"link","label":"A.25. Method","href":"/basic/method","docId":"basic/method"},{"type":"link","label":"A.26. Enum","href":"/basic/enum","docId":"basic/enum"},{"type":"link","label":"A.27. Type Alias & Casting","href":"/basic/type-alias-casting","docId":"basic/type-alias-casting"},{"type":"link","label":"A.28. Module System \u279c Visibility & Privacy","href":"/basic/visibility-privacy","docId":"basic/visibility-privacy"},{"type":"link","label":"A.29. Module System \u279c Use, Import, Re-export","href":"/basic/use","docId":"basic/use"},{"type":"link","label":"A.30. Block Expression","href":"/basic/block-expression","docId":"basic/block-expression"},{"type":"link","label":"A.31. Shadowing","href":"/basic/shadowing","docId":"basic/shadowing"},{"type":"link","label":"A.32. Basic Memory Management","href":"/basic/basic-memory-management","docId":"basic/basic-memory-management"},{"type":"link","label":"A.33. Pointer & References","href":"/basic/pointer-references","docId":"basic/pointer-references"},{"type":"link","label":"A.34. Ownership","href":"/basic/ownership","docId":"basic/ownership"},{"type":"link","label":"A.35. Borrowing","href":"/basic/borrowing","docId":"basic/borrowing"},{"type":"link","label":"A.36. Traits","href":"/basic/traits","docId":"basic/traits"},{"type":"link","label":"A.37. Traits \u279c Advanced","href":"/basic/advanced-traits","docId":"basic/advanced-traits"},{"type":"link","label":"A.38. Generics","href":"/basic/generics","docId":"basic/generics"},{"type":"link","label":"A.39. Tipe Data \u279c Option","href":"/basic/option-type","docId":"basic/option-type"},{"type":"link","label":"A.40. Tipe Data \u279c Result","href":"/basic/result-type","docId":"basic/result-type"},{"type":"link","label":"A.41. Pattern Matching","href":"/basic/pattern-matching","docId":"basic/pattern-matching"},{"type":"link","label":"A.42. Static Item","href":"/basic/static","docId":"basic/static"},{"type":"link","label":"A.43. Lifetime","href":"/basic/lifetime","docId":"basic/lifetime"},{"type":"link","label":"A.44. Slice Memory Management","href":"/basic/slice-memory-management","docId":"basic/slice-memory-management"},{"type":"link","label":"A.45. String Literal (&str) vs. String Custom Type","href":"/basic/string-slice-vs-string-literal","docId":"basic/string-slice-vs-string-literal"},{"type":"link","label":"A.46. Tipe Data \u279c String Custom Type","href":"/basic/tipe-data-custom-type-string-slice","docId":"basic/tipe-data-custom-type-string-slice"},{"type":"link","label":"A.47. Closures","href":"/basic/closures","docId":"basic/closures"},{"type":"link","label":"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)","href":"/basic/trait-function","docId":"basic/trait-function"},{"type":"link","label":"A.49. Trait \u279c Iterator","href":"/basic/trait-iterator","docId":"basic/trait-iterator"},{"type":"link","label":"A.50. Attributes","href":"/basic/attributes","docId":"basic/attributes"},{"type":"link","label":"A.51. Date Time","href":"/basic/datetime","docId":"basic/datetime"},{"type":"link","label":"A.52. File, Path, Directory","href":"/basic/file-path-directory","docId":"basic/file-path-directory"}]}]},"docs":{"basic/advanced-traits":{"id":"basic/advanced-traits","title":"A.37. Traits \u279c Advanced","description":"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya.","sidebar":"tutorialSidebar"},"basic/array":{"id":"basic/array","title":"A.13. Tipe Data \u279c Array","description":"Belajar array pada rust. Contoh penerapan array, iterasi array, dan operasi lainnya pada array","sidebar":"tutorialSidebar"},"basic/associated-function":{"id":"basic/associated-function","title":"A.24. Associated Function","description":"Chapter ini membahas tentang associated function. Kita akan belajar apa itu associated function dan apa perbedannya dengan fungsi biasa.","sidebar":"tutorialSidebar"},"basic/attributes":{"id":"basic/attributes","title":"A.50. Attributes","description":"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti #[derive(Debug)]. Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya.","sidebar":"tutorialSidebar"},"basic/basic-memory-management":{"id":"basic/basic-memory-management","title":"A.32. Basic Memory Management","description":"Pada chapter ini kita akan belajar tentang salah satu hal penting dalam topik pemrograman secara general, yaitu memory management yang mencakup pembahasan tentang alamat memori, pointer, heap, stack, dan juga error-error yang terjadi karena kesalahan dalam manajemen memori.","sidebar":"tutorialSidebar"},"basic/block-expression":{"id":"basic/block-expression","title":"A.30. Block Expression","description":"Pada chapter ini kita akan belajar tentang block expression.","sidebar":"tutorialSidebar"},"basic/borrowing":{"id":"basic/borrowing","title":"A.35. Borrowing","description":"Pada chapter ini kita akan belajar tentang apa itu borrowing dalam Rust programming.","sidebar":"tutorialSidebar"},"basic/build-dan-run-program-rust":{"id":"basic/build-dan-run-program-rust","title":"A.2. Build dan Run Program Rust","description":"Cara run program Rust menggunakan cargo. Pada chapter ini kita akan belajar lebih lanjut tentang command untuk proses build dan run dalam program Rust. Sebelumnya kita sudah belajar tentang cargo new dan cargo run, selain command tersebut ada juga command lain yaitu cargo build untuk proses kompilasi build kode program.","sidebar":"tutorialSidebar"},"basic/closures":{"id":"basic/closures","title":"A.47. Closures","description":"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope.","sidebar":"tutorialSidebar"},"basic/datetime":{"id":"basic/datetime","title":"A.51. Date Time","description":"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming.","sidebar":"tutorialSidebar"},"basic/enum":{"id":"basic/enum","title":"A.26. Enum","description":"Enum atau enumerated type adalah sebuah tipe data yang digunakan untuk menampung nilai konstan. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/file-path-directory":{"id":"basic/file-path-directory","title":"A.52. File, Path, Directory","description":"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system.","sidebar":"tutorialSidebar"},"basic/function":{"id":"basic/function","title":"A.17. Function","description":"Pada chapter ini kita akan belajar tentang function atau fungsi.","sidebar":"tutorialSidebar"},"basic/generics":{"id":"basic/generics","title":"A.38. Generics","description":"Chapter ini membahas tentang generics.","sidebar":"tutorialSidebar"},"basic/hello-rust":{"id":"basic/hello-rust","title":"A.1. Program Pertama \u279c Hello Rust","description":"Belajar membuat program hello world di Rust, dimulai dengan pembuatan program Hello World sederhana.","sidebar":"tutorialSidebar"},"basic/komentar":{"id":"basic/komentar","title":"A.3. Komentar","description":"Pada chapter ini kita akan membahas tentang komentar pada pemrograman Rust. Ada beberapa jenis komentar yang tersedia, namun untuk sekarang yang penting diketahui hanya 2.","sidebar":"tutorialSidebar"},"basic/konstanta":{"id":"basic/konstanta","title":"A.7. Konstanta","description":"Chapter ini membahas tentang konstanta di bahasa Rust.","sidebar":"tutorialSidebar"},"basic/lifetime":{"id":"basic/lifetime","title":"A.43. Lifetime","description":"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid.","sidebar":"tutorialSidebar"},"basic/method":{"id":"basic/method","title":"A.25. Method","description":"Pada chapter ini kita akan belajar tentang method beserta perbedaannya dengan associated function.","sidebar":"tutorialSidebar"},"basic/module-basic":{"id":"basic/module-basic","title":"A.20. Module System \u279c Module","description":"Module adalah salah satu chapter yang cukup penting dalam pemrograman Rust. Pada bagian ini kita akan mempelajari dasarnya.","sidebar":"tutorialSidebar"},"basic/module-inline":{"id":"basic/module-inline","title":"A.21. Module System \u279c Inline Module","description":"Pada chapter sebelumnya kita telah belajar cara manajemen module. Pembahasan tersebut dilanjut pada chapter ini, yaitu tentang inline module.","sidebar":"tutorialSidebar"},"basic/module-scope-item-access":{"id":"basic/module-scope-item-access","title":"A.22. Module System \u279c Scope & Akses Item","description":"Pembahasan chapter ini masih dalam lingkup module system, yaitu tentang scope dan pengakesan module item.","sidebar":"tutorialSidebar"},"basic/operator":{"id":"basic/operator","title":"A.8. Operator","description":"Chapter ini membahas mengenai operator pada pemrograman rust.","sidebar":"tutorialSidebar"},"basic/option-type":{"id":"basic/option-type","title":"A.39. Tipe Data \u279c Option","description":"Option adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (None). Chapter ini membahas tentang tipe data tersebut.","sidebar":"tutorialSidebar"},"basic/ownership":{"id":"basic/ownership","title":"A.34. Ownership","description":"Chapter ini berisi pembahasan tentang ownership, bagaimana Rust melakukan manajemen memory dengan menerapkan approach ownership ini.","sidebar":"tutorialSidebar"},"basic/package-crate":{"id":"basic/package-crate","title":"A.19. Module System \u279c Package & Crate","description":"Chapter ini membahas mengenai konsep package dan path dalam Rust programming. Pembelajaran dimulai dari pembahasan mengenai konsep crate terlebih dahulu, kemudian masuk ke package.","sidebar":"tutorialSidebar"},"basic/path-item":{"id":"basic/path-item","title":"A.18. Module System \u279c Path & Item","description":"Chapter ini membahas tentang konsep path dan item dalam Rust programming.","sidebar":"tutorialSidebar"},"basic/pattern-matching":{"id":"basic/pattern-matching","title":"A.41. Pattern Matching","description":"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih advance dibanding seleksi kondisi biasa.","sidebar":"tutorialSidebar"},"basic/perulangan-for-in":{"id":"basic/perulangan-for-in","title":"A.12. Perulangan \u279c for in","description":"for in adalah salah satu keyword untuk operasi perulangan yang ada di Rust selain loop dan while. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/perulangan-loop-break-continue-label":{"id":"basic/perulangan-loop-break-continue-label","title":"A.11. Perulangan \u279c loop, break, continue, label","description":"Selain keyword while, ada juga keyword loop yang fungsi dasarnya adalah sama, yaitu untuk perulangan.","sidebar":"tutorialSidebar"},"basic/perulangan-while":{"id":"basic/perulangan-while","title":"A.10. Perulangan \u279c while","description":"Di Rust ada beberapa cara untuk melakukan perulangan, salah satunya adalah dengan menggunakan keyword while, dan pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/pointer-references":{"id":"basic/pointer-references","title":"A.33. Pointer & References","description":"Chapter ini membahas tentang apa itu pointer, references, dan dereferences. Pembelajaran dimulai tentang konsep dan praktik dasar tentang ketiga topik tersebut, kemudian diikuti dengan pembahasan tentang karakteristik pointer & reference.","sidebar":"tutorialSidebar"},"basic/result-type":{"id":"basic/result-type","title":"A.40. Tipe Data \u279c Result","description":"Chapter ini membahas tentang tipe data Result. Tipe data ini digunakan untuk menampung nilai hasil suatu proses yang isinya adalah bisa sukses (Ok) atau error (Err).","sidebar":"tutorialSidebar"},"basic/seleksi-kondisi-if":{"id":"basic/seleksi-kondisi-if","title":"A.9. Seleksi Kondisi \u279c if, else if, else","description":"Pada chapter ini kita akan bahas tentang penerapan if untuk kontrol alur program.","sidebar":"tutorialSidebar"},"basic/shadowing":{"id":"basic/shadowing","title":"A.31. Shadowing","description":"Pada chapter ini kita akan belajar tentang shadowing pada variable dan apa perbedaannya dibanding variable mutable.","sidebar":"tutorialSidebar"},"basic/slice":{"id":"basic/slice","title":"A.14. Slice (Basic)","description":"Pada bab ini kita belajar tentang apa itu slice, apa perbedaan slice dan array, slicing atau borrowing pada slice, dan juga slice mutability.","sidebar":"tutorialSidebar"},"basic/slice-memory-management":{"id":"basic/slice-memory-management","title":"A.44. Slice Memory Management","description":"Kita telah mempelajari tipe data Array dan Vector, serta sudah beberapa kali menggunakan tipe data string slice (String). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice.","sidebar":"tutorialSidebar"},"basic/static":{"id":"basic/static","title":"A.42. Static Item","description":"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta.","sidebar":"tutorialSidebar"},"basic/string-slice-vs-string-literal":{"id":"basic/string-slice-vs-string-literal","title":"A.45. String Literal (&str) vs. String Custom Type","description":"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau String.","sidebar":"tutorialSidebar"},"basic/struct":{"id":"basic/struct","title":"A.23. Struct","description":"Pada chapter ini kita akan belajar tentang struct.","sidebar":"tutorialSidebar"},"basic/tipe-data-custom-type-string-slice":{"id":"basic/tipe-data-custom-type-string-slice","title":"A.46. Tipe Data \u279c String Custom Type","description":"Pembahasan kali ini lingkupnya masih dalam topik custom type String.","sidebar":"tutorialSidebar"},"basic/tipe-data-primitive-scalar":{"id":"basic/tipe-data-primitive-scalar","title":"A.5. Tipe Data \u279c Primitive Scalar","description":"Tipe data di Rust dikategorikan menjadi beberapa group, salah satunya adalah group tipe data primitif scalar atau biasa disebut scalar types. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/tipe-data-string-literal":{"id":"basic/tipe-data-string-literal","title":"A.6. Tipe Data \u279c String Literal (&str)","description":"String adalah tipe data penting dalam pemrograman manapun. Biasanya tiap bahasa punya cara berbeda dalam meng-handle tipe ini. Di bahasa Rust, ada dua jenis tipe data string:","sidebar":"tutorialSidebar"},"basic/trait-function":{"id":"basic/trait-function","title":"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)","description":"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure.","sidebar":"tutorialSidebar"},"basic/trait-iterator":{"id":"basic/trait-iterator","title":"A.49. Trait \u279c Iterator","description":"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator.","sidebar":"tutorialSidebar"},"basic/traits":{"id":"basic/traits","title":"A.36. Traits","description":"Trait jika diartikan dalam Bahasa Indonesia artinya adalah sifat. Chapter ini akan membahas tentang apa itu trait, apa kegunaannya, dan bagaimana cara penerapannya di Rust programming.","sidebar":"tutorialSidebar"},"basic/tuple":{"id":"basic/tuple","title":"A.15. Tipe Data \u279c Tuple","description":"Pada chapter ini kita akan membahas tentang tipe data kolektif bernama Tuple.","sidebar":"tutorialSidebar"},"basic/type-alias-casting":{"id":"basic/type-alias-casting","title":"A.27. Type Alias & Casting","description":"Chapter ini membahas tentang type alias dan juga casting (explicit conversion) pada tipe data primitif scalar.","sidebar":"tutorialSidebar"},"basic/use":{"id":"basic/use","title":"A.29. Module System \u279c Use, Import, Re-export","description":"Keyword use digunakan untuk dua hal, yaitu import path dan re-export path. Sebenarnya kita telah mempelajari kedua penerapan tersebut pada beberapa chapter sebelumnya. Pada chapter ini kita akan ulang lagi pembahasan agar lebih jelas.","sidebar":"tutorialSidebar"},"basic/variabel":{"id":"basic/variabel","title":"A.4. Variabel","description":"Rust merupakan bahasa yang kalau dikategorikan berdasarkan type system-nya adalah statically typed, yang artinya semua tipe data harus diketahui saat kompilasi (compile time).","sidebar":"tutorialSidebar"},"basic/vector":{"id":"basic/vector","title":"A.16. Tipe Data \u279c Vector","description":"Pada chapter ini kita akan belajar tetang tipe data Vector. Vector adalah tipe data seperti array tapi dinamis. Dinamis di sini artinya bisa bertambah dan berkurang kapanpun sesuai kebutuhan.","sidebar":"tutorialSidebar"},"basic/visibility-privacy":{"id":"basic/visibility-privacy","title":"A.28. Module System \u279c Visibility & Privacy","description":"Kita sebenarnya sudah mempelajari banyak hal yang berhubungan dengan visibility & privacy pada beberapa chapter sebelumnya. Jika pembaca mempelajari ebook ini secara urut, maka pastinya sudah familiar dengan keyword pub, self, crate, dan super.","sidebar":"tutorialSidebar"},"CONTRIBUTING":{"id":"CONTRIBUTING","title":"Contribution & Tech Stack","description":"Ebook Dasar Pemrograman Rust adalah project open source. Siapapun bebas untuk berkontribusi di sini, bisa dalam bentuk perbaikan typo, update kalimat, maupun submit tulisan baru.","sidebar":"tutorialSidebar"},"download-pdf":{"id":"download-pdf","title":"Download versi PDF","description":"Ebook Dasar Pemrograman Rust bisa di-download dalam bentuk file PDF, silakan gunakan link berikut:","sidebar":"tutorialSidebar"},"index":{"id":"index","title":"Tutorial Belajar Rust (Gratis!)","description":"Rust adalah sebuah bahasa pemrograman general purpose yang fokus pada performance, type safety, dan concurrency. Bahasa ini diciptakan sebagai alternatif bahasa pemrograman yang berfokus pada hal-hal yang cukup low-level tapi tetap men-support fitur yang sifatnya high-level.","sidebar":"tutorialSidebar"},"installation/instalasi-rust":{"id":"installation/instalasi-rust","title":"Instalasi Rust","description":"Pada chapter ini kita akan belajar cara instalasi Rust. Pembaca bisa mengikuti panduan instalasi ini, atau langsung saja navigasi ke https://www.rust-lang.org/tools/install.","sidebar":"tutorialSidebar"},"installation/rust-editor-plugin":{"id":"installation/rust-editor-plugin","title":"Rust Editor & Plugin","description":"Pemilihan editor dan plugin","sidebar":"tutorialSidebar"},"LICENSE":{"id":"LICENSE","title":"Lisensi & Distribusi Konten","description":"Ebook Dasar Pemrograman Rust gratis untuk disebarluaskan secara bebas, dengan catatan sesuai dengan aturan lisensi CC BY-SA 4.0 yang kurang lebih sebagai berikut:","sidebar":"tutorialSidebar"},"pengelanan-rust-programming":{"id":"pengelanan-rust-programming","title":"Pengenalan Rust Programming","description":"Rust adalah sebuah bahasa pemrograman general purpose yang fokus pada performance, type safety, dan concurrency. Bahasa ini diciptakan sebagai alternatif bahasa pemrograman yang berfokus pada hal-hal yang cukup low-level tapi tetap men-support fitur yang sifatnya high-level.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.5bca681b.js b/assets/js/935f2afb.5bca681b.js new file mode 100644 index 00000000..a5b29824 --- /dev/null +++ b/assets/js/935f2afb.5bca681b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[53],{1109:a=>{a.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Dasar Pemrograman Rust","href":"/","docId":"index"},{"type":"link","label":"Pengenalan Rust Programming","href":"/pengelanan-rust-programming","docId":"pengelanan-rust-programming"},{"type":"link","label":"Contribution & Tech Stack","href":"/CONTRIBUTING","docId":"CONTRIBUTING"},{"type":"link","label":"Download versi PDF","href":"/download-pdf","docId":"download-pdf"},{"type":"link","label":"Lisensi & Distribusi Konten","href":"/LICENSE","docId":"LICENSE"},{"type":"category","label":"Persiapan dan Instalasi","collapsible":false,"collapsed":false,"items":[{"type":"link","label":"Instalasi Rust","href":"/installation/instalasi-rust","docId":"installation/instalasi-rust"},{"type":"link","label":"Rust Editor & Plugin","href":"/installation/rust-editor-plugin","docId":"installation/rust-editor-plugin"}]},{"type":"category","label":"Pemrograman Rust Dasar","collapsible":false,"collapsed":false,"items":[{"type":"link","label":"A.1. Program Pertama \u279c Hello Rust","href":"/basic/hello-rust","docId":"basic/hello-rust"},{"type":"link","label":"A.2. Build dan Run Program Rust","href":"/basic/build-dan-run-program-rust","docId":"basic/build-dan-run-program-rust"},{"type":"link","label":"A.3. Komentar","href":"/basic/komentar","docId":"basic/komentar"},{"type":"link","label":"A.4. Variabel","href":"/basic/variabel","docId":"basic/variabel"},{"type":"link","label":"A.5. Tipe Data \u279c Primitive Scalar","href":"/basic/tipe-data-primitive-scalar","docId":"basic/tipe-data-primitive-scalar"},{"type":"link","label":"A.6. Tipe Data \u279c String Literal (&str)","href":"/basic/tipe-data-string-literal","docId":"basic/tipe-data-string-literal"},{"type":"link","label":"A.7. Konstanta","href":"/basic/konstanta","docId":"basic/konstanta"},{"type":"link","label":"A.8. Operator","href":"/basic/operator","docId":"basic/operator"},{"type":"link","label":"A.9. Seleksi Kondisi \u279c if, else if, else","href":"/basic/seleksi-kondisi-if","docId":"basic/seleksi-kondisi-if"},{"type":"link","label":"A.10. Perulangan \u279c while","href":"/basic/perulangan-while","docId":"basic/perulangan-while"},{"type":"link","label":"A.11. Perulangan \u279c loop, break, continue, label","href":"/basic/perulangan-loop-break-continue-label","docId":"basic/perulangan-loop-break-continue-label"},{"type":"link","label":"A.12. Perulangan \u279c for in","href":"/basic/perulangan-for-in","docId":"basic/perulangan-for-in"},{"type":"link","label":"A.13. Array","href":"/basic/array","docId":"basic/array"},{"type":"link","label":"A.14. Slice (Basic)","href":"/basic/slice","docId":"basic/slice"},{"type":"link","label":"A.15. Tuple","href":"/basic/tuple","docId":"basic/tuple"},{"type":"link","label":"A.16. Vector","href":"/basic/vector","docId":"basic/vector"},{"type":"link","label":"A.17. Function","href":"/basic/function","docId":"basic/function"},{"type":"link","label":"A.18. Module System \u279c Path & Item","href":"/basic/path-item","docId":"basic/path-item"},{"type":"link","label":"A.19. Module System \u279c Package & Crate","href":"/basic/package-crate","docId":"basic/package-crate"},{"type":"link","label":"A.20. Module System \u279c Module","href":"/basic/module-basic","docId":"basic/module-basic"},{"type":"link","label":"A.21. Module System \u279c Inline Module","href":"/basic/module-inline","docId":"basic/module-inline"},{"type":"link","label":"A.22. Module System \u279c Scope & Akses Item","href":"/basic/module-scope-item-access","docId":"basic/module-scope-item-access"},{"type":"link","label":"A.23. Struct","href":"/basic/struct","docId":"basic/struct"},{"type":"link","label":"A.24. Associated Function","href":"/basic/associated-function","docId":"basic/associated-function"},{"type":"link","label":"A.25. Method","href":"/basic/method","docId":"basic/method"},{"type":"link","label":"A.26. Enum","href":"/basic/enum","docId":"basic/enum"},{"type":"link","label":"A.27. Type Alias & Casting","href":"/basic/type-alias-casting","docId":"basic/type-alias-casting"},{"type":"link","label":"A.28. Module System \u279c Visibility & Privacy","href":"/basic/visibility-privacy","docId":"basic/visibility-privacy"},{"type":"link","label":"A.29. Module System \u279c Use, Import, Re-export","href":"/basic/use","docId":"basic/use"},{"type":"link","label":"A.30. Block Expression","href":"/basic/block-expression","docId":"basic/block-expression"},{"type":"link","label":"A.31. Shadowing","href":"/basic/shadowing","docId":"basic/shadowing"},{"type":"link","label":"A.32. Basic Memory Management","href":"/basic/basic-memory-management","docId":"basic/basic-memory-management"},{"type":"link","label":"A.33. Pointer & References","href":"/basic/pointer-references","docId":"basic/pointer-references"},{"type":"link","label":"A.34. Ownership","href":"/basic/ownership","docId":"basic/ownership"},{"type":"link","label":"A.35. Borrowing","href":"/basic/borrowing","docId":"basic/borrowing"},{"type":"link","label":"A.36. Traits","href":"/basic/traits","docId":"basic/traits"},{"type":"link","label":"A.37. Traits \u279c Advanced","href":"/basic/advanced-traits","docId":"basic/advanced-traits"},{"type":"link","label":"A.38. Generics","href":"/basic/generics","docId":"basic/generics"},{"type":"link","label":"A.39. Tipe Data \u279c Option","href":"/basic/option-type","docId":"basic/option-type"},{"type":"link","label":"A.40. Tipe Data \u279c Result","href":"/basic/result-type","docId":"basic/result-type"},{"type":"link","label":"A.41. Operator ?","href":"/basic/operator-tanda-tanya","docId":"basic/operator-tanda-tanya"},{"type":"link","label":"A.42. Pattern Matching","href":"/basic/pattern-matching","docId":"basic/pattern-matching"},{"type":"link","label":"A.43. Static Item","href":"/basic/static","docId":"basic/static"},{"type":"link","label":"A.44. Lifetime","href":"/basic/lifetime","docId":"basic/lifetime"},{"type":"link","label":"A.45. Slice Memory Management","href":"/basic/slice-memory-management","docId":"basic/slice-memory-management"},{"type":"link","label":"A.46. String Literal (&str) vs. String Custom Type","href":"/basic/string-slice-vs-string-literal","docId":"basic/string-slice-vs-string-literal"},{"type":"link","label":"A.47. Tipe Data \u279c String Custom Type","href":"/basic/tipe-data-custom-type-string-slice","docId":"basic/tipe-data-custom-type-string-slice"},{"type":"link","label":"A.48. Closures","href":"/basic/closures","docId":"basic/closures"},{"type":"link","label":"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)","href":"/basic/trait-function","docId":"basic/trait-function"},{"type":"link","label":"A.50. Trait \u279c Iterator","href":"/basic/trait-iterator","docId":"basic/trait-iterator"},{"type":"link","label":"A.51. Attributes","href":"/basic/attributes","docId":"basic/attributes"},{"type":"link","label":"A.52. Date Time","href":"/basic/datetime","docId":"basic/datetime"},{"type":"link","label":"A.53. File, Path, Directory","href":"/basic/file-path-directory","docId":"basic/file-path-directory"},{"type":"link","label":"A.54. Error \u279c Unrecoverable Error / Panic","href":"/basic/unrecoverable-panic-error","docId":"basic/unrecoverable-panic-error"}]}]},"docs":{"basic/advanced-traits":{"id":"basic/advanced-traits","title":"A.37. Traits \u279c Advanced","description":"Chapter ini merupakan kelanjutan dari chapter sebelumnya. Di sini kita fokus ke pembuatan local trait, macam-macam implementasi traits, traits bound syntax, associated types, dan topik yang masih relevan dengan traits lainnya.","sidebar":"tutorialSidebar"},"basic/array":{"id":"basic/array","title":"A.13. Tipe Data \u279c Array","description":"Belajar array pada rust. Contoh penerapan array, iterasi array, dan operasi lainnya pada array","sidebar":"tutorialSidebar"},"basic/associated-function":{"id":"basic/associated-function","title":"A.24. Associated Function","description":"Chapter ini membahas tentang associated function. Kita akan belajar apa itu associated function dan apa perbedannya dengan fungsi biasa.","sidebar":"tutorialSidebar"},"basic/attributes":{"id":"basic/attributes","title":"A.51. Attributes","description":"Kita telah beberapa kali menggunakan attributes pada chapter-chapter sebelumnya, contohnya seperti #[derive(Debug)]. Pada chapter ini kita akan bahas tentang apa sebenarnya attributes, macam-macam jenisnya, beserta kegunaannya.","sidebar":"tutorialSidebar"},"basic/basic-memory-management":{"id":"basic/basic-memory-management","title":"A.32. Basic Memory Management","description":"Pada chapter ini kita akan belajar tentang salah satu hal penting dalam topik pemrograman secara general, yaitu memory management yang mencakup pembahasan tentang alamat memori, pointer, heap, stack, dan juga error-error yang terjadi karena kesalahan dalam manajemen memori.","sidebar":"tutorialSidebar"},"basic/block-expression":{"id":"basic/block-expression","title":"A.30. Block Expression","description":"Pada chapter ini kita akan belajar tentang block expression.","sidebar":"tutorialSidebar"},"basic/borrowing":{"id":"basic/borrowing","title":"A.35. Borrowing","description":"Pada chapter ini kita akan belajar tentang apa itu borrowing dalam Rust programming.","sidebar":"tutorialSidebar"},"basic/build-dan-run-program-rust":{"id":"basic/build-dan-run-program-rust","title":"A.2. Build dan Run Program Rust","description":"Cara run program Rust menggunakan cargo. Pada chapter ini kita akan belajar lebih lanjut tentang command untuk proses build dan run dalam program Rust. Sebelumnya kita sudah belajar tentang cargo new dan cargo run, selain command tersebut ada juga command lain yaitu cargo build untuk proses kompilasi build kode program.","sidebar":"tutorialSidebar"},"basic/closures":{"id":"basic/closures","title":"A.48. Closures","description":"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope.","sidebar":"tutorialSidebar"},"basic/datetime":{"id":"basic/datetime","title":"A.52. Date Time","description":"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming.","sidebar":"tutorialSidebar"},"basic/enum":{"id":"basic/enum","title":"A.26. Enum","description":"Enum atau enumerated type adalah sebuah tipe data yang digunakan untuk menampung nilai konstan. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/file-path-directory":{"id":"basic/file-path-directory","title":"A.53. File, Path, Directory","description":"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system.","sidebar":"tutorialSidebar"},"basic/function":{"id":"basic/function","title":"A.17. Function","description":"Pada chapter ini kita akan belajar tentang function atau fungsi.","sidebar":"tutorialSidebar"},"basic/generics":{"id":"basic/generics","title":"A.38. Generics","description":"Chapter ini membahas tentang generics.","sidebar":"tutorialSidebar"},"basic/hello-rust":{"id":"basic/hello-rust","title":"A.1. Program Pertama \u279c Hello Rust","description":"Belajar membuat program hello world di Rust, dimulai dengan pembuatan program Hello World sederhana.","sidebar":"tutorialSidebar"},"basic/komentar":{"id":"basic/komentar","title":"A.3. Komentar","description":"Pada chapter ini kita akan membahas tentang komentar pada pemrograman Rust. Ada beberapa jenis komentar yang tersedia, namun untuk sekarang yang penting diketahui hanya 2.","sidebar":"tutorialSidebar"},"basic/konstanta":{"id":"basic/konstanta","title":"A.7. Konstanta","description":"Chapter ini membahas tentang konstanta di bahasa Rust.","sidebar":"tutorialSidebar"},"basic/lifetime":{"id":"basic/lifetime","title":"A.44. Lifetime","description":"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid.","sidebar":"tutorialSidebar"},"basic/method":{"id":"basic/method","title":"A.25. Method","description":"Pada chapter ini kita akan belajar tentang method beserta perbedaannya dengan associated function.","sidebar":"tutorialSidebar"},"basic/module-basic":{"id":"basic/module-basic","title":"A.20. Module System \u279c Module","description":"Module adalah salah satu chapter yang cukup penting dalam pemrograman Rust. Pada bagian ini kita akan mempelajari dasarnya.","sidebar":"tutorialSidebar"},"basic/module-inline":{"id":"basic/module-inline","title":"A.21. Module System \u279c Inline Module","description":"Pada chapter sebelumnya kita telah belajar cara manajemen module. Pembahasan tersebut dilanjut pada chapter ini, yaitu tentang inline module.","sidebar":"tutorialSidebar"},"basic/module-scope-item-access":{"id":"basic/module-scope-item-access","title":"A.22. Module System \u279c Scope & Akses Item","description":"Pembahasan chapter ini masih dalam lingkup module system, yaitu tentang scope dan pengakesan module item.","sidebar":"tutorialSidebar"},"basic/operator":{"id":"basic/operator","title":"A.8. Operator","description":"Chapter ini membahas mengenai operator pada pemrograman rust.","sidebar":"tutorialSidebar"},"basic/operator-tanda-tanya":{"id":"basic/operator-tanda-tanya","title":"A.41. Operator ?","description":"Operator ? (atau question mark operator) adalah operator yang cukup berguna untuk operasi unwrap nilai dari tipe Result atau Option. Pada chapter ini kita akan belajar tentang operator tersebut.","sidebar":"tutorialSidebar"},"basic/option-type":{"id":"basic/option-type","title":"A.39. Tipe Data \u279c Option","description":"Option adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (None). Chapter ini membahas tentang tipe data tersebut.","sidebar":"tutorialSidebar"},"basic/ownership":{"id":"basic/ownership","title":"A.34. Ownership","description":"Chapter ini berisi pembahasan tentang ownership, bagaimana Rust melakukan manajemen memory dengan menerapkan approach ownership ini.","sidebar":"tutorialSidebar"},"basic/package-crate":{"id":"basic/package-crate","title":"A.19. Module System \u279c Package & Crate","description":"Chapter ini membahas mengenai konsep package dan path dalam Rust programming. Pembelajaran dimulai dari pembahasan mengenai konsep crate terlebih dahulu, kemudian masuk ke package.","sidebar":"tutorialSidebar"},"basic/path-item":{"id":"basic/path-item","title":"A.18. Module System \u279c Path & Item","description":"Chapter ini membahas tentang konsep path dan item dalam Rust programming.","sidebar":"tutorialSidebar"},"basic/pattern-matching":{"id":"basic/pattern-matching","title":"A.42. Pattern Matching","description":"Chapter ini membahas tentang pattern matching, sebuah teknik yang lebih advance dibanding seleksi kondisi biasa.","sidebar":"tutorialSidebar"},"basic/perulangan-for-in":{"id":"basic/perulangan-for-in","title":"A.12. Perulangan \u279c for in","description":"for in adalah salah satu keyword untuk operasi perulangan yang ada di Rust selain loop dan while. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/perulangan-loop-break-continue-label":{"id":"basic/perulangan-loop-break-continue-label","title":"A.11. Perulangan \u279c loop, break, continue, label","description":"Selain keyword while, ada juga keyword loop yang fungsi dasarnya adalah sama, yaitu untuk perulangan.","sidebar":"tutorialSidebar"},"basic/perulangan-while":{"id":"basic/perulangan-while","title":"A.10. Perulangan \u279c while","description":"Di Rust ada beberapa cara untuk melakukan perulangan, salah satunya adalah dengan menggunakan keyword while, dan pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/pointer-references":{"id":"basic/pointer-references","title":"A.33. Pointer & References","description":"Chapter ini membahas tentang apa itu pointer, references, dan dereferences. Pembelajaran dimulai tentang konsep dan praktik dasar tentang ketiga topik tersebut, kemudian diikuti dengan pembahasan tentang karakteristik pointer & reference.","sidebar":"tutorialSidebar"},"basic/result-type":{"id":"basic/result-type","title":"A.40. Tipe Data \u279c Result","description":"Chapter ini membahas tentang tipe data Result, yaitu tipe data yang digunakan untuk menampung nilai yang isinya bisa berupa penanda operasi sukses (Ok) dan data, atau error (Err) beserta keterangan errornya.","sidebar":"tutorialSidebar"},"basic/seleksi-kondisi-if":{"id":"basic/seleksi-kondisi-if","title":"A.9. Seleksi Kondisi \u279c if, else if, else","description":"Pada chapter ini kita akan bahas tentang penerapan if untuk kontrol alur program.","sidebar":"tutorialSidebar"},"basic/shadowing":{"id":"basic/shadowing","title":"A.31. Shadowing","description":"Pada chapter ini kita akan belajar tentang shadowing pada variable dan apa perbedaannya dibanding variable mutable.","sidebar":"tutorialSidebar"},"basic/slice":{"id":"basic/slice","title":"A.14. Slice (Basic)","description":"Pada bab ini kita belajar tentang apa itu slice, apa perbedaan slice dan array, slicing atau borrowing pada slice, dan juga slice mutability.","sidebar":"tutorialSidebar"},"basic/slice-memory-management":{"id":"basic/slice-memory-management","title":"A.45. Slice Memory Management","description":"Kita telah mempelajari tipe data Array dan Vector, serta sudah beberapa kali menggunakan tipe data string slice (String). 3 tipe data itu memiliki kemiripan, yaitu kesemuanya termasuk dalam kategori tipe data slice.","sidebar":"tutorialSidebar"},"basic/static":{"id":"basic/static","title":"A.43. Static Item","description":"Pada chapter ini kita akan bahas tentang apa itu static item, dan perbedaanya dibanding konstanta.","sidebar":"tutorialSidebar"},"basic/string-slice-vs-string-literal":{"id":"basic/string-slice-vs-string-literal","title":"A.46. String Literal (&str) vs. String Custom Type","description":"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau String.","sidebar":"tutorialSidebar"},"basic/struct":{"id":"basic/struct","title":"A.23. Struct","description":"Pada chapter ini kita akan belajar tentang struct.","sidebar":"tutorialSidebar"},"basic/tipe-data-custom-type-string-slice":{"id":"basic/tipe-data-custom-type-string-slice","title":"A.47. Tipe Data \u279c String Custom Type","description":"Pembahasan kali ini lingkupnya masih dalam topik custom type String.","sidebar":"tutorialSidebar"},"basic/tipe-data-primitive-scalar":{"id":"basic/tipe-data-primitive-scalar","title":"A.5. Tipe Data \u279c Primitive Scalar","description":"Tipe data di Rust dikategorikan menjadi beberapa group, salah satunya adalah group tipe data primitif scalar atau biasa disebut scalar types. Pada chapter ini kita akan mempelajarinya.","sidebar":"tutorialSidebar"},"basic/tipe-data-string-literal":{"id":"basic/tipe-data-string-literal","title":"A.6. Tipe Data \u279c String Literal (&str)","description":"String adalah tipe data penting dalam pemrograman manapun. Biasanya tiap bahasa punya cara berbeda dalam meng-handle tipe ini. Di bahasa Rust, ada dua jenis tipe data string:","sidebar":"tutorialSidebar"},"basic/trait-function":{"id":"basic/trait-function","title":"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)","description":"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure.","sidebar":"tutorialSidebar"},"basic/trait-iterator":{"id":"basic/trait-iterator","title":"A.50. Trait \u279c Iterator","description":"Iterator adalah salah satu trait dan tipe data custom penting pada Rust programming, gunanya untuk iterasi data. Di chapter ini kita akan mempelajarinya beserta beberapa module item lainnya yang masih relevan dengan topik Iterator.","sidebar":"tutorialSidebar"},"basic/traits":{"id":"basic/traits","title":"A.36. Traits","description":"Trait jika diartikan dalam Bahasa Indonesia artinya adalah sifat. Chapter ini akan membahas tentang apa itu trait, apa kegunaannya, dan bagaimana cara penerapannya di Rust programming.","sidebar":"tutorialSidebar"},"basic/tuple":{"id":"basic/tuple","title":"A.15. Tipe Data \u279c Tuple","description":"Pada chapter ini kita akan membahas tentang tipe data kolektif bernama Tuple.","sidebar":"tutorialSidebar"},"basic/type-alias-casting":{"id":"basic/type-alias-casting","title":"A.27. Type Alias & Casting","description":"Chapter ini membahas tentang type alias dan juga casting (explicit conversion) pada tipe data primitif scalar.","sidebar":"tutorialSidebar"},"basic/unrecoverable-panic-error":{"id":"basic/unrecoverable-panic-error","title":"A.54. Error \u279c Unrecoverable Error / Panic","description":"Error handling atau penanganan error adalah salah satu aspek penting dalam pemrograman selalu umum. Rust mengenal 2 jenis error yaitu unrecoverable error (panic error) dan recoverable error. Pembahasan chapter ini fokus pada unrecoverable error atau panic error.","sidebar":"tutorialSidebar"},"basic/use":{"id":"basic/use","title":"A.29. Module System \u279c Use, Import, Re-export","description":"Keyword use digunakan untuk dua hal, yaitu import path dan re-export path. Sebenarnya kita telah mempelajari kedua penerapan tersebut pada beberapa chapter sebelumnya. Pada chapter ini kita akan ulang lagi pembahasan agar lebih jelas.","sidebar":"tutorialSidebar"},"basic/variabel":{"id":"basic/variabel","title":"A.4. Variabel","description":"Rust merupakan bahasa yang kalau dikategorikan berdasarkan type system-nya adalah statically typed, yang artinya semua tipe data harus diketahui saat kompilasi (compile time).","sidebar":"tutorialSidebar"},"basic/vector":{"id":"basic/vector","title":"A.16. Tipe Data \u279c Vector","description":"Pada chapter ini kita akan belajar tetang tipe data Vector. Vector adalah tipe data seperti array tapi dinamis. Dinamis di sini artinya bisa bertambah dan berkurang kapanpun sesuai kebutuhan.","sidebar":"tutorialSidebar"},"basic/visibility-privacy":{"id":"basic/visibility-privacy","title":"A.28. Module System \u279c Visibility & Privacy","description":"Kita sebenarnya sudah mempelajari banyak hal yang berhubungan dengan visibility & privacy pada beberapa chapter sebelumnya. Jika pembaca mempelajari ebook ini secara urut, maka pastinya sudah familiar dengan keyword pub, self, crate, dan super.","sidebar":"tutorialSidebar"},"CONTRIBUTING":{"id":"CONTRIBUTING","title":"Contribution & Tech Stack","description":"Ebook Dasar Pemrograman Rust adalah project open source. Siapapun bebas untuk berkontribusi di sini, bisa dalam bentuk perbaikan typo, update kalimat, maupun submit tulisan baru.","sidebar":"tutorialSidebar"},"download-pdf":{"id":"download-pdf","title":"Download versi PDF","description":"Ebook Dasar Pemrograman Rust bisa di-download dalam bentuk file PDF, silakan gunakan link berikut:","sidebar":"tutorialSidebar"},"index":{"id":"index","title":"Tutorial Belajar Rust (Gratis!)","description":"Rust adalah sebuah bahasa pemrograman general purpose yang fokus pada performance, type safety, dan concurrency. Bahasa ini diciptakan sebagai alternatif bahasa pemrograman yang berfokus pada hal-hal yang cukup low-level tapi tetap men-support fitur yang sifatnya high-level.","sidebar":"tutorialSidebar"},"installation/instalasi-rust":{"id":"installation/instalasi-rust","title":"Instalasi Rust","description":"Pada chapter ini kita akan belajar cara instalasi Rust. Pembaca bisa mengikuti panduan instalasi ini, atau langsung saja navigasi ke https://www.rust-lang.org/tools/install.","sidebar":"tutorialSidebar"},"installation/rust-editor-plugin":{"id":"installation/rust-editor-plugin","title":"Rust Editor & Plugin","description":"Pemilihan editor dan plugin","sidebar":"tutorialSidebar"},"LICENSE":{"id":"LICENSE","title":"Lisensi & Distribusi Konten","description":"Ebook Dasar Pemrograman Rust gratis untuk disebarluaskan secara bebas, dengan catatan sesuai dengan aturan lisensi CC BY-SA 4.0 yang kurang lebih sebagai berikut:","sidebar":"tutorialSidebar"},"pengelanan-rust-programming":{"id":"pengelanan-rust-programming","title":"Pengenalan Rust Programming","description":"Rust adalah sebuah bahasa pemrograman general purpose yang fokus pada performance, type safety, dan concurrency. Bahasa ini diciptakan sebagai alternatif bahasa pemrograman yang berfokus pada hal-hal yang cukup low-level tapi tetap men-support fitur yang sifatnya high-level.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/9a3629a6.23affd87.js b/assets/js/9a3629a6.23affd87.js new file mode 100644 index 00000000..0ed71537 --- /dev/null +++ b/assets/js/9a3629a6.23affd87.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[7865],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>k});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),o=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},u=function(e){var t=o(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),m=o(a),k=i,c=m["".concat(s,".").concat(k)]||m[k]||d[k]||r;return a?n.createElement(c,l(l({ref:t},u),{},{components:a})):n.createElement(c,l({ref:t},u))}));function k(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=m;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p.mdxType="string"==typeof e?e:i,l[1]=p;for(var o=2;o{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>p,toc:()=>o});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:53,title:"A.53. File, Path, Directory",sidebar_label:"A.53. File, Path, Directory"},l=void 0,p={unversionedId:"basic/file-path-directory",id:"basic/file-path-directory",title:"A.53. File, Path, Directory",description:"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system.",source:"@site/docs/basic/file-path-directory.md",sourceDirName:"basic",slug:"/basic/file-path-directory",permalink:"/basic/file-path-directory",draft:!1,tags:[],version:"current",sidebarPosition:53,frontMatter:{sidebar_position:53,title:"A.53. File, Path, Directory",sidebar_label:"A.53. File, Path, Directory"},sidebar:"tutorialSidebar",previous:{title:"A.52. Date Time",permalink:"/basic/datetime"},next:{title:"A.54. Error \u279c Unrecoverable Error / Panic",permalink:"/basic/unrecoverable-panic-error"}},s={},o=[{value:"A.53.1. File path (std::path::Path)",id:"a531-file-path-stdpathpath",level:2},{value:"A.53.2. Method filepath",id:"a532-method-filepath",level:2},{value:"\u25c9 Associated function Path::new()",id:"-associated-function-pathnew",level:3},{value:"\u25c9 Method join()",id:"-method-join",level:3},{value:"\u25c9 Method exists()",id:"-method-exists",level:3},{value:"\u25c9 Method is_file() & is_dir()",id:"-method-is_file--is_dir",level:3},{value:"\u25c9 Method is_absolute() & is_relative()",id:"-method-is_absolute--is_relative",level:3},{value:"A.53.3. Module std::fs (file system)",id:"a533-module-stdfs-file-system",level:2},{value:"A.53.4. Manajemen file system",id:"a534-manajemen-file-system",level:2},{value:"\u25c9 Pembuatan folder (fs::create_dir)",id:"-pembuatan-folder-fscreate_dir",level:3},{value:"\u25c9 Menulis konten file (fs::write)",id:"-menulis-konten-file-fswrite",level:3},{value:"\u25c9 Membaca isi file ke bentuk string (fs::read_to_string)",id:"-membaca-isi-file-ke-bentuk-string-fsread_to_string",level:3},{value:"\u25c9 Membaca isi file ke bentuk vector (fs::read)",id:"-membaca-isi-file-ke-bentuk-vector-fsread",level:3},{value:"\u25c9 Menghapus file (fs::remove_file)",id:"-menghapus-file-fsremove_file",level:3},{value:"\u25c9 Menghapus folder (fs::remove_dir)",id:"-menghapus-folder-fsremove_dir",level:3},{value:"\u25c9 List items dalam folder",id:"-list-items-dalam-folder",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],u={toc:o};function d(e){let{components:t,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system."),(0,i.kt)("h2",{id:"a531-file-path-stdpathpath"},"A.53.1. File path (",(0,i.kt)("inlineCode",{parentName:"h2"},"std::path::Path"),")"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},'"/home/novalagung/Desktop/my text.txt"')," adalah salah satu contoh file path. Di Rust, file path bisa direpresentasikan sebagai string (seperti yang sudah dicontohkan), atau menggunakan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Path"),"."),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Path")," tersedia dalam module ",(0,i.kt)("inlineCode",{parentName:"p"},"std::path"),". Cara penggunaannya cukup mudah, sebagai contoh, beberapa filepath berikut menghasilkan path yang sama:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'use std::path::Path;\n\nlet filepath_1 = "/home/novalagung/Desktop/my text.txt";\nlet filepath_2 = Path::new("/home/novalagung/Desktop/my text.txt");\nlet filepath_3 = Path::new("/home/novalagung/Desktop").join("my text.txt");\nlet filepath_4 = Path::new("/home/novalagung").join("Desktop").join("my text.txt");\nlet filepath_5 = Path::new("/home").join("novalagung/Desktop/my text.txt");\n\nprintln!("{:?}", filepath_1);\n// output => "/home/novalagung/Desktop/my text.txt"\n\nprintln!("{:?}", filepath_2);\n// output => "/home/novalagung/Desktop/my text.txt"\n')),(0,i.kt)("h2",{id:"a532-method-filepath"},"A.53.2. Method filepath"),(0,i.kt)("h3",{id:"-associated-function-pathnew"},"\u25c9 Associated function ",(0,i.kt)("inlineCode",{parentName:"h3"},"Path::new()")),(0,i.kt)("p",null,"Digunakan untuk membuat object ",(0,i.kt)("inlineCode",{parentName:"p"},"Path")," dari suatu string. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'Path::new("/home/novalagung/Desktop/my text.txt");\n')),(0,i.kt)("h3",{id:"-method-join"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"join()")),(0,i.kt)("p",null,"Digunakan untuk menggabungkan segment filepath. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'Path::new("/home/novalagung").join("Desktop").join("my text.txt");\n')),(0,i.kt)("p",null,"Hasil dari operasi di atas adalah path:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"/home/novalagung/Desktop/my text.txt\n")),(0,i.kt)("h3",{id:"-method-exists"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"exists()")),(0,i.kt)("p",null,"Digunakan untuk mengecek apakah suatu filepath ada atau tidak."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(&path).exists() {\n // path exists\n}\n")),(0,i.kt)("h3",{id:"-method-is_file--is_dir"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_file()")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_dir()")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_file()")," digunakan untuk mengecek apakah suatu filepath berisi file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(&path).is_file() {\n // path is a file\n}\n")),(0,i.kt)("p",null,"Sedangkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_dir()")," digunakan untuk mengecek apakah suatu filepath adalah folder/directory."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(&path).is_dir() {\n // path contains directory\n}\n")),(0,i.kt)("h3",{id:"-method-is_absolute--is_relative"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_absolute()")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_relative()")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_absolute()")," digunakan untuk mengecek apakah suatu filepath adalah ",(0,i.kt)("em",{parentName:"p"},"absolute path"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(&path).is_absolute() {\n // path is an absolute path\n}\n")),(0,i.kt)("p",null,"Sedangkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_relative()")," digunakan untuk mengecek apakah suatu filepath adalah ",(0,i.kt)("em",{parentName:"p"},"relative path"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(&path).is_relative() {\n // path is a relative path\n}\n")),(0,i.kt)("h2",{id:"a533-module-stdfs-file-system"},"A.53.3. Module ",(0,i.kt)("inlineCode",{parentName:"h2"},"std::fs")," (file system)"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"std::fs")," merupakan module yang disediakan Rust untuk pengolahan file system. Di dalamnya berisinya banyak sekali fungsi untuk keperluan seperti pembuatan file, modifikasi konten file, dan lainnya."),(0,i.kt)("p",null,"Sebagai contoh, untuk membuat suatu directory bisa menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir"),". Isi argument pemanggilan fungsi dengan path dalam bentuk string (atau ",(0,i.kt)("inlineCode",{parentName:"p"},"std::path::Path")," juga boleh)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'use std::fs;\n\nfn main() {\n let path = "./files";\n let res = fs::create_dir(&path);\n println!("{:?}", res);\n // output => Ok(())\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir")," mengembalikan value bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result<(), Error>"),". Gunakan pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk mengecek hasil operasi apakah sukses atau tidak."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match fs::create_dir("./files") {\n Err(err) => {\n println!("error on creating directory! {}", err);\n },\n _ => {\n println!("directory created");\n },\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Lebih detailnya mengenai tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result"),"."),(0,i.kt)("li",{parentName:"ul"},"Lebih detailnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching"),"."))),(0,i.kt)("h2",{id:"a534-manajemen-file-system"},"A.53.4. Manajemen file system"),(0,i.kt)("h3",{id:"-pembuatan-folder-fscreate_dir"},"\u25c9 Pembuatan folder (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::create_dir"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir")," digunakan untuk membuat folder. Contoh penerapannya sudah dibahas di sesi ",(0,i.kt)("a",{parentName:"p",href:"/basic/file-path-directory#a523-module-stdfs-file-system"},"A.53.3. Module std::fs (file system)")," di atas."),(0,i.kt)("h3",{id:"-menulis-konten-file-fswrite"},"\u25c9 Menulis konten file (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::write"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::write")," digunakan untuk membuat folder. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet content = "hello rust!";\nlet res = fs::write(&path, &content);\n\nmatch res {\n Err(err) => {\n println!("error on writing file {}! {}", path.to_str().unwrap_or_default(), err);\n },\n _ => {\n println!("file created");\n },\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::write")," melakukan penulisan konten pada variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"content")," ke path ",(0,i.kt)("inlineCode",{parentName:"p"},"path"),". Mode penulisannya adalah ",(0,i.kt)("em",{parentName:"p"},"overwrite")," (bukan ",(0,i.kt)("em",{parentName:"p"},"append"),"), yang artinya konten lama pada filepath akan di-",(0,i.kt)("em",{parentName:"p"},"replace")," total dengan konten baru."),(0,i.kt)("p",null,"Jika file tidak ada pada ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," tujuan, maka otomatis dibuatkan file baru. Namun jika folder/directory di mana file akan dibuat/ditulis tidak ada, maka muncul error."),(0,i.kt)("h3",{id:"-membaca-isi-file-ke-bentuk-string-fsread_to_string"},"\u25c9 Membaca isi file ke bentuk string (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::read_to_string"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::read_to_string()")," digunakan untuk membaca isi file dalam bentuk string. Contoh penerapannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet res = fs::read_to_string(&path);\n\nmatch res {\n Err(err) => {\n println!("error on reading file {}! {}", path.to_str().unwrap_or_default(), err);\n },\n Ok(content) => {\n println!("file {:?} content is: {:?}", path, content);\n },\n}\n')),(0,i.kt)("h3",{id:"-membaca-isi-file-ke-bentuk-vector-fsread"},"\u25c9 Membaca isi file ke bentuk vector (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::read"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::read()")," melakukan operasi baca file dan mengembalikan nilainya dalam bentuk vector ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),". Umumnya, fungsi ini dikombinasikan dengan fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"std::str::from_utf8()")," agar konten file bisa dimunculkan dalam format encoding tertentu (misalnya UTF-8)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet res = fs::read(&path);\n\nif res.is_err() {\n println!("error on reading file");\n return;\n}\n\nlet content = res.unwrap_or_default();\nmatch std::str::from_utf8(&content) {\n Err(err) => {\n println!("error on reading file! Invalid UTF-8 sequence. {}", err);\n },\n Ok(content) => {\n println!("file {:?} content is: {:?}", path, content);\n },\n};\n')),(0,i.kt)("h3",{id:"-menghapus-file-fsremove_file"},"\u25c9 Menghapus file (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::remove_file"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::remove_file")," digunakan untuk menghapus file pada suatu path. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet res = fs::remove_file(&path);\n\nmatch res {\n Err(err) => {\n println!("error on deleting file {}! {}", path.to_str().unwrap_or_default(), err);\n },\n _ => {\n println!("file deleted");\n },\n}\n')),(0,i.kt)("h3",{id:"-menghapus-folder-fsremove_dir"},"\u25c9 Menghapus folder (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::remove_dir"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::remove_dir")," digunakan untuk menghapus folder/directory. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files");\nlet res = fs::remove_dir(&path);\n\nmatch res {\n Err(err) => {\n println!("error on deleting directory {}! {}", path.to_str().unwrap_or_default(), err);\n },\n _ => {\n println!("directory deleted");\n },\n}\n')),(0,i.kt)("h3",{id:"-list-items-dalam-folder"},"\u25c9 List items dalam folder"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::read_dir")," digunakan untuk menampilkan list items suatu folder (baik subfolder ataupun file). Fungsi ini mengmbalikan nilai bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),", untuk mengakses list items bisa menggunakan teknik pattern matching, atau boleh juga langsung di ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap()")," (dengan resiko program bisa panic ketika ada error)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("D:\\\\Labs\\\\Adam Studio\\\\Ebook\\\\dasarpemrogramanrust\\\\file_path_directory_1");\nlet paths = fs::read_dir(&path).unwrap();\n\nfor path in paths {\n let item = &path.unwrap();\n println!("file name: {:?}, file path: {:?}", item.file_name(), item.path().display())\n}\n')),(0,i.kt)("p",null,"Pada contoh di atas, penulis menggunakan testing path yang isinya 4 buah item:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"File, Path, Directory",src:a(2944).Z,width:"595",height:"176"})),(0,i.kt)("p",null,"Output program bisa dilihat pada gambar berikut:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"File, Path, Directory",src:a(214).Z,width:"887",height:"149"})),(0,i.kt)("p",null,"Tipe data variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"paths")," di atas adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"ReadDir")," yang merupakan tipe data iterator. Jika digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for"),", maka variabel element perulangan ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," akan bertipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Dari tipe ini kita bisa mengakses file name maupun file path."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/file_path_directory"},"github.com/novalagung/dasarpemrogramanrust-example/../file_path_directory")),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang append content file (",(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/30684624/what-is-the-best-variant-for-appending-a-new-line-in-a-text-file"},"https://stackoverflow.com/questions/30684624/what-is-the-best-variant-for-appending-a-new-line-in-a-text-file"),")")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/path/struct.Path.html"},"https://doc.rust-lang.org/std/path/struct.Path.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/std_misc/path.html"},"https://doc.rust-lang.org/rust-by-example/std_misc/path.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/std_misc/fs.html"},"https://doc.rust-lang.org/rust-by-example/std_misc/fs.html"))))}d.isMDXComponent=!0},2944:(e,t,a)=>{a.d(t,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlMAAACwCAIAAACkbHy6AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFvGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi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b2bZWgtNWZtqj+VHhptrpX09pjgfITJvtitY9O3lmWtDLTZ/tRGbaK3vmzLTyAo1PcHpk9iOZVCWQmbZHUZ9OsGhc8J3qUzPTlst4d+sersxM67P+jMtEntj21BqAB4RcDU8EmWlBM8hMC7eBd7g8EWSmBc0gMy3cBq75AOBxITMt3AIiHwAA6AXv7QQAAL0g8gEAgF4Q+QAAQC+IfAAAoBdEPgAA0AsiHwAA6AWRDwAA9ILIBwAAekHkAwAAvSDyAQCAXhD5AABAL4h8AACgF0Q+AADQy/8BMFgxvPoJ+vYAAAAASUVORK5CYII="},214:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/file-path-directory-2-bbe0bb5499225e418b251930c44fb8f6.png"}}]); \ No newline at end of file diff --git a/assets/js/9a3629a6.3b2e999d.js b/assets/js/9a3629a6.3b2e999d.js deleted file mode 100644 index d89195d6..00000000 --- a/assets/js/9a3629a6.3b2e999d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[7865],{3905:(e,t,a)=>{a.d(t,{Zo:()=>o,kt:()=>h});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},o=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,o=p(e,["components","mdxType","originalType","parentName"]),m=u(a),h=i,k=m["".concat(s,".").concat(h)]||m[h]||d[h]||r;return a?n.createElement(k,l(l({ref:t},o),{},{components:a})):n.createElement(k,l({ref:t},o))}));function h(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=m;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p.mdxType="string"==typeof e?e:i,l[1]=p;for(var u=2;u{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>p,toc:()=>u});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:52,title:"A.52. File, Path, Directory",sidebar_label:"A.52. File, Path, Directory"},l=void 0,p={unversionedId:"basic/file-path-directory",id:"basic/file-path-directory",title:"A.52. File, Path, Directory",description:"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system.",source:"@site/docs/basic/file-path-directory.md",sourceDirName:"basic",slug:"/basic/file-path-directory",permalink:"/basic/file-path-directory",draft:!1,tags:[],version:"current",sidebarPosition:52,frontMatter:{sidebar_position:52,title:"A.52. File, Path, Directory",sidebar_label:"A.52. File, Path, Directory"},sidebar:"tutorialSidebar",previous:{title:"A.51. Date Time",permalink:"/basic/datetime"}},s={},u=[{value:"A.52.1. File path (std::path::Path)",id:"a521-file-path-stdpathpath",level:2},{value:"A.52.2. Method filepath",id:"a522-method-filepath",level:2},{value:"\u25c9 Associated function Path::new()",id:"-associated-function-pathnew",level:3},{value:"\u25c9 Method join()",id:"-method-join",level:3},{value:"\u25c9 Method exists()",id:"-method-exists",level:3},{value:"\u25c9 Method is_file() & is_dir()",id:"-method-is_file--is_dir",level:3},{value:"\u25c9 Method is_absolute() & is_relative()",id:"-method-is_absolute--is_relative",level:3},{value:"A.52.3. Module std::fs (file system)",id:"a523-module-stdfs-file-system",level:2},{value:"A.52.4. Manajemen file system",id:"a524-manajemen-file-system",level:2},{value:"\u25c9 Pembuatan folder (fs::create_dir)",id:"-pembuatan-folder-fscreate_dir",level:3},{value:"\u25c9 Menulis konten file (fs::write)",id:"-menulis-konten-file-fswrite",level:3},{value:"\u25c9 Menghapus file (fs::remove_file)",id:"-menghapus-file-fsremove_file",level:3},{value:"\u25c9 Menghapus folder (fs::remove_dir)",id:"-menghapus-folder-fsremove_dir",level:3},{value:"\u25c9 List items dalam folder",id:"-list-items-dalam-folder",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Work in progress",id:"-work-in-progress",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],o={toc:u};function d(e){let{components:t,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},o,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan belajar tentang beberapa API milik Rust yang disediakan untuk manajemen path dan file system."),(0,i.kt)("h2",{id:"a521-file-path-stdpathpath"},"A.52.1. File path (",(0,i.kt)("inlineCode",{parentName:"h2"},"std::path::Path"),")"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},'"/home/novalagung/Desktop/my text.txt"')," adalah salah satu contoh file path. Di Rust, file path bisa direpresentasikan sebagai string (seperti yang sudah dicontohkan), atau menggunakan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Path"),"."),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Path")," tersedia dalam module ",(0,i.kt)("inlineCode",{parentName:"p"},"std::path"),". Cara penggunaannya cukup mudah, sebagai contoh, beberapa filepath berikut menghasilkan path yang sama:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let filepath_1 = "/home/novalagung/Desktop/my text.txt";\nlet filepath_2 = Path::new("/home/novalagung/Desktop/my text.txt");\nlet filepath_3 = Path::new("/home/novalagung/Desktop").join("my text.txt");\nlet filepath_4 = Path::new("/home/novalagung").join("Desktop").join("my text.txt");\nlet filepath_5 = Path::new("/home").join("novalagung/Desktop/my text.txt");\n')),(0,i.kt)("h2",{id:"a522-method-filepath"},"A.52.2. Method filepath"),(0,i.kt)("h3",{id:"-associated-function-pathnew"},"\u25c9 Associated function ",(0,i.kt)("inlineCode",{parentName:"h3"},"Path::new()")),(0,i.kt)("p",null,"Digunakan untuk membuat object ",(0,i.kt)("inlineCode",{parentName:"p"},"Path")," dari suatu string. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'Path::new("/home/novalagung/Desktop/my text.txt");\n')),(0,i.kt)("h3",{id:"-method-join"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"join()")),(0,i.kt)("p",null,"Digunakan untuk menggabungkan segment filepath. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'Path::new("/home/novalagung").join("Desktop").join("my text.txt");\n')),(0,i.kt)("p",null,"Hasil dari operasi di atas adalah path:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"/home/novalagung/Desktop/my text.txt\n")),(0,i.kt)("h3",{id:"-method-exists"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"exists()")),(0,i.kt)("p",null,"Digunakan untuk mengecek apakah suatu filepath ada atau tidak."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(path).exists() {\n // path exists\n}\n")),(0,i.kt)("h3",{id:"-method-is_file--is_dir"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_file()")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_dir()")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_file()")," digunakan untuk mengecek apakah suatu filepath berisi file."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(path).is_file() {\n // path is a file\n}\n")),(0,i.kt)("p",null,"Sedangkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_dir()")," digunakan untuk mengecek apakah suatu filepath adalah folder/directory."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(path).is_dir() {\n // path contains directory\n}\n")),(0,i.kt)("h3",{id:"-method-is_absolute--is_relative"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_absolute()")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_relative()")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_absolute()")," digunakan untuk mengecek apakah suatu filepath adalah ",(0,i.kt)("em",{parentName:"p"},"absolute path"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(path).is_absolute() {\n // path is an absolute path\n}\n")),(0,i.kt)("p",null,"Sedangkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_relative()")," digunakan untuk mengecek apakah suatu filepath adalah ",(0,i.kt)("em",{parentName:"p"},"relative path"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"if Path::new(path).is_relative() {\n // path is a relative path\n}\n")),(0,i.kt)("h2",{id:"a523-module-stdfs-file-system"},"A.52.3. Module ",(0,i.kt)("inlineCode",{parentName:"h2"},"std::fs")," (file system)"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"std::fs")," merupakan module yang disediakan Rust untuk pengolahan file system. Di dalamnya berisinya banyak sekali fungsi untuk keperluan seperti pembuatan file, modifikasi konten file, dan lainnya."),(0,i.kt)("p",null,"Sebagai contoh, untuk membuat suatu directory bisa menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir"),". Isi argument pemanggilan fungsi dengan path dalam bentuk string (atau ",(0,i.kt)("inlineCode",{parentName:"p"},"std::path::Path")," juga boleh)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = "./files";\nlet res = fs::create_dir(path);\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir")," mengembalikan value bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result<(), Error>"),". Gunakan pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk mengecek hasil operasi apakah sukses atau tidak."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'match fs::create_dir("./files") {\n Err(err) => {\n println!("error on creating directory! {}", err);\n return\n },\n _ => {},\n}\n')),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"Lebih detailnya mengenai tipe data ",(0,i.kt)("inlineCode",{parentName:"li"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result"),"."),(0,i.kt)("li",{parentName:"ul"},"Lebih detailnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching"),"."))),(0,i.kt)("h2",{id:"a524-manajemen-file-system"},"A.52.4. Manajemen file system"),(0,i.kt)("h3",{id:"-pembuatan-folder-fscreate_dir"},"\u25c9 Pembuatan folder (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::create_dir"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::create_dir")," digunakan untuk membuat folder. Contoh penerapannya sudah dibahas di sesi ",(0,i.kt)("a",{parentName:"p",href:"/basic/file-path-directory#a523-module-stdfs-file-system"},"A.52.3. Module std::fs (file system)")," di atas."),(0,i.kt)("h3",{id:"-menulis-konten-file-fswrite"},"\u25c9 Menulis konten file (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::write"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::write")," digunakan untuk membuat folder. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet content = "hello rust!";\nlet res = fs::write(path, content);\n\nmatch res {\n Err(err) => {\n println!("error on writing file {}! {}", path.to_str().unwrap_or_default(), err);\n return\n },\n _ => {},\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::write")," melakukan penulisan konten pada variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"content")," ke path ",(0,i.kt)("inlineCode",{parentName:"p"},"path"),". Mode penulisannya adalah ",(0,i.kt)("em",{parentName:"p"},"overwrite")," (bukan ",(0,i.kt)("em",{parentName:"p"},"append"),"), yang artinya konten lama pada filepath akan di-",(0,i.kt)("em",{parentName:"p"},"replace")," total dengan konten baru."),(0,i.kt)("p",null,"Jika file tidak ada pada ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," tujuan, maka otomatis dibuatkan file baru. Namun jika folder/directory di mana file akan dibuat/ditulis tidak ada, maka muncul error."),(0,i.kt)("h3",{id:"-menghapus-file-fsremove_file"},"\u25c9 Menghapus file (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::remove_file"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::remove_file")," digunakan untuk menghapus file pada suatu path. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files").join("target.txt");\nlet res = fs::remove_file(path);\n\nmatch res {\n Err(err) => {\n println!("error on deleting file {}! {}", path.to_str().unwrap_or_default(), err);\n return\n },\n _ => {},\n}\n')),(0,i.kt)("h3",{id:"-menghapus-folder-fsremove_dir"},"\u25c9 Menghapus folder (",(0,i.kt)("inlineCode",{parentName:"h3"},"fs::remove_dir"),")"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::remove_dir")," digunakan untuk menghapus folder/directory. Contoh penerapan:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("./files");\nlet res = fs::remove_dir(path);\n\nmatch res {\n Err(err) => {\n println!("error on deleting directory {}! {}", path.to_str().unwrap_or_default(), err);\n return\n },\n _ => {},\n}\n')),(0,i.kt)("h3",{id:"-list-items-dalam-folder"},"\u25c9 List items dalam folder"),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"fs::read_dir")," digunakan untuk menampilkan list items suatu folder (baik subfolder ataupun file). Fungsi ini mengmbalikan nilai bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),", untuk mengakses list items bisa menggunakan teknik pattern matching, atau boleh juga langsung di ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap()")," (dengan resiko program bisa panic ketika ada error)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let path = Path::new("D:\\\\Labs\\\\Adam Studio\\\\Ebook\\\\dasarpemrogramanrust\\\\file_path_directory_1");\nlet paths = fs::read_dir(path).unwrap();\n\nfor path in paths {\n let item = path.unwrap();\n println!("file name: {:?}, file path: {:?}", item.file_name(), item.path().display())\n}\n')),(0,i.kt)("p",null,"Pada contoh di atas, penulis menggunakan testing path yang isinya 4 buah item:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"File, Path, Directory",src:a(2944).Z,width:"595",height:"176"})),(0,i.kt)("p",null,"Output program bisa dilihat pada gambar berikut:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"File, Path, Directory",src:a(214).Z,width:"887",height:"149"})),(0,i.kt)("p",null,"Tipe data variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"paths")," di atas adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"ReadDir")," yang merupakan tipe data iterator. Jika digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"for"),", maka variabel element perulangan ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," akan bertipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Dari tipe ini kita bisa mengakses file name maupun file path."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/file_path_directory"},"github.com/novalagung/dasarpemrogramanrust-example/../file_path_directory")),(0,i.kt)("h3",{id:"-work-in-progress"},"\u25c9 Work in progress"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Pembahasan tentang append content file (",(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/30684624/what-is-the-best-variant-for-appending-a-new-line-in-a-text-file"},"https://stackoverflow.com/questions/30684624/what-is-the-best-variant-for-appending-a-new-line-in-a-text-file"),")")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/path/struct.Path.html"},"https://doc.rust-lang.org/std/path/struct.Path.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/std_misc/path.html"},"https://doc.rust-lang.org/rust-by-example/std_misc/path.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/std_misc/fs.html"},"https://doc.rust-lang.org/rust-by-example/std_misc/fs.html"))))}d.isMDXComponent=!0},2944:(e,t,a)=>{a.d(t,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlMAAACwCAIAAACkbHy6AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFvGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgMTM3LmRhNGE3ZTUsIDIwMjIvMTEvMjctMDk6MzU6MDMgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCAyNC4xIChXaW5kb3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zvl2yQjnXLkRiEz7XiKvtTtiqekFD4x/fAVle+mG3xBGujoyDXf29vbTz/99N133/3666+//vrrd99999NPP729vd1n47T3WplpZdspW7tqbtl2rjyqUmOxdW56g+f1yEx7nLIvdbriCSmFnWAV7adl78RwDQWfb+ia749//OOPP/749evXf/zjH7vdjogmk8nf/va3H3/88T//+c9vv/02YvmS/JMw0mtlppVtpyNde3K4pGhcg/anJNocXrBdvnx7MmZLkJlWRdmXul1xKKVwd5nMNhr5PpIl36f7uCQzbePDcw4sitm7H/dnwajAixi65jMM4/vvvy+Kogx7RLTb7Yqi+P777w3DGJhxT5V/Eo57tcy0su0cv3bZlH6Z36+83nCChT0ybWETMtM2KfqStCuOTCncyK/XXuQlmWmbV5wipcFLTgnF7L5oXJuydk3sv0PYexG3fcJFmX8SjtEiM+3Q2ruZaaVThpyxNXlRFHErEyMPS8hMexpJVxxKKTzKRZlpfWYb+w6YLN/TwpydEPpks9ejCtI9zi3DHkasXsnQaGdRFF+/fjUMYzKZ7Ec7DcP4+vVr0b8ncjyLbJ1/Eplpj9IlM+3Q2sdMuT8VT3wR8WjlDm0SMtOeQ94VR6cUVrkkM63FSJXIcSTJ7NZE8UpQw7ZNKtIThzjgwQ1Fvt9+++3f//73X//617///e///e9/iehPf/rTt99++89//lNyk0+SMFaRfxKZaY/RJTOteu1jpgydYGVWyUop5IxE5DGfEtVZATLTnkHdFUelFKbsELmaS70oM63Vbqj2W61HkcyuvE1cpOKdFpwLP3nFk2xdHRnt3Gw2P//88++///7DDz/88MMPv//++88//7zZbMavoJV/EsY5PEXJGFvnVNR3GI7fuKvJppRnpi2M+jZLmZk2HpuZ9vIBQsXay1WI5m+wZFMSETVuDPoz89JLAehRdsVamThIOkpIRJQs45waD906gQjK/406MlSZadv33sKPnMqbgFSPUrbH44efO5bNXvYw1cPByXJ+5MljeDbHf8/3yy+/nPsDvtH5J2GcZ85MK99O2dqlEtmUydwSh7ylJz7jh8y0PeMz/Z6QUri6Gm+MNBPRZZlpy0XWvbM5Hj9UIi+KvLLjSmfvpLvtPNsZcvG24scG1OFpIFfDE0FmWtAMMtPCbSAz7RNBZlrQDDLTwm3gmg8AHhcy08ItIPIBAIBekKsBAAD0gsgHAAB6QeQDAAC9IPI9K2SmBbi1yxLbwuPCrxoe26tlpu07MWmppELUZZethQiZaYe167Pzgk1qt5Oqf8oW2Zv5Ti75cSsS274qXPM9stfKTCst4OgEp9X0nQoZLHsHMtMe16/PZDlvv7+s8YM6Zf9sQmZaeEC3vuZDZtrzvVZmWpmhBKeSa7BehQyXXQWZaVWO1qc/O/SWgf7ZmuUTM9M21tF4VxkPJZlpfRHNdunUto0iXWeWN+JCFp7Zba/5kJn2fK+WmVZhZIJTklbIUNnHQWbapiP12epO6v7Z8qmZacvr1fo924yx+r3v0tlNexKzdW7YXvmv5eJw9bqQmfZBaZGZdijBaTczrbpCToXMtOfxmd0YYr+sOR4vMy1R3c+bewa8quuNdiIz7RXpkpl2dILTgQoZDZlpL1GmhtoPsV/aHA+XmRb0cr3Ih8y016NLZlpqvVt7IMHpQIWMh8y0F2jdkj2hOZ4mMy3o5ebPdiIz7Rl0yUzb2bZWgtNWZtqj+VHhptrpX09pjgfITJvtitY9O3lmWtDLTZ/tRGbaK3vmzLTyAo1PcHpk9iOZVCWQmbZHUZ9OsGhc8J3qUzPTlst4d+sersxM67P+jMtEntj21BqAB4RcDU8EmWlBM8hMC7eBd7g8EWSmBc0gMy3cBq75AOBxITMt3AIiHwAA6AXv7QQAAL0g8gEAgF4Q+QAAQC+IfAAAoBdEPgAA0AsiHwAA6AWRDwAA9ILIBwAAekHkAwAAvSDyAQCAXhD5AABAL4h8AACgF0Q+AADQy/8BMFgxvPoJ+vYAAAAASUVORK5CYII="},214:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/file-path-directory-2-bbe0bb5499225e418b251930c44fb8f6.png"}}]); \ No newline at end of file diff --git a/assets/js/a2bea3ed.769f79f2.js b/assets/js/a2bea3ed.0e7c2791.js similarity index 96% rename from assets/js/a2bea3ed.769f79f2.js rename to assets/js/a2bea3ed.0e7c2791.js index ae692480..7bedd982 100644 --- a/assets/js/a2bea3ed.769f79f2.js +++ b/assets/js/a2bea3ed.0e7c2791.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[6345],{3905:(a,e,t)=>{t.d(e,{Zo:()=>o,kt:()=>u});var n=t(7294);function i(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function r(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,n)}return t}function l(a){for(var e=1;e=0||(i[t]=a[t]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(i[t]=a[t])}return i}var p=n.createContext({}),d=function(a){var e=n.useContext(p),t=e;return a&&(t="function"==typeof a?a(e):l(l({},e),a)),t},o=function(a){var e=d(a.components);return n.createElement(p.Provider,{value:e},a.children)},m={inlineCode:"code",wrapper:function(a){var e=a.children;return n.createElement(n.Fragment,{},e)}},k=n.forwardRef((function(a,e){var t=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,o=s(a,["components","mdxType","originalType","parentName"]),k=d(t),u=i,g=k["".concat(p,".").concat(u)]||k[u]||m[u]||r;return t?n.createElement(g,l(l({ref:e},o),{},{components:t})):n.createElement(g,l({ref:e},o))}));function u(a,e){var t=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=t.length,l=new Array(r);l[0]=k;var s={};for(var p in e)hasOwnProperty.call(e,p)&&(s[p]=e[p]);s.originalType=a,s.mdxType="string"==typeof a?a:i,l[1]=s;for(var d=2;d{t.r(e),t.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:45,title:"A.45. String Literal (&str) vs. String Custom Type",sidebar_label:"A.45. String Literal (&str) vs. String Custom Type"},l=void 0,s={unversionedId:"basic/string-slice-vs-string-literal",id:"basic/string-slice-vs-string-literal",title:"A.45. String Literal (&str) vs. String Custom Type",description:"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau String.",source:"@site/docs/basic/string-slice-vs-string-literal.md",sourceDirName:"basic",slug:"/basic/string-slice-vs-string-literal",permalink:"/basic/string-slice-vs-string-literal",draft:!1,tags:[],version:"current",sidebarPosition:45,frontMatter:{sidebar_position:45,title:"A.45. String Literal (&str) vs. String Custom Type",sidebar_label:"A.45. String Literal (&str) vs. String Custom Type"},sidebar:"tutorialSidebar",previous:{title:"A.44. Slice Memory Management",permalink:"/basic/slice-memory-management"},next:{title:"A.46. Tipe Data \u279c String Custom Type",permalink:"/basic/tipe-data-custom-type-string-slice"}},p={},d=[{value:"A.45.1. String slice (String)",id:"a451-string-slice-string",level:2},{value:"A.45.2. String literal (&str)",id:"a452-string-literal-str",level:2},{value:"A.45.3. Konversi data string",id:"a453-konversi-data-string",level:2},{value:"\u25c9 Konversi String ke &str",id:"-konversi-string-ke-str",level:3},{value:"\u25c9 Konversi &str ke String",id:"-konversi-str-ke-string",level:3},{value:"A.45.4. String literal & string slice",id:"a454-string-literal--string-slice",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],o={toc:d};function m(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,n.Z)({},o,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Di chapter ini kita akan bahas apa perbedaan antara tipe data string slice (",(0,i.kt)("inlineCode",{parentName:"p"},"String"),") dan string literal ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),"."),(0,i.kt)("p",null,"Pembahasan mengenai topik ini sengaja dilakukan tidak di awal-awal ebook, karena ada banyak hal yang perlu dipahami sebelum mempelajarinya, contohnya seperti aspek management memory dan ownership. Dan karena topik tersebut sudah selesai dibahas, berarti ini adalah waktu yang tepat untuk membahas string slice."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Silakan pelajari kembali pembahasan detail tentang tipe slice pada chapter sebelumnya jika diperlukan. Chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/slice-memory-management"},"Slice Memory Management"))),(0,i.kt)("h2",{id:"a451-string-slice-string"},"A.45.1. String slice (",(0,i.kt)("inlineCode",{parentName:"h2"},"String"),")"),(0,i.kt)("p",null,"String slice atau custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," merupakan tipe data bawaan Rust, dibuat via ",(0,i.kt)("inlineCode",{parentName:"p"},"struct"),", kegunaannya untuk menampung data UTF-8 bytes yang dinamis (bisa berkembang isinya)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"String")," masuk dalam kategori tipe data slice, isinya adalah data kolektif bertipe bytes, datanya disimpan di heap memory, dan metadata-nya di stack memory. Tipe data ini dikategorikan sebagai tipe data ",(0,i.kt)("strong",{parentName:"p"},"owned"),", yang artinya owner data bisa direpresentasikan oleh variabel. Sebagai contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Lisa Blackpink");\nprintln!("str1: {str1}");\n')),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"str1")," di atas merupakan owner dari string ",(0,i.kt)("inlineCode",{parentName:"p"},"Lisa Blackpink"),". Dari string tersebut operasi borrow bisa dilakukan. Contohnya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Lisa Blackpink");\nlet slice1 = &str1[..]; // "Lisa Blackpink"\nlet slice2 = &str1[4..7]; // " Bl"\n')),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"slice1")," adalah variabel baru yang datanya didapat dari borrowing seluruh elemen string milik ",(0,i.kt)("inlineCode",{parentName:"p"},"str1"),". Sedangkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"slice2")," hanya meminjam elemen indeks ke-4 hingga elemen sebelum 7 (yaitu 6)."),(0,i.kt)("p",null,"Karena ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," sebenarnya adalah UTF-8 bytes, maka kita bisa juga membuatnya menggunakan data Bytes. Tipe bytes (atau kadang disebut ",(0,i.kt)("em",{parentName:"p"},"chars"),") di Rust direpresentasikan oleh tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"[u8]"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let bytes = vec![69, 108, 117, 118, 101, 105, 116, 105, 101, 32, 243, 159, 164, 152];\nlet str2 = String::from_utf8(bytes).unwrap();\nprintln!("str2: {}", str2);\n')),(0,i.kt)("p",null,"Pada contoh di atas, data bytes dipersiapkan dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),". Data tersebut kemudian digunakan untuk membuat string menggunakan fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"String::from_utf8()"),". Nilai balik fungsi tersebut adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Pemanggilan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," di situ agar data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"-nya di-return."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"String slcie vs string literal",src:t(108).Z,width:"458",height:"108"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Kita akan bahas tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," pada chapter terpisah, ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h2",{id:"a452-string-literal-str"},"A.45.2. String literal (",(0,i.kt)("inlineCode",{parentName:"h2"},"&str"),")"),(0,i.kt)("p",null,"Tipe data string literal atau ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah tipe yang menampung data kolektif UTF-8 bytes (seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),") tetapi ",(0,i.kt)("strong",{parentName:"p"},"immutable")," dan disimpannya tidak di heap dan tidak juga di stack, melainkan di static storage."),(0,i.kt)("p",null,"String literal hanya bisa direpresentasikan dalam bentuk reference ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," (pointer yang mengarah ke suatu bytes)."),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," termasuk kategori tipe data yang ",(0,i.kt)("strong",{parentName:"p"},"unowned")," atau reference tanpa owner (atau boleh juga diartikan sebagai tipe data yang owner-nya adalah program)."),(0,i.kt)("p",null,"Rust menjamin data string literal selalu valid. Kita juga bisa menentukan lifetime-nya secara eksplist jike diperlukan, contohnya pada tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"."),(0,i.kt)("p",null,"Cara termudah membuat ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah menggunakan string literal."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str3 = "Helena Iren Michaelsen Epica";\nprintln!("str3: {str3}");\n')),(0,i.kt)("h2",{id:"a453-konversi-data-string"},"A.45.3. Konversi data string"),(0,i.kt)("h3",{id:"-konversi-string-ke-str"},"\u25c9 Konversi ",(0,i.kt)("inlineCode",{parentName:"h3"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")),(0,i.kt)("p",null,"Data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," juga didapat melalui operasi borrow dari data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", caranya dengan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_str"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str4: String = String::from("Hiroyuki Sawano");\nlet str4_slice1: &str = str4.as_str();\nprintln!("str4: {str4}"); // str4: Hiroyuki Sawano\nprintln!("str4_slice1: {str4_slice1}"); // str4_slice1: Hiroyuki Sawano\n')),(0,i.kt)("p",null,"Bisa juga menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str")," untuk mutable borrow. Namun dalam penggunaannya, owner data diwajibkan mutable. Contohnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5: String = String::from("Hans Zimmer");\nlet str5_slice1: &mut str = str5.as_mut_str();\nprintln!("str5: {str5}");\nprintln!("str5_slice1: {str5_slice1}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"String slcie vs string literal",src:t(6484).Z,width:"650",height:"237"})),(0,i.kt)("p",null,"Hmm, error. Perlu diingat kembali aturan ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing")," bahwa tidak boleh ada operasi borrow dan juga mutable borrow dalam satu waktu. Pada contoh di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," dipinjam oleh ",(0,i.kt)("inlineCode",{parentName:"p"},"str5_slice1")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str")," (yang di dalamnya menjalankan operasi mutable borrow). Selain itu, operasi mutable borrow maksimal hanya boleh dilakukan 1x dalam satu waktu, inilah kenapa ketika kita berusaha menampilkan data ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," hasilnya error, karena statement print data ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," adalah operasi borrow."),(0,i.kt)("p",null,"Solusinya masalah di atas bisa menggunakan block expression:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5: String = String::from("Hans Zimmer");\n{\n let str5_slice1: &mut str = str5.as_mut_str();\n println!("str5_slice1: {str5_slice1}"); // str5_slice1: Hans Zimmer\n}\nprintln!("str5: {}", str5); // str5_slice1: Hans Zimmer\n')),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," bisa diakses mutable reference-nya karena memang tipe tersebut size-nya adalah dinamis."),(0,i.kt)("h3",{id:"-konversi-str-ke-string"},"\u25c9 Konversi ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"h3"},"String")),(0,i.kt)("p",null,"Masih dalam topik konversi tipe data string. Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," memiliki method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," yang gunanya adalah untuk konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str6: &str = "John Towner Williams";\nlet str6_slice1: String = str6.to_string();\nprintln!("str6: {str6}"); // str6: John Towner Williams\nprintln!("str6_slice1: {str6_slice1}"); // str6_slice1: John Towner Williams\n')),(0,i.kt)("p",null,"Konversi pada tipe data ini sedikit berbeda dibandingkan konversi ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),". Pada contoh di atas, yang terjadi adalah data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," di-copy sebagai data baru bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," yang kemudian ditampung variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"str6_slice1")," (yang juga berperan sebagai owner untuk data baru tersebut)."),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," melakukan operasi copy, bukan borrow. Artinya setelah dipanggil akan ada 2 data yang reference-nya sudah berbeda."),(0,i.kt)("h2",{id:"a454-string-literal--string-slice"},"A.45.4. String literal & string slice"),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," memiliki hubungan dekat dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),". Data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," reference-nya bisa diakses dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"&String"),", maupun dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," (menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str"),"). Data text pada string tersebut bisa dimodifikasi, ditambahi, dan juga dikurangi."),(0,i.kt)("p",null,"Berbeda dengan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ",(0,i.kt)("strong",{parentName:"p"},"(di paragraph ini dan setelahnya yang kita bahas adalah data yang dari awal tipe-nya sudah ",(0,i.kt)("inlineCode",{parentName:"strong"},"&str"),", bukan data hasil operasi pinjam dari ",(0,i.kt)("inlineCode",{parentName:"strong"},"String"),")"),", data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah fixed dan immutable. Konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," menghasilkan data baru dengan owner baru. Bisa dibilang sangat terbatas apa yang bisa kita lakukan pada tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),"."),(0,i.kt)("p",null,"Meski demikian, tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," lebih cepat performa-nya dibanding ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," karena disimpan di static storage. Selain itu dijamin valid oleh Rust. Kekurangannya hanya pada ownership-nya. Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah ",(0,i.kt)("strong",{parentName:"p"},"unowned"),", operasi mutability tidak bisa dilakukan pada tipe ini."),(0,i.kt)("p",null,"Dalam case normal, sangat dianjurkan untuk menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),", kecuali memang yang dibutuhkan adalah ",(0,i.kt)("strong",{parentName:"p"},"owned")," string."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/string_slice_vs_string_literal"},"github.com/novalagung/dasarpemrogramanrust-example/../string_slice_vs_string_literal")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-string-literal"},"Tipe Data \u279c String Literal (&str)")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-custom-type-string-slice"},"Tipe Data \u279c String Custom Type"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch08-02-strings.html"},"https://doc.rust-lang.org/book/ch08-02-strings.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://users.rust-lang.org/t/str-string-literals/29635"},"https://users.rust-lang.org/t/str-string-literals/29635")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://www.quora.com/Why-does-Rust-have-two-different-string-types-static-str-and-String"},"https://www.quora.com/Why-does-Rust-have-two-different-string-types-static-str-and-String")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/24158114/what-are-the-differences-between-rusts-string-and-str"},"https://stackoverflow.com/questions/24158114/what-are-the-differences-between-rusts-string-and-str")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings"},"https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings"))))}m.isMDXComponent=!0},108:(a,e,t)=>{t.d(e,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcoAAABsCAIAAABlzGXMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhv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OSIA7KeyVGxs5F/e9nZwG3vvjoPi1DEKRXYgT8/lev//tvxZGs3X+5o0UQpFeCIAiC9EoQBEF6JQiCIL0SBEEQpFeCIAjSK0EQBOmVIAiCIL0SBEGQXgmCIPYA/wcGv+k9gijq8gAAAABJRU5ErkJggg=="},6484:(a,e,t)=>{t.d(e,{Z:()=>n});const n=t.p+"assets/images/string-slice-vs-string-literal-2-1b0caccba69a37db29f101f921a76df1.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[6345],{3905:(a,e,t)=>{t.d(e,{Zo:()=>o,kt:()=>u});var n=t(7294);function i(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function r(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.push.apply(t,n)}return t}function l(a){for(var e=1;e=0||(i[t]=a[t]);return i}(a,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(a,t)&&(i[t]=a[t])}return i}var p=n.createContext({}),d=function(a){var e=n.useContext(p),t=e;return a&&(t="function"==typeof a?a(e):l(l({},e),a)),t},o=function(a){var e=d(a.components);return n.createElement(p.Provider,{value:e},a.children)},m={inlineCode:"code",wrapper:function(a){var e=a.children;return n.createElement(n.Fragment,{},e)}},k=n.forwardRef((function(a,e){var t=a.components,i=a.mdxType,r=a.originalType,p=a.parentName,o=s(a,["components","mdxType","originalType","parentName"]),k=d(t),u=i,g=k["".concat(p,".").concat(u)]||k[u]||m[u]||r;return t?n.createElement(g,l(l({ref:e},o),{},{components:t})):n.createElement(g,l({ref:e},o))}));function u(a,e){var t=arguments,i=e&&e.mdxType;if("string"==typeof a||i){var r=t.length,l=new Array(r);l[0]=k;var s={};for(var p in e)hasOwnProperty.call(e,p)&&(s[p]=e[p]);s.originalType=a,s.mdxType="string"==typeof a?a:i,l[1]=s;for(var d=2;d{t.r(e),t.d(e,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>s,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const r={sidebar_position:46,title:"A.46. String Literal (&str) vs. String Custom Type",sidebar_label:"A.46. String Literal (&str) vs. String Custom Type"},l=void 0,s={unversionedId:"basic/string-slice-vs-string-literal",id:"basic/string-slice-vs-string-literal",title:"A.46. String Literal (&str) vs. String Custom Type",description:"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau String.",source:"@site/docs/basic/string-slice-vs-string-literal.md",sourceDirName:"basic",slug:"/basic/string-slice-vs-string-literal",permalink:"/basic/string-slice-vs-string-literal",draft:!1,tags:[],version:"current",sidebarPosition:46,frontMatter:{sidebar_position:46,title:"A.46. String Literal (&str) vs. String Custom Type",sidebar_label:"A.46. String Literal (&str) vs. String Custom Type"},sidebar:"tutorialSidebar",previous:{title:"A.45. Slice Memory Management",permalink:"/basic/slice-memory-management"},next:{title:"A.47. Tipe Data \u279c String Custom Type",permalink:"/basic/tipe-data-custom-type-string-slice"}},p={},d=[{value:"A.46.1. String slice (String)",id:"a461-string-slice-string",level:2},{value:"A.46.2. String literal (&str)",id:"a462-string-literal-str",level:2},{value:"A.46.3. Konversi data string",id:"a463-konversi-data-string",level:2},{value:"\u25c9 Konversi String ke &str",id:"-konversi-string-ke-str",level:3},{value:"\u25c9 Konversi &str ke String",id:"-konversi-str-ke-string",level:3},{value:"A.46.4. String literal & string slice",id:"a464-string-literal--string-slice",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],o={toc:d};function m(a){let{components:e,...r}=a;return(0,i.kt)("wrapper",(0,n.Z)({},o,r,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter sebelumnya kita telah membahas tentang bagaimana data slice di-manage di memory. Ada beberapa tipe data yang masuk dalam kategori slice, yang salah satunya adalah string slice atau ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("p",null,"Di chapter ini kita akan bahas apa perbedaan antara tipe data string slice (",(0,i.kt)("inlineCode",{parentName:"p"},"String"),") dan string literal ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),"."),(0,i.kt)("p",null,"Pembahasan mengenai topik ini sengaja dilakukan tidak di awal-awal ebook, karena ada banyak hal yang perlu dipahami sebelum mempelajarinya, contohnya seperti aspek management memory dan ownership. Dan karena topik tersebut sudah selesai dibahas, berarti ini adalah waktu yang tepat untuk membahas string slice."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Silakan pelajari kembali pembahasan detail tentang tipe slice pada chapter sebelumnya jika diperlukan. Chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/slice-memory-management"},"Slice Memory Management"))),(0,i.kt)("h2",{id:"a461-string-slice-string"},"A.46.1. String slice (",(0,i.kt)("inlineCode",{parentName:"h2"},"String"),")"),(0,i.kt)("p",null,"String slice atau custom type ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," merupakan tipe data bawaan Rust, dibuat via ",(0,i.kt)("inlineCode",{parentName:"p"},"struct"),", kegunaannya untuk menampung data UTF-8 bytes yang dinamis (bisa berkembang isinya)."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"String")," masuk dalam kategori tipe data slice, isinya adalah data kolektif bertipe bytes, datanya disimpan di heap memory, dan metadata-nya di stack memory. Tipe data ini dikategorikan sebagai tipe data ",(0,i.kt)("strong",{parentName:"p"},"owned"),", yang artinya owner data bisa direpresentasikan oleh variabel. Sebagai contoh:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Lisa Blackpink");\nprintln!("str1: {str1}");\n')),(0,i.kt)("p",null,"Variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"str1")," di atas merupakan owner dari string ",(0,i.kt)("inlineCode",{parentName:"p"},"Lisa Blackpink"),". Dari string tersebut operasi borrow bisa dilakukan. Contohnya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str1 = String::from("Lisa Blackpink");\nlet slice1 = &str1[..]; // "Lisa Blackpink"\nlet slice2 = &str1[4..7]; // " Bl"\n')),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"slice1")," adalah variabel baru yang datanya didapat dari borrowing seluruh elemen string milik ",(0,i.kt)("inlineCode",{parentName:"p"},"str1"),". Sedangkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"slice2")," hanya meminjam elemen indeks ke-4 hingga elemen sebelum 7 (yaitu 6)."),(0,i.kt)("p",null,"Karena ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," sebenarnya adalah UTF-8 bytes, maka kita bisa juga membuatnya menggunakan data Bytes. Tipe bytes (atau kadang disebut ",(0,i.kt)("em",{parentName:"p"},"chars"),") di Rust direpresentasikan oleh tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"[u8]"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let bytes = vec![69, 108, 117, 118, 101, 105, 116, 105, 101, 32, 243, 159, 164, 152];\nlet str2 = String::from_utf8(bytes).unwrap();\nprintln!("str2: {}", str2);\n')),(0,i.kt)("p",null,"Pada contoh di atas, data bytes dipersiapkan dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"Vec"),". Data tersebut kemudian digunakan untuk membuat string menggunakan fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"String::from_utf8()"),". Nilai balik fungsi tersebut adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Result"),". Pemanggilan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," di situ agar data ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"-nya di-return."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"String slcie vs string literal",src:t(108).Z,width:"458",height:"108"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Kita akan bahas tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," pada chapter terpisah, ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h2",{id:"a462-string-literal-str"},"A.46.2. String literal (",(0,i.kt)("inlineCode",{parentName:"h2"},"&str"),")"),(0,i.kt)("p",null,"Tipe data string literal atau ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah tipe yang menampung data kolektif UTF-8 bytes (seperti ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),") tetapi ",(0,i.kt)("strong",{parentName:"p"},"immutable")," dan disimpannya tidak di heap dan tidak juga di stack, melainkan di static storage."),(0,i.kt)("p",null,"String literal hanya bisa direpresentasikan dalam bentuk reference ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," (pointer yang mengarah ke suatu bytes)."),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," termasuk kategori tipe data yang ",(0,i.kt)("strong",{parentName:"p"},"unowned")," atau reference tanpa owner (atau boleh juga diartikan sebagai tipe data yang owner-nya adalah program)."),(0,i.kt)("p",null,"Rust menjamin data string literal selalu valid. Kita juga bisa menentukan lifetime-nya secara eksplist jike diperlukan, contohnya pada tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&'static str"),"."),(0,i.kt)("p",null,"Cara termudah membuat ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah menggunakan string literal."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str3 = "Helena Iren Michaelsen Epica";\nprintln!("str3: {str3}");\n')),(0,i.kt)("h2",{id:"a463-konversi-data-string"},"A.46.3. Konversi data string"),(0,i.kt)("h3",{id:"-konversi-string-ke-str"},"\u25c9 Konversi ",(0,i.kt)("inlineCode",{parentName:"h3"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")),(0,i.kt)("p",null,"Data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," juga didapat melalui operasi borrow dari data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),", caranya dengan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_str"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str4: String = String::from("Hiroyuki Sawano");\nlet str4_slice1: &str = str4.as_str();\nprintln!("str4: {str4}"); // str4: Hiroyuki Sawano\nprintln!("str4_slice1: {str4_slice1}"); // str4_slice1: Hiroyuki Sawano\n')),(0,i.kt)("p",null,"Bisa juga menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str")," untuk mutable borrow. Namun dalam penggunaannya, owner data diwajibkan mutable. Contohnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5: String = String::from("Hans Zimmer");\nlet str5_slice1: &mut str = str5.as_mut_str();\nprintln!("str5: {str5}");\nprintln!("str5_slice1: {str5_slice1}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"String slcie vs string literal",src:t(6484).Z,width:"650",height:"237"})),(0,i.kt)("p",null,"Hmm, error. Perlu diingat kembali aturan ",(0,i.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing")," bahwa tidak boleh ada operasi borrow dan juga mutable borrow dalam satu waktu. Pada contoh di atas, ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," dipinjam oleh ",(0,i.kt)("inlineCode",{parentName:"p"},"str5_slice1")," menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str")," (yang di dalamnya menjalankan operasi mutable borrow). Selain itu, operasi mutable borrow maksimal hanya boleh dilakukan 1x dalam satu waktu, inilah kenapa ketika kita berusaha menampilkan data ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," hasilnya error, karena statement print data ",(0,i.kt)("inlineCode",{parentName:"p"},"str5")," adalah operasi borrow."),(0,i.kt)("p",null,"Solusinya masalah di atas bisa menggunakan block expression:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let mut str5: String = String::from("Hans Zimmer");\n{\n let str5_slice1: &mut str = str5.as_mut_str();\n println!("str5_slice1: {str5_slice1}"); // str5_slice1: Hans Zimmer\n}\nprintln!("str5: {}", str5); // str5_slice1: Hans Zimmer\n')),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," bisa diakses mutable reference-nya karena memang tipe tersebut size-nya adalah dinamis."),(0,i.kt)("h3",{id:"-konversi-str-ke-string"},"\u25c9 Konversi ",(0,i.kt)("inlineCode",{parentName:"h3"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"h3"},"String")),(0,i.kt)("p",null,"Masih dalam topik konversi tipe data string. Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," memiliki method bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," yang gunanya adalah untuk konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"String"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let str6: &str = "John Towner Williams";\nlet str6_slice1: String = str6.to_string();\nprintln!("str6: {str6}"); // str6: John Towner Williams\nprintln!("str6_slice1: {str6_slice1}"); // str6_slice1: John Towner Williams\n')),(0,i.kt)("p",null,"Konversi pada tipe data ini sedikit berbeda dibandingkan konversi ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),". Pada contoh di atas, yang terjadi adalah data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," di-copy sebagai data baru bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," yang kemudian ditampung variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"str6_slice1")," (yang juga berperan sebagai owner untuk data baru tersebut)."),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"to_string")," melakukan operasi copy, bukan borrow. Artinya setelah dipanggil akan ada 2 data yang reference-nya sudah berbeda."),(0,i.kt)("h2",{id:"a464-string-literal--string-slice"},"A.46.4. String literal & string slice"),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," memiliki hubungan dekat dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),". Data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," reference-nya bisa diakses dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"&String"),", maupun dalam bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," (menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"as_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"as_mut_str"),"). Data text pada string tersebut bisa dimodifikasi, ditambahi, dan juga dikurangi."),(0,i.kt)("p",null,"Berbeda dengan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ",(0,i.kt)("strong",{parentName:"p"},"(di paragraph ini dan setelahnya yang kita bahas adalah data yang dari awal tipe-nya sudah ",(0,i.kt)("inlineCode",{parentName:"strong"},"&str"),", bukan data hasil operasi pinjam dari ",(0,i.kt)("inlineCode",{parentName:"strong"},"String"),")"),", data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah fixed dan immutable. Konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," ke ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," menghasilkan data baru dengan owner baru. Bisa dibilang sangat terbatas apa yang bisa kita lakukan pada tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),"."),(0,i.kt)("p",null,"Meski demikian, tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," lebih cepat performa-nya dibanding ",(0,i.kt)("inlineCode",{parentName:"p"},"String")," karena disimpan di static storage. Selain itu dijamin valid oleh Rust. Kekurangannya hanya pada ownership-nya. Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"&str")," adalah ",(0,i.kt)("strong",{parentName:"p"},"unowned"),", operasi mutability tidak bisa dilakukan pada tipe ini."),(0,i.kt)("p",null,"Dalam case normal, sangat dianjurkan untuk menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"&str"),", kecuali memang yang dibutuhkan adalah ",(0,i.kt)("strong",{parentName:"p"},"owned")," string."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/string_slice_vs_string_literal"},"github.com/novalagung/dasarpemrogramanrust-example/../string_slice_vs_string_literal")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-string-literal"},"Tipe Data \u279c String Literal (&str)")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/slice-memory-management"},"Slice Memory Management")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/tipe-data-custom-type-string-slice"},"Tipe Data \u279c String Custom Type"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch08-02-strings.html"},"https://doc.rust-lang.org/book/ch08-02-strings.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://users.rust-lang.org/t/str-string-literals/29635"},"https://users.rust-lang.org/t/str-string-literals/29635")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://www.quora.com/Why-does-Rust-have-two-different-string-types-static-str-and-String"},"https://www.quora.com/Why-does-Rust-have-two-different-string-types-static-str-and-String")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/24158114/what-are-the-differences-between-rusts-string-and-str"},"https://stackoverflow.com/questions/24158114/what-are-the-differences-between-rusts-string-and-str")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings"},"https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings"))))}m.isMDXComponent=!0},108:(a,e,t)=>{t.d(e,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcoAAABsCAIAAABlzGXMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI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3nz33XU2lXMmTWiRVlp5LsPffeLXj1r/f7f7eObNfvbn7lkOTIPabXv11b3SvHFFhEDt1mdZKr+LXYikeHAco2dQPjOo1j+cJmqmllHmm8ekff+jGW9t/7793h+OSIA7KeyVGxs5F/e9nZwG3vvjoPi1DEKRXYgT8/lev//tvxZGs3X+5o0UQpFeCIAiC9EoQBEF6JQiCIL0SBEEQpFeCIAjSK0EQBOmVIAiCIL0SBEGQXgmCIPYA/wcGv+k9gijq8gAAAABJRU5ErkJggg=="},6484:(a,e,t)=>{t.d(e,{Z:()=>n});const n=t.p+"assets/images/string-slice-vs-string-literal-2-1b0caccba69a37db29f101f921a76df1.png"}}]); \ No newline at end of file diff --git a/assets/js/af6aab29.f56b4c49.js b/assets/js/af6aab29.396c2ab9.js similarity index 94% rename from assets/js/af6aab29.f56b4c49.js rename to assets/js/af6aab29.396c2ab9.js index 17fa965b..85520a00 100644 --- a/assets/js/af6aab29.f56b4c49.js +++ b/assets/js/af6aab29.396c2ab9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8794],{3905:(e,t,a)=>{a.d(t,{Zo:()=>o,kt:()=>c});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var d=n.createContext({}),p=function(e){var t=n.useContext(d),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},o=function(e){var t=p(e.components);return n.createElement(d.Provider,{value:t},e.children)},k={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},s=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,d=e.parentName,o=m(e,["components","mdxType","originalType","parentName"]),s=p(a),c=i,u=s["".concat(d,".").concat(c)]||s[c]||k[c]||r;return a?n.createElement(u,l(l({ref:t},o),{},{components:a})):n.createElement(u,l({ref:t},o))}));function c(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=s;var m={};for(var d in t)hasOwnProperty.call(t,d)&&(m[d]=t[d]);m.originalType=e,m.mdxType="string"==typeof e?e:i,l[1]=m;for(var p=2;p{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>m,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:51,title:"A.51. Date Time",sidebar_label:"A.51. Date Time"},l=void 0,m={unversionedId:"basic/datetime",id:"basic/datetime",title:"A.51. Date Time",description:"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming.",source:"@site/docs/basic/datetime.md",sourceDirName:"basic",slug:"/basic/datetime",permalink:"/basic/datetime",draft:!1,tags:[],version:"current",sidebarPosition:51,frontMatter:{sidebar_position:51,title:"A.51. Date Time",sidebar_label:"A.51. Date Time"},sidebar:"tutorialSidebar",previous:{title:"A.50. Attributes",permalink:"/basic/attributes"},next:{title:"A.52. File, Path, Directory",permalink:"/basic/file-path-directory"}},d={},p=[{value:"A.51.1. Persiapan",id:"a511-persiapan",level:2},{value:"A.51.2. Tipe data DateTime",id:"a512-tipe-data-datetime",level:2},{value:"\u25c9 Tipe DateTime<Utc>",id:"-tipe-datetimeutc",level:3},{value:"\u25c9 Tipe DateTime<Local>",id:"-tipe-datetimelocal",level:3},{value:"\u25c9 Tipe NaiveDateTime",id:"-tipe-naivedatetime",level:3},{value:"A.51.3. Pembuatan objek DateTime",id:"a513-pembuatan-objek-datetime",level:2},{value:"\u25c9 Via Utc::now()",id:"-via-utcnow",level:3},{value:"\u25c9 Via Utc.with_ymd_and_hms()",id:"-via-utcwith_ymd_and_hms",level:3},{value:"\u25c9 Via DateTime::<Utc>::from()",id:"-via-datetimeutcfrom",level:3},{value:"\u25c9 Via String method parse()",id:"-via-string-method-parse",level:3},{value:"\u25c9 Cara lainnya",id:"-cara-lainnya",level:3},{value:"A.51.4. Utc vs Local",id:"a514-utc-vs-local",level:2},{value:"A.51.5. Tipe NaiveDateTime",id:"a515-tipe-naivedatetime",level:2},{value:"A.51.6. Konversi datetime UTC ke local timezone, dan sebaliknya",id:"a516-konversi-datetime-utc-ke-local-timezone-dan-sebaliknya",level:2},{value:"A.51.7. UNIX time",id:"a517-unix-time",level:2},{value:"A.51.8. Date formatting & parsing",id:"a518-date-formatting--parsing",level:2},{value:"A.51.9. DateTime formatting syntax",id:"a519-datetime-formatting-syntax",level:2},{value:"\u25c9 Date specifiers",id:"-date-specifiers",level:3},{value:"\u25c9 Time specifiers",id:"-time-specifiers",level:3},{value:"\u25c9 Timezone specifiers",id:"-timezone-specifiers",level:3},{value:"\u25c9 Date & time specifiers",id:"-date--time-specifiers",level:3},{value:"\u25c9 Special specifiers",id:"-special-specifiers",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],o={toc:p};function k(e){let{components:t,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},o,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming."),(0,i.kt)("p",null,"Rust menyediakan cukup banyak API untuk keperluan pengolahan datetime, tersedia dalam Standard Library crate. Namun pada chapter ini kita tidak akan menggunakannya, karena yang akan dipakai adalah ",(0,i.kt)("a",{parentName:"p",href:"https://crates.io/crates/chrono"},(0,i.kt)("inlineCode",{parentName:"a"},"chrono")," crate")," (dianjurkan untuk menggunakan crate ini karena fiturnya lebih banyak)."),(0,i.kt)("h2",{id:"a511-persiapan"},"A.51.1. Persiapan"),(0,i.kt)("p",null,"Sebelum memulai pembelajaran, siapkan satu project baru, kemudian tambahkan care ",(0,i.kt)("inlineCode",{parentName:"p"},"crono")," dalam ",(0,i.kt)("inlineCode",{parentName:"p"},"Cargo.toml"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-toml"},'[package]\nname = "time_chrono"\nversion = "0.1.0"\nedition = "2021"\n\n[dependencies]\nchrono = "0.4.23"\n')),(0,i.kt)("h2",{id:"a512-tipe-data-datetime"},"A.51.2. Tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"crono")," menyediakan cukup banyak tipe data untuk merepresentasikan informasi tanggal dan waktu, tetapi yang paling penting untuk diketahui dan dipahami ada dua, yaitu:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"DateTime")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"DateTime")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"NaiveDateTime"))),(0,i.kt)("h3",{id:"-tipe-datetimeutc"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," (gabungan dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::datetime::DateTime")," dan generic ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::offset::utc::Utc"),") adalah representasi untuk tipe data datetime dengan timezone offset ",(0,i.kt)("strong",{parentName:"p"},"UTC")," (atau ",(0,i.kt)("strong",{parentName:"p"},"GMT+0"),")."),(0,i.kt)("h3",{id:"-tipe-datetimelocal"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," (gabungan dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::datetime::DateTime")," dan generic ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::offset::local::Local"),") adalah representasi untuk tipe data datetime dengan ",(0,i.kt)("strong",{parentName:"p"},"timezone offset sesuai dengan di mana program dijalankan"),"."),(0,i.kt)("p",null,"Sebagai contoh, penulis berlokasi di Jawa Timur, maka ketika ada suatu data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," artinya timezone offset-nya adalah WIB (atau GMT+7)."),(0,i.kt)("h3",{id:"-tipe-naivedatetime"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"NaiveDateTime")),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::naive::datetime::NaiveDateTime")," merupakan tipe data datetime yang tidak menyimpan informasi timezone. Nanti akan kita bahas apa kegunaan dari tipe ini."),(0,i.kt)("h2",{id:"a513-pembuatan-objek-datetime"},"A.51.3. Pembuatan objek ",(0,i.kt)("inlineCode",{parentName:"h2"},"DateTime")),(0,i.kt)("h3",{id:"-via-utcnow"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"Utc::now()")),(0,i.kt)("p",null,"Ada banyak cara untuk membuat date time, dan kita akan bahas satu-per-satu."),(0,i.kt)("p",null,"Cara yang pertama, mari kita pelajari sambil praktek. Isi file program ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," dengan kode berikut, lalu jalankan."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'use chrono::prelude::*;\nuse std::time::{UNIX_EPOCH, Duration};\n\nfn main() {\n let sample_date1_in_utc: DateTime = Utc::now();\n println!("sample date 1 (in utc): {sample_date1_in_utc}");\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(6635).Z,width:"571",height:"95"})),(0,i.kt)("p",null,"Contoh sederhana di atas adalah salah satu cara membuat object datetime dengan isi adalah informasi waktu sekarang (waktu ketika baris kode tersebut dieksekusi)."),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc::now()")," mengembalikan informasi waktu sekarang dalam timezone UTC (representasi tipe data-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),")."),(0,i.kt)("p",null,"Module item ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," sendiri harus diimport terlebih dahulu agar bisa digunakan. Itulah kenapa ada statement ",(0,i.kt)("inlineCode",{parentName:"p"},"use chrono::prelude::*"),"."),(0,i.kt)("h3",{id:"-via-utcwith_ymd_and_hms"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"Utc.with_ymd_and_hms()")),(0,i.kt)("p",null,"Pembuatan object datetime dengan isi informasi waktu spesifik bisa dilakukan menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.with_ymd_and_hms()"),". Fungsi ini mewajibkan developer untuk mengisi 6 parameternya dengan segment waktu (tahun, bulan, dan lainnya)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date2_in_utc = Utc.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nprintln!("sample date 2 (in utc): {sample_date2_in_utc}");\n// output: sample date 2 (in utc): 2023-03-01 01:02:03 UTC\n')),(0,i.kt)("p",null,"Statement di atas menghasilkan data datetime dengan isi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-01 01:02:03 UTC"),"."),(0,i.kt)("h3",{id:"-via-datetimeutcfrom"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime::::from()")),(0,i.kt)("p",null,"Cara ini pas digunakan pada situasi di mana kita perlu membuat object datetime dari sebuah ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Unix_time"},"UNIX timestamp"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date3_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nprintln!("sample date 3 (in utc): {sample_date3_in_utc}");\n// output: sample date 3 (in utc): 2018-04-28 03:15:22 UTC\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime::::from()")," di atas menghasilkan data datetime ",(0,i.kt)("inlineCode",{parentName:"p"},"2018-04-28 03:15:22 UTC"),", karena nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"1524885322")," adalah representasi UNIX time untuk waktu tersebut."),(0,i.kt)("h3",{id:"-via-string-method-parse"},"\u25c9 Via String method ",(0,i.kt)("inlineCode",{parentName:"h3"},"parse()")),(0,i.kt)("p",null,"Tipe data string bisa langsung dikonversi ke bentuk datetime menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse()")," yang dikombinasikan dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," sebagai generic parameter."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date4_in_utc = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\nprintln!("sample date 4 (in utc): {sample_date4_in_utc}");\n// output: sample date 4 (in utc): 2023-03-01 01:02:03 UTC\n')),(0,i.kt)("p",null,"Statement parsing di atas menghasilkan data datetime ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-01 01:02:03 UTC"),", sesuai dengan isi data string."),(0,i.kt)("p",null,"O iya, perlu diketahui bahwa tidak semua string bisa di-parse ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),". Jika data string memiliki format yang tidak sesuai dengan aturan parsing di Rust, maka proses parsing menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse()")," pasti menghasilkan error."),(0,i.kt)("p",null,"Penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse::>()")," sebenarnya mengembalikan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result, ParseError>"),", itulah kenapa pada contoh perlu di chain lagi dengan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h3",{id:"-cara-lainnya"},"\u25c9 Cara lainnya"),(0,i.kt)("p",null,"Ada beberapa cara lain yang bisa digunakan untuk pembuatan object datetime, dan kita akan bahas juga sebentar lagi."),(0,i.kt)("h2",{id:"a514-utc-vs-local"},"A.51.4. ",(0,i.kt)("inlineCode",{parentName:"h2"},"Utc")," vs ",(0,i.kt)("inlineCode",{parentName:"h2"},"Local")),(0,i.kt)("p",null,"Kesemua cara yang sudah dipelajari di atas juga bisa diterapkan dalam pembuatan object date time dengan timezone offset ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),". Penerapannya kurang lebih sama, cukup ganti ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),"."),(0,i.kt)("p",null,"Jika disandingkan, akan seperti ini kodenya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1_in_utc: DateTime = Utc::now();\nlet date2_in_utc = Utc.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nlet date3_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nlet date4_in_utc = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\n\nprintln!("sample date 1 (in utc): {date1_in_utc}");\nprintln!("sample date 2 (in utc): {date2_in_utc}");\nprintln!("sample date 3 (in utc): {date3_in_utc}");\nprintln!("sample date 4 (in utc): {date4_in_utc}");\n\n// vs\n\nlet date1_in_local_tz: DateTime = Local::now();\nlet date2_in_local_tz = Local.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nlet date3_in_local_tz = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nlet date4_in_local_tz = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\n\nprintln!("sample date 1 (in local_tz): {date1_in_local_tz}");\nprintln!("sample date 2 (in local_tz): {date2_in_local_tz}");\nprintln!("sample date 3 (in local_tz): {date3_in_local_tz}");\nprintln!("sample date 4 (in local_tz): {date4_in_local_tz}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(239).Z,width:"571",height:"231"})),(0,i.kt)("p",null,"Semoga cukup jelas."),(0,i.kt)("p",null,"Dari contoh di atas, sebenarnya ada 2 variabel yang menarik untuk dibahas, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"sample_date1_in_utc")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"sample_date1_in_local_tz"),". Dua variabel tersebut berisi informasi waktu sekarang, perbedaannya hanya pada timezone offset saja. Namun, meski timezone offset-nya berbeda, kedua datetime tersebut sejatinya adalah merepresentasikan waktu yang sama (ekuivalen)."),(0,i.kt)("p",null,"Agar lebih jelas, silakan perhatikan contoh berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"sample date 1 (in utc): 2023-03-02 09:53:44.561519500 UTC\nsample date 1 (in local_tz): 2023-03-02 16:53:44.562389600 +07:00\n")),(0,i.kt)("p",null,"Kedua datetime tersebut terpaku ",(0,i.kt)("strong",{parentName:"p"},"7 jam")," persis. Data ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 09:53:44")," UTC (atau GMT+0), jika dikonversi ke waktu lokal penulis (WIB atau GMT+7) maka akan menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 16:53:44"),". Selisihnya sesuai dengan timezone offset, yaitu 7 jam."),(0,i.kt)("h2",{id:"a515-tipe-naivedatetime"},"A.51.5. Tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"NaiveDateTime")),(0,i.kt)("p",null,"Rust memilik caranya sendiri dalam pengelolaan data datetime (yang menurut penulis cukup unik). Ada satu tipe data bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),", yang kegunaannya adalah untuk menampung tipe data datetime ",(0,i.kt)("strong",{parentName:"p"},"tanpa spesifik timezone offset"),"."),(0,i.kt)("p",null,"Tipe data ini sangat berguna dibeberapa case yang kebanyakan adalah perihal konversi data ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),"."),(0,i.kt)("p",null,"Mari kita praktekan dengan contoh agar lebih jelas. Dimisalkan ada keperluan di mana data UNIX time perlu di konversi ke 2 bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),", dengan timezone offset ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),". Pada kasus ini, cara ke-3 dari praktek sebelumnya bisa dilakukan untuk penyelesaian case ini."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let timestamp: u64 = 1524885322;\nlet date2_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(timestamp));\nlet date2_in_local_tz = DateTime::::from(UNIX_EPOCH + Duration::from_secs(timestamp));\n")),(0,i.kt)("p",null,"Cara lain adalah dengan menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),", yang contoh penerapannnya kurang lebih seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let timestamp_in_ms: i64 = 1524885322000;\nlet naive_date_time: NaiveDateTime = NaiveDateTime::from_timestamp_millis(timestamp_in_ms).unwrap();\n\nlet sample_date_in_utc = Utc.from_utc_datetime(&naive_date_time);\nlet sample_date_in_local_tz = Local.from_local_datetime(&naive_date_time).unwrap();\n\nprintln!("sample date 1 (in utc): {sample_date_in_utc}");\nprintln!("sample date 2 (in local_tz): {sample_date_in_local_tz}");\n\n// output:\n// sample date 1 (in utc): 2018-04-28 03:15:22 UTC\n// sample date 2 (in local_tz): 2018-04-28 03:15:22 +07:00\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime::from_timestamp_millis")," berguna untuk mengkonversi data UNIX time (milisecond) ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),". Kemudian, dari data tersebut dapat kita konversi lagi ke bentuk UTC dengan mudah menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.from_utc_datetime()")," dan local timezone menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Local.from_local_datetime()"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(2330).Z,width:"571",height:"115"})),(0,i.kt)("p",null,"Bisa dilihat pada output di atas, bahwa hasil data datetime berbeda untuk timezone UTC dan local."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Jangan sampai bingung, 2 data datetime di atas tidak sama dan tidak ekuivalen meskipun informasi jam menit detiknya sama persis. Hal ini dikarenakan timezone offset-nya berbeda.")),(0,i.kt)("h2",{id:"a516-konversi-datetime-utc-ke-local-timezone-dan-sebaliknya"},"A.51.6. Konversi datetime UTC ke local timezone, dan sebaliknya"),(0,i.kt)("p",null,"Dalam bekerja dengan tipe data datetime, selalu memperhatikan timezone adalah hal yang sangat penting. Bisa saja dua buah datetime memiliki informasi tanggal dan waktu sama persis, tapi jika timezone-nya berbeda maka keduanya adalah berbeda!"),(0,i.kt)("p",null,"Agar lebih jelas, silakan perhatikan kode berikut beserta outputnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1_in_local_tz: DateTime = Local::now();\nprintln!("date (in local): {date1_in_local_tz}");\n\nlet date_in_utc = DateTime::::from(date1_in_local_tz);\nprintln!("date (in utc): {date_in_utc}");\n\nlet date2_in_local_tz = DateTime::::from(date_in_utc);\nprintln!("date (in local): {date2_in_local_tz}");\n\n// output:\n// date (in local): 2023-03-02 17:33:37.750279900 +07:00\n// date (in utc): 2023-03-02 10:33:37.750279900 UTC\n// date (in local): 2023-03-02 17:33:37.750279900 +07:00\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(7934).Z,width:"571",height:"129"})),(0,i.kt)("p",null,"Ketiga data datetime di atas adalah ekuivalen:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz")," berisi informasi datetime waktu sekarang, dengan timezone GMT+7."),(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date_in_utc")," adalah datetime yang ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz"),", hanya saja direpresentasikan dalam timezone UTC."),(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date2_in_local_tz")," juga ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"li"},"date_in_utc")," dan juga ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz"),".")),(0,i.kt)("p",null,"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 10 UTC")," jika ditambah 7 jam offset, maka menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 17 GMT+7"),"."),(0,i.kt)("h2",{id:"a517-unix-time"},"A.51.7. UNIX time"),(0,i.kt)("p",null,"Cara konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," ke bentuk UNIX time bisa dilakukan lewat 3 cara:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp"),", nilai baliknya dalam bentuk detik/second"),(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp_millis"),", nilai baliknya dalam bentuk miliseconds"),(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp_micros"),", nilai baliknya dalam bentuk microseconds")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date_in_local_tz: DateTime = Local::now();\nprintln!("date: {date_in_local_tz}");\nprintln!("date (in second timestamp): {}", date_in_local_tz.timestamp());\nprintln!("date (in milisecond timestamp): {}", date_in_local_tz.timestamp_millis());\nprintln!("date (in microsecond timestamp): {}", date_in_local_tz.timestamp_micros());\n')),(0,i.kt)("p",null,"Sedangkan cara untuk mengkonversi data timestamp ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," bisa dilakukan via ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime::from"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// via NaiveDateTime\nlet naive_date_time = NaiveDateTime::from_timestamp_millis(date_in_local_tz.timestamp_millis()).unwrap();\nlet new_datetime1 = Local.from_local_datetime(&naive_date_time).unwrap();\nprintln!("date1: {new_datetime1}");\n\n// via DateTime::from\nlet new_datetime2 = DateTime::::from(UNIX_EPOCH + Duration::from_millis(date_in_local_tz.timestamp_millis().unsigned_abs()));\nprintln!("date2: {new_datetime2}");\n')),(0,i.kt)("p",null,"Output program di atas:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(6451).Z,width:"571",height:"182"})),(0,i.kt)("h2",{id:"a518-date-formatting--parsing"},"A.51.8. Date formatting & parsing"),(0,i.kt)("p",null,"Konversi datetime ke string (atau biasa disebut dengan date formatting) dilakukan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"format")," yang dalam penerapannya membutuhkan argument ",(0,i.kt)("em",{parentName:"p"},"datetime formatting syntax"),"."),(0,i.kt)("p",null,"Sedangkan konversi dari string ke datetime dilakukan via ",(0,i.kt)("inlineCode",{parentName:"p"},"Local.datetime_from_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.datetime_from_str"),"."),(0,i.kt)("p",null,"Contoh pengaplikasian keduanya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1: DateTime = Local::now();\nprintln!("date1 (in local): {}", date1);\n// date1 (in local): 2023-03-02 18:13:39.954831600 +07:00\n\nlet str_from_date1 = date1.format("%Y-%m-%d %H:%M:%S %z").to_string();\nprintln!("date1 (in string): {}", str_from_date1);\n// date1 (in string): 2023-03-02 18:13:39 +0700\n\nlet date1_from_str = Local.datetime_from_str(&str_from_date1, "%Y-%m-%d %H:%M:%S %z").unwrap();\nprintln!("date1 (in local): {}", date1_from_str);\n// date1 (in local): 2023-03-02 18:13:39 +07:00\n\nlet date2_from_str = Utc.datetime_from_str("03/01/2023 13:04 +0000", "%m/%d/%Y %H:%M %z").unwrap();\nprintln!("date2 (in utc): {}", date2_from_str);\n// date2 (in utc): 2023-03-01 13:04:00 UTC\n\nlet str_from_date2 = date2_from_str.format("%Y-%m-%d %H:%M:%S %z").to_string();\nprintln!("date2 (in string): {}", str_from_date2);\n// date2 (in string): 2023-03-01 13:04:00 +0000\n')),(0,i.kt)("h2",{id:"a519-datetime-formatting-syntax"},"A.51.9. DateTime formatting syntax"),(0,i.kt)("p",null,"Berikut adalah tabel formatting syntax untuk tipe data datetime."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Selengkapnya silakan cek ",(0,i.kt)("a",{parentName:"p",href:"https://docs.rs/chrono/latest/chrono/format/strftime/index.html"},"https://docs.rs/chrono/latest/chrono/format/strftime/index.html"))),(0,i.kt)("h3",{id:"-date-specifiers"},"\u25c9 Date specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%Y"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%C"),(0,i.kt)("td",{parentName:"tr",align:"center"},"20"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The proleptic Gregorian year divided by 100, zero-padded to 2 digits. 1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%y"),(0,i.kt)("td",{parentName:"tr",align:"center"},"01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The proleptic Gregorian year modulo 100, zero-padded to 2 digits. 1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%m"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Month number (01\u201312), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%b"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Jul"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Abbreviated month name. Always 3 letters.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%B"),(0,i.kt)("td",{parentName:"tr",align:"center"},"July"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Full month name. Also accepts corresponding abbreviation in parsing.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%h"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Jul"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %b.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%d"),(0,i.kt)("td",{parentName:"tr",align:"center"},"08"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day number (01\u201331), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%e"),(0,i.kt)("td",{parentName:"tr",align:"center"},"8"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %d but space-padded. Same as %_d.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%a"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sun"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Abbreviated weekday name. Always 3 letters.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%A"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sunday"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Full weekday name. Also accepts corresponding abbreviation in parsing.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%w"),(0,i.kt)("td",{parentName:"tr",align:"center"},"0"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Sunday = 0, Monday = 1, \u2026, Saturday = 6.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%u"),(0,i.kt)("td",{parentName:"tr",align:"center"},"7"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Monday = 1, Tuesday = 2, \u2026, Sunday = 7. (ISO 8601)")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%U"),(0,i.kt)("td",{parentName:"tr",align:"center"},"28"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Week number starting with Sunday (00\u201353), zero-padded to 2 digits. 2")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%W"),(0,i.kt)("td",{parentName:"tr",align:"center"},"27"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %U, but week 1 starts with the first Monday in that year instead.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%G"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %Y but uses the year number in ISO 8601 week date. 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%g"),(0,i.kt)("td",{parentName:"tr",align:"center"},"01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %y but uses the year number in ISO 8601 week date. 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%V"),(0,i.kt)("td",{parentName:"tr",align:"center"},"27"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %U but uses the week number in ISO 8601 week date (01\u201353). 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%j"),(0,i.kt)("td",{parentName:"tr",align:"center"},"189"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day of the year (001\u2013366), zero-padded to 3 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%D"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07/08/01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Month-day-year format. Same as %m/%d/%y.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%x"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07/08/01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s date representation (e.g., 12/31/99).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%F"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001-07-08"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Year-month-day format (ISO 8601). Same as %Y-%m-%d.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%v"),(0,i.kt)("td",{parentName:"tr",align:"center"},"8-Jul-2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day-month-year format. Same as %e-%b-%Y.")))),(0,i.kt)("h3",{id:"-time-specifiers"},"\u25c9 Time specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%H"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour number (00\u201323), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%k"),(0,i.kt)("td",{parentName:"tr",align:"center"},"0"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %H but space-padded. Same as %_H.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%I"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour number in 12-hour clocks (01\u201312), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%l"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %I but space-padded. Same as %_I.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%P"),(0,i.kt)("td",{parentName:"tr",align:"center"},"am"),(0,i.kt)("td",{parentName:"tr",align:"left"},"am or pm in 12-hour clocks.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%p"),(0,i.kt)("td",{parentName:"tr",align:"center"},"AM"),(0,i.kt)("td",{parentName:"tr",align:"left"},"AM or PM in 12-hour clocks.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%M"),(0,i.kt)("td",{parentName:"tr",align:"center"},"34"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Minute number (00\u201359), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%S"),(0,i.kt)("td",{parentName:"tr",align:"center"},"60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Second number (00\u201360), zero-padded to 2 digits. 4")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The fractional seconds (in nanoseconds) since last whole second. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned. These all consume the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.3f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 3. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.6f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 6. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.9f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 9. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%3f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.3f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%6f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.6f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%9f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.9f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%R"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute format. Same as %H:%M.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%T"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34:60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute-second format. Same as %H:%M:%S.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%X"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34:60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s time representation (e.g., 23:13:48).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%r"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12:34:60 AM"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute-second format in 12-hour clocks. Same as %I:%M:%S %p.")))),(0,i.kt)("h3",{id:"-timezone-specifiers"},"\u25c9 Timezone specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%Z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"ACST"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Local time zone name. Skips all non-whitespace characters during parsing. 6")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+0930"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC (with UTC being +0000).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%:z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09:30"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %z but with a colon.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%::z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09:30:00"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC with seconds.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%:::z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC without minutes.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%#z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Parsing only: Same as %z but allows minutes to be missing or present.")))),(0,i.kt)("h3",{id:"-date--time-specifiers"},"\u25c9 Date & time specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%c"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sun Jul 8 00:34:60 2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s date and time (e.g., Thu Mar 3 23:05:25 2005).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%+"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001-07-08T00:34:60.026490+09:30"),(0,i.kt)("td",{parentName:"tr",align:"left"},"ISO 8601 / RFC 3339 date & time format. 7")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%s"),(0,i.kt)("td",{parentName:"tr",align:"center"},"994518299"),(0,i.kt)("td",{parentName:"tr",align:"left"},"UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. 8")))),(0,i.kt)("h3",{id:"-special-specifiers"},"\u25c9 Special specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%t"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal tab (\\t).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%n"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal newline (\\n).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%%"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal percent sign.")))),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/datetime"},"github.com/novalagung/dasarpemrogramanrust-example/../datetime")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generic"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/time/index.html"},"https://doc.rust-lang.org/std/time/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://docs.rs/time/latest/time/"},"https://docs.rs/time/latest/time/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://github.com/rust-lang/rust-wiki-backup/blob/master/Lib-datetime.md"},"https://github.com/rust-lang/rust-wiki-backup/blob/master/Lib-datetime.md")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://docs.rs/chrono/latest/chrono/"},"https://docs.rs/chrono/latest/chrono/"))))}k.isMDXComponent=!0},6635:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-1-c0119211ce2f1f5f14eaf24316a52b54.png"},239:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-2-998514b9bc7ad92870392305578f2a14.png"},2330:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-3-52a5ccd1fb458c09958eafdba3f6c0d4.png"},7934:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-4-62b94d0c3e24bea70a3355c814ed8d79.png"},6451:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-5-eb678ecf97453409d153b4f9727e6347.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8794],{3905:(e,t,a)=>{a.d(t,{Zo:()=>o,kt:()=>c});var n=a(7294);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var d=n.createContext({}),p=function(e){var t=n.useContext(d),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},o=function(e){var t=p(e.components);return n.createElement(d.Provider,{value:t},e.children)},k={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},s=n.forwardRef((function(e,t){var a=e.components,i=e.mdxType,r=e.originalType,d=e.parentName,o=m(e,["components","mdxType","originalType","parentName"]),s=p(a),c=i,u=s["".concat(d,".").concat(c)]||s[c]||k[c]||r;return a?n.createElement(u,l(l({ref:t},o),{},{components:a})):n.createElement(u,l({ref:t},o))}));function c(e,t){var a=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=a.length,l=new Array(r);l[0]=s;var m={};for(var d in t)hasOwnProperty.call(t,d)&&(m[d]=t[d]);m.originalType=e,m.mdxType="string"==typeof e?e:i,l[1]=m;for(var p=2;p{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>k,frontMatter:()=>r,metadata:()=>m,toc:()=>p});var n=a(7462),i=(a(7294),a(3905));const r={sidebar_position:52,title:"A.52. Date Time",sidebar_label:"A.52. Date Time"},l=void 0,m={unversionedId:"basic/datetime",id:"basic/datetime",title:"A.52. Date Time",description:"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming.",source:"@site/docs/basic/datetime.md",sourceDirName:"basic",slug:"/basic/datetime",permalink:"/basic/datetime",draft:!1,tags:[],version:"current",sidebarPosition:52,frontMatter:{sidebar_position:52,title:"A.52. Date Time",sidebar_label:"A.52. Date Time"},sidebar:"tutorialSidebar",previous:{title:"A.51. Attributes",permalink:"/basic/attributes"},next:{title:"A.53. File, Path, Directory",permalink:"/basic/file-path-directory"}},d={},p=[{value:"A.52.1. Persiapan",id:"a521-persiapan",level:2},{value:"A.52.2. Tipe data DateTime",id:"a522-tipe-data-datetime",level:2},{value:"\u25c9 Tipe DateTime<Utc>",id:"-tipe-datetimeutc",level:3},{value:"\u25c9 Tipe DateTime<Local>",id:"-tipe-datetimelocal",level:3},{value:"\u25c9 Tipe NaiveDateTime",id:"-tipe-naivedatetime",level:3},{value:"A.52.3. Pembuatan objek DateTime",id:"a523-pembuatan-objek-datetime",level:2},{value:"\u25c9 Via Utc::now()",id:"-via-utcnow",level:3},{value:"\u25c9 Via Utc.with_ymd_and_hms()",id:"-via-utcwith_ymd_and_hms",level:3},{value:"\u25c9 Via DateTime::<Utc>::from()",id:"-via-datetimeutcfrom",level:3},{value:"\u25c9 Via String method parse()",id:"-via-string-method-parse",level:3},{value:"\u25c9 Cara lainnya",id:"-cara-lainnya",level:3},{value:"A.52.4. Utc vs Local",id:"a524-utc-vs-local",level:2},{value:"A.52.5. Tipe NaiveDateTime",id:"a525-tipe-naivedatetime",level:2},{value:"A.52.6. Konversi datetime UTC ke local timezone, dan sebaliknya",id:"a526-konversi-datetime-utc-ke-local-timezone-dan-sebaliknya",level:2},{value:"A.52.7. UNIX time",id:"a527-unix-time",level:2},{value:"A.52.8. Date formatting & parsing",id:"a528-date-formatting--parsing",level:2},{value:"A.52.9. DateTime formatting syntax",id:"a529-datetime-formatting-syntax",level:2},{value:"\u25c9 Date specifiers",id:"-date-specifiers",level:3},{value:"\u25c9 Time specifiers",id:"-time-specifiers",level:3},{value:"\u25c9 Timezone specifiers",id:"-timezone-specifiers",level:3},{value:"\u25c9 Date & time specifiers",id:"-date--time-specifiers",level:3},{value:"\u25c9 Special specifiers",id:"-special-specifiers",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],o={toc:p};function k(e){let{components:t,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},o,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Pada chapter ini kita akan mempelajari tentang tipe data datetime yang ada di Rust programming."),(0,i.kt)("p",null,"Rust menyediakan cukup banyak API untuk keperluan pengolahan datetime, tersedia dalam Standard Library crate. Namun pada chapter ini kita tidak akan menggunakannya, karena yang akan dipakai adalah ",(0,i.kt)("a",{parentName:"p",href:"https://crates.io/crates/chrono"},(0,i.kt)("inlineCode",{parentName:"a"},"chrono")," crate")," (dianjurkan untuk menggunakan crate ini karena fiturnya lebih banyak)."),(0,i.kt)("h2",{id:"a521-persiapan"},"A.52.1. Persiapan"),(0,i.kt)("p",null,"Sebelum memulai pembelajaran, siapkan satu project baru, kemudian tambahkan care ",(0,i.kt)("inlineCode",{parentName:"p"},"crono")," dalam ",(0,i.kt)("inlineCode",{parentName:"p"},"Cargo.toml"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-toml"},'[package]\nname = "time_chrono"\nversion = "0.1.0"\nedition = "2021"\n\n[dependencies]\nchrono = "0.4.23"\n')),(0,i.kt)("h2",{id:"a522-tipe-data-datetime"},"A.52.2. Tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"crono")," menyediakan cukup banyak tipe data untuk merepresentasikan informasi tanggal dan waktu, tetapi yang paling penting untuk diketahui dan dipahami ada dua, yaitu:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"DateTime")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"DateTime")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"NaiveDateTime"))),(0,i.kt)("h3",{id:"-tipe-datetimeutc"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," (gabungan dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::datetime::DateTime")," dan generic ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::offset::utc::Utc"),") adalah representasi untuk tipe data datetime dengan timezone offset ",(0,i.kt)("strong",{parentName:"p"},"UTC")," (atau ",(0,i.kt)("strong",{parentName:"p"},"GMT+0"),")."),(0,i.kt)("h3",{id:"-tipe-datetimelocal"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," (gabungan dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::datetime::DateTime")," dan generic ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::offset::local::Local"),") adalah representasi untuk tipe data datetime dengan ",(0,i.kt)("strong",{parentName:"p"},"timezone offset sesuai dengan di mana program dijalankan"),"."),(0,i.kt)("p",null,"Sebagai contoh, penulis berlokasi di Jawa Timur, maka ketika ada suatu data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," artinya timezone offset-nya adalah WIB (atau GMT+7)."),(0,i.kt)("h3",{id:"-tipe-naivedatetime"},"\u25c9 Tipe ",(0,i.kt)("inlineCode",{parentName:"h3"},"NaiveDateTime")),(0,i.kt)("p",null,"Tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"chrono::naive::datetime::NaiveDateTime")," merupakan tipe data datetime yang tidak menyimpan informasi timezone. Nanti akan kita bahas apa kegunaan dari tipe ini."),(0,i.kt)("h2",{id:"a523-pembuatan-objek-datetime"},"A.52.3. Pembuatan objek ",(0,i.kt)("inlineCode",{parentName:"h2"},"DateTime")),(0,i.kt)("h3",{id:"-via-utcnow"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"Utc::now()")),(0,i.kt)("p",null,"Ada banyak cara untuk membuat date time, dan kita akan bahas satu-per-satu."),(0,i.kt)("p",null,"Cara yang pertama, mari kita pelajari sambil praktek. Isi file program ",(0,i.kt)("inlineCode",{parentName:"p"},"main.rs")," dengan kode berikut, lalu jalankan."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'use chrono::prelude::*;\nuse std::time::{UNIX_EPOCH, Duration};\n\nfn main() {\n let sample_date1_in_utc: DateTime = Utc::now();\n println!("sample date 1 (in utc): {sample_date1_in_utc}");\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(6635).Z,width:"571",height:"95"})),(0,i.kt)("p",null,"Contoh sederhana di atas adalah salah satu cara membuat object datetime dengan isi adalah informasi waktu sekarang (waktu ketika baris kode tersebut dieksekusi)."),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc::now()")," mengembalikan informasi waktu sekarang dalam timezone UTC (representasi tipe data-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),")."),(0,i.kt)("p",null,"Module item ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," sendiri harus diimport terlebih dahulu agar bisa digunakan. Itulah kenapa ada statement ",(0,i.kt)("inlineCode",{parentName:"p"},"use chrono::prelude::*"),"."),(0,i.kt)("h3",{id:"-via-utcwith_ymd_and_hms"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"Utc.with_ymd_and_hms()")),(0,i.kt)("p",null,"Pembuatan object datetime dengan isi informasi waktu spesifik bisa dilakukan menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.with_ymd_and_hms()"),". Fungsi ini mewajibkan developer untuk mengisi 6 parameternya dengan segment waktu (tahun, bulan, dan lainnya)."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date2_in_utc = Utc.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nprintln!("sample date 2 (in utc): {sample_date2_in_utc}");\n// output: sample date 2 (in utc): 2023-03-01 01:02:03 UTC\n')),(0,i.kt)("p",null,"Statement di atas menghasilkan data datetime dengan isi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-01 01:02:03 UTC"),"."),(0,i.kt)("h3",{id:"-via-datetimeutcfrom"},"\u25c9 Via ",(0,i.kt)("inlineCode",{parentName:"h3"},"DateTime::::from()")),(0,i.kt)("p",null,"Cara ini pas digunakan pada situasi di mana kita perlu membuat object datetime dari sebuah ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Unix_time"},"UNIX timestamp"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date3_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nprintln!("sample date 3 (in utc): {sample_date3_in_utc}");\n// output: sample date 3 (in utc): 2018-04-28 03:15:22 UTC\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime::::from()")," di atas menghasilkan data datetime ",(0,i.kt)("inlineCode",{parentName:"p"},"2018-04-28 03:15:22 UTC"),", karena nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"1524885322")," adalah representasi UNIX time untuk waktu tersebut."),(0,i.kt)("h3",{id:"-via-string-method-parse"},"\u25c9 Via String method ",(0,i.kt)("inlineCode",{parentName:"h3"},"parse()")),(0,i.kt)("p",null,"Tipe data string bisa langsung dikonversi ke bentuk datetime menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse()")," yang dikombinasikan dengan ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," sebagai generic parameter."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let sample_date4_in_utc = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\nprintln!("sample date 4 (in utc): {sample_date4_in_utc}");\n// output: sample date 4 (in utc): 2023-03-01 01:02:03 UTC\n')),(0,i.kt)("p",null,"Statement parsing di atas menghasilkan data datetime ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-01 01:02:03 UTC"),", sesuai dengan isi data string."),(0,i.kt)("p",null,"O iya, perlu diketahui bahwa tidak semua string bisa di-parse ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),". Jika data string memiliki format yang tidak sesuai dengan aturan parsing di Rust, maka proses parsing menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse()")," pasti menghasilkan error."),(0,i.kt)("p",null,"Penerapan method ",(0,i.kt)("inlineCode",{parentName:"p"},"parse::>()")," sebenarnya mengembalikan tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result, ParseError>"),", itulah kenapa pada contoh perlu di chain lagi dengan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih detailnya mengenai tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Result")," dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/result-type"},"Tipe Data \u279c Result"))),(0,i.kt)("h3",{id:"-cara-lainnya"},"\u25c9 Cara lainnya"),(0,i.kt)("p",null,"Ada beberapa cara lain yang bisa digunakan untuk pembuatan object datetime, dan kita akan bahas juga sebentar lagi."),(0,i.kt)("h2",{id:"a524-utc-vs-local"},"A.52.4. ",(0,i.kt)("inlineCode",{parentName:"h2"},"Utc")," vs ",(0,i.kt)("inlineCode",{parentName:"h2"},"Local")),(0,i.kt)("p",null,"Kesemua cara yang sudah dipelajari di atas juga bisa diterapkan dalam pembuatan object date time dengan timezone offset ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),". Penerapannya kurang lebih sama, cukup ganti ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),"."),(0,i.kt)("p",null,"Jika disandingkan, akan seperti ini kodenya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1_in_utc: DateTime = Utc::now();\nlet date2_in_utc = Utc.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nlet date3_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nlet date4_in_utc = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\n\nprintln!("sample date 1 (in utc): {date1_in_utc}");\nprintln!("sample date 2 (in utc): {date2_in_utc}");\nprintln!("sample date 3 (in utc): {date3_in_utc}");\nprintln!("sample date 4 (in utc): {date4_in_utc}");\n\n// vs\n\nlet date1_in_local_tz: DateTime = Local::now();\nlet date2_in_local_tz = Local.with_ymd_and_hms(2023, 3, 1, 1, 2, 3).unwrap();\nlet date3_in_local_tz = DateTime::::from(UNIX_EPOCH + Duration::from_secs(1524885322));\nlet date4_in_local_tz = "2023-03-01 01:02:03 UTC".parse::>().unwrap();\n\nprintln!("sample date 1 (in local_tz): {date1_in_local_tz}");\nprintln!("sample date 2 (in local_tz): {date2_in_local_tz}");\nprintln!("sample date 3 (in local_tz): {date3_in_local_tz}");\nprintln!("sample date 4 (in local_tz): {date4_in_local_tz}");\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(239).Z,width:"571",height:"231"})),(0,i.kt)("p",null,"Semoga cukup jelas."),(0,i.kt)("p",null,"Dari contoh di atas, sebenarnya ada 2 variabel yang menarik untuk dibahas, yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"sample_date1_in_utc")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"sample_date1_in_local_tz"),". Dua variabel tersebut berisi informasi waktu sekarang, perbedaannya hanya pada timezone offset saja. Namun, meski timezone offset-nya berbeda, kedua datetime tersebut sejatinya adalah merepresentasikan waktu yang sama (ekuivalen)."),(0,i.kt)("p",null,"Agar lebih jelas, silakan perhatikan contoh berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"sample date 1 (in utc): 2023-03-02 09:53:44.561519500 UTC\nsample date 1 (in local_tz): 2023-03-02 16:53:44.562389600 +07:00\n")),(0,i.kt)("p",null,"Kedua datetime tersebut terpaku ",(0,i.kt)("strong",{parentName:"p"},"7 jam")," persis. Data ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 09:53:44")," UTC (atau GMT+0), jika dikonversi ke waktu lokal penulis (WIB atau GMT+7) maka akan menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 16:53:44"),". Selisihnya sesuai dengan timezone offset, yaitu 7 jam."),(0,i.kt)("h2",{id:"a525-tipe-naivedatetime"},"A.52.5. Tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"NaiveDateTime")),(0,i.kt)("p",null,"Rust memilik caranya sendiri dalam pengelolaan data datetime (yang menurut penulis cukup unik). Ada satu tipe data bernama ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),", yang kegunaannya adalah untuk menampung tipe data datetime ",(0,i.kt)("strong",{parentName:"p"},"tanpa spesifik timezone offset"),"."),(0,i.kt)("p",null,"Tipe data ini sangat berguna dibeberapa case yang kebanyakan adalah perihal konversi data ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),"."),(0,i.kt)("p",null,"Mari kita praktekan dengan contoh agar lebih jelas. Dimisalkan ada keperluan di mana data UNIX time perlu di konversi ke 2 bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime"),", dengan timezone offset ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc")," dan ",(0,i.kt)("inlineCode",{parentName:"p"},"Local"),". Pada kasus ini, cara ke-3 dari praktek sebelumnya bisa dilakukan untuk penyelesaian case ini."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},"let timestamp: u64 = 1524885322;\nlet date2_in_utc = DateTime::::from(UNIX_EPOCH + Duration::from_secs(timestamp));\nlet date2_in_local_tz = DateTime::::from(UNIX_EPOCH + Duration::from_secs(timestamp));\n")),(0,i.kt)("p",null,"Cara lain adalah dengan menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),", yang contoh penerapannnya kurang lebih seperti ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let timestamp_in_ms: i64 = 1524885322000;\nlet naive_date_time: NaiveDateTime = NaiveDateTime::from_timestamp_millis(timestamp_in_ms).unwrap();\n\nlet sample_date_in_utc = Utc.from_utc_datetime(&naive_date_time);\nlet sample_date_in_local_tz = Local.from_local_datetime(&naive_date_time).unwrap();\n\nprintln!("sample date 1 (in utc): {sample_date_in_utc}");\nprintln!("sample date 2 (in local_tz): {sample_date_in_local_tz}");\n\n// output:\n// sample date 1 (in utc): 2018-04-28 03:15:22 UTC\n// sample date 2 (in local_tz): 2018-04-28 03:15:22 +07:00\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime::from_timestamp_millis")," berguna untuk mengkonversi data UNIX time (milisecond) ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime"),". Kemudian, dari data tersebut dapat kita konversi lagi ke bentuk UTC dengan mudah menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.from_utc_datetime()")," dan local timezone menggunakan ",(0,i.kt)("inlineCode",{parentName:"p"},"Local.from_local_datetime()"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(2330).Z,width:"571",height:"115"})),(0,i.kt)("p",null,"Bisa dilihat pada output di atas, bahwa hasil data datetime berbeda untuk timezone UTC dan local."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Jangan sampai bingung, 2 data datetime di atas tidak sama dan tidak ekuivalen meskipun informasi jam menit detiknya sama persis. Hal ini dikarenakan timezone offset-nya berbeda.")),(0,i.kt)("h2",{id:"a526-konversi-datetime-utc-ke-local-timezone-dan-sebaliknya"},"A.52.6. Konversi datetime UTC ke local timezone, dan sebaliknya"),(0,i.kt)("p",null,"Dalam bekerja dengan tipe data datetime, selalu memperhatikan timezone adalah hal yang sangat penting. Bisa saja dua buah datetime memiliki informasi tanggal dan waktu sama persis, tapi jika timezone-nya berbeda maka keduanya adalah berbeda!"),(0,i.kt)("p",null,"Agar lebih jelas, silakan perhatikan kode berikut beserta outputnya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1_in_local_tz: DateTime = Local::now();\nprintln!("date (in local): {date1_in_local_tz}");\n\nlet date_in_utc = DateTime::::from(date1_in_local_tz);\nprintln!("date (in utc): {date_in_utc}");\n\nlet date2_in_local_tz = DateTime::::from(date_in_utc);\nprintln!("date (in local): {date2_in_local_tz}");\n\n// output:\n// date (in local): 2023-03-02 17:33:37.750279900 +07:00\n// date (in utc): 2023-03-02 10:33:37.750279900 UTC\n// date (in local): 2023-03-02 17:33:37.750279900 +07:00\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(7934).Z,width:"571",height:"129"})),(0,i.kt)("p",null,"Ketiga data datetime di atas adalah ekuivalen:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz")," berisi informasi datetime waktu sekarang, dengan timezone GMT+7."),(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date_in_utc")," adalah datetime yang ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz"),", hanya saja direpresentasikan dalam timezone UTC."),(0,i.kt)("li",{parentName:"ul"},"Variabel ",(0,i.kt)("inlineCode",{parentName:"li"},"date2_in_local_tz")," juga ekuivalen dengan ",(0,i.kt)("inlineCode",{parentName:"li"},"date_in_utc")," dan juga ",(0,i.kt)("inlineCode",{parentName:"li"},"date1_in_local_tz"),".")),(0,i.kt)("p",null,"Data ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 10 UTC")," jika ditambah 7 jam offset, maka menjadi ",(0,i.kt)("inlineCode",{parentName:"p"},"2023-03-02 17 GMT+7"),"."),(0,i.kt)("h2",{id:"a527-unix-time"},"A.52.7. UNIX time"),(0,i.kt)("p",null,"Cara konversi data ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," ke bentuk UNIX time bisa dilakukan lewat 3 cara:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp"),", nilai baliknya dalam bentuk detik/second"),(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp_millis"),", nilai baliknya dalam bentuk miliseconds"),(0,i.kt)("li",{parentName:"ul"},"menggunakan method ",(0,i.kt)("inlineCode",{parentName:"li"},"timestamp_micros"),", nilai baliknya dalam bentuk microseconds")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date_in_local_tz: DateTime = Local::now();\nprintln!("date: {date_in_local_tz}");\nprintln!("date (in second timestamp): {}", date_in_local_tz.timestamp());\nprintln!("date (in milisecond timestamp): {}", date_in_local_tz.timestamp_millis());\nprintln!("date (in microsecond timestamp): {}", date_in_local_tz.timestamp_micros());\n')),(0,i.kt)("p",null,"Sedangkan cara untuk mengkonversi data timestamp ke bentuk ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime")," bisa dilakukan via ",(0,i.kt)("inlineCode",{parentName:"p"},"NaiveDateTime")," ataupun ",(0,i.kt)("inlineCode",{parentName:"p"},"DateTime::from"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'// via NaiveDateTime\nlet naive_date_time = NaiveDateTime::from_timestamp_millis(date_in_local_tz.timestamp_millis()).unwrap();\nlet new_datetime1 = Local.from_local_datetime(&naive_date_time).unwrap();\nprintln!("date1: {new_datetime1}");\n\n// via DateTime::from\nlet new_datetime2 = DateTime::::from(UNIX_EPOCH + Duration::from_millis(date_in_local_tz.timestamp_millis().unsigned_abs()));\nprintln!("date2: {new_datetime2}");\n')),(0,i.kt)("p",null,"Output program di atas:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"DateTime",src:a(6451).Z,width:"571",height:"182"})),(0,i.kt)("h2",{id:"a528-date-formatting--parsing"},"A.52.8. Date formatting & parsing"),(0,i.kt)("p",null,"Konversi datetime ke string (atau biasa disebut dengan date formatting) dilakukan menggunakan method ",(0,i.kt)("inlineCode",{parentName:"p"},"format")," yang dalam penerapannya membutuhkan argument ",(0,i.kt)("em",{parentName:"p"},"datetime formatting syntax"),"."),(0,i.kt)("p",null,"Sedangkan konversi dari string ke datetime dilakukan via ",(0,i.kt)("inlineCode",{parentName:"p"},"Local.datetime_from_str")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Utc.datetime_from_str"),"."),(0,i.kt)("p",null,"Contoh pengaplikasian keduanya bisa dilihat pada kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let date1: DateTime = Local::now();\nprintln!("date1 (in local): {}", date1);\n// date1 (in local): 2023-03-02 18:13:39.954831600 +07:00\n\nlet str_from_date1 = date1.format("%Y-%m-%d %H:%M:%S %z").to_string();\nprintln!("date1 (in string): {}", str_from_date1);\n// date1 (in string): 2023-03-02 18:13:39 +0700\n\nlet date1_from_str = Local.datetime_from_str(&str_from_date1, "%Y-%m-%d %H:%M:%S %z").unwrap();\nprintln!("date1 (in local): {}", date1_from_str);\n// date1 (in local): 2023-03-02 18:13:39 +07:00\n\nlet date2_from_str = Utc.datetime_from_str("03/01/2023 13:04 +0000", "%m/%d/%Y %H:%M %z").unwrap();\nprintln!("date2 (in utc): {}", date2_from_str);\n// date2 (in utc): 2023-03-01 13:04:00 UTC\n\nlet str_from_date2 = date2_from_str.format("%Y-%m-%d %H:%M:%S %z").to_string();\nprintln!("date2 (in string): {}", str_from_date2);\n// date2 (in string): 2023-03-01 13:04:00 +0000\n')),(0,i.kt)("h2",{id:"a529-datetime-formatting-syntax"},"A.52.9. DateTime formatting syntax"),(0,i.kt)("p",null,"Berikut adalah tabel formatting syntax untuk tipe data datetime."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Selengkapnya silakan cek ",(0,i.kt)("a",{parentName:"p",href:"https://docs.rs/chrono/latest/chrono/format/strftime/index.html"},"https://docs.rs/chrono/latest/chrono/format/strftime/index.html"))),(0,i.kt)("h3",{id:"-date-specifiers"},"\u25c9 Date specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%Y"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The full proleptic Gregorian year, zero-padded to 4 digits. chrono supports years from -262144 to 262143.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%C"),(0,i.kt)("td",{parentName:"tr",align:"center"},"20"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The proleptic Gregorian year divided by 100, zero-padded to 2 digits. 1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%y"),(0,i.kt)("td",{parentName:"tr",align:"center"},"01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The proleptic Gregorian year modulo 100, zero-padded to 2 digits. 1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%m"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Month number (01\u201312), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%b"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Jul"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Abbreviated month name. Always 3 letters.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%B"),(0,i.kt)("td",{parentName:"tr",align:"center"},"July"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Full month name. Also accepts corresponding abbreviation in parsing.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%h"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Jul"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %b.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%d"),(0,i.kt)("td",{parentName:"tr",align:"center"},"08"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day number (01\u201331), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%e"),(0,i.kt)("td",{parentName:"tr",align:"center"},"8"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %d but space-padded. Same as %_d.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%a"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sun"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Abbreviated weekday name. Always 3 letters.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%A"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sunday"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Full weekday name. Also accepts corresponding abbreviation in parsing.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%w"),(0,i.kt)("td",{parentName:"tr",align:"center"},"0"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Sunday = 0, Monday = 1, \u2026, Saturday = 6.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%u"),(0,i.kt)("td",{parentName:"tr",align:"center"},"7"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Monday = 1, Tuesday = 2, \u2026, Sunday = 7. (ISO 8601)")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%U"),(0,i.kt)("td",{parentName:"tr",align:"center"},"28"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Week number starting with Sunday (00\u201353), zero-padded to 2 digits. 2")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%W"),(0,i.kt)("td",{parentName:"tr",align:"center"},"27"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %U, but week 1 starts with the first Monday in that year instead.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%G"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %Y but uses the year number in ISO 8601 week date. 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%g"),(0,i.kt)("td",{parentName:"tr",align:"center"},"01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %y but uses the year number in ISO 8601 week date. 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%V"),(0,i.kt)("td",{parentName:"tr",align:"center"},"27"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %U but uses the week number in ISO 8601 week date (01\u201353). 3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%j"),(0,i.kt)("td",{parentName:"tr",align:"center"},"189"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day of the year (001\u2013366), zero-padded to 3 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%D"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07/08/01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Month-day-year format. Same as %m/%d/%y.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%x"),(0,i.kt)("td",{parentName:"tr",align:"center"},"07/08/01"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s date representation (e.g., 12/31/99).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%F"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001-07-08"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Year-month-day format (ISO 8601). Same as %Y-%m-%d.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%v"),(0,i.kt)("td",{parentName:"tr",align:"center"},"8-Jul-2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Day-month-year format. Same as %e-%b-%Y.")))),(0,i.kt)("h3",{id:"-time-specifiers"},"\u25c9 Time specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%H"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour number (00\u201323), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%k"),(0,i.kt)("td",{parentName:"tr",align:"center"},"0"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %H but space-padded. Same as %_H.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%I"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour number in 12-hour clocks (01\u201312), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%l"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %I but space-padded. Same as %_I.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%P"),(0,i.kt)("td",{parentName:"tr",align:"center"},"am"),(0,i.kt)("td",{parentName:"tr",align:"left"},"am or pm in 12-hour clocks.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%p"),(0,i.kt)("td",{parentName:"tr",align:"center"},"AM"),(0,i.kt)("td",{parentName:"tr",align:"left"},"AM or PM in 12-hour clocks.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%M"),(0,i.kt)("td",{parentName:"tr",align:"center"},"34"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Minute number (00\u201359), zero-padded to 2 digits.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%S"),(0,i.kt)("td",{parentName:"tr",align:"center"},"60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Second number (00\u201360), zero-padded to 2 digits. 4")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"The fractional seconds (in nanoseconds) since last whole second. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned. These all consume the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.3f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 3. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.6f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 6. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%.9f"),(0,i.kt)("td",{parentName:"tr",align:"center"},".026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to .%f but left-aligned but fixed to a length of 9. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%3f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.3f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%6f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.6f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%9f"),(0,i.kt)("td",{parentName:"tr",align:"center"},"026490000"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Similar to %.9f but without the leading dot. 5")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%R"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute format. Same as %H:%M.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%T"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34:60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute-second format. Same as %H:%M:%S.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%X"),(0,i.kt)("td",{parentName:"tr",align:"center"},"00:34:60"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s time representation (e.g., 23:13:48).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%r"),(0,i.kt)("td",{parentName:"tr",align:"center"},"12:34:60 AM"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Hour-minute-second format in 12-hour clocks. Same as %I:%M:%S %p.")))),(0,i.kt)("h3",{id:"-timezone-specifiers"},"\u25c9 Timezone specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%Z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"ACST"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Local time zone name. Skips all non-whitespace characters during parsing. 6")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+0930"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC (with UTC being +0000).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%:z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09:30"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Same as %z but with a colon.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%::z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09:30:00"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC with seconds.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%:::z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Offset from the local time to UTC without minutes.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%#z"),(0,i.kt)("td",{parentName:"tr",align:"center"},"+09"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Parsing only: Same as %z but allows minutes to be missing or present.")))),(0,i.kt)("h3",{id:"-date--time-specifiers"},"\u25c9 Date & time specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"center"},"Example"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%c"),(0,i.kt)("td",{parentName:"tr",align:"center"},"Sun Jul 8 00:34:60 2001"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Locale\u2019s date and time (e.g., Thu Mar 3 23:05:25 2005).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%+"),(0,i.kt)("td",{parentName:"tr",align:"center"},"2001-07-08T00:34:60.026490+09:30"),(0,i.kt)("td",{parentName:"tr",align:"left"},"ISO 8601 / RFC 3339 date & time format. 7")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%s"),(0,i.kt)("td",{parentName:"tr",align:"center"},"994518299"),(0,i.kt)("td",{parentName:"tr",align:"left"},"UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. 8")))),(0,i.kt)("h3",{id:"-special-specifiers"},"\u25c9 Special specifiers"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"center"},"Spec"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%t"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal tab (\\t).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%n"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal newline (\\n).")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"center"},"%%"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Literal percent sign.")))),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/datetime"},"github.com/novalagung/dasarpemrogramanrust-example/../datetime")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/result-type"},"Tipe Data \u279c Result")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generic"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/time/index.html"},"https://doc.rust-lang.org/std/time/index.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://docs.rs/time/latest/time/"},"https://docs.rs/time/latest/time/")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://github.com/rust-lang/rust-wiki-backup/blob/master/Lib-datetime.md"},"https://github.com/rust-lang/rust-wiki-backup/blob/master/Lib-datetime.md")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://docs.rs/chrono/latest/chrono/"},"https://docs.rs/chrono/latest/chrono/"))))}k.isMDXComponent=!0},6635:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-1-c0119211ce2f1f5f14eaf24316a52b54.png"},239:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-2-998514b9bc7ad92870392305578f2a14.png"},2330:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-3-52a5ccd1fb458c09958eafdba3f6c0d4.png"},7934:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-4-62b94d0c3e24bea70a3355c814ed8d79.png"},6451:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/datetime-5-eb678ecf97453409d153b4f9727e6347.png"}}]); \ No newline at end of file diff --git a/assets/js/bc4edc5c.2d761a7d.js b/assets/js/bc4edc5c.d4905b46.js similarity index 97% rename from assets/js/bc4edc5c.2d761a7d.js rename to assets/js/bc4edc5c.d4905b46.js index beec778d..697da2e3 100644 --- a/assets/js/bc4edc5c.2d761a7d.js +++ b/assets/js/bc4edc5c.d4905b46.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[4452],{3905:(a,e,n)=>{n.d(e,{Zo:()=>d,kt:()=>o});var i=n(7294);function t(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function l(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,i)}return n}function r(a){for(var e=1;e=0||(t[n]=a[n]);return t}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(t[n]=a[n])}return t}var m=i.createContext({}),s=function(a){var e=i.useContext(m),n=e;return a&&(n="function"==typeof a?a(e):r(r({},e),a)),n},d=function(a){var e=s(a.components);return i.createElement(m.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},p=i.forwardRef((function(a,e){var n=a.components,t=a.mdxType,l=a.originalType,m=a.parentName,d=u(a,["components","mdxType","originalType","parentName"]),p=s(n),o=t,c=p["".concat(m,".").concat(o)]||p[o]||k[o]||l;return n?i.createElement(c,r(r({ref:e},d),{},{components:n})):i.createElement(c,r({ref:e},d))}));function o(a,e){var n=arguments,t=e&&e.mdxType;if("string"==typeof a||t){var l=n.length,r=new Array(l);r[0]=p;var u={};for(var m in e)hasOwnProperty.call(e,m)&&(u[m]=e[m]);u.originalType=a,u.mdxType="string"==typeof a?a:t,r[1]=u;for(var s=2;s{n.r(e),n.d(e,{assets:()=>m,contentTitle:()=>r,default:()=>k,frontMatter:()=>l,metadata:()=>u,toc:()=>s});var i=n(7462),t=(n(7294),n(3905));const l={sidebar_position:47,title:"A.47. Closures",sidebar_label:"A.47. Closures"},r=void 0,u={unversionedId:"basic/closures",id:"basic/closures",title:"A.47. Closures",description:"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope.",source:"@site/docs/basic/closures.md",sourceDirName:"basic",slug:"/basic/closures",permalink:"/basic/closures",draft:!1,tags:[],version:"current",sidebarPosition:47,frontMatter:{sidebar_position:47,title:"A.47. Closures",sidebar_label:"A.47. Closures"},sidebar:"tutorialSidebar",previous:{title:"A.46. Tipe Data \u279c String Custom Type",permalink:"/basic/tipe-data-custom-type-string-slice"},next:{title:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)",permalink:"/basic/trait-function"}},m={},s=[{value:"A.47.1. Konsep Closures",id:"a471-konsep-closures",level:2},{value:"\u25c9 formatted print {:.n}",id:"-formatted-print-n",level:3},{value:"A.47.2. Notasi penulisan closure",id:"a472-notasi-penulisan-closure",level:2},{value:"A.47.3. Mutable closure",id:"a473-mutable-closure",level:2},{value:"A.47.4. Borrowing pada closure",id:"a474-borrowing-pada-closure",level:2},{value:"A.47.5. Keyword move",id:"a475-keyword-move",level:2},{value:"A.47.6. Closure sebagai return type",id:"a476-closure-sebagai-return-type",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2",level:3},{value:"A.47.7. Closure sebagai parameter fungsi",id:"a477-closure-sebagai-parameter-fungsi",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2-1",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:s};function k(a){let{components:e,...l}=a;return(0,t.kt)("wrapper",(0,i.Z)({},d,l,{components:e,mdxType:"MDXLayout"}),(0,t.kt)("p",null,"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope."),(0,t.kt)("p",null,"Topik closures sangat erat hubungannya dengan ",(0,t.kt)("a",{parentName:"p",href:"/basic/trait-function"},"Trait \u279c Function"),", namun pada chapter ini pembahasan hanya difokuskan pada bagian penerapan closures saja. Penulis anjurkan untuk lanjut ke chapter berikutnya setelah selesai dengan chapter ini."),(0,t.kt)("h2",{id:"a471-konsep-closures"},"A.47.1. Konsep Closures"),(0,t.kt)("p",null,"Cara penerapan closure sangat mirip seperti fungsi, perbedaannya ada pada notasi penulisan-nya. Agar lebih jelas silakan perhatikan program sederhana di bawah ini."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let r = 10.0;\n let volume = calculate_circle_volume_v1(r);\n println!("{volume:.2}");\n}\n\nfn calculate_circle_volume_v1(e: f64) -> f64 {\n const PI: f64 = 3.14;\n let volume = 4.0 / 3.0 * PI * e.powi(3);\n volume\n}\n')),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v1")," akan kita refactor ke bentuk closure, hasilnya adalah berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let calculate_circle_volume_v2 = |e: f64| -> f64 {\n const PI: f64 = 3.14;\n let volume = 4.0 / 3.0 * PI * e.powi(3);\n volume\n };\n \n let r = 10.0;\n let volume = calculate_circle_volume_v2(r);\n println!("{:.2}", volume);\n}\n')),(0,t.kt)("p",null,"Silakan pelajari perbedaan dan juga kemiripannya."),(0,t.kt)("p",null,"Fungsi dideklarasikan menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"fn")," dan memiliki nama. Closure tidak memiliki nama, namun bisa disimpan dalam variabel (yang disimpan adalah block closure-nya, bukan return value-nya). Contohnya variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v2")," di atas."),(0,t.kt)("p",null,"Perbedaan minor lainnya ada pada notasi penulisan parameter. Pada fungsi tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"()")," digunakan sebagai penanda parameter, sedangkan pada closure tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"||")," digunakan."),(0,t.kt)("h3",{id:"-formatted-print-n"},"\u25c9 formatted print ",(0,t.kt)("inlineCode",{parentName:"h3"},"{:.n}")),(0,t.kt)("p",null,"Notasi penulisan formatted print ",(0,t.kt)("inlineCode",{parentName:"p"},"{:.n}")," digunakan untuk mem-format bilangan desimal di mana ",(0,t.kt)("inlineCode",{parentName:"p"},"n")," adalah jumlah digit setelah tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"."),"."),(0,t.kt)("p",null,"Sebagai contoh, variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"pi")," berikut memiliki 0 digit angka dibelakang koma. Untuk menampilkan hanya 4 angka terdepan, bisa gunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"{:.4}"),". Perlu diketahui bahwa angka dibelakang koma yang muncul otomatis dibulatkan."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let pi = 3.1415926535;\n\nprintln!("{:.4}", pi); // 3.1416\nprintln!("{pi:.4}"); // 3.1416\n')),(0,t.kt)("h2",{id:"a472-notasi-penulisan-closure"},"A.47.2. Notasi penulisan closure"),(0,t.kt)("p",null,"Closure ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v2")," pada contoh di atas adalah salah satu contoh penulisan closure. Sebuah closure bisa memiliki parameter, bisa juga tidak, dan aturan tersebut juga berlaku pada return value."),(0,t.kt)("p",null,"Bebebrapa contoh lain penulisan closure bisa dilihat di bawah ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// closure dengan 2 parameter tanpa return value\nlet do_something_v1 = | a: i32, b: String | {\n // ...\n};\n\n// closure dengan 2 parameter dan return value bertipe tuple\nlet do_something_v2 = | a: i32, b: String | -> (i32, bool) {\n // ...\n};\n\n// closure tanpa parameter dan return value bertipe Vec\nlet do_something_v3 = || -> Vec {\n // ...\n};\n\n// closure tanpa parameter dan tanpa return value\nlet do_something_v4 = || {\n // ...\n};\n")),(0,t.kt)("p",null,"Jika tipe return value tidak dideklarasikan secara eksplist, maka Rust menganggap tipe return value adalah sesuai dengan tipe data pada statement terakhir."),(0,t.kt)("p",null,"Untuk closure yang isinya hanya 1 baris statement, boleh tidak dituliskan block kurung kurawal-nya (",(0,t.kt)("inlineCode",{parentName:"p"},"{}"),")."),(0,t.kt)("p",null,"Tambahan contoh, satu fungsi dan tiga buah closures berikut adalah ekuivalen."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn pow_v1(x: i32) -> i32 {\n x.pow(2)\n}\n\nlet pow_v2 = |x: i32| -> i32 {\n x.pow(2)\n};\n\nlet pow_v3 = |x: i32| {\n x.pow(2)\n};\n\nlet pow_v4 = |x: i32| x.pow(2);\n")),(0,t.kt)("p",null,"Ok, sekarang bagaimana dengan closure yang tidak memiliki parameter dengan isi hanya return value saja? Penulisannya seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let get_pi = || 3.14;\n\nprintln!("{:?}", get_pi());\n')),(0,t.kt)("h2",{id:"a473-mutable-closure"},"A.47.3. Mutable closure"),(0,t.kt)("p",null,"Tidak ada yang spesial mengenai cara mengakses item yang berada di luar block closure. Caranya cukup dengan panggil saja item seperti biasanya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let num = 5;\nlet display = || println!("{num}");\n\nprintln!("{num}"); // 5\ndisplay(); // 5\n')),(0,t.kt)("p",null,"Beda lagi jika data di luar block closure adalah diubah (di-mutate) nilainya dari dalam closure, jika seperti itu maka ada beberapa hal yang perlu diperhatikan."),(0,t.kt)("p",null,"Sebagai contoh, pelajari kode berikut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\n\nlet increase_by = |x: i32| {\n num += x\n};\n\nincrease_by(10);\nprintln!("{num}"); // 15\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(6894).Z,width:"765",height:"176"})),(0,t.kt)("p",null,"Solusi untuk menghilangkan error di atas adalah dengan menambahkan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"mut")," pada variabel closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// before\nlet increase_by = |x: i32| {\n num += x\n};\n\n// after\nlet mut increase_by = |x: i32| {\n num += x\n};\n")),(0,t.kt)("p",null,"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"mut")," wajib ditambahkan ke variabel penampung closure ketika di dalamnya terdapat operasi perubahan data terhadap variabel yang posisinya di-luar closure. Contohnya bisa dilihat di atas, variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," nilainya di-mutate atau diubah dari dalam closure, karena inilah variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," harus didefinisikan mutable."),(0,t.kt)("h2",{id:"a474-borrowing-pada-closure"},"A.47.4. Borrowing pada closure"),(0,t.kt)("p",null,(0,t.kt)("strong",{parentName:"p"},"Semua variabel di luar block closure ketika digunakan di dalam closure maka terjadi operasi borrowing pada variabel tersebut"),". Variabel di luar block closure dipinjam agar bisa digunakan di dalam closure."),(0,t.kt)("p",null,"Sebagai contoh, kode sederhana berikut menghasilkan error, karena variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," adalah dipinjam oleh closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," untuk dipergunakan di dalam block-nya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet mut increase_by = |x: i32| num += x;\n\nnum += 5;\nincrease_by(10);\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3022).Z,width:"525",height:"222"})),(0,t.kt)("p",null,"Error muncul di statement setelahnya, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," karena ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," statusnya masih dipinjam oleh closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by"),"."),(0,t.kt)("p",null,"Variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," dipinjam dengan mode peminjaman adalah ",(0,t.kt)("em",{parentName:"p"},"mutable borrow")," karena closure didefinisikan mutable. Salah satu aturan pada borrowing: bahwa dalam waktu yang sama, ketika sudah terjadi mutable borrow, maka tidak boleh ada borrowing lainnya. Itulah alasan kenapa statement ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," menghasilkan error."),(0,t.kt)("p",null,"Solusi dari masalah di atas ada beberapa, yang pertama adalah menggunakan block expression untuk meng-isolasi closure, agar peminjaman pada closure tersebut dan statement ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," tidak terjadi dalam waktu yang sama."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nnum += 5;\n\n{\n let mut increase_by = |x: i32| num += x;\n increase_by(10);\n}\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,"Solusi di atas efektif untuk menghilangkan error borrowing yang sebelumnya muncul, tapi setelah d-refactor kode menjadi tidak sesuai spesifikasi awal. Pada kode yang baru di atas, deklarasi closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," terjadi di dalam block expression, artinya closure ini hanya akan bisa digunakan pada block kode tersebut saja, tidak bisa di-reuse di luar block."),(0,t.kt)("p",null,"Solusi yang lebih baik pada kasus di atas adalah dengan tidak menggunakan default borrowing (yang terjadi di dalam block closure ketika mengakses variabel yang posisinya berada di luar closure), melainkan gunakan saja borrowing pada parameter closure. Kita ubah lagi kodenya menjadi seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet increase_by = |num: &mut i32, x: i32| *num += x;\n\nnum += 5;\nincrease_by(&mut num, 10);\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,"Pada contoh di atas, closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," ditambahi parameter baru. Sekarang ada 2 parameter, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," yang tipe-nya adalah pointer ",(0,t.kt)("inlineCode",{parentName:"p"},"&mut i32")," dan parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),". Di dalam block closure, ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," di-dereference (menggunakan operator ",(0,t.kt)("inlineCode",{parentName:"p"},"*"),") kemudian diubah nilainya. Setelah eksekusi statement selesai, data pinjaman tersebut langsung dikembalikan ke pemilik. Inilah kenapa kode di atas tidak menghasilkan error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Pengaksesan variabel yang berada di luar scope closure tanpa via parameter berarti adalah borrowing, maka dalam penerapannya wajib untuk memperhatikan aturan yang berlaku pada ownership dan borrowing.")),(0,t.kt)("h2",{id:"a475-keyword-move"},"A.47.5. Keyword ",(0,t.kt)("inlineCode",{parentName:"h2"},"move")),(0,t.kt)("p",null,"Telah dijelaskan di atas bahwa variabel di luar closure, jika diakses dari dalam closure maka terjadi borrowing. Ada cara agar variabel tersebut ownership-nya berpindah ke dalam closure (",(0,t.kt)("em",{parentName:"p"},"move semantics"),"), yaitu menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"move"),"."),(0,t.kt)("p",null,"Contohnya bisa dilihat berikut ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet mut increase_by = move |x: i32| {\n num += x;\n println!("{num} (from closure)"); // 15\n};\n\nincrease_by(10);\nprintln!("{num}"); // 5\n')),(0,t.kt)("p",null,"Closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," di atas memiliki keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"move")," dalam pendefinisiannya. Dengan ini maka semua variabel di luar scope closure jika diakses dari dalam closure, maka variabel tersebut berpindah owner-nya (",(0,t.kt)("em",{parentName:"p"},"move semantics"),")."),(0,t.kt)("p",null,"Lalu bagaimana dengan nasib variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," yang berada di luar closure setelah owner-nya berpindah? Pada kondisi normal jawaban pertanyaan ini adalah tergantung tipe data-nya, jika ",(0,t.kt)("em",{parentName:"p"},"by default")," variabel adalah mengadopsi ",(0,t.kt)("em",{parentName:"p"},"move semantics")," maka variabel tersebut menjadi invalid. Namun pada contoh di atas ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," bertipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"i32")," yang mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", maka variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," tersebut masih bisa digunakan di luar closure."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(2682).Z,width:"324",height:"105"})),(0,t.kt)("p",null,"Bisa dilihat dari gambar di atas, statement ",(0,t.kt)("inlineCode",{parentName:"p"},"print")," dari dalam block closure hasilnya adalah benar, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"5 + 10 = 15"),". Dan variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," di luar block closure tidak berubah nilainya."),(0,t.kt)("h2",{id:"a476-closure-sebagai-return-type"},"A.47.6. Closure sebagai return type"),(0,t.kt)("h3",{id:"-praktik-ke-1"},"\u25c9 Praktik ke-1"),(0,t.kt)("p",null,"Fungsi bisa memiliki nilai balik bertipe closure. Caranya dengan menggunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"impl Fn()")," sebagai tipe data nilai balik. Contoh penerapannya:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_something() -> impl Fn() {\n println!("hello (from do_something)");\n\n return || {\n println!("hello (from closure)");\n };\n}\n')),(0,t.kt)("p",null,"Tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"impl Fn()")," adalah ekuvalen dengan closure ",(0,t.kt)("inlineCode",{parentName:"p"},"|| { }"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let my_closure = do_something();\n println!("hello (from main)");\n my_closure();\n}\n\nfn main() {\n let my_closure = do_something_v2();\n let message = my_closure(123, "hello rust".to_owned());\n println!("{message} (from main)");\n}\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(4600).Z,width:"321",height:"124"})),(0,t.kt)("p",null,"Bisa dilihat, fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something")," di atas mengembalikan closure yang menampilkan string ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from closure)"),". String tersebut hanya muncul ketika closure dipanggil."),(0,t.kt)("p",null,"Sedangkan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something")," sendiri juga menampilkan pesan string lainnya, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from do_something)"),", yang pesan ini adalah muncul langsung saat pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something"),". Berbeda dengan pesan ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from closure)")," yang hanya muncul ketika closure dieksekusi."),(0,t.kt)("h3",{id:"-praktik-ke-2"},"\u25c9 Praktik ke-2"),(0,t.kt)("p",null,"Pada contoh di atas, closure yang dikembalikan fungsi memiliki skema sangat sederhana, tanpa parameter dan argument. Mari coba praktik dengan contoh yang lebih kompleks."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_something_v2() -> impl Fn(i32, String) -> String {\n println!("hello (from do_something_v2)");\n\n return |a: i32, b: String| -> String {\n let message = format!("{b} {a}");\n message\n };\n}\n')),(0,t.kt)("p",null,"Pada kode di atas fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v2")," mengembalikan closure dengan skema ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32, String) -> String"),", yang artinya:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Parameter pertamanya bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"i32")),(0,t.kt)("li",{parentName:"ul"},"Parameter keduanya bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"String")),(0,t.kt)("li",{parentName:"ul"},"Mengembalikan nilai bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"String"))),(0,t.kt)("p",null,"Di dalam closure tersebut, data parameter digabung menjadi sebuah pesan string yang kemudian dijadikan nilai balik."),(0,t.kt)("p",null,"Sekarang jalankan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v2")," di atas, kemudian lihat hasilnya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let my_closure = do_something_v2();\nlet message = my_closure(123, "hello rust".to_owned());\nprintln!("{message} (from main)");\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3546).Z,width:"323",height:"106"})),(0,t.kt)("h2",{id:"a477-closure-sebagai-parameter-fungsi"},"A.47.7. Closure sebagai parameter fungsi"),(0,t.kt)("h3",{id:"-praktik-ke-1-1"},"\u25c9 Praktik ke-1"),(0,t.kt)("p",null,"Pengaplikasian closure sebagai parameter fungsi banyak dilakukan di Rust, hal ini bisa dilakukan dengan memanfaatkan generic parameter. Silakan perhatikan kode berikut untuk contoh penerapannya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn run_x_times(x: i32, my_closure: F)\nwhere\n F: Fn(i32),\n{\n for i in 0..x {\n my_closure(i)\n }\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times")," dibuat dengan tugas mengeksekusi closure ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," sebanyak ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," kali. Parameter closure harus selalu memiliki tipe data generic, contohnya ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," di atas yang tipe data-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"F"),"."),(0,t.kt)("p",null,"Fungsi yang memiliki parameter closure wajib menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"where")," yang keyword ini digunakan untuk mendaftarkan skema closure yang nantiya bisa diterima saat pemanggilan fungsi. Tipe generic ",(0,t.kt)("inlineCode",{parentName:"p"},"F")," di daftarkan dengan notasi ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32)"),", artinya dalam pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times"),", parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," harus diisi dengan closure yang skema-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32)")," yang jika di ilustrasikan dalam bentuk closure adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"|param1: i32| { }"),"."),(0,t.kt)("p",null,"Sekarang mari kita test fungsi di atas. Panggil fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times")," kemudian pada bagian parameter closure isi dengan block closure yang memiliki skema sesuai requirement, contohnya ",(0,t.kt)("inlineCode",{parentName:"p"},'|i: i32| { println!("hello rust {i}") }'),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'run_x_times(4, |i: i32| {\n println!("hello rust {i}");\n});\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(2376).Z,width:"314",height:"147"})),(0,t.kt)("p",null,"O iya, closure di atas juga bisa dituliskan dalam bentuk seperti ini. Bebas, pilih sesuai preferensi dan/atau kesepakatan team perihal code convention."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'run_x_times(4, |i: i32| println!("hello rust {i}"));\n')),(0,t.kt)("h3",{id:"-praktik-ke-2-1"},"\u25c9 Praktik ke-2"),(0,t.kt)("p",null,"Ok, sekarang mari kita coba praktikkan contoh yang lebih kompleks."),(0,t.kt)("p",null,"Pada praktik ini kita akan buat sebuah fungsi yang tugasnya melakukan pencarian indeks slice dengan kondisi pencarian didapat dari eksekusi closure."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_index(data: &[T], cond_fn: F) -> i32\nwhere\n F: Fn(&T) -> bool,\n{\n for i in 0..data.len() {\n if cond_fn(&data[i]) {\n return i as i32\n }\n }\n\n return -1\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_index")," memiliki 2 parameter generic, yaitu:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("inlineCode",{parentName:"li"},"T")," yang digunakan sebagai tipe data element slice ",(0,t.kt)("inlineCode",{parentName:"li"},"data"),"."),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("inlineCode",{parentName:"li"},"F")," yang digunakan sebagai tipe data closure ",(0,t.kt)("inlineCode",{parentName:"li"},"cond_fn")," dengan skema ",(0,t.kt)("inlineCode",{parentName:"li"},"Fn(&T) -> bool"),", yang jika diilustrasikan dalam bentuk closure adalah ",(0,t.kt)("inlineCode",{parentName:"li"},"|param1: &T| -> bool { }"),".")),(0,t.kt)("p",null,"Di dalam fungsi tersebut, data slice di-loop, kemudian tiap elemen-nya digunakan sebagai parameter pemanggilan closure ",(0,t.kt)("inlineCode",{parentName:"p"},"cond_fn"),"."),(0,t.kt)("p",null,"Jika nilai balik pemanggilan closure adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"true")," maka ",(0,t.kt)("inlineCode",{parentName:"p"},"i")," dikembalikan dalam bentuk ",(0,t.kt)("inlineCode",{parentName:"p"},"i32")," (ada proses casting). Dan jika tidak diketemukan, maka indeks ",(0,t.kt)("inlineCode",{parentName:"p"},"-1")," dikembalikan."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"as")," digunakan untuk casting tipe data. Lebih jelasnya dibahas pada chapter ",(0,t.kt)("a",{parentName:"p",href:"/basic/type-alias-casting"},"Type Alias & Casting")," dan ",(0,t.kt)("a",{parentName:"p",href:"#/wip/trait-conversion-from-into"},"Trait \u279c Conversion (From & Into)"))),(0,t.kt)("p",null,"Jalankan program tersebut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = [24, 13, 2, 53, 3];\nlet number_to_find = 53;\nlet index = find_index(&numbers, |e: &i32| -> bool {\n if *e == number_to_find {\n true \n } else {\n false\n }\n});\n\nprintln!("number_to_find: {number_to_find}");\nprintln!("index: {index}");\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3451).Z,width:"324",height:"108"})),(0,t.kt)("p",null,"Bisa dilihat program berjalan sesuai harapan."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn")," merupakan salah satu trait function yang ada di Rust. Lebih jelasnya perihal keyword tersebut dibahas pada chapter selanjutnya, yaitu ",(0,t.kt)("a",{parentName:"p",href:"/basic/trait-function"},"Trait \u279c Function"))),(0,t.kt)("hr",null),(0,t.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,t.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,t.kt)("pre",null,(0,t.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/closures"},"github.com/novalagung/dasarpemrogramanrust-example/../closures")),(0,t.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/function"},"Function")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/borrowing"},"Borrowing")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/trait-function"},"Trait \u279c Function (Fn, FnMut, FnOnce)"))),(0,t.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch13-01-closures.html"},"https://doc.rust-lang.org/book/ch13-01-closures.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"},"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"))))}k.isMDXComponent=!0},6894:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/closures-1-2c7599bfed946d5bd1fb34a57acd9de7.png"},3022:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/closures-2-35b45e21715884c98b155c79b2d8f1c4.png"},2682:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAABpCAIAAADNzc3NAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1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+lN4T5HbzhL7qchPnKlU6zNyQZTLP3S8i5lHNObc65WoSZomiZKYoizBRFEWaKoggzRRFmiqIIM0VRhJmiKMJMUYSZoijCTFHUFcD87eXP6+/nXTbA8+/XQX9evolD46fYNWqSUxRhXp+iI7dZwbaA+dgiQn0ZphvL617vfRRh3inMK5VrHszeKceC0dhTTWDux95oOXoAEhSGD29Jfr90VufPy/Pw9/SlOj21T6djPRjjFxZqyrKJpMK8FXHIDPN02ekwrLsugsiqS1m6RRRg5sydagnzOGJHq2HA/Kr+/klPnwgSKE2WaICmO160T9mQl2d0mRpQ2feC3GDDuif3gbQYa8BMlqmmMGtuLZi7USj/ajo6Dro/YsiLE6ZxXJoG6zGvLG1xFg2XzAhmXc2sQovWzPrGwTUzdS4wd5+AcUxOnLVYVZ93DLPmWpeCi2bqXCzz20LaIG0pzMranwHMuCV2/DSPulCYxTr4NQZzsuSGz4XiYGT2S07SA8ZtNszizGQ/ILxmLhjm8n2IotaEWSzx+q1rF2a08QuOV1q5fD9c7GYXadDIZFN/awIi8/n9nO5mRWCWGSU7BHzOTLWGmaIowkxRFGHW02bjsXDL0ymKMFMURZgpiiLMFEWYKYq6JpjptU9RhLmB6MpPUdtNszeyzPRKoKg4zIu99rP3LrsDadyt8QqVrzdzOk9RtZZ5ttc+jEMwuUXod6QrYSbLFLUc5phvII5DcDrrZa63H135KWpjmI04BBOQS1nkopmitoMZ89oleF6OIl35KWptmLHXvmF+x7Tass7YACPLFGGuXJ3O9drPtrjB/rWxtx0oEkmmKL7OSVGEmaIowkxRFGGmKIowUxRhpiiKMFMURZgpiiLMFEWYKYoizBRFEWaKoggzRVGD/geWHMKpfLG1lAAAAABJRU5ErkJggg=="}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[4452],{3905:(a,e,n)=>{n.d(e,{Zo:()=>d,kt:()=>o});var i=n(7294);function t(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function l(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,i)}return n}function r(a){for(var e=1;e=0||(t[n]=a[n]);return t}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(t[n]=a[n])}return t}var m=i.createContext({}),s=function(a){var e=i.useContext(m),n=e;return a&&(n="function"==typeof a?a(e):r(r({},e),a)),n},d=function(a){var e=s(a.components);return i.createElement(m.Provider,{value:e},a.children)},k={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},p=i.forwardRef((function(a,e){var n=a.components,t=a.mdxType,l=a.originalType,m=a.parentName,d=u(a,["components","mdxType","originalType","parentName"]),p=s(n),o=t,c=p["".concat(m,".").concat(o)]||p[o]||k[o]||l;return n?i.createElement(c,r(r({ref:e},d),{},{components:n})):i.createElement(c,r({ref:e},d))}));function o(a,e){var n=arguments,t=e&&e.mdxType;if("string"==typeof a||t){var l=n.length,r=new Array(l);r[0]=p;var u={};for(var m in e)hasOwnProperty.call(e,m)&&(u[m]=e[m]);u.originalType=a,u.mdxType="string"==typeof a?a:t,r[1]=u;for(var s=2;s{n.r(e),n.d(e,{assets:()=>m,contentTitle:()=>r,default:()=>k,frontMatter:()=>l,metadata:()=>u,toc:()=>s});var i=n(7462),t=(n(7294),n(3905));const l={sidebar_position:48,title:"A.48. Closures",sidebar_label:"A.48. Closures"},r=void 0,u={unversionedId:"basic/closures",id:"basic/closures",title:"A.48. Closures",description:"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope.",source:"@site/docs/basic/closures.md",sourceDirName:"basic",slug:"/basic/closures",permalink:"/basic/closures",draft:!1,tags:[],version:"current",sidebarPosition:48,frontMatter:{sidebar_position:48,title:"A.48. Closures",sidebar_label:"A.48. Closures"},sidebar:"tutorialSidebar",previous:{title:"A.47. Tipe Data \u279c String Custom Type",permalink:"/basic/tipe-data-custom-type-string-slice"},next:{title:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)",permalink:"/basic/trait-function"}},m={},s=[{value:"A.48.1. Konsep Closures",id:"a481-konsep-closures",level:2},{value:"\u25c9 formatted print {:.n}",id:"-formatted-print-n",level:3},{value:"A.48.2. Notasi penulisan closure",id:"a482-notasi-penulisan-closure",level:2},{value:"A.48.3. Mutable closure",id:"a483-mutable-closure",level:2},{value:"A.48.4. Borrowing pada closure",id:"a484-borrowing-pada-closure",level:2},{value:"A.48.5. Keyword move",id:"a485-keyword-move",level:2},{value:"A.48.6. Closure sebagai return type",id:"a486-closure-sebagai-return-type",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2",level:3},{value:"A.48.7. Closure sebagai parameter fungsi",id:"a487-closure-sebagai-parameter-fungsi",level:2},{value:"\u25c9 Praktik ke-1",id:"-praktik-ke-1-1",level:3},{value:"\u25c9 Praktik ke-2",id:"-praktik-ke-2-1",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],d={toc:s};function k(a){let{components:e,...l}=a;return(0,t.kt)("wrapper",(0,i.Z)({},d,l,{components:e,mdxType:"MDXLayout"}),(0,t.kt)("p",null,"Chapter ini membahas tentang closures. Closures sendiri merupakan block fungsi anonimus (anonymous function) yang memiliki kelebihan bisa mengakses item-tem yang posisinya berada di luar block closure tersebut tetapi masih dalam current block scope."),(0,t.kt)("p",null,"Topik closures sangat erat hubungannya dengan ",(0,t.kt)("a",{parentName:"p",href:"/basic/trait-function"},"Trait \u279c Function"),", namun pada chapter ini pembahasan hanya difokuskan pada bagian penerapan closures saja. Penulis anjurkan untuk lanjut ke chapter berikutnya setelah selesai dengan chapter ini."),(0,t.kt)("h2",{id:"a481-konsep-closures"},"A.48.1. Konsep Closures"),(0,t.kt)("p",null,"Cara penerapan closure sangat mirip seperti fungsi, perbedaannya ada pada notasi penulisan-nya. Agar lebih jelas silakan perhatikan program sederhana di bawah ini."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let r = 10.0;\n let volume = calculate_circle_volume_v1(r);\n println!("{volume:.2}");\n}\n\nfn calculate_circle_volume_v1(e: f64) -> f64 {\n const PI: f64 = 3.14;\n let volume = 4.0 / 3.0 * PI * e.powi(3);\n volume\n}\n')),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v1")," akan kita refactor ke bentuk closure, hasilnya adalah berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let calculate_circle_volume_v2 = |e: f64| -> f64 {\n const PI: f64 = 3.14;\n let volume = 4.0 / 3.0 * PI * e.powi(3);\n volume\n };\n \n let r = 10.0;\n let volume = calculate_circle_volume_v2(r);\n println!("{:.2}", volume);\n}\n')),(0,t.kt)("p",null,"Silakan pelajari perbedaan dan juga kemiripannya."),(0,t.kt)("p",null,"Fungsi dideklarasikan menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"fn")," dan memiliki nama. Closure tidak memiliki nama, namun bisa disimpan dalam variabel (yang disimpan adalah block closure-nya, bukan return value-nya). Contohnya variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v2")," di atas."),(0,t.kt)("p",null,"Perbedaan minor lainnya ada pada notasi penulisan parameter. Pada fungsi tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"()")," digunakan sebagai penanda parameter, sedangkan pada closure tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"||")," digunakan."),(0,t.kt)("h3",{id:"-formatted-print-n"},"\u25c9 formatted print ",(0,t.kt)("inlineCode",{parentName:"h3"},"{:.n}")),(0,t.kt)("p",null,"Notasi penulisan formatted print ",(0,t.kt)("inlineCode",{parentName:"p"},"{:.n}")," digunakan untuk mem-format bilangan desimal di mana ",(0,t.kt)("inlineCode",{parentName:"p"},"n")," adalah jumlah digit setelah tanda ",(0,t.kt)("inlineCode",{parentName:"p"},"."),"."),(0,t.kt)("p",null,"Sebagai contoh, variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"pi")," berikut memiliki 0 digit angka dibelakang koma. Untuk menampilkan hanya 4 angka terdepan, bisa gunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"{:.4}"),". Perlu diketahui bahwa angka dibelakang koma yang muncul otomatis dibulatkan."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let pi = 3.1415926535;\n\nprintln!("{:.4}", pi); // 3.1416\nprintln!("{pi:.4}"); // 3.1416\n')),(0,t.kt)("h2",{id:"a482-notasi-penulisan-closure"},"A.48.2. Notasi penulisan closure"),(0,t.kt)("p",null,"Closure ",(0,t.kt)("inlineCode",{parentName:"p"},"calculate_circle_volume_v2")," pada contoh di atas adalah salah satu contoh penulisan closure. Sebuah closure bisa memiliki parameter, bisa juga tidak, dan aturan tersebut juga berlaku pada return value."),(0,t.kt)("p",null,"Bebebrapa contoh lain penulisan closure bisa dilihat di bawah ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// closure dengan 2 parameter tanpa return value\nlet do_something_v1 = | a: i32, b: String | {\n // ...\n};\n\n// closure dengan 2 parameter dan return value bertipe tuple\nlet do_something_v2 = | a: i32, b: String | -> (i32, bool) {\n // ...\n};\n\n// closure tanpa parameter dan return value bertipe Vec\nlet do_something_v3 = || -> Vec {\n // ...\n};\n\n// closure tanpa parameter dan tanpa return value\nlet do_something_v4 = || {\n // ...\n};\n")),(0,t.kt)("p",null,"Jika tipe return value tidak dideklarasikan secara eksplist, maka Rust menganggap tipe return value adalah sesuai dengan tipe data pada statement terakhir."),(0,t.kt)("p",null,"Untuk closure yang isinya hanya 1 baris statement, boleh tidak dituliskan block kurung kurawal-nya (",(0,t.kt)("inlineCode",{parentName:"p"},"{}"),")."),(0,t.kt)("p",null,"Tambahan contoh, satu fungsi dan tiga buah closures berikut adalah ekuivalen."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn pow_v1(x: i32) -> i32 {\n x.pow(2)\n}\n\nlet pow_v2 = |x: i32| -> i32 {\n x.pow(2)\n};\n\nlet pow_v3 = |x: i32| {\n x.pow(2)\n};\n\nlet pow_v4 = |x: i32| x.pow(2);\n")),(0,t.kt)("p",null,"Ok, sekarang bagaimana dengan closure yang tidak memiliki parameter dengan isi hanya return value saja? Penulisannya seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let get_pi = || 3.14;\n\nprintln!("{:?}", get_pi());\n')),(0,t.kt)("h2",{id:"a483-mutable-closure"},"A.48.3. Mutable closure"),(0,t.kt)("p",null,"Tidak ada yang spesial mengenai cara mengakses item yang berada di luar block closure. Caranya cukup dengan panggil saja item seperti biasanya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let num = 5;\nlet display = || println!("{num}");\n\nprintln!("{num}"); // 5\ndisplay(); // 5\n')),(0,t.kt)("p",null,"Beda lagi jika data di luar block closure adalah diubah (di-mutate) nilainya dari dalam closure, jika seperti itu maka ada beberapa hal yang perlu diperhatikan."),(0,t.kt)("p",null,"Sebagai contoh, pelajari kode berikut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\n\nlet increase_by = |x: i32| {\n num += x\n};\n\nincrease_by(10);\nprintln!("{num}"); // 15\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(6894).Z,width:"765",height:"176"})),(0,t.kt)("p",null,"Solusi untuk menghilangkan error di atas adalah dengan menambahkan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"mut")," pada variabel closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// before\nlet increase_by = |x: i32| {\n num += x\n};\n\n// after\nlet mut increase_by = |x: i32| {\n num += x\n};\n")),(0,t.kt)("p",null,"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"mut")," wajib ditambahkan ke variabel penampung closure ketika di dalamnya terdapat operasi perubahan data terhadap variabel yang posisinya di-luar closure. Contohnya bisa dilihat di atas, variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," nilainya di-mutate atau diubah dari dalam closure, karena inilah variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," harus didefinisikan mutable."),(0,t.kt)("h2",{id:"a484-borrowing-pada-closure"},"A.48.4. Borrowing pada closure"),(0,t.kt)("p",null,(0,t.kt)("strong",{parentName:"p"},"Semua variabel di luar block closure ketika digunakan di dalam closure maka terjadi operasi borrowing pada variabel tersebut"),". Variabel di luar block closure dipinjam agar bisa digunakan di dalam closure."),(0,t.kt)("p",null,"Sebagai contoh, kode sederhana berikut menghasilkan error, karena variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," adalah dipinjam oleh closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," untuk dipergunakan di dalam block-nya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet mut increase_by = |x: i32| num += x;\n\nnum += 5;\nincrease_by(10);\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3022).Z,width:"525",height:"222"})),(0,t.kt)("p",null,"Error muncul di statement setelahnya, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," karena ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," statusnya masih dipinjam oleh closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by"),"."),(0,t.kt)("p",null,"Variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," dipinjam dengan mode peminjaman adalah ",(0,t.kt)("em",{parentName:"p"},"mutable borrow")," karena closure didefinisikan mutable. Salah satu aturan pada borrowing: bahwa dalam waktu yang sama, ketika sudah terjadi mutable borrow, maka tidak boleh ada borrowing lainnya. Itulah alasan kenapa statement ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," menghasilkan error."),(0,t.kt)("p",null,"Solusi dari masalah di atas ada beberapa, yang pertama adalah menggunakan block expression untuk meng-isolasi closure, agar peminjaman pada closure tersebut dan statement ",(0,t.kt)("inlineCode",{parentName:"p"},"num += 5")," tidak terjadi dalam waktu yang sama."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nnum += 5;\n\n{\n let mut increase_by = |x: i32| num += x;\n increase_by(10);\n}\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,"Solusi di atas efektif untuk menghilangkan error borrowing yang sebelumnya muncul, tapi setelah d-refactor kode menjadi tidak sesuai spesifikasi awal. Pada kode yang baru di atas, deklarasi closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," terjadi di dalam block expression, artinya closure ini hanya akan bisa digunakan pada block kode tersebut saja, tidak bisa di-reuse di luar block."),(0,t.kt)("p",null,"Solusi yang lebih baik pada kasus di atas adalah dengan tidak menggunakan default borrowing (yang terjadi di dalam block closure ketika mengakses variabel yang posisinya berada di luar closure), melainkan gunakan saja borrowing pada parameter closure. Kita ubah lagi kodenya menjadi seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet increase_by = |num: &mut i32, x: i32| *num += x;\n\nnum += 5;\nincrease_by(&mut num, 10);\n\nprintln!("{num}"); // 20\n')),(0,t.kt)("p",null,"Pada contoh di atas, closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," ditambahi parameter baru. Sekarang ada 2 parameter, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," yang tipe-nya adalah pointer ",(0,t.kt)("inlineCode",{parentName:"p"},"&mut i32")," dan parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),". Di dalam block closure, ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," di-dereference (menggunakan operator ",(0,t.kt)("inlineCode",{parentName:"p"},"*"),") kemudian diubah nilainya. Setelah eksekusi statement selesai, data pinjaman tersebut langsung dikembalikan ke pemilik. Inilah kenapa kode di atas tidak menghasilkan error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Pengaksesan variabel yang berada di luar scope closure tanpa via parameter berarti adalah borrowing, maka dalam penerapannya wajib untuk memperhatikan aturan yang berlaku pada ownership dan borrowing.")),(0,t.kt)("h2",{id:"a485-keyword-move"},"A.48.5. Keyword ",(0,t.kt)("inlineCode",{parentName:"h2"},"move")),(0,t.kt)("p",null,"Telah dijelaskan di atas bahwa variabel di luar closure, jika diakses dari dalam closure maka terjadi borrowing. Ada cara agar variabel tersebut ownership-nya berpindah ke dalam closure (",(0,t.kt)("em",{parentName:"p"},"move semantics"),"), yaitu menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"move"),"."),(0,t.kt)("p",null,"Contohnya bisa dilihat berikut ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let mut num = 5;\nlet mut increase_by = move |x: i32| {\n num += x;\n println!("{num} (from closure)"); // 15\n};\n\nincrease_by(10);\nprintln!("{num}"); // 5\n')),(0,t.kt)("p",null,"Closure ",(0,t.kt)("inlineCode",{parentName:"p"},"increase_by")," di atas memiliki keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"move")," dalam pendefinisiannya. Dengan ini maka semua variabel di luar scope closure jika diakses dari dalam closure, maka variabel tersebut berpindah owner-nya (",(0,t.kt)("em",{parentName:"p"},"move semantics"),")."),(0,t.kt)("p",null,"Lalu bagaimana dengan nasib variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," yang berada di luar closure setelah owner-nya berpindah? Pada kondisi normal jawaban pertanyaan ini adalah tergantung tipe data-nya, jika ",(0,t.kt)("em",{parentName:"p"},"by default")," variabel adalah mengadopsi ",(0,t.kt)("em",{parentName:"p"},"move semantics")," maka variabel tersebut menjadi invalid. Namun pada contoh di atas ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," bertipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"i32")," yang mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", maka variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," tersebut masih bisa digunakan di luar closure."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(2682).Z,width:"324",height:"105"})),(0,t.kt)("p",null,"Bisa dilihat dari gambar di atas, statement ",(0,t.kt)("inlineCode",{parentName:"p"},"print")," dari dalam block closure hasilnya adalah benar, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"5 + 10 = 15"),". Dan variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"num")," di luar block closure tidak berubah nilainya."),(0,t.kt)("h2",{id:"a486-closure-sebagai-return-type"},"A.48.6. Closure sebagai return type"),(0,t.kt)("h3",{id:"-praktik-ke-1"},"\u25c9 Praktik ke-1"),(0,t.kt)("p",null,"Fungsi bisa memiliki nilai balik bertipe closure. Caranya dengan menggunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"impl Fn()")," sebagai tipe data nilai balik. Contoh penerapannya:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_something() -> impl Fn() {\n println!("hello (from do_something)");\n\n return || {\n println!("hello (from closure)");\n };\n}\n')),(0,t.kt)("p",null,"Tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"impl Fn()")," adalah ekuvalen dengan closure ",(0,t.kt)("inlineCode",{parentName:"p"},"|| { }"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let my_closure = do_something();\n println!("hello (from main)");\n my_closure();\n}\n\nfn main() {\n let my_closure = do_something_v2();\n let message = my_closure(123, "hello rust".to_owned());\n println!("{message} (from main)");\n}\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(4600).Z,width:"321",height:"124"})),(0,t.kt)("p",null,"Bisa dilihat, fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something")," di atas mengembalikan closure yang menampilkan string ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from closure)"),". String tersebut hanya muncul ketika closure dipanggil."),(0,t.kt)("p",null,"Sedangkan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something")," sendiri juga menampilkan pesan string lainnya, yaitu ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from do_something)"),", yang pesan ini adalah muncul langsung saat pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something"),". Berbeda dengan pesan ",(0,t.kt)("inlineCode",{parentName:"p"},"hello (from closure)")," yang hanya muncul ketika closure dieksekusi."),(0,t.kt)("h3",{id:"-praktik-ke-2"},"\u25c9 Praktik ke-2"),(0,t.kt)("p",null,"Pada contoh di atas, closure yang dikembalikan fungsi memiliki skema sangat sederhana, tanpa parameter dan argument. Mari coba praktik dengan contoh yang lebih kompleks."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn do_something_v2() -> impl Fn(i32, String) -> String {\n println!("hello (from do_something_v2)");\n\n return |a: i32, b: String| -> String {\n let message = format!("{b} {a}");\n message\n };\n}\n')),(0,t.kt)("p",null,"Pada kode di atas fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v2")," mengembalikan closure dengan skema ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32, String) -> String"),", yang artinya:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Parameter pertamanya bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"i32")),(0,t.kt)("li",{parentName:"ul"},"Parameter keduanya bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"String")),(0,t.kt)("li",{parentName:"ul"},"Mengembalikan nilai bertipe ",(0,t.kt)("inlineCode",{parentName:"li"},"String"))),(0,t.kt)("p",null,"Di dalam closure tersebut, data parameter digabung menjadi sebuah pesan string yang kemudian dijadikan nilai balik."),(0,t.kt)("p",null,"Sekarang jalankan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v2")," di atas, kemudian lihat hasilnya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let my_closure = do_something_v2();\nlet message = my_closure(123, "hello rust".to_owned());\nprintln!("{message} (from main)");\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3546).Z,width:"323",height:"106"})),(0,t.kt)("h2",{id:"a487-closure-sebagai-parameter-fungsi"},"A.48.7. Closure sebagai parameter fungsi"),(0,t.kt)("h3",{id:"-praktik-ke-1-1"},"\u25c9 Praktik ke-1"),(0,t.kt)("p",null,"Pengaplikasian closure sebagai parameter fungsi banyak dilakukan di Rust, hal ini bisa dilakukan dengan memanfaatkan generic parameter. Silakan perhatikan kode berikut untuk contoh penerapannya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn run_x_times(x: i32, my_closure: F)\nwhere\n F: Fn(i32),\n{\n for i in 0..x {\n my_closure(i)\n }\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times")," dibuat dengan tugas mengeksekusi closure ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," sebanyak ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," kali. Parameter closure harus selalu memiliki tipe data generic, contohnya ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," di atas yang tipe data-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"F"),"."),(0,t.kt)("p",null,"Fungsi yang memiliki parameter closure wajib menggunakan keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"where")," yang keyword ini digunakan untuk mendaftarkan skema closure yang nantiya bisa diterima saat pemanggilan fungsi. Tipe generic ",(0,t.kt)("inlineCode",{parentName:"p"},"F")," di daftarkan dengan notasi ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32)"),", artinya dalam pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times"),", parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"my_closure")," harus diisi dengan closure yang skema-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn(i32)")," yang jika di ilustrasikan dalam bentuk closure adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"|param1: i32| { }"),"."),(0,t.kt)("p",null,"Sekarang mari kita test fungsi di atas. Panggil fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"run_x_times")," kemudian pada bagian parameter closure isi dengan block closure yang memiliki skema sesuai requirement, contohnya ",(0,t.kt)("inlineCode",{parentName:"p"},'|i: i32| { println!("hello rust {i}") }'),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'run_x_times(4, |i: i32| {\n println!("hello rust {i}");\n});\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(2376).Z,width:"314",height:"147"})),(0,t.kt)("p",null,"O iya, closure di atas juga bisa dituliskan dalam bentuk seperti ini. Bebas, pilih sesuai preferensi dan/atau kesepakatan team perihal code convention."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'run_x_times(4, |i: i32| println!("hello rust {i}"));\n')),(0,t.kt)("h3",{id:"-praktik-ke-2-1"},"\u25c9 Praktik ke-2"),(0,t.kt)("p",null,"Ok, sekarang mari kita coba praktikkan contoh yang lebih kompleks."),(0,t.kt)("p",null,"Pada praktik ini kita akan buat sebuah fungsi yang tugasnya melakukan pencarian indeks slice dengan kondisi pencarian didapat dari eksekusi closure."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_index(data: &[T], cond_fn: F) -> i32\nwhere\n F: Fn(&T) -> bool,\n{\n for i in 0..data.len() {\n if cond_fn(&data[i]) {\n return i as i32\n }\n }\n\n return -1\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_index")," memiliki 2 parameter generic, yaitu:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("inlineCode",{parentName:"li"},"T")," yang digunakan sebagai tipe data element slice ",(0,t.kt)("inlineCode",{parentName:"li"},"data"),"."),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("inlineCode",{parentName:"li"},"F")," yang digunakan sebagai tipe data closure ",(0,t.kt)("inlineCode",{parentName:"li"},"cond_fn")," dengan skema ",(0,t.kt)("inlineCode",{parentName:"li"},"Fn(&T) -> bool"),", yang jika diilustrasikan dalam bentuk closure adalah ",(0,t.kt)("inlineCode",{parentName:"li"},"|param1: &T| -> bool { }"),".")),(0,t.kt)("p",null,"Di dalam fungsi tersebut, data slice di-loop, kemudian tiap elemen-nya digunakan sebagai parameter pemanggilan closure ",(0,t.kt)("inlineCode",{parentName:"p"},"cond_fn"),"."),(0,t.kt)("p",null,"Jika nilai balik pemanggilan closure adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"true")," maka ",(0,t.kt)("inlineCode",{parentName:"p"},"i")," dikembalikan dalam bentuk ",(0,t.kt)("inlineCode",{parentName:"p"},"i32")," (ada proses casting). Dan jika tidak diketemukan, maka indeks ",(0,t.kt)("inlineCode",{parentName:"p"},"-1")," dikembalikan."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"as")," digunakan untuk casting tipe data. Lebih jelasnya dibahas pada chapter ",(0,t.kt)("a",{parentName:"p",href:"/basic/type-alias-casting"},"Type Alias & Casting")," dan ",(0,t.kt)("a",{parentName:"p",href:"#/wip/trait-conversion-from-into"},"Trait \u279c Conversion (From & Into)"))),(0,t.kt)("p",null,"Jalankan program tersebut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'let numbers = [24, 13, 2, 53, 3];\nlet number_to_find = 53;\nlet index = find_index(&numbers, |e: &i32| -> bool {\n if *e == number_to_find {\n true \n } else {\n false\n }\n});\n\nprintln!("number_to_find: {number_to_find}");\nprintln!("index: {index}");\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Closure",src:n(3451).Z,width:"324",height:"108"})),(0,t.kt)("p",null,"Bisa dilihat program berjalan sesuai harapan."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Keyword ",(0,t.kt)("inlineCode",{parentName:"p"},"Fn")," merupakan salah satu trait function yang ada di Rust. Lebih jelasnya perihal keyword tersebut dibahas pada chapter selanjutnya, yaitu ",(0,t.kt)("a",{parentName:"p",href:"/basic/trait-function"},"Trait \u279c Function"))),(0,t.kt)("hr",null),(0,t.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,t.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,t.kt)("pre",null,(0,t.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/closures"},"github.com/novalagung/dasarpemrogramanrust-example/../closures")),(0,t.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/function"},"Function")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/borrowing"},"Borrowing")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"/basic/trait-function"},"Trait \u279c Function (Fn, FnMut, FnOnce)"))),(0,t.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch13-01-closures.html"},"https://doc.rust-lang.org/book/ch13-01-closures.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"},"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"))))}k.isMDXComponent=!0},6894:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/closures-1-2c7599bfed946d5bd1fb34a57acd9de7.png"},3022:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/closures-2-35b45e21715884c98b155c79b2d8f1c4.png"},2682:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAABpCAIAAADNzc3NAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD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vmF+x7Tass7YACPLFGGuXJ3O9drPtrjB/rWxtx0oEkmmKL7OSVGEmaIowkxRFGGmKIowUxRhpiiKMFMURZgpiiLMFEWYKYoizBRFEWaKoggzRVGD/geWHMKpfLG1lAAAAABJRU5ErkJggg=="}}]); \ No newline at end of file diff --git a/assets/js/cb962766.d450d5f7.js b/assets/js/cb962766.4f3c4b22.js similarity index 94% rename from assets/js/cb962766.d450d5f7.js rename to assets/js/cb962766.4f3c4b22.js index 9361bd72..eb39bd17 100644 --- a/assets/js/cb962766.d450d5f7.js +++ b/assets/js/cb962766.4f3c4b22.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[6691],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>c});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function l(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=a.createContext({}),o=function(e){var n=a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},s=function(e){var n=o(e.components);return a.createElement(p.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},d=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),d=o(t),c=r,k=d["".concat(p,".").concat(c)]||d[c]||m[c]||i;return t?a.createElement(k,l(l({ref:n},s),{},{components:t})):a.createElement(k,l({ref:n},s))}));function c(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,l=new Array(i);l[0]=d;var u={};for(var p in n)hasOwnProperty.call(n,p)&&(u[p]=n[p]);u.originalType=e,u.mdxType="string"==typeof e?e:r,l[1]=u;for(var o=2;o{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>o});var a=t(7462),r=(t(7294),t(3905));const i={sidebar_position:48,title:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)",sidebar_label:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)"},l=void 0,u={unversionedId:"basic/trait-function",id:"basic/trait-function",title:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)",description:"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure.",source:"@site/docs/basic/trait-function.md",sourceDirName:"basic",slug:"/basic/trait-function",permalink:"/basic/trait-function",draft:!1,tags:[],version:"current",sidebarPosition:48,frontMatter:{sidebar_position:48,title:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)",sidebar_label:"A.48. Trait \u279c Function (Fn, FnMut, FnOnce)"},sidebar:"tutorialSidebar",previous:{title:"A.47. Closures",permalink:"/basic/closures"},next:{title:"A.49. Trait \u279c Iterator",permalink:"/basic/trait-iterator"}},p={},o=[{value:"A.48.1. Trait Fn",id:"a481-trait-fn",level:2},{value:"A.48.2. Trait FnMut",id:"a482-trait-fnmut",level:2},{value:"A.48.3. Trait FnOnce",id:"a483-trait-fnonce",level:2},{value:"A.48.4. Relasi antara trait function dengan function",id:"a484-relasi-antara-trait-function-dengan-function",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],s={toc:o};function m(e){let{components:n,...i}=e;return(0,r.kt)("wrapper",(0,a.Z)({},s,i,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure."),(0,r.kt)("p",null,"Rust memiliki 3 buah trait yang otomatis ter-implement pada closure, yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),", dan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce"),". Ketiga trait ini juga otomatis ter-implement pada fungsi yang didefinisikan menggunakan keyword ",(0,r.kt)("inlineCode",{parentName:"p"},"fn"),"."),(0,r.kt)("h2",{id:"a481-trait-fn"},"A.48.1. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"Fn")),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," sudah kita terapkan beberapa kali saat praktik pembuatan closure di chapter sebelumnya. Fn adalah trait (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.Fn.html"},"std::ops::Fn"),"), yang dipakai oleh Rust untuk menandai bahwa suatu closure bisa dipanggil berkali-kali dengan catatan di dalam closure tersebut tidak ada operasi mutable terhadap variabel yang scope-nya berada di luar block closure."),(0,r.kt)("p",null,"Contoh penerapan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," bisa dilihat pada kode berikut. Trait tersebut secara otomatis ter-implement pada closure ",(0,r.kt)("inlineCode",{parentName:"p"},"pow"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let pow_number = |n: i32| n.pow(2);\n\nprintln!("pow_number(2): {}", pow_number(2));\nprintln!("pow_number(3): {}", pow_number(3));\nprintln!("pow_number(4): {}", pow_number(4));\n')),(0,r.kt)("p",null,"Contoh penerapan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," lainnya pada fungsi yang memiliki parameter closure:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = do_something_with_number_v1(13, |d: i32| d * 2);\n println!("result: {result}");\n}\n\nfn do_something_with_number_v1(n: i32, f: F) -> i32\nwhere\n F: Fn(i32) -> i32, // <----- Fn digunakan\n{\n // Statement `f(n)` bisa dipanggil berkali-kali\n return f(n);\n}\n')),(0,r.kt)("h2",{id:"a482-trait-fnmut"},"A.48.2. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"FnMut")),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.FnMut.html"},"std::ops::FnMut"),") merupakan trait yang menjadikan suatu closure bisa diakses berkali-kali dan bisa me-mutate atau mengubah data suatu variabel yang berada di luar scope block closure. Trait ini juga otomatis ter-implement pada closure yang di dalamnya ada kode pengaksesan variabel yang berada di luar scope block closure."),(0,r.kt)("p",null,"Contoh penerapannya silakan lihat closure ",(0,r.kt)("inlineCode",{parentName:"p"},"square_x")," berikut. Closure tersebut di-dalamnya mengubah nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"x")," yang dideklarasikan di luar blcok closure, oleh karenanya trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," otomatis ter-implement."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let mut x = 5;\n{\n let mut square_x = || x *= x;\n square_x();\n}\nprintln!("result: {}", x);\n')),(0,r.kt)("p",null,"Contoh lain penerapan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," pada fungsi yang memiliki parameter closure:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let mut number = 1;\n do_something_with_number_v2(14, |x| number += x);\n println!("number: {number}");\n}\n\nfn do_something_with_number_v2(n: i32, mut f: F)\nwhere\n F: FnMut(i32), // <----- FnMut digunakan\n{\n // Statement `f(n)` berisi kode yang mengubah isi variavel `number` (mutable).\n // `f(n)` bisa dipanggil berkali-kali\n f(n);\n}\n')),(0,r.kt)("p",null,"Parameter ke-2 fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_something_with_number_v2")," adalah closure yang me-mutate nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),", berarti terjadi mutable borrow karena variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," berada di luar block closure. Karena alasan tersebut maka closure harus dideklarasikan menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," (bukan ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),")."),(0,r.kt)("p",null,"Jika dipaksa deklarasi menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", hasilnya pasti error."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(2212).Z,width:"673",height:"274"})),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," merupakan supertrait dari ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", artinya closure dengan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," juga bisa digunakan sebagai argument pemanggilan fungsi di mana parameter fungsi tersebut bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai supertrait dibahas pada chpater ",(0,r.kt)("a",{parentName:"p",href:"#/wip/supertrait"},"Supertrait"))),(0,r.kt)("h2",{id:"a483-trait-fnonce"},"A.48.3. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"FnOnce")),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"},"std::ops::FnOnce"),") adalah trait yang menjadikan suatu closure hanya boleh di akses sekali saja, dan closure tersebut bisa berisi operasi mutable ataupun tidak."),(0,r.kt)("p",null,"Contoh penerapan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," pada fungsi yang memiliki parameter closure."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let mut number = 1;\n do_something_with_number_v3(14, |x| number += x);\n println!("number: {number}");\n}\n\nfn do_something_with_number_v3(n: i32, f: F)\nwhere\n F: FnOnce(i32), // <----- FnOnce digunakan\n{\n f(n);\n}\n')),(0,r.kt)("p",null,"Jika closure dengan tipe ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," dipaksa diakses dua kali, pasti muncul error. Contohnya bisa dilihat pada parameter ",(0,r.kt)("inlineCode",{parentName:"p"},"f")," berikut."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(1385).Z,width:"506",height:"395"})),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai supertrait dibahas pada chpater ",(0,r.kt)("a",{parentName:"p",href:"#/wip/supertrait"},"Supertrait"))),(0,r.kt)("h2",{id:"a484-relasi-antara-trait-function-dengan-function"},"A.48.4. Relasi antara trait function dengan function"),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),", dan juga ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," tidak hanya ter-implement pada closure, tapi juga ter-implement pada fungsi juga (secara otomatis)."),(0,r.kt)("p",null,"Contohnya bisa dilihat pada contoh berikut. Fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_something_with_number_v1")," dipanggil 3 kali."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Pemanggilan pertama, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan closure ",(0,r.kt)("inlineCode",{parentName:"li"},"|d: i32| d * 2")),(0,r.kt)("li",{parentName:"ul"},"Pemanggilan kedua, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan fungsi ",(0,r.kt)("inlineCode",{parentName:"li"},"double")),(0,r.kt)("li",{parentName:"ul"},"Pemanggilan ketiga, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan fungsi ",(0,r.kt)("inlineCode",{parentName:"li"},"pow_number"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = do_something_with_number_v1(13, |d: i32| d * 2);\n println!("result: {result}");\n \n let result = do_something_with_number_v1(13, double);\n println!("result: {result}");\n \n let result = do_something_with_number_v1(13, pow_number);\n println!("result: {result}");\n}\n\nfn do_something_with_number_v1(n: i32, f: F) -> i32\nwhere\n F: Fn(i32) -> i32,\n{\n return f(n);\n}\n\nfn double(d: i32) -> i32 {\n d * 2\n}\n\nfn pow_number(d: i32) -> i32 {\n d.pow(2)\n}\n')),(0,r.kt)("p",null,"Dari contoh di atas terbukti bahwa fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"double")," dan juga ",(0,r.kt)("inlineCode",{parentName:"p"},"pow_number")," memenuhi kriteria tipe ",(0,r.kt)("inlineCode",{parentName:"p"},"F")," yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn(i32) -> i32"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(2795).Z,width:"450",height:"143"})),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,r.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,r.kt)("pre",null,(0,r.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/trait_function"},"github.com/novalagung/dasarpemrogramanrust-example/../trait_function")),(0,r.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/function"},"Function")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures"))),(0,r.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch13-01-closures.html"},"https://doc.rust-lang.org/book/ch13-01-closures.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"},"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.Fn.html"},"https://doc.rust-lang.org/std/ops/trait.Fn.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.FnMut.html"},"https://doc.rust-lang.org/std/ops/trait.FnMut.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"},"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"))))}m.isMDXComponent=!0},2212:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/trait-function-1-69d13024d5321866a37aa3bb1f72a1b2.png"},1385:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/trait-function-2-5f9002b90d061f7ad1815a678e71f312.png"},2795:(e,n,t)=>{t.d(n,{Z:()=>a});const a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAACPCAIAAADmy0wUAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPS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gPbNseiL84XPnPia00AcCEZPaJtsx7UF22bgw+KAgDsJqOHtG2WKZRtm43TAQBsLqN3x7NtztI0bZsxcgaAfWUUAACQUQAAZBQAABkFAEBGAQAAGQUAQEYBAJBRAABkFAAAGQUAAGQUAOAy/A82p+fN3SYAAgAAAABJRU5ErkJggg=="}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[6691],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>c});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function l(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=a.createContext({}),o=function(e){var n=a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},s=function(e){var n=o(e.components);return a.createElement(p.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},d=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),d=o(t),c=r,k=d["".concat(p,".").concat(c)]||d[c]||m[c]||i;return t?a.createElement(k,l(l({ref:n},s),{},{components:t})):a.createElement(k,l({ref:n},s))}));function c(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,l=new Array(i);l[0]=d;var u={};for(var p in n)hasOwnProperty.call(n,p)&&(u[p]=n[p]);u.originalType=e,u.mdxType="string"==typeof e?e:r,l[1]=u;for(var o=2;o{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>o});var a=t(7462),r=(t(7294),t(3905));const i={sidebar_position:49,title:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)",sidebar_label:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)"},l=void 0,u={unversionedId:"basic/trait-function",id:"basic/trait-function",title:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)",description:"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure.",source:"@site/docs/basic/trait-function.md",sourceDirName:"basic",slug:"/basic/trait-function",permalink:"/basic/trait-function",draft:!1,tags:[],version:"current",sidebarPosition:49,frontMatter:{sidebar_position:49,title:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)",sidebar_label:"A.49. Trait \u279c Function (Fn, FnMut, FnOnce)"},sidebar:"tutorialSidebar",previous:{title:"A.48. Closures",permalink:"/basic/closures"},next:{title:"A.50. Trait \u279c Iterator",permalink:"/basic/trait-iterator"}},p={},o=[{value:"A.49.1. Trait Fn",id:"a491-trait-fn",level:2},{value:"A.49.2. Trait FnMut",id:"a492-trait-fnmut",level:2},{value:"A.49.3. Trait FnOnce",id:"a493-trait-fnonce",level:2},{value:"A.49.4. Relasi antara trait function dengan function",id:"a494-relasi-antara-trait-function-dengan-function",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],s={toc:o};function m(e){let{components:n,...i}=e;return(0,r.kt)("wrapper",(0,a.Z)({},s,i,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Chapter ini merupakan topik lanjutan dari chapter sebelumnya, di sini kita akan bahas beberapa jenis trait yang digunakan di closure."),(0,r.kt)("p",null,"Rust memiliki 3 buah trait yang otomatis ter-implement pada closure, yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),", dan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce"),". Ketiga trait ini juga otomatis ter-implement pada fungsi yang didefinisikan menggunakan keyword ",(0,r.kt)("inlineCode",{parentName:"p"},"fn"),"."),(0,r.kt)("h2",{id:"a491-trait-fn"},"A.49.1. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"Fn")),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," sudah kita terapkan beberapa kali saat praktik pembuatan closure di chapter sebelumnya. Fn adalah trait (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.Fn.html"},"std::ops::Fn"),"), yang dipakai oleh Rust untuk menandai bahwa suatu closure bisa dipanggil berkali-kali dengan catatan di dalam closure tersebut tidak ada operasi mutable terhadap variabel yang scope-nya berada di luar block closure."),(0,r.kt)("p",null,"Contoh penerapan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," bisa dilihat pada kode berikut. Trait tersebut secara otomatis ter-implement pada closure ",(0,r.kt)("inlineCode",{parentName:"p"},"pow"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let pow_number = |n: i32| n.pow(2);\n\nprintln!("pow_number(2): {}", pow_number(2));\nprintln!("pow_number(3): {}", pow_number(3));\nprintln!("pow_number(4): {}", pow_number(4));\n')),(0,r.kt)("p",null,"Contoh penerapan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," lainnya pada fungsi yang memiliki parameter closure:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = do_something_with_number_v1(13, |d: i32| d * 2);\n println!("result: {result}");\n}\n\nfn do_something_with_number_v1(n: i32, f: F) -> i32\nwhere\n F: Fn(i32) -> i32, // <----- Fn digunakan\n{\n // Statement `f(n)` bisa dipanggil berkali-kali\n return f(n);\n}\n')),(0,r.kt)("h2",{id:"a492-trait-fnmut"},"A.49.2. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"FnMut")),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.FnMut.html"},"std::ops::FnMut"),") merupakan trait yang menjadikan suatu closure bisa diakses berkali-kali dan bisa me-mutate atau mengubah data suatu variabel yang berada di luar scope block closure. Trait ini juga otomatis ter-implement pada closure yang di dalamnya ada kode pengaksesan variabel yang berada di luar scope block closure."),(0,r.kt)("p",null,"Contoh penerapannya silakan lihat closure ",(0,r.kt)("inlineCode",{parentName:"p"},"square_x")," berikut. Closure tersebut di-dalamnya mengubah nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"x")," yang dideklarasikan di luar blcok closure, oleh karenanya trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," otomatis ter-implement."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let mut x = 5;\n{\n let mut square_x = || x *= x;\n square_x();\n}\nprintln!("result: {}", x);\n')),(0,r.kt)("p",null,"Contoh lain penerapan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," pada fungsi yang memiliki parameter closure:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let mut number = 1;\n do_something_with_number_v2(14, |x| number += x);\n println!("number: {number}");\n}\n\nfn do_something_with_number_v2(n: i32, mut f: F)\nwhere\n F: FnMut(i32), // <----- FnMut digunakan\n{\n // Statement `f(n)` berisi kode yang mengubah isi variavel `number` (mutable).\n // `f(n)` bisa dipanggil berkali-kali\n f(n);\n}\n')),(0,r.kt)("p",null,"Parameter ke-2 fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_something_with_number_v2")," adalah closure yang me-mutate nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),", berarti terjadi mutable borrow karena variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," berada di luar block closure. Karena alasan tersebut maka closure harus dideklarasikan menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," (bukan ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),")."),(0,r.kt)("p",null,"Jika dipaksa deklarasi menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", hasilnya pasti error."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(2212).Z,width:"673",height:"274"})),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"FnMut")," merupakan supertrait dari ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", artinya closure dengan trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn")," juga bisa digunakan sebagai argument pemanggilan fungsi di mana parameter fungsi tersebut bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai supertrait dibahas pada chpater ",(0,r.kt)("a",{parentName:"p",href:"#/wip/supertrait"},"Supertrait"))),(0,r.kt)("h2",{id:"a493-trait-fnonce"},"A.49.3. Trait ",(0,r.kt)("inlineCode",{parentName:"h2"},"FnOnce")),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," (",(0,r.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"},"std::ops::FnOnce"),") adalah trait yang menjadikan suatu closure hanya boleh di akses sekali saja, dan closure tersebut bisa berisi operasi mutable ataupun tidak."),(0,r.kt)("p",null,"Contoh penerapan ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," pada fungsi yang memiliki parameter closure."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let mut number = 1;\n do_something_with_number_v3(14, |x| number += x);\n println!("number: {number}");\n}\n\nfn do_something_with_number_v3(n: i32, f: F)\nwhere\n F: FnOnce(i32), // <----- FnOnce digunakan\n{\n f(n);\n}\n')),(0,r.kt)("p",null,"Jika closure dengan tipe ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," dipaksa diakses dua kali, pasti muncul error. Contohnya bisa dilihat pada parameter ",(0,r.kt)("inlineCode",{parentName:"p"},"f")," berikut."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(1385).Z,width:"506",height:"395"})),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai supertrait dibahas pada chpater ",(0,r.kt)("a",{parentName:"p",href:"#/wip/supertrait"},"Supertrait"))),(0,r.kt)("h2",{id:"a494-relasi-antara-trait-function-dengan-function"},"A.49.4. Relasi antara trait function dengan function"),(0,r.kt)("p",null,"Trait ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"FnMut"),", dan juga ",(0,r.kt)("inlineCode",{parentName:"p"},"FnOnce")," tidak hanya ter-implement pada closure, tapi juga ter-implement pada fungsi juga (secara otomatis)."),(0,r.kt)("p",null,"Contohnya bisa dilihat pada contoh berikut. Fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"do_something_with_number_v1")," dipanggil 3 kali."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Pemanggilan pertama, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan closure ",(0,r.kt)("inlineCode",{parentName:"li"},"|d: i32| d * 2")),(0,r.kt)("li",{parentName:"ul"},"Pemanggilan kedua, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan fungsi ",(0,r.kt)("inlineCode",{parentName:"li"},"double")),(0,r.kt)("li",{parentName:"ul"},"Pemanggilan ketiga, argument ",(0,r.kt)("inlineCode",{parentName:"li"},"f")," diisi dengan fungsi ",(0,r.kt)("inlineCode",{parentName:"li"},"pow_number"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = do_something_with_number_v1(13, |d: i32| d * 2);\n println!("result: {result}");\n \n let result = do_something_with_number_v1(13, double);\n println!("result: {result}");\n \n let result = do_something_with_number_v1(13, pow_number);\n println!("result: {result}");\n}\n\nfn do_something_with_number_v1(n: i32, f: F) -> i32\nwhere\n F: Fn(i32) -> i32,\n{\n return f(n);\n}\n\nfn double(d: i32) -> i32 {\n d * 2\n}\n\nfn pow_number(d: i32) -> i32 {\n d.pow(2)\n}\n')),(0,r.kt)("p",null,"Dari contoh di atas terbukti bahwa fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"double")," dan juga ",(0,r.kt)("inlineCode",{parentName:"p"},"pow_number")," memenuhi kriteria tipe ",(0,r.kt)("inlineCode",{parentName:"p"},"F")," yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"Fn(i32) -> i32"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Closure",src:t(2795).Z,width:"450",height:"143"})),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,r.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,r.kt)("pre",null,(0,r.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/trait_function"},"github.com/novalagung/dasarpemrogramanrust-example/../trait_function")),(0,r.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/function"},"Function")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/traits"},"Traits")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures"))),(0,r.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch13-01-closures.html"},"https://doc.rust-lang.org/book/ch13-01-closures.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html"},"https://doc.rust-lang.org/beta/rust-by-example/fn/closures.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.Fn.html"},"https://doc.rust-lang.org/std/ops/trait.Fn.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.FnMut.html"},"https://doc.rust-lang.org/std/ops/trait.FnMut.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"},"https://doc.rust-lang.org/std/ops/trait.FnOnce.html"))))}m.isMDXComponent=!0},2212:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/trait-function-1-69d13024d5321866a37aa3bb1f72a1b2.png"},1385:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/trait-function-2-5f9002b90d061f7ad1815a678e71f312.png"},2795:(e,n,t)=>{t.d(n,{Z:()=>a});const a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAACPCAIAAADmy0wUAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5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AAgAAAABJRU5ErkJggg=="}}]); \ No newline at end of file diff --git a/assets/js/dabee7bd.9e39dc43.js b/assets/js/dabee7bd.7ac3877f.js similarity index 55% rename from assets/js/dabee7bd.9e39dc43.js rename to assets/js/dabee7bd.7ac3877f.js index 0e76ff78..48e88f4f 100644 --- a/assets/js/dabee7bd.9e39dc43.js +++ b/assets/js/dabee7bd.7ac3877f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[4943],{3905:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>s});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),d=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},m=function(e){var t=d(e.components);return n.createElement(o.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},k=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),k=d(a),s=r,c=k["".concat(o,".").concat(s)]||k[s]||u[s]||l;return a?n.createElement(c,i(i({ref:t},m),{},{components:a})):n.createElement(c,i({ref:t},m))}));function s(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=k;var p={};for(var o in t)hasOwnProperty.call(t,o)&&(p[o]=t[o]);p.originalType=e,p.mdxType="string"==typeof e?e:r,i[1]=p;for(var d=2;d{a.r(t),a.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>d});var n=a(7462),r=(a(7294),a(3905));const l={sidebar_position:8,title:"A.8. Operator",sidebar_label:"A.8. Operator"},i=void 0,p={unversionedId:"basic/operator",id:"basic/operator",title:"A.8. Operator",description:"Chapter ini membahas mengenai operator pada pemrograman rust.",source:"@site/docs/basic/operator.md",sourceDirName:"basic",slug:"/basic/operator",permalink:"/basic/operator",draft:!1,tags:[],version:"current",sidebarPosition:8,frontMatter:{sidebar_position:8,title:"A.8. Operator",sidebar_label:"A.8. Operator"},sidebar:"tutorialSidebar",previous:{title:"A.7. Konstanta",permalink:"/basic/konstanta"},next:{title:"A.9. Seleksi Kondisi \u279c if, else if, else",permalink:"/basic/seleksi-kondisi-if"}},o={},d=[{value:"A.8.1. Operator aritmatika",id:"a81-operator-aritmatika",level:2},{value:"A.8.2. Operator perbandingan",id:"a82-operator-perbandingan",level:2},{value:"\u25c9 Named argument macro println",id:"-named-argument-macro-println",level:3},{value:"A.8.3. Operator negasi",id:"a83-operator-negasi",level:2},{value:"A.8.4. Operator logika / bool",id:"a84-operator-logika--bool",level:2},{value:"\u25c9 Whitespace character tab \t",id:"-whitespace-character-tab-t",level:3},{value:"A.8.5. Operator reference dan dereference",id:"a85-operator-reference-dan-dereference",level:2},{value:"A.8.6. Operator bitwise",id:"a86-operator-bitwise",level:2},{value:"A.8.7. Operator lainnya",id:"a87-operator-lainnya",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:d};function u(e){let{components:t,...l}=e;return(0,r.kt)("wrapper",(0,n.Z)({},m,l,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Chapter ini membahas mengenai operator pada pemrograman rust."),(0,r.kt)("h2",{id:"a81-operator-aritmatika"},"A.8.1. Operator aritmatika"),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi aritmatika beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"+")),(0,r.kt)("td",{parentName:"tr",align:null},"penambahan")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"-")),(0,r.kt)("td",{parentName:"tr",align:null},"pengurangan")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"*")),(0,r.kt)("td",{parentName:"tr",align:null},"pengalian")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"/")),(0,r.kt)("td",{parentName:"tr",align:null},"pembagian")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"%")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("em",{parentName:"td"},"modulus")," atau sisa hasil bagi")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (num1, num2) = (12, 4);\n\nlet value_addition = num1 + num2;\nprintln!("{} + {} = {}", num1, num2, value_addition);\n// output => 12 + 4 = 16\n\nlet value_sub = num1 - num2;\nprintln!("{} - {} = {}", num1, num2, value_sub);\n// output => 12 - 4 = 8\n\nlet value_mut = num1 * num2;\nprintln!("{} * {} = {}", num1, num2, value_mut);\n// output => 12 * 4 = 48\n\nlet value_div = num1 / num2;\nprintln!("{} / {} = {}", num1, num2, value_div);\n// output => 12 / 4 = 3\n\nlet value_mod = num1 % num2;\nprintln!("{} % {} = {}", num1, num2, value_mod);\n// output => 12 % 4 = 0\n')),(0,r.kt)("h2",{id:"a82-operator-perbandingan"},"A.8.2. Operator perbandingan"),(0,r.kt)("p",null,"Operator perbandingan selalu menghasilkan nilai bertipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi perbandingan beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan untuk mengecek"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"==")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri tidak sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih besar dari kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih kecil dari kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih besar atau sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih kecil atau sama dengan kanan?")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let number_a = 12;\nlet number_b = 24;\n\nlet res_one = number_a == number_b;\nprintln!("res_one: {res_one}");\n\nlet res_two = number_a != number_b;\nprintln!("res_two: {res_two}");\n\nlet res_three = number_a > number_b;\nprintln!("res_three: {res_three}");\n\nlet res_four = number_a < number_b;\nprintln!("res_four: {res_four}");\n\nlet res_five = number_a >= number_b;\nprintln!("res_five: {res_five}");\n\nlet res_six = number_a <= number_b;\nprintln!("res_six: {res_six}");\n')),(0,r.kt)("p",null,"Pada contoh di atas, variabel di print menggunakan macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println")," tanpa disisipkan paramnya. Penjelasannya ada di bawah ini."),(0,r.kt)("h3",{id:"-named-argument-macro-println"},"\u25c9 ",(0,r.kt)("em",{parentName:"h3"},"Named argument")," macro ",(0,r.kt)("inlineCode",{parentName:"h3"},"println")),(0,r.kt)("p",null,"Salah satu teknik ",(0,r.kt)("em",{parentName:"p"},"formatted print")," macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println")," adalah dengan menerapkan ",(0,r.kt)("em",{parentName:"p"},"named argument"),". Yang biasanya menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"{}")," atau ",(0,r.kt)("inlineCode",{parentName:"p"},"{1}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{2}"),", dan seterusnya, diganti dengan nama variabel yang diapit tanda kurung kurawal, contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"res_one"),". Dengan teknik ini maka jika variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"res_one")," ada, akan langsung mereplace argument ",(0,r.kt)("inlineCode",{parentName:"p"},"{res_one}")," tanpa perlu menyisipkan variabel tersebut saat pemanggilan macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let res_one = number_a == number_b;\nprintln!("res_one: {res_one}");\n// output => res_one: false\n\nlet res_two = number_a != number_b;\nprintln!("res_two: {res_two}");\n// output => res_one: true\n')),(0,r.kt)("h2",{id:"a83-operator-negasi"},"A.8.3. Operator negasi"),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi negasi beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"),(0,r.kt)("th",{parentName:"tr",align:null},"Catatan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"-")),(0,r.kt)("td",{parentName:"tr",align:null},"negasi numerik"),(0,r.kt)("td",{parentName:"tr",align:null},"bisa digunakan pada tipe data integer dan float")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT")," atau bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT")),(0,r.kt)("td",{parentName:"tr",align:null},"bisa digunakan pada tipe data integer dan bool")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (value_left, value_right) = (12, -12);\nlet res_one = -value_left == value_right;\nlet res_two = !(value_left == value_right);\nprintln!("{res_one} {res_two}");\n// output => true true\n')),(0,r.kt)("p",null,"Untuk menggunakan operator negasi pada tipe data numerik, caranya dengan langsung menambahkan prefix ",(0,r.kt)("inlineCode",{parentName:"p"},"-")," pada angka atau variabel. Contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"-12")," atau ",(0,r.kt)("inlineCode",{parentName:"p"},"-value_left"),"."),(0,r.kt)("p",null,"Penggunaan operator logika ",(0,r.kt)("inlineCode",{parentName:"p"},"!")," juga sama, tinggal tambahkan saja sebagai prefix dari data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool")," atau statement yang menghasilkan data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),", contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"!(value_left == value_right)"),"."),(0,r.kt)("h2",{id:"a84-operator-logika--bool"},"A.8.4. Operator logika / ",(0,r.kt)("inlineCode",{parentName:"h2"},"bool")),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi logika ",(0,r.kt)("inlineCode",{parentName:"p"},"bool")," beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"&&")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"AND"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},"|","|"),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"OR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT"))))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (bool_left, bool_right) = (false, true);\nprintln!("AND result \\t: {}", bool_left && bool_right);\nprintln!("OR result \\t: {}", bool_left || bool_right);\n')),(0,r.kt)("h3",{id:"-whitespace-character-tab-t"},"\u25c9 ",(0,r.kt)("em",{parentName:"h3"},"Whitespace character")," tab ",(0,r.kt)("inlineCode",{parentName:"h3"},"\\t")),(0,r.kt)("p",null,"Rust mendukung karakter standar whitespace seperti ",(0,r.kt)("inlineCode",{parentName:"p"},"\\t")," yang kegunaannya adalah untuk horizontal tab. Contoh penerapannya seperti pada kode di atas, tulis saja ",(0,r.kt)("inlineCode",{parentName:"p"},"\\t")," dalam string literal, hasilnya bisa dilihat saat di-print."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'println!("AND result \\t: {}", bool_left && bool_right);\nprintln!("OR result \\t: {}", bool_left || bool_right);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"operator boolean",src:a(6032).Z,width:"381",height:"100"})),(0,r.kt)("h2",{id:"a85-operator-reference-dan-dereference"},"A.8.5. Operator reference dan dereference"),(0,r.kt)("p",null,"Untuk jenis operasi ini ada 3 buah operator yang bisa dipergunakan yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"*"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut"),". Untuk sekarang kita tidak akan membahas topik ini karena masih terlalu awal. Nantinya kita akan kupas tuntas di chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/pointer-references"},"Pointer & References"),". Sementara kita pelajari chapter per chapter secara berurutan dulu."),(0,r.kt)("h2",{id:"a86-operator-bitwise"},"A.8.6. Operator bitwise"),(0,r.kt)("p",null,"Rust mendukung operator bitwise standar yang ada di bahasa pemrograman."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"&")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"AND"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("code",null,"|")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"OR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"^")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"XOR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<<")),(0,r.kt)("td",{parentName:"tr",align:null},"left shift")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">>")),(0,r.kt)("td",{parentName:"tr",align:null},"right shift")))),(0,r.kt)("h2",{id:"a87-operator-lainnya"},"A.8.7. Operator lainnya"),(0,r.kt)("p",null,"Sebenarnya ada banyak lagi jenis operator di Rust programming, seperti type cast operator, reference/borrow operator, dll. Nantinya kita akan bahas operator tersebut satu per satu secara terpisah di chapter berbeda."),(0,r.kt)("blockquote",null,(0,r.kt)("ul",{parentName:"blockquote"},(0,r.kt)("li",{parentName:"ul"},"Type cast operator dibahas pada chapter ",(0,r.kt)("a",{parentName:"li",href:"/basic/type-alias-casting"},"Type Alias & Casting")),(0,r.kt)("li",{parentName:"ul"},"Reference/borrow operator dibahas pada chapter ",(0,r.kt)("a",{parentName:"li",href:"/basic/pointer-references"},"Pointer & References")))),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,r.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,r.kt)("pre",null,(0,r.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/operator"},"github.com/novalagung/dasarpemrogramanrust-example/../operator")),(0,r.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/pointer-references"},"Pointer & References")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#/wip/macro"},"Macro")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#/wip/whitespace-token"},"Whitespace Token"))),(0,r.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/expressions/operator-expr.html"},"https://doc.rust-lang.org/reference/expressions/operator-expr.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/whitespace.html"},"https://doc.rust-lang.org/reference/whitespace.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/hello/print.html"},"https://doc.rust-lang.org/rust-by-example/hello/print.html"))))}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KOPxcA7s/KOwf4AsBjvxB04rAvQfavm8+cnt5/VrkuW1gXY/mBcU6Df9enzXX+pFDr1ONL6DvtcRTsndsOaDrAZ7yQjZ1iQzPfLufd3/EA6gnfyvJiL+StFXdJh2YmZMJCyoruH2M9Snku0M2c3yf4AsAbvAAAAgHcAAADvAAAAgHcAAADvAAAAgHcAAADvzALo7FDQTXDT+TjYDdgV78TvcSTv7OzuvPJdvZcsN1n30p+baDcA2IZ36FmEE3kRlh68StKAd/YR7NQd4wTvAHvinX7gjM55tudBowOflgMH0NmZEL9Uvq8s8E6wc3Y35x3W/kp7AcBsvJO7Iz0ASkS/ygEFdHZW4B2GZ4l+CNUVKNrNcm4OZ7iARXgndyxWSNl6Dgs6O/uYZ1nsJtgfujzAPuId46AHnZ1teSc1tfG8fmJ/6PIAK63vRGsuw3oPnWcNI+MY3oHOziq8k6zHGe3G2R+6PMAKvBOv3fh1gcSP8/UCI++coLMz6/qOzDthZ73XRTLzjmR/AFiKd4KbxsF5On4aQh7o7GzIO32M4635XrCbZn/o8gAr8A4AAAB4BwAA8A4AAAB4BwAA8A4AAAB4BwAA8A4AAOAdAAAA8A4AAOAdAACAKfgPih3v0dH3yZcAAAAASUVORK5CYII="}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[4943],{3905:(e,a,t)=>{t.d(a,{Zo:()=>m,kt:()=>s});var n=t(7294);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var o=n.createContext({}),d=function(e){var a=n.useContext(o),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},m=function(e){var a=d(e.components);return n.createElement(o.Provider,{value:a},e.children)},u={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},k=n.forwardRef((function(e,a){var t=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),k=d(t),s=r,c=k["".concat(o,".").concat(s)]||k[s]||u[s]||i;return t?n.createElement(c,l(l({ref:a},m),{},{components:t})):n.createElement(c,l({ref:a},m))}));function s(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=t.length,l=new Array(i);l[0]=k;var p={};for(var o in a)hasOwnProperty.call(a,o)&&(p[o]=a[o]);p.originalType=e,p.mdxType="string"==typeof e?e:r,l[1]=p;for(var d=2;d{t.r(a),t.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>p,toc:()=>d});var n=t(7462),r=(t(7294),t(3905));const i={sidebar_position:8,title:"A.8. Operator",sidebar_label:"A.8. Operator"},l=void 0,p={unversionedId:"basic/operator",id:"basic/operator",title:"A.8. Operator",description:"Chapter ini membahas mengenai operator pada pemrograman rust.",source:"@site/docs/basic/operator.md",sourceDirName:"basic",slug:"/basic/operator",permalink:"/basic/operator",draft:!1,tags:[],version:"current",sidebarPosition:8,frontMatter:{sidebar_position:8,title:"A.8. Operator",sidebar_label:"A.8. Operator"},sidebar:"tutorialSidebar",previous:{title:"A.7. Konstanta",permalink:"/basic/konstanta"},next:{title:"A.9. Seleksi Kondisi \u279c if, else if, else",permalink:"/basic/seleksi-kondisi-if"}},o={},d=[{value:"A.8.1. Operator aritmatika",id:"a81-operator-aritmatika",level:2},{value:"A.8.2. Operator perbandingan",id:"a82-operator-perbandingan",level:2},{value:"\u25c9 Named argument macro println",id:"-named-argument-macro-println",level:3},{value:"A.8.3. Operator negasi",id:"a83-operator-negasi",level:2},{value:"A.8.4. Operator logika / bool",id:"a84-operator-logika--bool",level:2},{value:"\u25c9 Whitespace character tab \t",id:"-whitespace-character-tab-t",level:3},{value:"A.8.5. Operator reference dan dereference",id:"a85-operator-reference-dan-dereference",level:2},{value:"A.8.6. Operator bitwise",id:"a86-operator-bitwise",level:2},{value:"A.8.7. Operator lainnya",id:"a87-operator-lainnya",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:d};function u(e){let{components:a,...i}=e;return(0,r.kt)("wrapper",(0,n.Z)({},m,i,{components:a,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Chapter ini membahas mengenai operator pada pemrograman rust."),(0,r.kt)("h2",{id:"a81-operator-aritmatika"},"A.8.1. Operator aritmatika"),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi aritmatika beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"+")),(0,r.kt)("td",{parentName:"tr",align:null},"penambahan")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"-")),(0,r.kt)("td",{parentName:"tr",align:null},"pengurangan")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"*")),(0,r.kt)("td",{parentName:"tr",align:null},"pengalian")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"/")),(0,r.kt)("td",{parentName:"tr",align:null},"pembagian")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"%")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("em",{parentName:"td"},"modulus")," atau sisa hasil bagi")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (num1, num2) = (12, 4);\n\nlet value_addition = num1 + num2;\nprintln!("{} + {} = {}", num1, num2, value_addition);\n// output => 12 + 4 = 16\n\nlet value_sub = num1 - num2;\nprintln!("{} - {} = {}", num1, num2, value_sub);\n// output => 12 - 4 = 8\n\nlet value_mut = num1 * num2;\nprintln!("{} * {} = {}", num1, num2, value_mut);\n// output => 12 * 4 = 48\n\nlet value_div = num1 / num2;\nprintln!("{} / {} = {}", num1, num2, value_div);\n// output => 12 / 4 = 3\n\nlet value_mod = num1 % num2;\nprintln!("{} % {} = {}", num1, num2, value_mod);\n// output => 12 % 4 = 0\n')),(0,r.kt)("h2",{id:"a82-operator-perbandingan"},"A.8.2. Operator perbandingan"),(0,r.kt)("p",null,"Operator perbandingan selalu menghasilkan nilai bertipe data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi perbandingan beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan untuk mengecek"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"==")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri tidak sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih besar dari kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih kecil dari kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih besar atau sama dengan kanan?")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<=")),(0,r.kt)("td",{parentName:"tr",align:null},"apakah kiri lebih kecil atau sama dengan kanan?")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let number_a = 12;\nlet number_b = 24;\n\nlet res_one = number_a == number_b;\nprintln!("res_one: {res_one}");\n\nlet res_two = number_a != number_b;\nprintln!("res_two: {res_two}");\n\nlet res_three = number_a > number_b;\nprintln!("res_three: {res_three}");\n\nlet res_four = number_a < number_b;\nprintln!("res_four: {res_four}");\n\nlet res_five = number_a >= number_b;\nprintln!("res_five: {res_five}");\n\nlet res_six = number_a <= number_b;\nprintln!("res_six: {res_six}");\n')),(0,r.kt)("p",null,"Pada contoh di atas, variabel di print menggunakan macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println")," tanpa disisipkan paramnya. Penjelasannya ada di bawah ini."),(0,r.kt)("h3",{id:"-named-argument-macro-println"},"\u25c9 ",(0,r.kt)("em",{parentName:"h3"},"Named argument")," macro ",(0,r.kt)("inlineCode",{parentName:"h3"},"println")),(0,r.kt)("p",null,"Salah satu teknik ",(0,r.kt)("em",{parentName:"p"},"formatted print")," macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println")," adalah dengan menerapkan ",(0,r.kt)("em",{parentName:"p"},"named argument"),". Yang biasanya menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"{}")," atau ",(0,r.kt)("inlineCode",{parentName:"p"},"{1}"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"{2}"),", dan seterusnya, diganti dengan nama variabel yang diapit tanda kurung kurawal, contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"res_one"),". Dengan teknik ini maka jika variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"res_one")," ada, akan langsung mereplace argument ",(0,r.kt)("inlineCode",{parentName:"p"},"{res_one}")," tanpa perlu menyisipkan variabel tersebut saat pemanggilan macro ",(0,r.kt)("inlineCode",{parentName:"p"},"println"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let res_one = number_a == number_b;\nprintln!("res_one: {res_one}");\n// output => res_one: false\n\nlet res_two = number_a != number_b;\nprintln!("res_two: {res_two}");\n// output => res_one: true\n')),(0,r.kt)("h2",{id:"a83-operator-negasi"},"A.8.3. Operator negasi"),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi negasi beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"),(0,r.kt)("th",{parentName:"tr",align:null},"Catatan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"-")),(0,r.kt)("td",{parentName:"tr",align:null},"negasi numerik"),(0,r.kt)("td",{parentName:"tr",align:null},"bisa digunakan pada tipe data integer dan float")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT")," atau bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT")),(0,r.kt)("td",{parentName:"tr",align:null},"bisa digunakan pada tipe data integer dan bool")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (value_left, value_right) = (12, -12);\nlet res_one = -value_left == value_right;\nlet res_two = !(value_left == value_right);\nprintln!("{res_one} {res_two}");\n// output => true true\n')),(0,r.kt)("p",null,"Untuk menggunakan operator negasi pada tipe data numerik, caranya dengan langsung menambahkan prefix ",(0,r.kt)("inlineCode",{parentName:"p"},"-")," pada angka atau variabel. Contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"-12")," atau ",(0,r.kt)("inlineCode",{parentName:"p"},"-value_left"),"."),(0,r.kt)("p",null,"Penggunaan operator logika ",(0,r.kt)("inlineCode",{parentName:"p"},"!")," juga sama, tinggal tambahkan saja sebagai prefix dari data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool")," atau statement yang menghasilkan data ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),", contohnya ",(0,r.kt)("inlineCode",{parentName:"p"},"!(value_left == value_right)"),"."),(0,r.kt)("h2",{id:"a84-operator-logika--bool"},"A.8.4. Operator logika / ",(0,r.kt)("inlineCode",{parentName:"h2"},"bool")),(0,r.kt)("p",null,"Berikut merupakan list operator untuk operasi logika ",(0,r.kt)("inlineCode",{parentName:"p"},"bool")," beserta contoh penerapannya di rust."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"&&")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"AND"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},"|","|"),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"OR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"logika ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT"))))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let (bool_left, bool_right) = (false, true);\nprintln!("AND result \\t: {}", bool_left && bool_right);\nprintln!("OR result \\t: {}", bool_left || bool_right);\n')),(0,r.kt)("h3",{id:"-whitespace-character-tab-t"},"\u25c9 ",(0,r.kt)("em",{parentName:"h3"},"Whitespace character")," tab ",(0,r.kt)("inlineCode",{parentName:"h3"},"\\t")),(0,r.kt)("p",null,"Rust mendukung karakter standar whitespace seperti ",(0,r.kt)("inlineCode",{parentName:"p"},"\\t")," yang kegunaannya adalah untuk horizontal tab. Contoh penerapannya seperti pada kode di atas, tulis saja ",(0,r.kt)("inlineCode",{parentName:"p"},"\\t")," dalam string literal, hasilnya bisa dilihat saat di-print."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'println!("AND result \\t: {}", bool_left && bool_right);\nprintln!("OR result \\t: {}", bool_left || bool_right);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"operator boolean",src:t(6032).Z,width:"381",height:"100"})),(0,r.kt)("h2",{id:"a85-operator-reference-dan-dereference"},"A.8.5. Operator reference dan dereference"),(0,r.kt)("p",null,"Untuk jenis operasi ini ada 3 buah operator yang bisa dipergunakan yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"*"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut"),". Untuk sekarang kita tidak akan membahas topik ini karena masih terlalu awal. Nantinya kita akan kupas tuntas di chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/pointer-references"},"Pointer & References"),". Sementara kita pelajari chapter per chapter secara berurutan dulu."),(0,r.kt)("h2",{id:"a86-operator-bitwise"},"A.8.6. Operator bitwise"),(0,r.kt)("p",null,"Rust mendukung operator bitwise standar yang ada di bahasa pemrograman."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"center"},"Simbol"),(0,r.kt)("th",{parentName:"tr",align:null},"Kegunaan"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"&")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"AND"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("code",null,"|")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"OR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"^")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"XOR"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"!")),(0,r.kt)("td",{parentName:"tr",align:null},"bitwise ",(0,r.kt)("inlineCode",{parentName:"td"},"NOT"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},"<<")),(0,r.kt)("td",{parentName:"tr",align:null},"left shift")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"center"},(0,r.kt)("inlineCode",{parentName:"td"},">>")),(0,r.kt)("td",{parentName:"tr",align:null},"right shift")))),(0,r.kt)("h2",{id:"a87-operator-lainnya"},"A.8.7. Operator lainnya"),(0,r.kt)("p",null,"Sebenarnya ada banyak lagi jenis operator di Rust programming, seperti type cast operator, reference/borrow operator, dll. Nantinya kita akan bahas operator tersebut satu per satu secara terpisah di chapter berbeda."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Type cast operator dibahas pada chapter ",(0,r.kt)("a",{parentName:"li",href:"/basic/type-alias-casting"},"Type Alias & Casting")),(0,r.kt)("li",{parentName:"ul"},"Reference/borrow operator dibahas pada chapter ",(0,r.kt)("a",{parentName:"li",href:"/basic/pointer-references"},"Pointer & References")),(0,r.kt)("li",{parentName:"ul"},"Operator ",(0,r.kt)("inlineCode",{parentName:"li"},"?")," dibahas pada chapter ",(0,r.kt)("a",{parentName:"li",href:"/basic/operator-tanda-tanya"},"Operator ?"))),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,r.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,r.kt)("pre",null,(0,r.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/operator"},"github.com/novalagung/dasarpemrogramanrust-example/../operator")),(0,r.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/pointer-references"},"Pointer & References")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#/wip/macro"},"Macro")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#/wip/whitespace-token"},"Whitespace Token")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/basic/operator-tanda-tanya"},"Operator ?"))),(0,r.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/expressions/operator-expr.html"},"https://doc.rust-lang.org/reference/expressions/operator-expr.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/reference/whitespace.html"},"https://doc.rust-lang.org/reference/whitespace.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/rust-by-example/hello/print.html"},"https://doc.rust-lang.org/rust-by-example/hello/print.html"))))}u.isMDXComponent=!0},6032:(e,a,t)=>{t.d(a,{Z:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAX0AAABkCAIAAADltXfhAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAGdWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4L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6zHGe3G2R+6PMAKvBOv3fh1gcSP8/UCI++coLMz6/qOzDthZ73XRTLzjmR/AFiKd4KbxsF5On4aQh7o7GzIO32M4635XrCbZn/o8gAr8A4AAAB4BwAA8A4AAAB4BwAA8A4AAAB4BwAA8A4AAOAdAAAA8A4AAOAdAACAKfgPih3v0dH3yZcAAAAASUVORK5CYII="}}]); \ No newline at end of file diff --git a/assets/js/e4904969.1e20f726.js b/assets/js/e4904969.1e20f726.js deleted file mode 100644 index 5dc36cfa..00000000 --- a/assets/js/e4904969.1e20f726.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8732],{3905:(e,a,n)=>{n.d(a,{Zo:()=>m,kt:()=>s});var t=n(7294);function i(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var a=1;a=0||(i[n]=e[n]);return i}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=t.createContext({}),o=function(e){var a=t.useContext(d),n=a;return e&&(n="function"==typeof e?e(a):r(r({},a),e)),n},m=function(e){var a=o(e.components);return t.createElement(d.Provider,{value:a},e.children)},u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},k=t.forwardRef((function(e,a){var n=e.components,i=e.mdxType,l=e.originalType,d=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),k=o(n),s=i,c=k["".concat(d,".").concat(s)]||k[s]||u[s]||l;return n?t.createElement(c,r(r({ref:a},m),{},{components:n})):t.createElement(c,r({ref:a},m))}));function s(e,a){var n=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var l=n.length,r=new Array(l);r[0]=k;var p={};for(var d in a)hasOwnProperty.call(a,d)&&(p[d]=a[d]);p.originalType=e,p.mdxType="string"==typeof e?e:i,r[1]=p;for(var o=2;o{n.r(a),n.d(a,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=n(7462),i=(n(7294),n(3905));const l={sidebar_position:39,title:"A.39. Tipe Data \u279c Option",sidebar_label:"A.39. Tipe Data \u279c Option"},r=void 0,p={unversionedId:"basic/option-type",id:"basic/option-type",title:"A.39. Tipe Data \u279c Option",description:"Option adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (None). Chapter ini membahas tentang tipe data tersebut.",source:"@site/docs/basic/option-type.md",sourceDirName:"basic",slug:"/basic/option-type",permalink:"/basic/option-type",draft:!1,tags:[],version:"current",sidebarPosition:39,frontMatter:{sidebar_position:39,title:"A.39. Tipe Data \u279c Option",sidebar_label:"A.39. Tipe Data \u279c Option"},sidebar:"tutorialSidebar",previous:{title:"A.38. Generics",permalink:"/basic/generics"},next:{title:"A.40. Tipe Data \u279c Result",permalink:"/basic/result-type"}},d={},o=[{value:"A.39.1. Konsep Option",id:"a391-konsep-option",level:2},{value:"A.39.2. Pattern matching pada tipe Option",id:"a392-pattern-matching-pada-tipe-option",level:2},{value:"\u25c9 Tips pattern matching",id:"-tips-pattern-matching",level:3},{value:"A.39.3. Method tipe data Option",id:"a393-method-tipe-data-option",level:2},{value:"\u25c9 Method unwrap",id:"-method-unwrap",level:3},{value:"\u25c9 Method is_some & is_none",id:"-method-is_some--is_none",level:3},{value:"\u25c9 Method unwrap_or_default",id:"-method-unwrap_or_default",level:3},{value:"\u25c9 Method unwrap_or",id:"-method-unwrap_or",level:3},{value:"\u25c9 Method unwrap_or_else",id:"-method-unwrap_or_else",level:3},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function u(e){let{components:a,...l}=e;return(0,i.kt)("wrapper",(0,t.Z)({},m,l,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Option")," adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"). Chapter ini membahas tentang tipe data tersebut."),(0,i.kt)("h2",{id:"a391-konsep-option"},"A.39.1. Konsep ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," adalah enum dengan isi 2 buah enum value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Option::Some")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Some"),"), digunakan untuk menandai bahwa data memiliki value/nilai."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Option::None")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),"), digunakan untuk menandai bawah data adalah tidak ada nilainya.")),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"None")," bisa disamakan dengan nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"null")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"nil")," pada bahasa pemrograman lain."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," merupakan parameter generic. Lebih jelasnya mengenai generic dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics"),"."))),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," memiliki notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data sebenarnya yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),"."),(0,i.kt)("p",null,"Berikut adalah contoh cara penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn divider(a: i32, b: i32) -> Option {\n if b == 0 {\n return None;\n }\n\n let result = a / b;\n return Some(result);\n}\n\nfn main() {\n let result1 = divider(10, 5);\n println!("result: {:?}", result1);\n\n let result2: Option = divider(10, 0);\n println!("result: {:?}", result2);\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," di atas tugasnya adalah melakukan operasi aritmatika pembagian angka numerik ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"a")," dibagi ",(0,i.kt)("inlineCode",{parentName:"p"},"b"),"."),(0,i.kt)("p",null,"Pada fungsi tersebut terdapat pengecekan apabila nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", maka yang dikembalikan adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", selainnya maka hasil operasi pembagian dikembalikan dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Bisa dilihat pada statement return value fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider"),", nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," dibungkus menggunakan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),"."),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),". Dari tipe data yang digunakan nantinya bisa diprediksi pasti akan ada 2 potensi value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Return value adalah enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", muncul ketika nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"0")),(0,i.kt)("li",{parentName:"ul"},"Return value adalah nilai hasil numerik yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Some"))),(0,i.kt)("p",null,"Output program di atas saat di-run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(1384).Z,width:"450",height:"127"})),(0,i.kt)("h2",{id:"a392-pattern-matching-pada-tipe-option"},"A.39.2. Pattern matching pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("p",null,"Dalam penerapannya, ketika ada data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," artinya data tersebut berpotensi untuk berisi nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", pasti antara 2 nilai tersebut."),(0,i.kt)("p",null,"Umumnya penggunaan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," selalu diikuti dengan seleksi kondisi. Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," bisa digunakan dalam seleksi kondisi, namun dalam Praktiknya lebih baik menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," karena memberikan kemudahan dalam pengaksesan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," (yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," adalah data yang kita cari dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),")."),(0,i.kt)("p",null,"Mari kita praktikkan. Ubah isi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nmatch result1 {\n None => println!("cannot divide by 0"),\n Some(x) => println!("result: {x}"),\n}\n\nlet result2 = divider(10, 0);\nmatch result2 {\n None => println!("cannot divide by 0"),\n Some(x) => {\n println!("result: {}", x)\n },\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(4890).Z,width:"446",height:"124"})),(0,i.kt)("p",null,"Bisa dilihat cara mengambil nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," cukup mudah dengan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk seleksi kondisi biasa disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"pattern matching")," dan teknik ini sangat fleksibel dan advance."),(0,i.kt)("p",null,"Sebagai contoh, dengan penerapan match yang seperti ini kita bisa meng-handle 3 skenario seleksi kondisi:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nmatch result1 {\n None => println!("cannot divide by 0"),\n Some(2) => println!("the result is 2"),\n Some(x) => println!("result: {x}"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"cannot divide by 0")),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-2: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"2"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"the result is 2")),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Some")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(2)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"result: {x}"))),(0,i.kt)("h3",{id:"-tips-pattern-matching"},"\u25c9 Tips pattern matching"),(0,i.kt)("p",null,"Silakan perhatikan kode yang sudah kita praktikkan berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10, 5);\nmatch result {\n None => println!("cannot divide by 0"),\n Some(x) => println!("result: {x}"),\n}\n')),(0,i.kt)("p",null,"Penerapan pattern matching seperti contoh di atas memiliki konsekuensi, yaitu variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," hanya bisa diakses pada block ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(x)")," saja."),(0,i.kt)("p",null,"Adakalanya kita butuh untuk mengeluarkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," ke luar block. Hal seperti ini mudah untuk dilakukan, dan ada beberapa cara yang bisa dipilih, namun menurut penulis yang paling elegan adalah cara berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = match divider(10, 5) {\n None => {\n println!("cannot divide by 0");\n 0\n },\n Some(x) => x,\n };\n\n println!("result: {:?}", result);\n}\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 5)")," mengembalikan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),". Data tersebut digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," seperti biasa. Namun pada contoh di atas ada yang berbeda, yaitu return value dari statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," ditampung ke variabel (",(0,i.kt)("inlineCode",{parentName:"p"},"result"),")."),(0,i.kt)("p",null,"Isi dari pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," sendiri ada dua:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," match, pesan error di-print kemudian nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"0")," dijadikan return statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),"."),(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Some")," match, data ",(0,i.kt)("inlineCode",{parentName:"li"},"x")," dijadikan return value statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),".")),(0,i.kt)("p",null,"Dengan penerapan pattern matching seperti di atas, maka variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," akan selalu berisi data hasil operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 5)"),". Dengan pengecualian ketika ada error, pesan errornya dimunculkan kemudian hasil operasi pembagian di-set sebagai ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h2",{id:"a393-method-tipe-data-option"},"A.39.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("h3",{id:"-method-unwrap"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap")),(0,i.kt)("p",null,"Isi dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," bisa diakses tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan cara memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nif result1 != None {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n')),(0,i.kt)("p",null,"Penggunaan method tersebut sangat dianjurkan diiringi dengan seleksi kondisi untuk memastikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," tidak berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Jika data ternyata adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," dan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," diakses, hasilnya adalah panic error. Contohnya bisa dilihat pada gambar berikut:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(5499).Z,width:"659",height:"262"})),(0,i.kt)("p",null,"Selain method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," ada beberapa method sejenis lainnya yang bisa dimanfaatkan untuk pengambilan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),". Kita akan bahas satu per satu."),(0,i.kt)("h3",{id:"-method-is_some--is_none"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_some")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_none")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_some")," menghasilkan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika data isinya adalah enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Sedangkan ",(0,i.kt)("inlineCode",{parentName:"p"},"is_none")," bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("p",null,"Contoh penerapannya bisa dilihat pada program berikut. Kesemua seleksi kondisi pada konteks ini menghasilkan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\n\nif result1 != None {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n\nif result1.is_some() {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n\nif !result1.is_none() {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_default"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_default")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),"."),(0,i.kt)("p",null,"Sebagai contoh, pada kode berikut statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 0)")," return type-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),", sedangkan return value-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," menghasilkan ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"0")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or_default();\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", namun jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah argument pemanggilan method tersebut."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or(0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Pada contoh di atas argument pemanggilan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or")," adalah angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", artinya ketika ",(0,i.kt)("inlineCode",{parentName:"p"},"result2")," isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," maka angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," adalah return value pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or"),"."),(0,i.kt)("h3",{id:"-method-unwrap_or_else"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_else")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", namun jika data isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah hasil eksekusi closure yang disisipkan saat memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_else"),". Contoh pengaplikasiannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or_else(|| 0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Closure harus dalam notasi ",(0,i.kt)("inlineCode",{parentName:"p"},"FnOnce() -> T")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," pada konteks ini adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Closure ",(0,i.kt)("inlineCode",{parentName:"p"},"|| 0")," adalah kependekan dari ",(0,i.kt)("inlineCode",{parentName:"p"},"|| -> i32 { 0 }"),"."),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai closure dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/closures"},"Closures"),".")),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/option_type"},"github.com/novalagung/dasarpemrogramanrust-example/../option_type")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/option/index.html"},"https://doc.rust-lang.org/std/option/index.html"))))}u.isMDXComponent=!0},1384:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAB/CAIAAADzWVUNAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjO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QgiBToQQAp0IIQQ6EUIIdCKEEOhECCEEOhFC6C2iM37stHu60/VEZyll+0tN9ferEEKgcx8Ovil0YtSMEOi8GDovVYyl6Axs8jB+Quhm0Bm85RhaIsWbep/2MelodZxvFDkWrY6LMdrvwC1UHCQ2x0veA40OIfJ0B4M9OuNqGkc39p5oabzIjxC6LnSqMOjzj5+hhWdAv4lj5Y0RmwakOMO9kELJLnH4F+Gq7Nsk85SOzjbKA5+T017R0Uv2y2EdQmdphNDVorMeA30OTD0yTqmNCUWCJC50ZnS00Rn+DD5elKfUeWpHZ1eZ0soXaxZ9w6RvIMJOhK4bnUa0lEywW9Fp0G51dE6/U3I60Gk7OlfKFB50nLwX4sgk0uR2PUK3EXVm53H+0Y0FUWd8i2RldA4bMnI60elEmFWmqcYud9OmZQuE0IHRKW2NkzXAxqgzIm+EDd8dkuno0RKjQfoOmt9//Cp+cE7n6f9aR/pxz6lIJw7++lWpVGjTzF0ihG4CncnsPL2d/fvnj9aoM5ijlm5z12e4pzRDOFmwT06cko2UIs8747Z7uYWSZM6HjaYc4CZCN4JOtEBMvxECnagdnNzyQQh0ohZoMv1GCHQihBACnQghBDoRQgh0IoQQ6EQIIdCJEEKgEyGEEOhECCHQiRBCoBMhhEAnQgi9Of0fmQb7AJMnfVgAAAAASUVORK5CYII="},5499:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/option-type-3-e2943c7c0a60b13cd69ce8461805846c.png"}}]); \ No newline at end of file diff --git a/assets/js/e4904969.59f9cb8c.js b/assets/js/e4904969.59f9cb8c.js new file mode 100644 index 00000000..2743e4cd --- /dev/null +++ b/assets/js/e4904969.59f9cb8c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[8732],{3905:(e,a,n)=>{n.d(a,{Zo:()=>m,kt:()=>s});var t=n(7294);function i(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var a=1;a=0||(i[n]=e[n]);return i}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=t.createContext({}),o=function(e){var a=t.useContext(d),n=a;return e&&(n="function"==typeof e?e(a):r(r({},a),e)),n},m=function(e){var a=o(e.components);return t.createElement(d.Provider,{value:a},e.children)},u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},k=t.forwardRef((function(e,a){var n=e.components,i=e.mdxType,l=e.originalType,d=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),k=o(n),s=i,c=k["".concat(d,".").concat(s)]||k[s]||u[s]||l;return n?t.createElement(c,r(r({ref:a},m),{},{components:n})):t.createElement(c,r({ref:a},m))}));function s(e,a){var n=arguments,i=a&&a.mdxType;if("string"==typeof e||i){var l=n.length,r=new Array(l);r[0]=k;var p={};for(var d in a)hasOwnProperty.call(a,d)&&(p[d]=a[d]);p.originalType=e,p.mdxType="string"==typeof e?e:i,r[1]=p;for(var o=2;o{n.r(a),n.d(a,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>o});var t=n(7462),i=(n(7294),n(3905));const l={sidebar_position:39,title:"A.39. Tipe Data \u279c Option",sidebar_label:"A.39. Tipe Data \u279c Option"},r=void 0,p={unversionedId:"basic/option-type",id:"basic/option-type",title:"A.39. Tipe Data \u279c Option",description:"Option adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (None). Chapter ini membahas tentang tipe data tersebut.",source:"@site/docs/basic/option-type.md",sourceDirName:"basic",slug:"/basic/option-type",permalink:"/basic/option-type",draft:!1,tags:[],version:"current",sidebarPosition:39,frontMatter:{sidebar_position:39,title:"A.39. Tipe Data \u279c Option",sidebar_label:"A.39. Tipe Data \u279c Option"},sidebar:"tutorialSidebar",previous:{title:"A.38. Generics",permalink:"/basic/generics"},next:{title:"A.40. Tipe Data \u279c Result",permalink:"/basic/result-type"}},d={},o=[{value:"A.39.1. Konsep Option",id:"a391-konsep-option",level:2},{value:"A.39.2. Pattern matching pada tipe Option",id:"a392-pattern-matching-pada-tipe-option",level:2},{value:"\u25c9 Tips pattern matching",id:"-tips-pattern-matching",level:3},{value:"A.39.3. Method tipe data Option",id:"a393-method-tipe-data-option",level:2},{value:"\u25c9 Method unwrap",id:"-method-unwrap",level:3},{value:"\u25c9 Method is_some & is_none",id:"-method-is_some--is_none",level:3},{value:"\u25c9 Method unwrap_or_default",id:"-method-unwrap_or_default",level:3},{value:"\u25c9 Method unwrap_or",id:"-method-unwrap_or",level:3},{value:"\u25c9 Method unwrap_or_else",id:"-method-unwrap_or_else",level:3},{value:"A.38.4. Operator ? pada tipe Option",id:"a384-operator--pada-tipe-option",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Chapter relevan lainnya",id:"-chapter-relevan-lainnya",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],m={toc:o};function u(e){let{components:a,...l}=e;return(0,i.kt)("wrapper",(0,t.Z)({},m,l,{components:a,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Option")," adalah salah satu tipe data penting pada Rust programming, digunakan untuk menampung data yang isinya bisa berpotensi kosong (",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"). Chapter ini membahas tentang tipe data tersebut."),(0,i.kt)("h2",{id:"a391-konsep-option"},"A.39.1. Konsep ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," adalah enum dengan isi 2 buah enum value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Option::Some")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"Some"),"), digunakan untuk menandai bahwa data memiliki value/nilai."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Option::None")," (atau ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),"), digunakan untuk menandai bawah data adalah tidak ada nilainya.")),(0,i.kt)("blockquote",null,(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"None")," bisa disamakan dengan nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"null")," atau ",(0,i.kt)("inlineCode",{parentName:"li"},"nil")," pada bahasa pemrograman lain."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"T")," merupakan parameter generic. Lebih jelasnya mengenai generic dibahas pada chapter ",(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics"),"."))),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," memiliki notasi penulisan ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," adalah tipe data sebenarnya yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),"."),(0,i.kt)("p",null,"Berikut adalah contoh cara penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn divider(a: i32, b: i32) -> Option {\n if b == 0 {\n return None;\n }\n\n let result = a / b;\n return Some(result);\n}\n\nfn main() {\n let result1 = divider(10, 5);\n println!("result: {:?}", result1);\n\n let result2: Option = divider(10, 0);\n println!("result: {:?}", result2);\n}\n')),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," di atas tugasnya adalah melakukan operasi aritmatika pembagian angka numerik ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", parameter ",(0,i.kt)("inlineCode",{parentName:"p"},"a")," dibagi ",(0,i.kt)("inlineCode",{parentName:"p"},"b"),"."),(0,i.kt)("p",null,"Pada fungsi tersebut terdapat pengecekan apabila nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", maka yang dikembalikan adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", selainnya maka hasil operasi pembagian dikembalikan dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Bisa dilihat pada statement return value fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider"),", nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," dibungkus menggunakan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),"."),(0,i.kt)("p",null,"Fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider")," nilai baliknya bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),". Dari tipe data yang digunakan nantinya bisa diprediksi pasti akan ada 2 potensi value:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Return value adalah enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", muncul ketika nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"b")," adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"0")),(0,i.kt)("li",{parentName:"ul"},"Return value adalah nilai hasil numerik yang dibungkus oleh enum value ",(0,i.kt)("inlineCode",{parentName:"li"},"Some"))),(0,i.kt)("p",null,"Output program di atas saat di-run:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(1384).Z,width:"450",height:"127"})),(0,i.kt)("h2",{id:"a392-pattern-matching-pada-tipe-option"},"A.39.2. Pattern matching pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("p",null,"Dalam penerapannya, ketika ada data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," artinya data tersebut berpotensi untuk berisi nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," atau ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", pasti antara 2 nilai tersebut."),(0,i.kt)("p",null,"Umumnya penggunaan tipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," selalu diikuti dengan seleksi kondisi. Keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"if")," bisa digunakan dalam seleksi kondisi, namun dalam Praktiknya lebih baik menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," karena memberikan kemudahan dalam pengaksesan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," (yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," adalah data yang kita cari dibungkus dalam enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),")."),(0,i.kt)("p",null,"Mari kita praktikkan. Ubah isi fungsi ",(0,i.kt)("inlineCode",{parentName:"p"},"main")," dengan kode berikut:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nmatch result1 {\n None => println!("cannot divide by 0"),\n Some(x) => println!("result: {x}"),\n}\n\nlet result2 = divider(10, 0);\nmatch result2 {\n None => println!("cannot divide by 0"),\n Some(x) => {\n println!("result: {}", x)\n },\n}\n')),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(4890).Z,width:"446",height:"124"})),(0,i.kt)("p",null,"Bisa dilihat cara mengambil nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," cukup mudah dengan menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match"),". Penerapan ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," untuk seleksi kondisi biasa disebut dengan ",(0,i.kt)("strong",{parentName:"p"},"pattern matching")," dan teknik ini sangat fleksibel dan advance."),(0,i.kt)("p",null,"Sebagai contoh, dengan penerapan match yang seperti ini kita bisa meng-handle 3 skenario seleksi kondisi:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nmatch result1 {\n None => println!("cannot divide by 0"),\n Some(2) => println!("the result is 2"),\n Some(x) => println!("result: {x}"),\n}\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"cannot divide by 0")),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-2: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"2"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"the result is 2")),(0,i.kt)("li",{parentName:"ul"},"Kondisi ke-1: jika nilai adalah ",(0,i.kt)("inlineCode",{parentName:"li"},"Some")," selain dari ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," dan ",(0,i.kt)("inlineCode",{parentName:"li"},"Some(2)"),", maka munculkan pesan ",(0,i.kt)("inlineCode",{parentName:"li"},"result: {x}"))),(0,i.kt)("h3",{id:"-tips-pattern-matching"},"\u25c9 Tips pattern matching"),(0,i.kt)("p",null,"Silakan perhatikan kode yang sudah kita praktikkan berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result = divider(10, 5);\nmatch result {\n None => println!("cannot divide by 0"),\n Some(x) => println!("result: {x}"),\n}\n')),(0,i.kt)("p",null,"Penerapan pattern matching seperti contoh di atas memiliki konsekuensi, yaitu variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," hanya bisa diakses pada block ",(0,i.kt)("inlineCode",{parentName:"p"},"Some(x)")," saja."),(0,i.kt)("p",null,"Adakalanya kita butuh untuk mengeluarkan variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"x")," ke luar block. Hal seperti ini mudah untuk dilakukan, dan ada beberapa cara yang bisa dipilih, namun menurut penulis yang paling elegan adalah cara berikut ini:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let result = match divider(10, 5) {\n None => {\n println!("cannot divide by 0");\n 0\n },\n Some(x) => x,\n };\n\n println!("result: {:?}", result);\n}\n')),(0,i.kt)("p",null,"Statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 5)")," mengembalikan data bertipe ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),". Data tersebut digunakan pada keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," seperti biasa. Namun pada contoh di atas ada yang berbeda, yaitu return value dari statement ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," ditampung ke variabel (",(0,i.kt)("inlineCode",{parentName:"p"},"result"),")."),(0,i.kt)("p",null,"Isi dari pattern matching ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," sendiri ada dua:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"None")," match, pesan error di-print kemudian nilai ",(0,i.kt)("inlineCode",{parentName:"li"},"0")," dijadikan return statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),"."),(0,i.kt)("li",{parentName:"ul"},"Ketika block ",(0,i.kt)("inlineCode",{parentName:"li"},"Some")," match, data ",(0,i.kt)("inlineCode",{parentName:"li"},"x")," dijadikan return value statement ",(0,i.kt)("inlineCode",{parentName:"li"},"match"),".")),(0,i.kt)("p",null,"Dengan penerapan pattern matching seperti di atas, maka variabel ",(0,i.kt)("inlineCode",{parentName:"p"},"result")," akan selalu berisi data hasil operasi ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 5)"),". Dengan pengecualian ketika ada error, pesan errornya dimunculkan kemudian hasil operasi pembagian di-set sebagai ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai pattern matching dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/pattern-matching"},"Pattern Matching"))),(0,i.kt)("h2",{id:"a393-method-tipe-data-option"},"A.39.3. Method tipe data ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("h3",{id:"-method-unwrap"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap")),(0,i.kt)("p",null,"Isi dari enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some")," bisa diakses tanpa menggunakan keyword ",(0,i.kt)("inlineCode",{parentName:"p"},"match")," dengan cara memanfaatkan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," milik ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\nif result1 != None {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n')),(0,i.kt)("p",null,"Penggunaan method tersebut sangat dianjurkan diiringi dengan seleksi kondisi untuk memastikan data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," tidak berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Jika data ternyata adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," dan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," diakses, hasilnya adalah panic error. Contohnya bisa dilihat pada gambar berikut:"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Option type",src:n(5499).Z,width:"659",height:"262"})),(0,i.kt)("p",null,"Selain method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap")," ada beberapa method sejenis lainnya yang bisa dimanfaatkan untuk pengambilan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),". Kita akan bahas satu per satu."),(0,i.kt)("h3",{id:"-method-is_some--is_none"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_some")," & ",(0,i.kt)("inlineCode",{parentName:"h3"},"is_none")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"is_some")," menghasilkan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika data isinya adalah enum value ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Sedangkan ",(0,i.kt)("inlineCode",{parentName:"p"},"is_none")," bernilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," jika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),"."),(0,i.kt)("p",null,"Contoh penerapannya bisa dilihat pada program berikut. Kesemua seleksi kondisi pada konteks ini menghasilkan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"true"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result1 = divider(10, 5);\n\nif result1 != None {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n\nif result1.is_some() {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n\nif !result1.is_none() {\n let number = result1.unwrap();\n println!("result: {}", number);\n}\n')),(0,i.kt)("h3",{id:"-method-unwrap_or_default"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_default")),(0,i.kt)("p",null,"Method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),". Jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"T"),"."),(0,i.kt)("p",null,"Sebagai contoh, pada kode berikut statement ",(0,i.kt)("inlineCode",{parentName:"p"},"divider(10, 0)")," return type-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"Option"),", sedangkan return value-nya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),". Pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_default")," menghasilkan ",(0,i.kt)("em",{parentName:"p"},"default value")," dari tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),", yaitu ",(0,i.kt)("inlineCode",{parentName:"p"},"0")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or_default();\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("h3",{id:"-method-unwrap_or"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", namun jika data ternyata isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah argument pemanggilan method tersebut."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or(0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Pada contoh di atas argument pemanggilan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or")," adalah angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0"),", artinya ketika ",(0,i.kt)("inlineCode",{parentName:"p"},"result2")," isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None")," maka angka ",(0,i.kt)("inlineCode",{parentName:"p"},"0")," adalah return value pengaksesan method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or"),"."),(0,i.kt)("h3",{id:"-method-unwrap_or_else"},"\u25c9 Method ",(0,i.kt)("inlineCode",{parentName:"h3"},"unwrap_or_else")),(0,i.kt)("p",null,"Method ini mengembalikan nilai ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," ketika data berisi ",(0,i.kt)("inlineCode",{parentName:"p"},"Some"),", namun jika data isinya adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"None"),", maka nilai yang dikembalikan adalah hasil eksekusi closure yang disisipkan saat memanggil method ",(0,i.kt)("inlineCode",{parentName:"p"},"unwrap_or_else"),". Contoh pengaplikasiannya:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-rust"},'let result2 = divider(10, 0);\nlet number = result2.unwrap_or_else(|| 0);\nprintln!("result: {}", number);\n// result: 0\n')),(0,i.kt)("p",null,"Closure harus dalam notasi ",(0,i.kt)("inlineCode",{parentName:"p"},"FnOnce() -> T")," yang mana ",(0,i.kt)("inlineCode",{parentName:"p"},"T")," pada konteks ini adalah ",(0,i.kt)("inlineCode",{parentName:"p"},"i32"),"."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Closure ",(0,i.kt)("inlineCode",{parentName:"p"},"|| 0")," adalah kependekan dari ",(0,i.kt)("inlineCode",{parentName:"p"},"|| -> i32 { 0 }"),"."),(0,i.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai closure dibahas pada chapter ",(0,i.kt)("a",{parentName:"p",href:"/basic/closures"},"Closures"),".")),(0,i.kt)("h2",{id:"a384-operator--pada-tipe-option"},"A.38.4. Operator ",(0,i.kt)("inlineCode",{parentName:"h2"},"?")," pada tipe ",(0,i.kt)("inlineCode",{parentName:"h2"},"Option")),(0,i.kt)("p",null,"Tipe data ",(0,i.kt)("inlineCode",{parentName:"p"},"Option")," bisa digunakan pada operator ",(0,i.kt)("inlineCode",{parentName:"p"},"?"),". Penjelasannya ada di chapter terpisah di ",(0,i.kt)("a",{parentName:"p",href:"/basic/operator-tanda-tanya"},"Operator ?"),"."),(0,i.kt)("hr",null),(0,i.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,i.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,i.kt)("pre",null,(0,i.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/option_type"},"github.com/novalagung/dasarpemrogramanrust-example/../option_type")),(0,i.kt)("h3",{id:"-chapter-relevan-lainnya"},"\u25c9 Chapter relevan lainnya"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/generics"},"Generics")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/pattern-matching"},"Pattern Matching")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/closures"},"Closures")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/basic/operator-tanda-tanya"},"Operator ?"))),(0,i.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html"},"https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/option/index.html"},"https://doc.rust-lang.org/std/option/index.html"))))}u.isMDXComponent=!0},1384:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAB/CAIAAADzWVUNAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENv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GDovVYyl6Axs8jB+Quhm0Bm85RhaIsWbep/2MelodZxvFDkWrY6LMdrvwC1UHCQ2x0veA40OIfJ0B4M9OuNqGkc39p5oabzIjxC6LnSqMOjzj5+hhWdAv4lj5Y0RmwakOMO9kELJLnH4F+Gq7Nsk85SOzjbKA5+T017R0Uv2y2EdQmdphNDVorMeA30OTD0yTqmNCUWCJC50ZnS00Rn+DD5elKfUeWpHZ1eZ0soXaxZ9w6RvIMJOhK4bnUa0lEywW9Fp0G51dE6/U3I60Gk7OlfKFB50nLwX4sgk0uR2PUK3EXVm53H+0Y0FUWd8i2RldA4bMnI60elEmFWmqcYud9OmZQuE0IHRKW2NkzXAxqgzIm+EDd8dkuno0RKjQfoOmt9//Cp+cE7n6f9aR/pxz6lIJw7++lWpVGjTzF0ihG4CncnsPL2d/fvnj9aoM5ijlm5z12e4pzRDOFmwT06cko2UIs8747Z7uYWSZM6HjaYc4CZCN4JOtEBMvxECnagdnNzyQQh0ohZoMv1GCHQihBACnQghBDoRQgh0IoQQ6EQIIdCJEEKgEyGEEOhECCHQiRBCoBMhhEAnQgi9Of0fmQb7AJMnfVgAAAAASUVORK5CYII="},5499:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/option-type-3-e2943c7c0a60b13cd69ce8461805846c.png"}}]); \ No newline at end of file diff --git a/assets/js/f8d4e457.5fd13ae8.js b/assets/js/f8d4e457.b9fffacd.js similarity index 97% rename from assets/js/f8d4e457.5fd13ae8.js rename to assets/js/f8d4e457.b9fffacd.js index 8d57665d..3f891e50 100644 --- a/assets/js/f8d4e457.5fd13ae8.js +++ b/assets/js/f8d4e457.b9fffacd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[740],{3905:(a,e,n)=>{n.d(e,{Zo:()=>p,kt:()=>o});var i=n(7294);function t(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function l(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,i)}return n}function r(a){for(var e=1;e=0||(t[n]=a[n]);return t}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(t[n]=a[n])}return t}var d=i.createContext({}),u=function(a){var e=i.useContext(d),n=e;return a&&(n="function"==typeof a?a(e):r(r({},e),a)),n},p=function(a){var e=u(a.components);return i.createElement(d.Provider,{value:e},a.children)},s={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},k=i.forwardRef((function(a,e){var n=a.components,t=a.mdxType,l=a.originalType,d=a.parentName,p=m(a,["components","mdxType","originalType","parentName"]),k=u(n),o=t,g=k["".concat(d,".").concat(o)]||k[o]||s[o]||l;return n?i.createElement(g,r(r({ref:e},p),{},{components:n})):i.createElement(g,r({ref:e},p))}));function o(a,e){var n=arguments,t=e&&e.mdxType;if("string"==typeof a||t){var l=n.length,r=new Array(l);r[0]=k;var m={};for(var d in e)hasOwnProperty.call(e,d)&&(m[d]=e[d]);m.originalType=a,m.mdxType="string"==typeof a?a:t,r[1]=m;for(var u=2;u{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>r,default:()=>s,frontMatter:()=>l,metadata:()=>m,toc:()=>u});var i=n(7462),t=(n(7294),n(3905));const l={sidebar_position:43,title:"A.43. Lifetime",sidebar_label:"A.43. Lifetime"},r=void 0,m={unversionedId:"basic/lifetime",id:"basic/lifetime",title:"A.43. Lifetime",description:"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid.",source:"@site/docs/basic/lifetime.md",sourceDirName:"basic",slug:"/basic/lifetime",permalink:"/basic/lifetime",draft:!1,tags:[],version:"current",sidebarPosition:43,frontMatter:{sidebar_position:43,title:"A.43. Lifetime",sidebar_label:"A.43. Lifetime"},sidebar:"tutorialSidebar",previous:{title:"A.42. Static Item",permalink:"/basic/static"},next:{title:"A.44. Slice Memory Management",permalink:"/basic/slice-memory-management"}},d={},u=[{value:"A.43.1. Konsep Lifetime",id:"a431-konsep-lifetime",level:2},{value:"A.43.2. Relasi antara lifetime dengan owner dan borrower",id:"a432-relasi-antara-lifetime-dengan-owner-dan-borrower",level:2},{value:"A.43.3. Lifetime annotation dan penerapannya pada return value",id:"a433-lifetime-annotation-dan-penerapannya-pada-return-value",level:2},{value:"A.43.4. Lifetime pada parameter",id:"a434-lifetime-pada-parameter",level:2},{value:"A.43.5. Lifetime elision",id:"a435-lifetime-elision",level:2},{value:"A.43.6. Lifetime pada struct",id:"a436-lifetime-pada-struct",level:2},{value:"A.43.7. Lifetime pada method",id:"a437-lifetime-pada-method",level:2},{value:"A.43.8. Generic parameter + trait bounds + lifetime",id:"a438-generic-parameter--trait-bounds--lifetime",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],p={toc:u};function s(a){let{components:e,...l}=a;return(0,t.kt)("wrapper",(0,i.Z)({},p,l,{components:e,mdxType:"MDXLayout"}),(0,t.kt)("p",null,"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid."),(0,t.kt)("p",null,"Normalnya kita tidak perlu berurusan dengan lifetime, karena Rust-lah yang mengelola lifetime sebuah reference. Namun di luar itu, pada beberapa case kita bisa me-manage lifetime data dengan memanfaatkan ",(0,t.kt)("em",{parentName:"p"},"annotation"),"."),(0,t.kt)("p",null,"Ketika berurusan dengan data primitif maupun non-primitif tak perlu khawatir perihal urusan lifetime. Aspek lifetime hanya perlu diperhatikan sewaktu berurusan dengan data pointer/reference, apalagi kalau data tersebut keluar masuk block scope."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Topik lifetime adalah salah satu yang paling membingungkan di Rust. Wajar jika membutuhkan waktu lebih lama untuk menguasainya. ",(0,t.kt)("em",{parentName:"p"},"Take your time"),", pelajari pelan-pelan dan ulangi berkali-kali jika perlu.")),(0,t.kt)("h2",{id:"a431-konsep-lifetime"},"A.43.1. Konsep Lifetime"),(0,t.kt)("p",null,"Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap valid. Lifetime menempel di variabel, lebih tepatnya di reference variabel."),(0,t.kt)("p",null,"Rust menerapkan default lifetime dalam pengecekan reference. Beberapa aturan pada default lifetime sudah kita pelajari pada chapter sebelumnya, seperti variabel yang hanya akan valid di dalam block dan invalid di luar block dan data yang akan di-dealokasi ketika sudah tidak ada reference-nya."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Rust mengidentifikasi default lifetime menggunakan ",(0,t.kt)("strong",{parentName:"p"},"lifetime elision"),", yang juga akan dibahas pada chapter ini.")),(0,t.kt)("p",null,"Agar mudah memahami konsep default lifetime, mari mulai dengan kode sederhana berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let r;\n {\n let x = 5;\n r = &x;\n }\n println!("r: {}", r);\n}\n')),(0,t.kt)("p",null,"Kode di atas kalau di jalankan hasilnya error, karena ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," di-dealokasi ketika block expression selesai dieksekusi, meskipun data tersebut dipinjamkan pada ",(0,t.kt)("inlineCode",{parentName:"p"},"r")," yang scope-nya berada di atasnya."),(0,t.kt)("p",null,"Kalau diilustrasikan, lifetime variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"r")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," kurang lebih seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn main() {\n let r; // -----------+-- 'lf1\n { // |\n let x = 5; // -+-- 'lf2 |\n r = &x; // | |\n } // -+ |\n println!(\"r: {}\", r); // |\n} // -----------+\n")),(0,t.kt)("p",null,"Setiap data memiliki default lifetime."),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"r")," memiliki lifetime yang pada contoh di atas diilustrasikan sebagai ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf1"),"."),(0,t.kt)("li",{parentName:"ul"},"Variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"x")," memiliki lifetime yang pada contoh di atas diilustrasikan sebagai ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2"),"."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2")," milik variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"x")," menjadikan umur variabel tersebut valid mulai variabel tersebut dideklarasikan, hingga block expression selesai."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2")," sudah tidak valid di luar block expression. Inilah kenapa program di atas menjadi error."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf1")," milik variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"r")," menjadikan umur variabel tersebut valid mulai variabel tersebut dideklarasikan, hingga block fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"main")," selesai.")),(0,t.kt)("p",null,"Default lifetime bisa di-override menggunakan lifetime yang kita definisikan sendiri."),(0,t.kt)("h2",{id:"a432-relasi-antara-lifetime-dengan-owner-dan-borrower"},"A.43.2. Relasi antara lifetime dengan owner dan borrower"),(0,t.kt)("p",null,"Lifetime menjadi salah satu hal yang wajib diperhatikan ketika bermain dengan references. Operasi seperti melempar reference ke luar scope, atau memasukan reference ke block scope baru berpotensi memunculkan error yang berhubungan dengan lifetime."),(0,t.kt)("p",null,"Setelah ini kita akan praktik penerapan pembuatan lifetime, namun sebelum itu mari pelajari dulu pembahasan pada section berikut agar tau kenapa dan kapan kita harus menerapkan lifetime yang kita buat sendiri."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let message = String::from("darkspear is better than zandalari");\n print_mesage(&message)\n}\n\nfn print_mesage(m: &String) {\n println!("the message: {m}")\n}\n')),(0,t.kt)("p",null,"Program di atas menampilkan pesan string via fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message"),". Data string didapat dari parameter pointer ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," milik fungsi tersebut."),(0,t.kt)("p",null,"Pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"main"),", ada string bernama ",(0,t.kt)("inlineCode",{parentName:"p"},"message"),", niainya dipinjamkan sebagai argument pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message"),"."),(0,t.kt)("p",null,"Setelah eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message")," selesai, yang terjadi di block kode fungsi tersebut adalah data ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," di-dealokasi. Hasil dari dealokasi sendiri adalah nilai sebenarnya dikembalikan ke owner (pemilik aslinya). Sampai sini harusnya cukup jelas."),(0,t.kt)("p",null,"Sekarang lanjut ke contoh ke-2 berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let m: &String = get_message();\n println!("the message: {m}");\n}\n\nfn get_message() -> &String {\n let message = String::from("darkspear is better than zandalari");\n &message\n}\n')),(0,t.kt)("p",null,"Esensi program ke-2 ini sama seperti program sebelumnya, yaitu menampilkan pesan string yang sama persis. Perbedaannya, pesan string datanya ada di dalam fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_message"),". Fungsi tersebut dipanggil kemudian reference dari pesan string dipinjamkan, maka dengan ini variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"main")," nilainya adalah data pinjaman (borrowing)."),(0,t.kt)("p",null,"Ketika di-run, hasilnya error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(8116).Z,width:"779",height:"275"})),(0,t.kt)("p",null,"Error tersebut muncul karena setelah eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_message")," selesai, semua data dalam fungsi tersebut di-dealokasi. Termasuk variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"message")," yang merupakan owner dari data yang dipinjamkan ke variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m"),"."),(0,t.kt)("p",null,"Ok, jadi owner-nya sudah di-dealokasi, lalu bagaimana nasib dari peminjam data (variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m"),")? Variabel tersebut menjadi bermasalah, karena owner data aslinya sudah tidak ada di memory, dan itulah kenapa muncul error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Error ini disebut dengan ",(0,t.kt)("strong",{parentName:"p"},"dangling reference"),", muncul ketika data di-share ke variabel lain tapi owner-nya sudah tidak ada di-memory."),(0,t.kt)("p",{parentName:"blockquote"},"Di pemrograman Rust, error jenis ini bisa di-identifikasi saat kompilasi.")),(0,t.kt)("p",null,"Solusi pada error di atas, salah satunya adalah dengan tidak menggunakan tipe data pointer sebagai nilai balik. Gunakan saja tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"String"),". Solusi ini aman, karena tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"String")," owner-nya selalu berpindah saat ada operasi asignment, dengan ini maka manajemen memory menjadi efisien."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'// ganti kode berikut ...\nfn get_message() -> &String {\n let message = String::from("darkspear is better than zandalari");\n message\n}\n\n// ... menjadi ...\nfn get_message() -> String {\n let message = String::from("darkspear is better than zandalari");\n message\n}\n')),(0,t.kt)("p",null,"Ok, bagaimana dengan tipe data lain yang mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", misalnya ada kebutuhan untuk share reference data tersebut ke block lain. Mari kita coba."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let n = get_number();\n println!("the number: {n}");\n}\n\nfn get_number() -> &i32 {\n let number = 13;\n &number\n}\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(5384).Z,width:"782",height:"276"})),(0,t.kt)("p",null,"Bisa dilihat, ada error, karena kondisi tersebut menimbulkan dangling reference (sama seperti contoh sebelumnya). Namun pada contoh ini kita tidak bisa menerapkan solusi yang sama, karena variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"number")," mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", bukan ",(0,t.kt)("em",{parentName:"p"},"move semantics"),"."),(0,t.kt)("p",null,"Di Rust error dangling reference diantisipasi saat kompilasi, menjadikan kode tidak bisa sukses dikompilasi."),(0,t.kt)("p",null,"Solusi yang bisa diambil adalah dengan menjadikan data tersebut tidak memiliki owner (atau owner-nya adalah program), caranya dengan langsung mengembalikan reference data tanpa perlu menampungnya terlebih dahulu ke variabel, seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let n = get_number();\n println!("the number: {n}");\n}\n\nfn get_number() -> &i32 {\n &13\n}\n')),(0,t.kt)("p",null,"Ok, tapi entah kenapa ketika dilihat masih muncul error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(6875).Z,width:"777",height:"260"})),(0,t.kt)("p",null,"Error tersebut muncul karena meskipun owner data ",(0,t.kt)("inlineCode",{parentName:"p"},"&13")," adalah program, ketika eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," selesai, data borrow tersebut langsung di-dealokasi, dan tidak ada variabel lain di-luar scope yang menampung reference data tersebut."),(0,t.kt)("p",null,"Agar tidak terjadi proses dealokasi, harus ada variabel yang menampung reference tersebut di-luar scope, tapi cara ini tidak bisa dilakukan karena data-nya saja baru dideklarasikan dalam block fungsi, tidak mungkin tiba-tiba ada yang menampung di-luar scope."),(0,t.kt)("p",null,"Solusi dari masalah ini adalah menggunakan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," (yang detailnya sudah dibahas pada chapter sebelumnya). Dengan ini maka data reference ",(0,t.kt)("inlineCode",{parentName:"p"},"&13")," hidup lebih lama dari umur yang sebenarnya sudah ditakdirkan untuk data data tersebut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number() -> &'static i32 {\n &13\n}\n")),(0,t.kt)("p",null,"Namun perlu diingat, bahwa data efek dari lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," adalah data tidak akan pernah di-dealokasi. Data tersebut akan hidup selamanya di program hingga kecuali program dimatikan. Karena alasan itulah penggunaan ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," pada contoh ini bisa disebut berlebihan."),(0,t.kt)("p",null,"Solusi yang lebih pas adalah dengan membuat lifetime sendiri dengan cara menerapkan ",(0,t.kt)("strong",{parentName:"p"},"lifetime annotation")," (tidak menggunakan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static"),")."),(0,t.kt)("h2",{id:"a433-lifetime-annotation-dan-penerapannya-pada-return-value"},"A.43.3. Lifetime annotation dan penerapannya pada return value"),(0,t.kt)("p",null,"Lifetime dituliskan dengan notasi ",(0,t.kt)("inlineCode",{parentName:"p"},"'nama_lifetime"),". Dengan notasi tersebut, kita bisa menciptakan lifetime baru misalnya ",(0,t.kt)("inlineCode",{parentName:"p"},"'a"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"'ini_lifetime"),", dst."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"&i32 // => tipe data reference i32\n&'a i32 // => tipe data reference i32 dengan lifetime 'a\n&'a mut i32 // => tipe data mutable reference i32 dengan lifetime 'a\n")),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Lifetime dan block label memiliki bentuk literal yang sama, keduanya diawali tanda kutip ",(0,t.kt)("inlineCode",{parentName:"p"},"'"),". Yang membedakan hanya pada tempat di mana syntax tersebut ditulis.")),(0,t.kt)("p",null,"Kegunaan dari lifetime annotation adalah untuk menginformasikan compiler agar reference tidak langsung didealokasikan setelah eksekusi block selesai. Agar lebih jelas mari kita langsung terapkan saja pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," yang sudah ditulis. Silakan tambahkan lifetime dengan nama bebas. Di sini penulis gunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"'my_lifetime"),".nnnn"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number() -> &'my_lifetime i32 {\n &13\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(4982).Z,width:"689",height:"184"})),(0,t.kt)("p",null,"Meski sudah ditambahkan, error tetap muncul, karena lifetime tersebut tidak dikenal. Berbeda dengan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," yang memang sudah disediakan oleh Rust."),(0,t.kt)("p",null,"Step selanjutnya adalah mengenalkan lifetime tersebut, caranya dengan menambahkannya dalam notasi parameter generic fungsi, seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number<'my_lifetime>() -> &'my_lifetime i32 {\n &13\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," sekarang tidak menghasilkan error, karena reference yang dikembalikan memiliki umur ",(0,t.kt)("inlineCode",{parentName:"p"},"'my_lifetime")," yang membuatnya tetap valid sampai menjadi return value, meski eksekusi block fungsi-nya sendiri sudah selesai. Efeknya, data yang di-return bisa ditampung di luar scope fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number"),"."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(4734).Z,width:"460",height:"104"})),(0,t.kt)("p",null,"Tanpa adanya lifetime pada return value, maka data return value akan langsung di-dealokasi setelah block fungsi selesai dieksekusi. Tapi karena hal ini ",(0,t.kt)("em",{parentName:"p"},"by default")," sudah di-handle Rust, maka kita tidak perlu memikirkannya."),(0,t.kt)("h2",{id:"a434-lifetime-pada-parameter"},"A.43.4. Lifetime pada parameter"),(0,t.kt)("p",null,"Pada praktik ini kita akan bahas penerapan lifetime pada parameter."),(0,t.kt)("p",null,"Silakan perhatikan kode berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v1(x: &str) -> &str {\n x\n}\n")),(0,t.kt)("p",null,"Kode di atas tidak menghasilkan error, karena kalau dilihat dari sudut pandang lifetime (sesuai dengan aturan lifetime elision), yang sebenarnya terjadi adalah kurang lebih seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v2<'a>(x: &'a str) -> &'a str {\n x\n}\n")),(0,t.kt)("p",null,"Pada saat parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," masuk ke fungsi, ",(0,t.kt)("em",{parentName:"p"},"by default")," variabel tersebut memiliki lifetime (yang pada contoh di atas diilustrasikan dengan `'a'). Lifetime tersebut akan aktif hingga menjadi return value karena lifetime yang sama digunakan juga pada return value. Dengan ini nantinya setelah fungsi selesai dieksekusi, nilai baliknya tetap bisa ditampung."),(0,t.kt)("p",null,"Beda lagi jika lifetime lain digunakan pada nilai balik fungsi, misalnya:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v3<'a, 'b>(x: &'a str) -> &'b str {\n x\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(5109).Z,width:"736",height:"204"})),(0,t.kt)("p",null,"Error muncul dengan keterangan kurang lebih: data yang dijadikan return value pada block fungsi akan valid untuk lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),", namun data yang dijadikan return value hanya valid untuk lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'a"),"."),(0,t.kt)("p",null,"Dari sini bisa ditarik kesimpulan: data yang didapat dari luar scope (yang memiliki lifetime sendiri) ketika digunakan sebagai nilai balik, lifetime-nya harus sama."),(0,t.kt)("p",null,"Sekarang mari kita modifikasi lagi fungsi menjadi seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v4<'a, 'b, 'c>(x: &'a str, y: &'b str) -> &'c str {\n \"hello\"\n}\n")),(0,t.kt)("p",null,"Fungsi di atas memiliki 2 buah lifetime, yaitu:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'a"),", digunakan pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"x")),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'b"),", digunakan pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"y")),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'c"),", digunakan pada return value")),(0,t.kt)("p",null,"Karena yang dikembalikan ada data baru, yaitu string ",(0,t.kt)("inlineCode",{parentName:"p"},"hello"),", maka kode di atas tidak error. Data tersebut lifetime-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"'c"),", dan akan tetap valid setelah pemanggilan fungsi selesai."),(0,t.kt)("p",null,"Beda situasi jika yang dikembalikan adalah data dari parameter, misalnya, ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),". Jika seperti ini, maka lifetime yang sama dengan lifetime parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," harus digunakan, yaitu lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),". Contoh:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v5<'a, 'b, 'c>(x: &'a str, y: &'b str) -> &'b str {\n y\n}\n")),(0,t.kt)("p",null,"Pada kode di atas, lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'c")," tidak dipergunakan sama sekali, maka lifetime tersebut boleh dihapus dari fungsi. Silakan cukup definisikan lifetime yang hanya digunakan saja pada block parameter generic."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v6<'a, 'b>(x: &'a str, y: &'b str) -> &'b str {\n y\n}\n")),(0,t.kt)("p",null,"Dimisalkan ada seleksi kondisi, jadi return value bisa saja ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),", bisa juga ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Jika seperti ini, maka ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),", dan juga return value harus memiliki lifetime yang sama."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v7<'a>(x: &'a str, y: &'a str) -> &'a str {\n if x.len() < y.len() {\n x\n } else {\n y\n }\n}\n")),(0,t.kt)("h2",{id:"a435-lifetime-elision"},"A.43.5. Lifetime elision"),(0,t.kt)("p",null,"Sampai section ini kita telah mempelajari kurang lebih 4 point berikut:"),(0,t.kt)("ol",null,(0,t.kt)("li",{parentName:"ol"},"Setiap data, lebih tepatnya setiap reference memiliki lifetime."),(0,t.kt)("li",{parentName:"ol"},"Lifetime digunakan oleh Rust dalam penentuan kapan reference tersebut di-dealokasi."),(0,t.kt)("li",{parentName:"ol"},"Pada beberapa case, lifetime perlu di-urus secara eksplisit (contohnya seperti pada fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"do_something_vx")," di atas)."),(0,t.kt)("li",{parentName:"ol"},"Pengecekan lifetime terjadi saat kompilasi.")),(0,t.kt)("p",null,"Rust memiliki sesuatu yang disebut dengan ",(0,t.kt)("strong",{parentName:"p"},"lifetime elision"),", isinya adalah aturan yang digunakan oleh Rust dalam menganalisa reference untuk menentukan lifetime ",(0,t.kt)("em",{parentName:"p"},"default"),"-nya."),(0,t.kt)("p",null,"Namun, bukan berarti Rust akan selalu tau lifetime tiap reference. Pada beberapa case, Rust membutuhkan bantuan kita selaku programmer untuk menginformasikan lifetime reference kode yang ditulis, contohnya seperti pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v7")," di atas."),(0,t.kt)("p",null,"Meskipun demikian, tak usah terlalu khawatir, karena pengecekan lifetime reference terjadi saat kompilasi, dan ketika ada reference yang perlu dikasih ",(0,t.kt)("em",{parentName:"p"},"annotication"),", Rust akan menginformasikan ke kita via pesan error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Untuk sekarang, pembahasan detail mengenai lifetime elision tidak dibahas pada ebook ini. Silakan gunakan dokumentasi official Rust untuk ",(0,t.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/nomicon/lifetime-elision.html"},"lifetime elision")," jika berminat untuk pengkajian yang lebih dalam.")),(0,t.kt)("p",null,"Jika kawan-kawan menggunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"rust-analyzer")," extension di VSCode, tak perlu meng-compiler program untuk memunculkan error-nya, karena langsung muncul saat penulisan kode program."),(0,t.kt)("h2",{id:"a436-lifetime-pada-struct"},"A.43.6. Lifetime pada struct"),(0,t.kt)("p",null,"Tak hanya pada parameter fungsi dan return value fungsi, lifetime juga bisa diterapkan pada (property) struct."),(0,t.kt)("p",null,"Ketika menggunakan tipe data reference sebagai tipe property struct, Rust langsung menginformasikan kita via error message jika tidak ada anotasi lifetime pada field tersebut."),(0,t.kt)("p",null,"Contohnya bisa dilihat pada kode di bawah ini. Pesan error muncul karena tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"&str")," pada property struct tidak ada lifetime annotation-nya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book {\n title: &str,\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(7106).Z,width:"725",height:"160"})),(0,t.kt)("p",null,"Solusinya, tambahkan anotasi lifetime pada tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"&str"),", dan juga daftarkan lifetime tersebut pada struct. Notasi penulisannya seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// struct NamaStruct<'lifetime_annotication> {\n// field: &'lifetime_annotication tipe_data,\n// }\n\nstruct Book<'abc> {\n title: &'abc str,\n}\n")),(0,t.kt)("p",null,"Contoh jika ada lebih dari 1 field dengan lifetime sama:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc> {\n title: &'abc str,\n description: &'abc str,\n}\n")),(0,t.kt)("p",null,"Contoh jika ada beberapa field yang di antaranya memiliki lifetime berbeda (artinya ada lebih dari 1 lifetime):"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc, 'def> {\n title: &'abc str,\n description: &'abc str,\n price: &'def i32,\n}\n\nfn main() {\n let book = Book {\n title: \"The Silmarillion\",\n description: \"Good story, 10/10, would read again\",\n price: &99,\n };\n}\n")),(0,t.kt)("h2",{id:"a437-lifetime-pada-method"},"A.43.7. Lifetime pada method"),(0,t.kt)("p",null,"Ada 2 hal yang perlu diketahui dalam penerapan lifetime pada method. Yang pertama, lifetime annotication harus ditulis pada block ",(0,t.kt)("inlineCode",{parentName:"p"},"impl")," meskipun pada block method tidak digunakan secara langsung."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc, 'def> {\n title: &'abc str,\n description: &'abc str,\n price: &'def i32,\n}\n\nimpl<'abc, 'def> Book<'abc, 'def> {\n\n fn get_info(&self) -> String {\n let info = format!(\"{} (${}), {}\", self.title, self.price, self.description);\n info\n }\n}\n")),(0,t.kt)("p",null,"Bisa dilihat statement block ",(0,t.kt)("inlineCode",{parentName:"p"},"impl<'abc, 'def> Book<'abc, 'def>"),", lifetime annotation-nya sama persis dengan yang ada di struct. Jika ingin mengetes, silakan coba saja hapus syntax lifetime dari statement itu, pasti muncul error."),(0,t.kt)("p",null,"Hal ke-2 yang penting diketahui, pada block kode method, tidak perlu menuliskan lifetime annotation, karena sudah ditulis di block kode ",(0,t.kt)("inlineCode",{parentName:"p"},"impl"),"."),(0,t.kt)("p",null,"Sebagai contoh, dua method berikut tidak memunculkan error:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\nimpl<'abc, 'def> Book<'abc, 'def> {\n\n fn get_info(&self) -> String {\n let info = format!(\"{} (${}), {}\", self.title, self.price, self.description);\n info\n }\n\n fn get_price(&self) -> &i32 {\n self.price\n }\n}\n")),(0,t.kt)("p",null,"Bandingkan dengan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_book_price")," berikut, error muncul karena lifetime annotation tidak ditambahkan ke block fungsi (meskipun fungsi tersebut mengembalikan property ",(0,t.kt)("inlineCode",{parentName:"p"},"price")," milik struct ",(0,t.kt)("inlineCode",{parentName:"p"},"Book")," yang sudah memiliki lifetime sendiri). Hal ini karena data ",(0,t.kt)("inlineCode",{parentName:"p"},"&i32")," yang dikembalikan statement ",(0,t.kt)("inlineCode",{parentName:"p"},"book.get_price()")," langsung didealokasi setelah block fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_book_price")," selesai dieksekusi."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(378).Z,width:"813",height:"223"})),(0,t.kt)("p",null,"Agar error tidak muncul, tambahkan lifetime:"),(0,t.kt)("ol",null,(0,t.kt)("li",{parentName:"ol"},"ke return value (karena tipe data return value adalah reference)"),(0,t.kt)("li",{parentName:"ol"},"lalu pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"book")," (karena di block fungsi return value berasal dari data milik property variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"book"),"),"),(0,t.kt)("li",{parentName:"ol"},"dan juga tak lupa daftarkan lifetime annotation pada block fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"get_book_price"),".")),(0,t.kt)("p",null,"Kurang kode menjadi seperti berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'// ...\n\nfn get_book_price<\'ghi>(book: &\'ghi Book) -> &\'ghi i32 {\n book.get_price()\n}\n\nfn main() {\n let book = Book {\n title: "The Silmarillion",\n description: "Good story, 10/10, would read again",\n price: &99,\n };\n\n println!("{}", book.get_info());\n println!("the price: {}", get_book_price(&book));\n}\n')),(0,t.kt)("p",null,"Run program, hasilnya sukses."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(7146).Z,width:"473",height:"127"})),(0,t.kt)("h2",{id:"a438-generic-parameter--trait-bounds--lifetime"},"A.43.8. Generic parameter + trait bounds + lifetime"),(0,t.kt)("p",null,"Lalu bagaimana jika ada fungsi yang di situ ada penerapan trait bounds, ada juga generic parameter, dan lifetime annotation. Cara penulisannya seperti apa? Silakan lihat contoh berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_greater_number<'a, T>(\n x: &'a T,\n y: &'a T,\n) -> &'a T\nwhere\n T: std::cmp::PartialOrd,\n{\n if x > y {\n x\n } else {\n y\n }\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," di atas digunakan untuk mencari angka terbesar dari dua inputan parameter (",(0,t.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),"), dengan tipe data yang digunakan adalah generic ",(0,t.kt)("inlineCode",{parentName:"p"},"T"),". Dari sini maka nantinya fungsi ini bisa digunakan pada data bertipe ",(0,t.kt)("inlineCode",{parentName:"p"},"i32"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"f64"),", dan data numerik lainnya."),(0,t.kt)("p",null,"Tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"T")," diasosiasikan dengan trait ",(0,t.kt)("inlineCode",{parentName:"p"},"std::cmp::PartialOrd")," agar variabel dengan tipe tersebut bisa digunakan dalam seleksi kondisi ",(0,t.kt)("inlineCode",{parentName:"p"},"if")," yang ada dalam block fungsi tersebut."),(0,t.kt)("p",null,"Ok, sampai sini semoga cukup jelas. Lalu bagaimana dengan lifetime annotation-nya? Karena lifetime annotation definisinya berada pada tempat yang sama dengan definisi tipe generic, maka langsung saja tulis di situ tanpa memperhatikan urutan. Sebagai contoh, dua definisi block fungsi berikut adalah ekuivalen."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn say_hello_v1<'abc, T>()\nfn say_hello_v2()\n")),(0,t.kt)("p",null,"Sekarang kembali ke pembahasan di atas. Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," mengembalikan tipe data reference ",(0,t.kt)("inlineCode",{parentName:"p"},"&T")," yang nilainya bisa saja dari ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," atau ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Dari sini maka wajib hukumnya untuk return value memiliki lifetime yang sama dengan ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Itulah kenapa definisi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," agak panjang."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_greater_number<'a, T>(x: &'a T, y: &'a T) -> &'a T\n")),(0,t.kt)("p",null,"Lanjut, mari kita panggil fungsi tersebut pada dua block expression. Block pertama untuk pengecekan data numerik ",(0,t.kt)("inlineCode",{parentName:"p"},"i32"),", dan yang kedua untuk tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"f64"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n\n {\n // i32 comparison test\n let x = 13;\n let y = 20;\n let result = find_greater_number::(&x, &y); // atau cukup `find_greater_number(&x, &y)`\n println!("result: {}", result);\n }\n \n {\n // f64 comparison test\n let x = 3.14;\n let y = 2.11;\n let result = find_greater_number::(&x, &y); // atau cukup `find_greater_number(&x, &y)`\n println!("result: {}", result);\n }\n}\n')),(0,t.kt)("p",null,"Jalankan program, hasilnya sesuai harapan, tidak ada error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(757).Z,width:"1072",height:"200"})),(0,t.kt)("hr",null),(0,t.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,t.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,t.kt)("pre",null,(0,t.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/lifetime"},"github.com/novalagung/dasarpemrogramanrust-example/../lifetime")),(0,t.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"},"https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/nomicon/lifetimes.html"},"https://doc.rust-lang.org/nomicon/lifetimes.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://dev.to/takaakifuruse/rust-lifetimes-a-high-wall-for-rust-newbies-3ap"},"https://dev.to/takaakifuruse/rust-lifetimes-a-high-wall-for-rust-newbies-3ap")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://anooppoommen.medium.com/lifetimes-in-rust-7f2331be998b"},"https://anooppoommen.medium.com/lifetimes-in-rust-7f2331be998b")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://blog.logrocket.com/understanding-lifetimes-in-rust/"},"https://blog.logrocket.com/understanding-lifetimes-in-rust/")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://educative.io/answers/what-are-generic-lifetime-parameters-in-a-rust-function"},"https://educative.io/answers/what-are-generic-lifetime-parameters-in-a-rust-function"))))}s.isMDXComponent=!0},8116:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-1-49980dd171b372c65a19ab2c8bd2334f.png"},5384:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-2-1116463c388b09c1a8822e3b1ff4682c.png"},6875:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-3-d0688570ad7d667d603cde8665c863fc.png"},4982:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArEAAAC4CAIAAAB7KCObAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtMjE6NTc6MjEgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm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+bIH+Julzpj0dy3oty90jxtrJpSWmRQvPUdhXjtDJt/WqU97pZTUK/VCCJvfonuZ6lmm8b3v+i6/qFp887PX+KkRAghBH/Mkz8WV/N4/vr523fIfyCEEII/4I958cdLt/+b4gtCCCH4A/7wdfTQYxY4rj7+7S+/973Pv/OsXcIJhBBCCMEfs5JhDgMcBj7+99nvfvvIyTeffNou4QRCCCGE4I9ZyQKHsYEPmwixSziBEEIIoRnyB0IIIYQQ/IEQQggh+AMhhBBCCP5ACCGE0NLzx/Xbf3f/zw/c/5+v85QKhBBCCM2JP6ze//iBL2//AwOHEEIIofnxx4M//dr9j/+egUMIIYQQ/IEQQggh+AMhhBBCaDT+uPD1L//8tfcZOYQQQgjNjz8qBHmALAhCCCGE5sUfP/0at+AihBBCaO78QeYDIYQQQvAHQgghhOAPhBBCCKHx+IPnnyKEEEJofvxRff8LN98ihBBCaG78gRBCCCEEfyCEEEII/kAIIYQQgj8QQgghBH8ghBBCCMEfCCGEEII/EEIIIQR/IIQQQgjBHwghhBCCPxBCCCGE4A+EEEIIwR8IIYQQQvAHQgghhOAPhBBCCMEfCCGEEELwB0IIIYT2jP4fTuXrBQlA1EIAAAAASUVORK5CYII="},378:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-8-da413de408eba24af5e0d0db885af9fc.png"},757:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-9-fix-96c668297e128c0b8d548a6cf72dfd0c.png"},7146:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAAB/CAIAAAAsFy8SAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIg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IgFxMEQRDkYoIgCHIxQRAEEeJ/kBoUtRad3qEAAAAASUVORK5CYII="}}]); \ No newline at end of file +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[740],{3905:(a,e,n)=>{n.d(e,{Zo:()=>p,kt:()=>o});var i=n(7294);function t(a,e,n){return e in a?Object.defineProperty(a,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[e]=n,a}function l(a,e){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.push.apply(n,i)}return n}function r(a){for(var e=1;e=0||(t[n]=a[n]);return t}(a,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(a,n)&&(t[n]=a[n])}return t}var d=i.createContext({}),u=function(a){var e=i.useContext(d),n=e;return a&&(n="function"==typeof a?a(e):r(r({},e),a)),n},p=function(a){var e=u(a.components);return i.createElement(d.Provider,{value:e},a.children)},s={inlineCode:"code",wrapper:function(a){var e=a.children;return i.createElement(i.Fragment,{},e)}},k=i.forwardRef((function(a,e){var n=a.components,t=a.mdxType,l=a.originalType,d=a.parentName,p=m(a,["components","mdxType","originalType","parentName"]),k=u(n),o=t,g=k["".concat(d,".").concat(o)]||k[o]||s[o]||l;return n?i.createElement(g,r(r({ref:e},p),{},{components:n})):i.createElement(g,r({ref:e},p))}));function o(a,e){var n=arguments,t=e&&e.mdxType;if("string"==typeof a||t){var l=n.length,r=new Array(l);r[0]=k;var m={};for(var d in e)hasOwnProperty.call(e,d)&&(m[d]=e[d]);m.originalType=a,m.mdxType="string"==typeof a?a:t,r[1]=m;for(var u=2;u{n.r(e),n.d(e,{assets:()=>d,contentTitle:()=>r,default:()=>s,frontMatter:()=>l,metadata:()=>m,toc:()=>u});var i=n(7462),t=(n(7294),n(3905));const l={sidebar_position:44,title:"A.44. Lifetime",sidebar_label:"A.44. Lifetime"},r=void 0,m={unversionedId:"basic/lifetime",id:"basic/lifetime",title:"A.44. Lifetime",description:"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid.",source:"@site/docs/basic/lifetime.md",sourceDirName:"basic",slug:"/basic/lifetime",permalink:"/basic/lifetime",draft:!1,tags:[],version:"current",sidebarPosition:44,frontMatter:{sidebar_position:44,title:"A.44. Lifetime",sidebar_label:"A.44. Lifetime"},sidebar:"tutorialSidebar",previous:{title:"A.43. Static Item",permalink:"/basic/static"},next:{title:"A.45. Slice Memory Management",permalink:"/basic/slice-memory-management"}},d={},u=[{value:"A.44.1. Konsep Lifetime",id:"a441-konsep-lifetime",level:2},{value:"A.44.2. Relasi antara lifetime dengan owner dan borrower",id:"a442-relasi-antara-lifetime-dengan-owner-dan-borrower",level:2},{value:"A.44.3. Lifetime annotation dan penerapannya pada return value",id:"a443-lifetime-annotation-dan-penerapannya-pada-return-value",level:2},{value:"A.44.4. Lifetime pada parameter",id:"a444-lifetime-pada-parameter",level:2},{value:"A.44.5. Lifetime elision",id:"a445-lifetime-elision",level:2},{value:"A.44.6. Lifetime pada struct",id:"a446-lifetime-pada-struct",level:2},{value:"A.44.7. Lifetime pada method",id:"a447-lifetime-pada-method",level:2},{value:"A.44.8. Generic parameter + trait bounds + lifetime",id:"a448-generic-parameter--trait-bounds--lifetime",level:2},{value:"Catatan chapter \ud83d\udcd1",id:"catatan-chapter-",level:2},{value:"\u25c9 Source code praktik",id:"-source-code-praktik",level:3},{value:"\u25c9 Referensi",id:"-referensi",level:3}],p={toc:u};function s(a){let{components:e,...l}=a;return(0,t.kt)("wrapper",(0,i.Z)({},p,l,{components:e,mdxType:"MDXLayout"}),(0,t.kt)("p",null,"Pada chapter ini kita akan belajar tentang lifetime. Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap dianggap valid."),(0,t.kt)("p",null,"Normalnya kita tidak perlu berurusan dengan lifetime, karena Rust-lah yang mengelola lifetime sebuah reference. Namun di luar itu, pada beberapa case kita bisa me-manage lifetime data dengan memanfaatkan ",(0,t.kt)("em",{parentName:"p"},"annotation"),"."),(0,t.kt)("p",null,"Ketika berurusan dengan data primitif maupun non-primitif tak perlu khawatir perihal urusan lifetime. Aspek lifetime hanya perlu diperhatikan sewaktu berurusan dengan data pointer/reference, apalagi kalau data tersebut keluar masuk block scope."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Topik lifetime adalah salah satu yang paling membingungkan di Rust. Wajar jika membutuhkan waktu lebih lama untuk menguasainya. ",(0,t.kt)("em",{parentName:"p"},"Take your time"),", pelajari pelan-pelan dan ulangi berkali-kali jika perlu.")),(0,t.kt)("h2",{id:"a441-konsep-lifetime"},"A.44.1. Konsep Lifetime"),(0,t.kt)("p",null,"Lifetime adalah yang digunakan oleh Rust compiler untuk memonitor umur dari references agar tetap valid. Lifetime menempel di variabel, lebih tepatnya di reference variabel."),(0,t.kt)("p",null,"Rust menerapkan default lifetime dalam pengecekan reference. Beberapa aturan pada default lifetime sudah kita pelajari pada chapter sebelumnya, seperti variabel yang hanya akan valid di dalam block dan invalid di luar block dan data yang akan di-dealokasi ketika sudah tidak ada reference-nya."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Rust mengidentifikasi default lifetime menggunakan ",(0,t.kt)("strong",{parentName:"p"},"lifetime elision"),", yang juga akan dibahas pada chapter ini.")),(0,t.kt)("p",null,"Agar mudah memahami konsep default lifetime, mari mulai dengan kode sederhana berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let r;\n {\n let x = 5;\n r = &x;\n }\n println!("r: {}", r);\n}\n')),(0,t.kt)("p",null,"Kode di atas kalau di jalankan hasilnya error, karena ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," di-dealokasi ketika block expression selesai dieksekusi, meskipun data tersebut dipinjamkan pada ",(0,t.kt)("inlineCode",{parentName:"p"},"r")," yang scope-nya berada di atasnya."),(0,t.kt)("p",null,"Kalau diilustrasikan, lifetime variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"r")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," kurang lebih seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn main() {\n let r; // -----------+-- 'lf1\n { // |\n let x = 5; // -+-- 'lf2 |\n r = &x; // | |\n } // -+ |\n println!(\"r: {}\", r); // |\n} // -----------+\n")),(0,t.kt)("p",null,"Setiap data memiliki default lifetime."),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"r")," memiliki lifetime yang pada contoh di atas diilustrasikan sebagai ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf1"),"."),(0,t.kt)("li",{parentName:"ul"},"Variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"x")," memiliki lifetime yang pada contoh di atas diilustrasikan sebagai ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2"),"."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2")," milik variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"x")," menjadikan umur variabel tersebut valid mulai variabel tersebut dideklarasikan, hingga block expression selesai."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf2")," sudah tidak valid di luar block expression. Inilah kenapa program di atas menjadi error."),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'lf1")," milik variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"r")," menjadikan umur variabel tersebut valid mulai variabel tersebut dideklarasikan, hingga block fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"main")," selesai.")),(0,t.kt)("p",null,"Default lifetime bisa di-override menggunakan lifetime yang kita definisikan sendiri."),(0,t.kt)("h2",{id:"a442-relasi-antara-lifetime-dengan-owner-dan-borrower"},"A.44.2. Relasi antara lifetime dengan owner dan borrower"),(0,t.kt)("p",null,"Lifetime menjadi salah satu hal yang wajib diperhatikan ketika bermain dengan references. Operasi seperti melempar reference ke luar scope, atau memasukan reference ke block scope baru berpotensi memunculkan error yang berhubungan dengan lifetime."),(0,t.kt)("p",null,"Setelah ini kita akan praktik penerapan pembuatan lifetime, namun sebelum itu mari pelajari dulu pembahasan pada section berikut agar tau kenapa dan kapan kita harus menerapkan lifetime yang kita buat sendiri."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let message = String::from("darkspear is better than zandalari");\n print_mesage(&message)\n}\n\nfn print_mesage(m: &String) {\n println!("the message: {m}")\n}\n')),(0,t.kt)("p",null,"Program di atas menampilkan pesan string via fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message"),". Data string didapat dari parameter pointer ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," milik fungsi tersebut."),(0,t.kt)("p",null,"Pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"main"),", ada string bernama ",(0,t.kt)("inlineCode",{parentName:"p"},"message"),", niainya dipinjamkan sebagai argument pemanggilan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message"),"."),(0,t.kt)("p",null,"Setelah eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"print_message")," selesai, yang terjadi di block kode fungsi tersebut adalah data ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," di-dealokasi. Hasil dari dealokasi sendiri adalah nilai sebenarnya dikembalikan ke owner (pemilik aslinya). Sampai sini harusnya cukup jelas."),(0,t.kt)("p",null,"Sekarang lanjut ke contoh ke-2 berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let m: &String = get_message();\n println!("the message: {m}");\n}\n\nfn get_message() -> &String {\n let message = String::from("darkspear is better than zandalari");\n &message\n}\n')),(0,t.kt)("p",null,"Esensi program ke-2 ini sama seperti program sebelumnya, yaitu menampilkan pesan string yang sama persis. Perbedaannya, pesan string datanya ada di dalam fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_message"),". Fungsi tersebut dipanggil kemudian reference dari pesan string dipinjamkan, maka dengan ini variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m")," pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"main")," nilainya adalah data pinjaman (borrowing)."),(0,t.kt)("p",null,"Ketika di-run, hasilnya error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(8116).Z,width:"779",height:"275"})),(0,t.kt)("p",null,"Error tersebut muncul karena setelah eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_message")," selesai, semua data dalam fungsi tersebut di-dealokasi. Termasuk variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"message")," yang merupakan owner dari data yang dipinjamkan ke variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m"),"."),(0,t.kt)("p",null,"Ok, jadi owner-nya sudah di-dealokasi, lalu bagaimana nasib dari peminjam data (variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"m"),")? Variabel tersebut menjadi bermasalah, karena owner data aslinya sudah tidak ada di memory, dan itulah kenapa muncul error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Error ini disebut dengan ",(0,t.kt)("strong",{parentName:"p"},"dangling reference"),", muncul ketika data di-share ke variabel lain tapi owner-nya sudah tidak ada di-memory."),(0,t.kt)("p",{parentName:"blockquote"},"Di pemrograman Rust, error jenis ini bisa di-identifikasi saat kompilasi.")),(0,t.kt)("p",null,"Solusi pada error di atas, salah satunya adalah dengan tidak menggunakan tipe data pointer sebagai nilai balik. Gunakan saja tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"String"),". Solusi ini aman, karena tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"String")," owner-nya selalu berpindah saat ada operasi asignment, dengan ini maka manajemen memory menjadi efisien."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'// ganti kode berikut ...\nfn get_message() -> &String {\n let message = String::from("darkspear is better than zandalari");\n message\n}\n\n// ... menjadi ...\nfn get_message() -> String {\n let message = String::from("darkspear is better than zandalari");\n message\n}\n')),(0,t.kt)("p",null,"Ok, bagaimana dengan tipe data lain yang mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", misalnya ada kebutuhan untuk share reference data tersebut ke block lain. Mari kita coba."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let n = get_number();\n println!("the number: {n}");\n}\n\nfn get_number() -> &i32 {\n let number = 13;\n &number\n}\n')),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(5384).Z,width:"782",height:"276"})),(0,t.kt)("p",null,"Bisa dilihat, ada error, karena kondisi tersebut menimbulkan dangling reference (sama seperti contoh sebelumnya). Namun pada contoh ini kita tidak bisa menerapkan solusi yang sama, karena variabel ",(0,t.kt)("inlineCode",{parentName:"p"},"number")," mengadopsi ",(0,t.kt)("em",{parentName:"p"},"copy semantics"),", bukan ",(0,t.kt)("em",{parentName:"p"},"move semantics"),"."),(0,t.kt)("p",null,"Di Rust error dangling reference diantisipasi saat kompilasi, menjadikan kode tidak bisa sukses dikompilasi."),(0,t.kt)("p",null,"Solusi yang bisa diambil adalah dengan menjadikan data tersebut tidak memiliki owner (atau owner-nya adalah program), caranya dengan langsung mengembalikan reference data tanpa perlu menampungnya terlebih dahulu ke variabel, seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n let n = get_number();\n println!("the number: {n}");\n}\n\nfn get_number() -> &i32 {\n &13\n}\n')),(0,t.kt)("p",null,"Ok, tapi entah kenapa ketika dilihat masih muncul error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(6875).Z,width:"777",height:"260"})),(0,t.kt)("p",null,"Error tersebut muncul karena meskipun owner data ",(0,t.kt)("inlineCode",{parentName:"p"},"&13")," adalah program, ketika eksekusi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," selesai, data borrow tersebut langsung di-dealokasi, dan tidak ada variabel lain di-luar scope yang menampung reference data tersebut."),(0,t.kt)("p",null,"Agar tidak terjadi proses dealokasi, harus ada variabel yang menampung reference tersebut di-luar scope, tapi cara ini tidak bisa dilakukan karena data-nya saja baru dideklarasikan dalam block fungsi, tidak mungkin tiba-tiba ada yang menampung di-luar scope."),(0,t.kt)("p",null,"Solusi dari masalah ini adalah menggunakan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," (yang detailnya sudah dibahas pada chapter sebelumnya). Dengan ini maka data reference ",(0,t.kt)("inlineCode",{parentName:"p"},"&13")," hidup lebih lama dari umur yang sebenarnya sudah ditakdirkan untuk data data tersebut."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number() -> &'static i32 {\n &13\n}\n")),(0,t.kt)("p",null,"Namun perlu diingat, bahwa data efek dari lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," adalah data tidak akan pernah di-dealokasi. Data tersebut akan hidup selamanya di program hingga kecuali program dimatikan. Karena alasan itulah penggunaan ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," pada contoh ini bisa disebut berlebihan."),(0,t.kt)("p",null,"Solusi yang lebih pas adalah dengan membuat lifetime sendiri dengan cara menerapkan ",(0,t.kt)("strong",{parentName:"p"},"lifetime annotation")," (tidak menggunakan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static"),")."),(0,t.kt)("h2",{id:"a443-lifetime-annotation-dan-penerapannya-pada-return-value"},"A.44.3. Lifetime annotation dan penerapannya pada return value"),(0,t.kt)("p",null,"Lifetime dituliskan dengan notasi ",(0,t.kt)("inlineCode",{parentName:"p"},"'nama_lifetime"),". Dengan notasi tersebut, kita bisa menciptakan lifetime baru misalnya ",(0,t.kt)("inlineCode",{parentName:"p"},"'a"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"'ini_lifetime"),", dst."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"&i32 // => tipe data reference i32\n&'a i32 // => tipe data reference i32 dengan lifetime 'a\n&'a mut i32 // => tipe data mutable reference i32 dengan lifetime 'a\n")),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Lifetime dan block label memiliki bentuk literal yang sama, keduanya diawali tanda kutip ",(0,t.kt)("inlineCode",{parentName:"p"},"'"),". Yang membedakan hanya pada tempat di mana syntax tersebut ditulis.")),(0,t.kt)("p",null,"Kegunaan dari lifetime annotation adalah untuk menginformasikan compiler agar reference tidak langsung didealokasikan setelah eksekusi block selesai. Agar lebih jelas mari kita langsung terapkan saja pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," yang sudah ditulis. Silakan tambahkan lifetime dengan nama bebas. Di sini penulis gunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"'my_lifetime"),".nnnn"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number() -> &'my_lifetime i32 {\n &13\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(4982).Z,width:"689",height:"184"})),(0,t.kt)("p",null,"Meski sudah ditambahkan, error tetap muncul, karena lifetime tersebut tidak dikenal. Berbeda dengan lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'static")," yang memang sudah disediakan oleh Rust."),(0,t.kt)("p",null,"Step selanjutnya adalah mengenalkan lifetime tersebut, caranya dengan menambahkannya dalam notasi parameter generic fungsi, seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn get_number<'my_lifetime>() -> &'my_lifetime i32 {\n &13\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number")," sekarang tidak menghasilkan error, karena reference yang dikembalikan memiliki umur ",(0,t.kt)("inlineCode",{parentName:"p"},"'my_lifetime")," yang membuatnya tetap valid sampai menjadi return value, meski eksekusi block fungsi-nya sendiri sudah selesai. Efeknya, data yang di-return bisa ditampung di luar scope fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_number"),"."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(4734).Z,width:"460",height:"104"})),(0,t.kt)("p",null,"Tanpa adanya lifetime pada return value, maka data return value akan langsung di-dealokasi setelah block fungsi selesai dieksekusi. Tapi karena hal ini ",(0,t.kt)("em",{parentName:"p"},"by default")," sudah di-handle Rust, maka kita tidak perlu memikirkannya."),(0,t.kt)("h2",{id:"a444-lifetime-pada-parameter"},"A.44.4. Lifetime pada parameter"),(0,t.kt)("p",null,"Pada praktik ini kita akan bahas penerapan lifetime pada parameter."),(0,t.kt)("p",null,"Silakan perhatikan kode berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v1(x: &str) -> &str {\n x\n}\n")),(0,t.kt)("p",null,"Kode di atas tidak menghasilkan error, karena kalau dilihat dari sudut pandang lifetime (sesuai dengan aturan lifetime elision), yang sebenarnya terjadi adalah kurang lebih seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v2<'a>(x: &'a str) -> &'a str {\n x\n}\n")),(0,t.kt)("p",null,"Pada saat parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," masuk ke fungsi, ",(0,t.kt)("em",{parentName:"p"},"by default")," variabel tersebut memiliki lifetime (yang pada contoh di atas diilustrasikan dengan `'a'). Lifetime tersebut akan aktif hingga menjadi return value karena lifetime yang sama digunakan juga pada return value. Dengan ini nantinya setelah fungsi selesai dieksekusi, nilai baliknya tetap bisa ditampung."),(0,t.kt)("p",null,"Beda lagi jika lifetime lain digunakan pada nilai balik fungsi, misalnya:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v3<'a, 'b>(x: &'a str) -> &'b str {\n x\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(5109).Z,width:"736",height:"204"})),(0,t.kt)("p",null,"Error muncul dengan keterangan kurang lebih: data yang dijadikan return value pada block fungsi akan valid untuk lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),", namun data yang dijadikan return value hanya valid untuk lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'a"),"."),(0,t.kt)("p",null,"Dari sini bisa ditarik kesimpulan: data yang didapat dari luar scope (yang memiliki lifetime sendiri) ketika digunakan sebagai nilai balik, lifetime-nya harus sama."),(0,t.kt)("p",null,"Sekarang mari kita modifikasi lagi fungsi menjadi seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v4<'a, 'b, 'c>(x: &'a str, y: &'b str) -> &'c str {\n \"hello\"\n}\n")),(0,t.kt)("p",null,"Fungsi di atas memiliki 2 buah lifetime, yaitu:"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'a"),", digunakan pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"x")),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'b"),", digunakan pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"y")),(0,t.kt)("li",{parentName:"ul"},"Lifetime ",(0,t.kt)("inlineCode",{parentName:"li"},"'c"),", digunakan pada return value")),(0,t.kt)("p",null,"Karena yang dikembalikan ada data baru, yaitu string ",(0,t.kt)("inlineCode",{parentName:"p"},"hello"),", maka kode di atas tidak error. Data tersebut lifetime-nya adalah ",(0,t.kt)("inlineCode",{parentName:"p"},"'c"),", dan akan tetap valid setelah pemanggilan fungsi selesai."),(0,t.kt)("p",null,"Beda situasi jika yang dikembalikan adalah data dari parameter, misalnya, ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),". Jika seperti ini, maka lifetime yang sama dengan lifetime parameter ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," harus digunakan, yaitu lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'b"),". Contoh:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v5<'a, 'b, 'c>(x: &'a str, y: &'b str) -> &'b str {\n y\n}\n")),(0,t.kt)("p",null,"Pada kode di atas, lifetime ",(0,t.kt)("inlineCode",{parentName:"p"},"'c")," tidak dipergunakan sama sekali, maka lifetime tersebut boleh dihapus dari fungsi. Silakan cukup definisikan lifetime yang hanya digunakan saja pada block parameter generic."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v6<'a, 'b>(x: &'a str, y: &'b str) -> &'b str {\n y\n}\n")),(0,t.kt)("p",null,"Dimisalkan ada seleksi kondisi, jadi return value bisa saja ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),", bisa juga ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Jika seperti ini, maka ",(0,t.kt)("inlineCode",{parentName:"p"},"x"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),", dan juga return value harus memiliki lifetime yang sama."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn do_something_v7<'a>(x: &'a str, y: &'a str) -> &'a str {\n if x.len() < y.len() {\n x\n } else {\n y\n }\n}\n")),(0,t.kt)("h2",{id:"a445-lifetime-elision"},"A.44.5. Lifetime elision"),(0,t.kt)("p",null,"Sampai section ini kita telah mempelajari kurang lebih 4 point berikut:"),(0,t.kt)("ol",null,(0,t.kt)("li",{parentName:"ol"},"Setiap data, lebih tepatnya setiap reference memiliki lifetime."),(0,t.kt)("li",{parentName:"ol"},"Lifetime digunakan oleh Rust dalam penentuan kapan reference tersebut di-dealokasi."),(0,t.kt)("li",{parentName:"ol"},"Pada beberapa case, lifetime perlu di-urus secara eksplisit (contohnya seperti pada fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"do_something_vx")," di atas)."),(0,t.kt)("li",{parentName:"ol"},"Pengecekan lifetime terjadi saat kompilasi.")),(0,t.kt)("p",null,"Rust memiliki sesuatu yang disebut dengan ",(0,t.kt)("strong",{parentName:"p"},"lifetime elision"),", isinya adalah aturan yang digunakan oleh Rust dalam menganalisa reference untuk menentukan lifetime ",(0,t.kt)("em",{parentName:"p"},"default"),"-nya."),(0,t.kt)("p",null,"Namun, bukan berarti Rust akan selalu tau lifetime tiap reference. Pada beberapa case, Rust membutuhkan bantuan kita selaku programmer untuk menginformasikan lifetime reference kode yang ditulis, contohnya seperti pada fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"do_something_v7")," di atas."),(0,t.kt)("p",null,"Meskipun demikian, tak usah terlalu khawatir, karena pengecekan lifetime reference terjadi saat kompilasi, dan ketika ada reference yang perlu dikasih ",(0,t.kt)("em",{parentName:"p"},"annotication"),", Rust akan menginformasikan ke kita via pesan error."),(0,t.kt)("blockquote",null,(0,t.kt)("p",{parentName:"blockquote"},"Untuk sekarang, pembahasan detail mengenai lifetime elision tidak dibahas pada ebook ini. Silakan gunakan dokumentasi official Rust untuk ",(0,t.kt)("a",{parentName:"p",href:"https://doc.rust-lang.org/nomicon/lifetime-elision.html"},"lifetime elision")," jika berminat untuk pengkajian yang lebih dalam.")),(0,t.kt)("p",null,"Jika kawan-kawan menggunakan ",(0,t.kt)("inlineCode",{parentName:"p"},"rust-analyzer")," extension di VSCode, tak perlu meng-compiler program untuk memunculkan error-nya, karena langsung muncul saat penulisan kode program."),(0,t.kt)("h2",{id:"a446-lifetime-pada-struct"},"A.44.6. Lifetime pada struct"),(0,t.kt)("p",null,"Tak hanya pada parameter fungsi dan return value fungsi, lifetime juga bisa diterapkan pada (property) struct."),(0,t.kt)("p",null,"Ketika menggunakan tipe data reference sebagai tipe property struct, Rust langsung menginformasikan kita via error message jika tidak ada anotasi lifetime pada field tersebut."),(0,t.kt)("p",null,"Contohnya bisa dilihat pada kode di bawah ini. Pesan error muncul karena tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"&str")," pada property struct tidak ada lifetime annotation-nya."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book {\n title: &str,\n}\n")),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(7106).Z,width:"725",height:"160"})),(0,t.kt)("p",null,"Solusinya, tambahkan anotasi lifetime pada tipe data ",(0,t.kt)("inlineCode",{parentName:"p"},"&str"),", dan juga daftarkan lifetime tersebut pada struct. Notasi penulisannya seperti ini:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// struct NamaStruct<'lifetime_annotication> {\n// field: &'lifetime_annotication tipe_data,\n// }\n\nstruct Book<'abc> {\n title: &'abc str,\n}\n")),(0,t.kt)("p",null,"Contoh jika ada lebih dari 1 field dengan lifetime sama:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc> {\n title: &'abc str,\n description: &'abc str,\n}\n")),(0,t.kt)("p",null,"Contoh jika ada beberapa field yang di antaranya memiliki lifetime berbeda (artinya ada lebih dari 1 lifetime):"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc, 'def> {\n title: &'abc str,\n description: &'abc str,\n price: &'def i32,\n}\n\nfn main() {\n let book = Book {\n title: \"The Silmarillion\",\n description: \"Good story, 10/10, would read again\",\n price: &99,\n };\n}\n")),(0,t.kt)("h2",{id:"a447-lifetime-pada-method"},"A.44.7. Lifetime pada method"),(0,t.kt)("p",null,"Ada 2 hal yang perlu diketahui dalam penerapan lifetime pada method. Yang pertama, lifetime annotication harus ditulis pada block ",(0,t.kt)("inlineCode",{parentName:"p"},"impl")," meskipun pada block method tidak digunakan secara langsung."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"struct Book<'abc, 'def> {\n title: &'abc str,\n description: &'abc str,\n price: &'def i32,\n}\n\nimpl<'abc, 'def> Book<'abc, 'def> {\n\n fn get_info(&self) -> String {\n let info = format!(\"{} (${}), {}\", self.title, self.price, self.description);\n info\n }\n}\n")),(0,t.kt)("p",null,"Bisa dilihat statement block ",(0,t.kt)("inlineCode",{parentName:"p"},"impl<'abc, 'def> Book<'abc, 'def>"),", lifetime annotation-nya sama persis dengan yang ada di struct. Jika ingin mengetes, silakan coba saja hapus syntax lifetime dari statement itu, pasti muncul error."),(0,t.kt)("p",null,"Hal ke-2 yang penting diketahui, pada block kode method, tidak perlu menuliskan lifetime annotation, karena sudah ditulis di block kode ",(0,t.kt)("inlineCode",{parentName:"p"},"impl"),"."),(0,t.kt)("p",null,"Sebagai contoh, dua method berikut tidak memunculkan error:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"// ...\n\nimpl<'abc, 'def> Book<'abc, 'def> {\n\n fn get_info(&self) -> String {\n let info = format!(\"{} (${}), {}\", self.title, self.price, self.description);\n info\n }\n\n fn get_price(&self) -> &i32 {\n self.price\n }\n}\n")),(0,t.kt)("p",null,"Bandingkan dengan fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_book_price")," berikut, error muncul karena lifetime annotation tidak ditambahkan ke block fungsi (meskipun fungsi tersebut mengembalikan property ",(0,t.kt)("inlineCode",{parentName:"p"},"price")," milik struct ",(0,t.kt)("inlineCode",{parentName:"p"},"Book")," yang sudah memiliki lifetime sendiri). Hal ini karena data ",(0,t.kt)("inlineCode",{parentName:"p"},"&i32")," yang dikembalikan statement ",(0,t.kt)("inlineCode",{parentName:"p"},"book.get_price()")," langsung didealokasi setelah block fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"get_book_price")," selesai dieksekusi."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(378).Z,width:"813",height:"223"})),(0,t.kt)("p",null,"Agar error tidak muncul, tambahkan lifetime:"),(0,t.kt)("ol",null,(0,t.kt)("li",{parentName:"ol"},"ke return value (karena tipe data return value adalah reference)"),(0,t.kt)("li",{parentName:"ol"},"lalu pada parameter ",(0,t.kt)("inlineCode",{parentName:"li"},"book")," (karena di block fungsi return value berasal dari data milik property variabel ",(0,t.kt)("inlineCode",{parentName:"li"},"book"),"),"),(0,t.kt)("li",{parentName:"ol"},"dan juga tak lupa daftarkan lifetime annotation pada block fungsi ",(0,t.kt)("inlineCode",{parentName:"li"},"get_book_price"),".")),(0,t.kt)("p",null,"Kurang kode menjadi seperti berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'// ...\n\nfn get_book_price<\'ghi>(book: &\'ghi Book) -> &\'ghi i32 {\n book.get_price()\n}\n\nfn main() {\n let book = Book {\n title: "The Silmarillion",\n description: "Good story, 10/10, would read again",\n price: &99,\n };\n\n println!("{}", book.get_info());\n println!("the price: {}", get_book_price(&book));\n}\n')),(0,t.kt)("p",null,"Run program, hasilnya sukses."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(7146).Z,width:"473",height:"127"})),(0,t.kt)("h2",{id:"a448-generic-parameter--trait-bounds--lifetime"},"A.44.8. Generic parameter + trait bounds + lifetime"),(0,t.kt)("p",null,"Lalu bagaimana jika ada fungsi yang di situ ada penerapan trait bounds, ada juga generic parameter, dan lifetime annotation. Cara penulisannya seperti apa? Silakan lihat contoh berikut:"),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_greater_number<'a, T>(\n x: &'a T,\n y: &'a T,\n) -> &'a T\nwhere\n T: std::cmp::PartialOrd,\n{\n if x > y {\n x\n } else {\n y\n }\n}\n")),(0,t.kt)("p",null,"Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," di atas digunakan untuk mencari angka terbesar dari dua inputan parameter (",(0,t.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),"), dengan tipe data yang digunakan adalah generic ",(0,t.kt)("inlineCode",{parentName:"p"},"T"),". Dari sini maka nantinya fungsi ini bisa digunakan pada data bertipe ",(0,t.kt)("inlineCode",{parentName:"p"},"i32"),", ",(0,t.kt)("inlineCode",{parentName:"p"},"f64"),", dan data numerik lainnya."),(0,t.kt)("p",null,"Tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"T")," diasosiasikan dengan trait ",(0,t.kt)("inlineCode",{parentName:"p"},"std::cmp::PartialOrd")," agar variabel dengan tipe tersebut bisa digunakan dalam seleksi kondisi ",(0,t.kt)("inlineCode",{parentName:"p"},"if")," yang ada dalam block fungsi tersebut."),(0,t.kt)("p",null,"Ok, sampai sini semoga cukup jelas. Lalu bagaimana dengan lifetime annotation-nya? Karena lifetime annotation definisinya berada pada tempat yang sama dengan definisi tipe generic, maka langsung saja tulis di situ tanpa memperhatikan urutan. Sebagai contoh, dua definisi block fungsi berikut adalah ekuivalen."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn say_hello_v1<'abc, T>()\nfn say_hello_v2()\n")),(0,t.kt)("p",null,"Sekarang kembali ke pembahasan di atas. Fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," mengembalikan tipe data reference ",(0,t.kt)("inlineCode",{parentName:"p"},"&T")," yang nilainya bisa saja dari ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," atau ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Dari sini maka wajib hukumnya untuk return value memiliki lifetime yang sama dengan ",(0,t.kt)("inlineCode",{parentName:"p"},"x")," dan ",(0,t.kt)("inlineCode",{parentName:"p"},"y"),". Itulah kenapa definisi fungsi ",(0,t.kt)("inlineCode",{parentName:"p"},"find_greater_number")," agak panjang."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},"fn find_greater_number<'a, T>(x: &'a T, y: &'a T) -> &'a T\n")),(0,t.kt)("p",null,"Lanjut, mari kita panggil fungsi tersebut pada dua block expression. Block pertama untuk pengecekan data numerik ",(0,t.kt)("inlineCode",{parentName:"p"},"i32"),", dan yang kedua untuk tipe ",(0,t.kt)("inlineCode",{parentName:"p"},"f64"),"."),(0,t.kt)("pre",null,(0,t.kt)("code",{parentName:"pre",className:"language-rust"},'fn main() {\n\n {\n // i32 comparison test\n let x = 13;\n let y = 20;\n let result = find_greater_number::(&x, &y); // atau cukup `find_greater_number(&x, &y)`\n println!("result: {}", result);\n }\n \n {\n // f64 comparison test\n let x = 3.14;\n let y = 2.11;\n let result = find_greater_number::(&x, &y); // atau cukup `find_greater_number(&x, &y)`\n println!("result: {}", result);\n }\n}\n')),(0,t.kt)("p",null,"Jalankan program, hasilnya sesuai harapan, tidak ada error."),(0,t.kt)("p",null,(0,t.kt)("img",{alt:"Lifetime",src:n(757).Z,width:"1072",height:"200"})),(0,t.kt)("hr",null),(0,t.kt)("h2",{id:"catatan-chapter-"},"Catatan chapter \ud83d\udcd1"),(0,t.kt)("h3",{id:"-source-code-praktik"},"\u25c9 Source code praktik"),(0,t.kt)("pre",null,(0,t.kt)("a",{href:"https://github.com/novalagung/dasarpemrogramanrust-example/tree/master/lifetime"},"github.com/novalagung/dasarpemrogramanrust-example/../lifetime")),(0,t.kt)("h3",{id:"-referensi"},"\u25c9 Referensi"),(0,t.kt)("ul",null,(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"},"https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/nomicon/lifetimes.html"},"https://doc.rust-lang.org/nomicon/lifetimes.html")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://dev.to/takaakifuruse/rust-lifetimes-a-high-wall-for-rust-newbies-3ap"},"https://dev.to/takaakifuruse/rust-lifetimes-a-high-wall-for-rust-newbies-3ap")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://anooppoommen.medium.com/lifetimes-in-rust-7f2331be998b"},"https://anooppoommen.medium.com/lifetimes-in-rust-7f2331be998b")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://blog.logrocket.com/understanding-lifetimes-in-rust/"},"https://blog.logrocket.com/understanding-lifetimes-in-rust/")),(0,t.kt)("li",{parentName:"ul"},(0,t.kt)("a",{parentName:"li",href:"https://educative.io/answers/what-are-generic-lifetime-parameters-in-a-rust-function"},"https://educative.io/answers/what-are-generic-lifetime-parameters-in-a-rust-function"))))}s.isMDXComponent=!0},8116:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-1-49980dd171b372c65a19ab2c8bd2334f.png"},5384:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-2-1116463c388b09c1a8822e3b1ff4682c.png"},6875:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-3-d0688570ad7d667d603cde8665c863fc.png"},4982:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArEAAAC4CAIAAAB7KCObAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFGGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgMTE2LjM5YWJhZjcsIDIwMjIvMDIvMjUtM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pjzYu8rj+KOEjw8/+riafLr+sQWRkj/0OkuSPxxzrL7zwierD3EOIoQQgj/2Hn/ExZ0B/OHmnDZVmHIKSPHaudVnqjrLO49m8McTq5x1CCGE4I99wB8i/zFML7mbX+yNMEXNZj2cf1pO+2gQBP5ACCGEFp8/ykSFft+Kxh9yVkcrf5RzPvQ1H8ye/1GkPeqZH+UUVIU/yomoDX8UOBKWV9r4o+zJ3Q+vc04ihBCCP+bIH+Julzpj0dy3oty90jxtrJpSWmRQvPUdhXjtDJt/WqU97pZTUK/VCCJvfonuZ6lmm8b3v+i6/qFp887PX+KkRAghBH/Mkz8WV/N4/vr523fIfyCEEII/4I958cdLt/+b4gtCCCH4A/7wdfTQYxY4rj7+7S+/973Pv/OsXcIJhBBCCMEfs5JhDgMcBj7+99nvfvvIyTeffNou4QRCCCGE4I9ZyQKHsYEPmwixSziBEEIIoRnyB0IIIYQQ/IEQQggh+AMhhBBCCP5ACCGE0NLzx/Xbf3f/zw/c/5+v85QKhBBCCM2JP6ze//iBL2//AwOHEEIIofnxx4M//dr9j/+egUMIIYQQ/IEQQggh+AMhhBBCaDT+uPD1L//8tfcZOYQQQgjNjz8qBHmALAhCCCGE5sUfP/0at+AihBBCaO78QeYDIYQQQvAHQgghhOAPhBBCCKHx+IPnnyKEEEJofvxRff8LN98ihBBCaG78gRBCCCEEfyCEEEII/kAIIYQQgj8QQgghBH8ghBBCCMEfCCGEEII/EEIIIQR/IIQQQgjBHwghhBCCPxBCCCGE4A+EEEIIwR8IIYQQQvAHQgghhOAPhBBCCMEfCCGEEELwB0IIIYT2jP4fTuXrBQlA1EIAAAAASUVORK5CYII="},378:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-8-da413de408eba24af5e0d0db885af9fc.png"},757:(a,e,n)=>{n.d(e,{Z:()=>i});const i=n.p+"assets/images/lifetime-9-fix-96c668297e128c0b8d548a6cf72dfd0c.png"},7146:(a,e,n)=>{n.d(e,{Z:()=>i});const i="data:image/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lv3HRJ9mZK96Rh7NdoJgiCOx8UFWvJYus+tb4lCt3VK9jjo4dVoJwiCOCYXO7lK9Yt9XKzpFDZjSqdGO0EQxKZcjOTDlmjJJwfU5ETB8UnMSJMXl+6IF1uNVS8SBEFsysVii8IyLXklmVv3Pf0BHoBVtnZXodFOEASxORe3BbeHEQRBkIsJgiDIxeRigiCII3AxQRAEQS4mCIIgFxMEQRDkYoIgCHIxQRAEQS4mCIIgFxMEQRDkYoIgCHIxQRAEEeJ/kBoUtRad3qEAAAAASUVORK5CYII="}}]); \ No newline at end of file diff --git a/assets/js/main.577cbb9f.js b/assets/js/main.577cbb9f.js new file mode 100644 index 00000000..4054f81e --- /dev/null +++ b/assets/js/main.577cbb9f.js @@ -0,0 +1,2 @@ +/*! For license information please see main.577cbb9f.js.LICENSE.txt */ +(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(7294);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),a=n(7462),o=n(8356),i=n.n(o),l=n(6887);const s={"016a0787":[()=>n.e(274).then(n.bind(n,1854)),"@site/docs/basic/basic-memory-management.md",1854],"04da11da":[()=>n.e(3007).then(n.bind(n,7019)),"@site/docs/basic/perulangan-loop-break-continue-label.md",7019],"05cc1716":[()=>n.e(6477).then(n.bind(n,9810)),"@site/docs/basic/seleksi-kondisi-if.md",9810],"0ae704f7":[()=>n.e(2089).then(n.bind(n,5444)),"@site/docs/basic/pointer-references.md",5444],"0e6b6dd1":[()=>n.e(7949).then(n.t.bind(n,3769,19)),"/home/runner/work/dasarpemrogramanrust/dasarpemrogramanrust/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],"164327b9":[()=>n.e(3306).then(n.t.bind(n,7085,19)),"/home/runner/work/dasarpemrogramanrust/dasarpemrogramanrust/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],17896441:[()=>Promise.all([n.e(532),n.e(205),n.e(7918)]).then(n.bind(n,718)),"@theme/DocItem",718],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,6675)),"@theme/SearchPage",6675],"1be78505":[()=>Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,2868)),"@theme/DocPage",2868],"2452d5f5":[()=>n.e(5989).then(n.bind(n,831)),"@site/docs/basic/type-alias-casting.md",831],"2bc2e36b":[()=>n.e(620).then(n.bind(n,8283)),"@site/docs/basic/pattern-matching.md",8283],"388041ab":[()=>n.e(1494).then(n.bind(n,395)),"@site/docs/basic/unrecoverable-panic-error.md",395],"3aa512bf":[()=>n.e(7386).then(n.bind(n,7495)),"@site/docs/basic/module-inline.md",7495],"3b1dfe68":[()=>n.e(6161).then(n.bind(n,4008)),"@site/docs/basic/visibility-privacy.md",4008],"3d2f5b0c":[()=>n.e(676).then(n.bind(n,5569)),"@site/docs/basic/operator-tanda-tanya.md",5569],"4232c3ed":[()=>n.e(8308).then(n.bind(n,1597)),"@site/docs/basic/enum.md",1597],"4513d9f5":[()=>n.e(5729).then(n.bind(n,2589)),"@site/docs/basic/slice-memory-management.md",2589],"475d163e":[()=>n.e(6403).then(n.bind(n,6889)),"@site/docs/basic/perulangan-while.md",6889],"48e2ebd6":[()=>n.e(2359).then(n.bind(n,611)),"@site/src/pages/intro.js",611],"496dcc30":[()=>n.e(4738).then(n.bind(n,4547)),"@site/docs/basic/hello-rust.md",4547],"4c7e7ada":[()=>n.e(2706).then(n.bind(n,5442)),"@site/docs/basic/module-basic.md",5442],"5925ce9f":[()=>n.e(9831).then(n.bind(n,3121)),"@site/docs/basic/generics.md",3121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"5f289fb7":[()=>n.e(2870).then(n.bind(n,4950)),"@site/docs/basic/attributes.md",4950],"62b99870":[()=>n.e(1422).then(n.bind(n,1569)),"@site/docs/basic/slice.md",1569],"68e1906b":[()=>n.e(4758).then(n.bind(n,7630)),"@site/docs/basic/method.md",7630],"68ec37cc":[()=>n.e(2959).then(n.bind(n,3275)),"@site/docs/basic/static.md",3275],71880105:[()=>n.e(5758).then(n.bind(n,3548)),"@site/docs/basic/perulangan-for-in.md",3548],"7390b81e":[()=>n.e(4274).then(n.bind(n,6981)),"@site/docs/basic/package-crate.md",6981],"742a9bdc":[()=>n.e(7988).then(n.bind(n,8046)),"@site/docs/basic/advanced-traits.md",8046],"7794a932":[()=>n.e(8358).then(n.bind(n,6682)),"@site/docs/basic/result-type.md",6682],"7a2568c4":[()=>n.e(4197).then(n.bind(n,6425)),"@site/docs/basic/build-dan-run-program-rust.md",6425],"7d03ccaf":[()=>n.e(1059).then(n.bind(n,2409)),"@site/docs/pengelanan-rust-programming.md",2409],"82a9b669":[()=>n.e(3257).then(n.bind(n,1958)),"@site/docs/basic/trait-iterator.md",1958],"8333c691":[()=>n.e(4248).then(n.bind(n,9739)),"@site/docs/basic/ownership.md",9739],"8333ea4d":[()=>n.e(9323).then(n.bind(n,7485)),"@site/docs/basic/tuple.md",7485],"87499f15":[()=>n.e(7742).then(n.bind(n,67)),"@site/docs/basic/variabel.md",67],"8ad68633":[()=>n.e(2399).then(n.bind(n,1606)),"@site/docs/LICENSE.md",1606],"8b55bf27":[()=>n.e(9886).then(n.bind(n,5877)),"@site/docs/basic/tipe-data-custom-type-string-slice.md",5877],"8d193b98":[()=>n.e(7505).then(n.bind(n,676)),"@site/docs/CONTRIBUTING.md",676],"8e991452":[()=>n.e(2107).then(n.bind(n,9484)),"@site/docs/download-pdf.md",9484],"93422b31":[()=>n.e(8469).then(n.bind(n,1704)),"@site/docs/basic/struct.md",1704],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9a3629a6":[()=>n.e(7865).then(n.bind(n,8472)),"@site/docs/basic/file-path-directory.md",8472],"9e6fe7cf":[()=>n.e(623).then(n.bind(n,2508)),"@site/docs/installation/instalasi-rust.md",2508],a2bea3ed:[()=>n.e(6345).then(n.bind(n,1099)),"@site/docs/basic/string-slice-vs-string-literal.md",1099],af6aab29:[()=>n.e(8794).then(n.bind(n,1468)),"@site/docs/basic/datetime.md",1468],b28a365a:[()=>n.e(6794).then(n.bind(n,7356)),"@site/docs/basic/block-expression.md",7356],b97d8256:[()=>n.e(4790).then(n.bind(n,232)),"@site/docs/basic/komentar.md",232],bc4edc5c:[()=>n.e(4452).then(n.bind(n,129)),"@site/docs/basic/closures.md",129],bd9b9d52:[()=>n.e(909).then(n.bind(n,5943)),"@site/docs/basic/tipe-data-primitive-scalar.md",5943],bdfc7662:[()=>n.e(7720).then(n.bind(n,2486)),"@site/docs/basic/associated-function.md",2486],be3f5c40:[()=>n.e(5572).then(n.bind(n,4387)),"@site/docs/basic/module-scope-item-access.md",4387],c01cce30:[()=>n.e(6531).then(n.bind(n,231)),"@site/docs/basic/konstanta.md",231],c377a04b:[()=>n.e(6971).then(n.bind(n,1269)),"@site/docs/index.md",1269],c526a898:[()=>n.e(9157).then(n.bind(n,3024)),"@site/docs/basic/function.md",3024],c76cc2e3:[()=>n.e(4729).then(n.bind(n,6556)),"@site/docs/basic/vector.md",6556],cb962766:[()=>n.e(6691).then(n.bind(n,2900)),"@site/docs/basic/trait-function.md",2900],d47a3664:[()=>n.e(8784).then(n.t.bind(n,5745,19)),"/home/runner/work/dasarpemrogramanrust/dasarpemrogramanrust/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],d8837387:[()=>n.e(4622).then(n.bind(n,8007)),"@site/docs/basic/tipe-data-string-literal.md",8007],dabee7bd:[()=>n.e(4943).then(n.bind(n,3296)),"@site/docs/basic/operator.md",3296],dadaca00:[()=>n.e(8051).then(n.bind(n,375)),"@site/docs/basic/array.md",375],db8ccf76:[()=>n.e(4861).then(n.bind(n,5443)),"@site/docs/basic/traits.md",5443],e4904969:[()=>n.e(8732).then(n.bind(n,4510)),"@site/docs/basic/option-type.md",4510],e7bd9b37:[()=>n.e(7539).then(n.bind(n,2079)),"@site/docs/basic/path-item.md",2079],eb2a6637:[()=>n.e(6388).then(n.bind(n,164)),"@site/docs/basic/use.md",164],f8d4e457:[()=>n.e(740).then(n.bind(n,8514)),"@site/docs/basic/lifetime.md",8514],fb18633e:[()=>n.e(7310).then(n.bind(n,5555)),"@site/docs/basic/borrowing.md",5555],fd4f5a0c:[()=>n.e(5751).then(n.bind(n,5445)),"@site/docs/installation/rust-editor-plugin.md",5445],fef7d16c:[()=>n.e(5673).then(n.bind(n,2043)),"@site/docs/basic/shadowing.md",2043]};function u(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var c=n(9670),d=n(226);function f(e,t){if("*"===e)return i()({loading:u,loader:()=>n.e(4972).then(n.bind(n,4972)),modules:["@theme/NotFound"],webpack:()=>[4972],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],f={},p=[],m=[],h=(0,c.Z)(o);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:u,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,a.Z)({},i,n)))}})}const p=[{path:"/intro",component:f("/intro","a5b"),exact:!0},{path:"/search",component:f("/search","fa3"),exact:!0},{path:"/",component:f("/","323"),routes:[{path:"/",component:f("/","98e"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/advanced-traits",component:f("/basic/advanced-traits","88d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/array",component:f("/basic/array","354"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/associated-function",component:f("/basic/associated-function","a80"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/attributes",component:f("/basic/attributes","7d4"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/basic-memory-management",component:f("/basic/basic-memory-management","24e"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/block-expression",component:f("/basic/block-expression","22b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/borrowing",component:f("/basic/borrowing","85f"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/build-dan-run-program-rust",component:f("/basic/build-dan-run-program-rust","1a9"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/closures",component:f("/basic/closures","98c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/datetime",component:f("/basic/datetime","b5e"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/enum",component:f("/basic/enum","a0e"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/file-path-directory",component:f("/basic/file-path-directory","020"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/function",component:f("/basic/function","c21"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/generics",component:f("/basic/generics","3f9"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/hello-rust",component:f("/basic/hello-rust","91f"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/komentar",component:f("/basic/komentar","f72"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/konstanta",component:f("/basic/konstanta","758"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/lifetime",component:f("/basic/lifetime","ee9"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/method",component:f("/basic/method","970"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/module-basic",component:f("/basic/module-basic","81c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/module-inline",component:f("/basic/module-inline","4f6"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/module-scope-item-access",component:f("/basic/module-scope-item-access","b6b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/operator",component:f("/basic/operator","85d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/operator-tanda-tanya",component:f("/basic/operator-tanda-tanya","f6a"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/option-type",component:f("/basic/option-type","c23"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/ownership",component:f("/basic/ownership","74d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/package-crate",component:f("/basic/package-crate","fce"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/path-item",component:f("/basic/path-item","e90"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/pattern-matching",component:f("/basic/pattern-matching","45d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/perulangan-for-in",component:f("/basic/perulangan-for-in","c5f"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/perulangan-loop-break-continue-label",component:f("/basic/perulangan-loop-break-continue-label","b52"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/perulangan-while",component:f("/basic/perulangan-while","011"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/pointer-references",component:f("/basic/pointer-references","dfd"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/result-type",component:f("/basic/result-type","c01"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/seleksi-kondisi-if",component:f("/basic/seleksi-kondisi-if","e3d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/shadowing",component:f("/basic/shadowing","5be"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/slice",component:f("/basic/slice","2c8"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/slice-memory-management",component:f("/basic/slice-memory-management","6b3"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/static",component:f("/basic/static","655"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/string-slice-vs-string-literal",component:f("/basic/string-slice-vs-string-literal","5e6"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/struct",component:f("/basic/struct","392"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/tipe-data-custom-type-string-slice",component:f("/basic/tipe-data-custom-type-string-slice","384"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/tipe-data-primitive-scalar",component:f("/basic/tipe-data-primitive-scalar","18c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/tipe-data-string-literal",component:f("/basic/tipe-data-string-literal","788"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/trait-function",component:f("/basic/trait-function","ebd"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/trait-iterator",component:f("/basic/trait-iterator","2f7"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/traits",component:f("/basic/traits","594"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/tuple",component:f("/basic/tuple","dfc"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/type-alias-casting",component:f("/basic/type-alias-casting","dbf"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/unrecoverable-panic-error",component:f("/basic/unrecoverable-panic-error","445"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/use",component:f("/basic/use","f71"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/variabel",component:f("/basic/variabel","21b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/vector",component:f("/basic/vector","4d7"),exact:!0,sidebar:"tutorialSidebar"},{path:"/basic/visibility-privacy",component:f("/basic/visibility-privacy","794"),exact:!0,sidebar:"tutorialSidebar"},{path:"/CONTRIBUTING",component:f("/CONTRIBUTING","93d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/download-pdf",component:f("/download-pdf","a82"),exact:!0,sidebar:"tutorialSidebar"},{path:"/installation/instalasi-rust",component:f("/installation/instalasi-rust","e6a"),exact:!0,sidebar:"tutorialSidebar"},{path:"/installation/rust-editor-plugin",component:f("/installation/rust-editor-plugin","a9b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/LICENSE",component:f("/LICENSE","67b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/pengelanan-rust-programming",component:f("/pengelanan-rust-programming","aab"),exact:!0,sidebar:"tutorialSidebar"}]},{path:"*",component:f("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,t:()=>o});var r=n(7294);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},9383:(e,t,n)=>{"use strict";var r=n(7294),a=n(3935),o=n(3727),i=n(405),l=n(412);const s=[n(6657),n(2497),n(3310),n(8320),n(8049),n(6882)];var u=n(723),c=n(6775),d=n(8790);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(7462),m=n(5742),h=n(2263),g=n(4996),b=n(6668),v=n(833),y=n(4711),w=n(9727),E=n(3320),k=n(197);function S(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,h.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.Z)(),a=function(){const{siteConfig:{url:e}}=(0,h.Z)(),{pathname:t}=(0,c.TH)();return e+(0,g.Z)(t)}(),o=t?`${n}${t}`:a;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function x(){const{i18n:{currentLocale:e}}=(0,h.Z)(),{metadata:t,image:n}=(0,b.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(v.d,{image:n}),r.createElement(_,null),r.createElement(S,null),r.createElement(k.Z,{tag:E.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,p.Z)({key:t},e))))))}const T=new Map;function C(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(u.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var A=n(8934),N=n(8940);function O(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var r;const a=(null==(r=t.default)?void 0:r[e])??t[e];return null==a?void 0:a(...n)}));return()=>a.forEach((e=>null==e?void 0:e()))}const L=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(a&&function(e){const{hash:t}=e;if(t){const e=decodeURIComponent(t.substring(1)),n=document.getElementById(e);null==n||n.scrollIntoView()}else window.scrollTo(0,0)}(n),O("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function I(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(u.Z,e))).flat();return Promise.all(t.map((e=>null==e.route.component.preload?void 0:e.route.component.preload())))}class P extends r.Component{constructor(e){super(e),this.previousLocation=void 0,this.routeUpdateCleanupCb=void 0,this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?O("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=O("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),I(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(L,{previousLocation:this.previousLocation,location:t},r.createElement(c.AW,{location:t,render:()=>e}))}}const R=P,M="docusaurus-base-url-issue-banner-container",D="docusaurus-base-url-issue-banner-suggestion-container",F="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${F}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${F}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${M}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{window[F]=!1}),[]),r.createElement(r.Fragment,null,!l.Z.canUseDOM&&r.createElement(m.Z,null,r.createElement("script",null,B(e))),r.createElement("div",{id:M}))}function U(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,h.Z)(),{pathname:n}=(0,c.TH)();return t&&n===e?r.createElement($,null):null}function z(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:a,localeConfigs:o}}=(0,h.Z)(),i=(0,g.Z)(e),{htmlLang:l,direction:s}=o[a];return r.createElement(m.Z,null,r.createElement("html",{lang:l,dir:s}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:i}))}var j=n(4763);function H(){const e=(0,d.H)(u.Z),t=(0,c.TH)();return r.createElement(j.Z,null,r.createElement(N.M,null,r.createElement(A.t,null,r.createElement(f,null,r.createElement(z,null),r.createElement(x,null),r.createElement(U,null),r.createElement(R,{location:C(t)},e)))))}var Z=n(6887);const G=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{var r;if("undefined"==typeof document)return void n();const a=document.createElement("link");a.setAttribute("rel","prefetch"),a.setAttribute("href",e),a.onload=()=>t(),a.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??(null==(r=document.getElementsByName("script")[0])?void 0:r.parentNode);null==o||o.appendChild(a)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var V=n(9670);const W=new Set,q=new Set,Y=()=>{var e,t;return(null==(e=navigator.connection)?void 0:e.effectiveType.includes("2g"))||(null==(t=navigator.connection)?void 0:t.saveData)},K={prefetch(e){if(!(e=>!Y()&&!q.has(e)&&!W.has(e))(e))return!1;W.add(e);const t=(0,d.f)(u.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(Z).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,V.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?G(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!Y()&&!q.has(e))(e)&&(q.add(e),I(e))},X=Object.freeze(K);if(l.Z.canUseDOM){window.docusaurus=X;const e=a.hydrate;I(window.location.pathname).then((()=>{e(r.createElement(i.B6,null,r.createElement(o.VK,null,r.createElement(H,null))),document.getElementById("__docusaurus"))}))}},8940:(e,t,n)=>{"use strict";n.d(t,{_:()=>c,M:()=>d});var r=n(7294),a=n(6809);const o=JSON.parse('{"docusaurus-plugin-google-gtag":{"default":{"trackingID":"G-HKPC8ZGM74","anonymizeIP":false,"id":"default"}},"docusaurus-plugin-content-docs":{"default":{"path":"/","versions":[{"name":"current","label":"Next","isLast":true,"path":"/","mainDocId":"index","docs":[{"id":"basic/advanced-traits","path":"/basic/advanced-traits","sidebar":"tutorialSidebar"},{"id":"basic/array","path":"/basic/array","sidebar":"tutorialSidebar"},{"id":"basic/associated-function","path":"/basic/associated-function","sidebar":"tutorialSidebar"},{"id":"basic/attributes","path":"/basic/attributes","sidebar":"tutorialSidebar"},{"id":"basic/basic-memory-management","path":"/basic/basic-memory-management","sidebar":"tutorialSidebar"},{"id":"basic/block-expression","path":"/basic/block-expression","sidebar":"tutorialSidebar"},{"id":"basic/borrowing","path":"/basic/borrowing","sidebar":"tutorialSidebar"},{"id":"basic/build-dan-run-program-rust","path":"/basic/build-dan-run-program-rust","sidebar":"tutorialSidebar"},{"id":"basic/closures","path":"/basic/closures","sidebar":"tutorialSidebar"},{"id":"basic/datetime","path":"/basic/datetime","sidebar":"tutorialSidebar"},{"id":"basic/enum","path":"/basic/enum","sidebar":"tutorialSidebar"},{"id":"basic/file-path-directory","path":"/basic/file-path-directory","sidebar":"tutorialSidebar"},{"id":"basic/function","path":"/basic/function","sidebar":"tutorialSidebar"},{"id":"basic/generics","path":"/basic/generics","sidebar":"tutorialSidebar"},{"id":"basic/hello-rust","path":"/basic/hello-rust","sidebar":"tutorialSidebar"},{"id":"basic/komentar","path":"/basic/komentar","sidebar":"tutorialSidebar"},{"id":"basic/konstanta","path":"/basic/konstanta","sidebar":"tutorialSidebar"},{"id":"basic/lifetime","path":"/basic/lifetime","sidebar":"tutorialSidebar"},{"id":"basic/method","path":"/basic/method","sidebar":"tutorialSidebar"},{"id":"basic/module-basic","path":"/basic/module-basic","sidebar":"tutorialSidebar"},{"id":"basic/module-inline","path":"/basic/module-inline","sidebar":"tutorialSidebar"},{"id":"basic/module-scope-item-access","path":"/basic/module-scope-item-access","sidebar":"tutorialSidebar"},{"id":"basic/operator","path":"/basic/operator","sidebar":"tutorialSidebar"},{"id":"basic/operator-tanda-tanya","path":"/basic/operator-tanda-tanya","sidebar":"tutorialSidebar"},{"id":"basic/option-type","path":"/basic/option-type","sidebar":"tutorialSidebar"},{"id":"basic/ownership","path":"/basic/ownership","sidebar":"tutorialSidebar"},{"id":"basic/package-crate","path":"/basic/package-crate","sidebar":"tutorialSidebar"},{"id":"basic/path-item","path":"/basic/path-item","sidebar":"tutorialSidebar"},{"id":"basic/pattern-matching","path":"/basic/pattern-matching","sidebar":"tutorialSidebar"},{"id":"basic/perulangan-for-in","path":"/basic/perulangan-for-in","sidebar":"tutorialSidebar"},{"id":"basic/perulangan-loop-break-continue-label","path":"/basic/perulangan-loop-break-continue-label","sidebar":"tutorialSidebar"},{"id":"basic/perulangan-while","path":"/basic/perulangan-while","sidebar":"tutorialSidebar"},{"id":"basic/pointer-references","path":"/basic/pointer-references","sidebar":"tutorialSidebar"},{"id":"basic/result-type","path":"/basic/result-type","sidebar":"tutorialSidebar"},{"id":"basic/seleksi-kondisi-if","path":"/basic/seleksi-kondisi-if","sidebar":"tutorialSidebar"},{"id":"basic/shadowing","path":"/basic/shadowing","sidebar":"tutorialSidebar"},{"id":"basic/slice","path":"/basic/slice","sidebar":"tutorialSidebar"},{"id":"basic/slice-memory-management","path":"/basic/slice-memory-management","sidebar":"tutorialSidebar"},{"id":"basic/static","path":"/basic/static","sidebar":"tutorialSidebar"},{"id":"basic/string-slice-vs-string-literal","path":"/basic/string-slice-vs-string-literal","sidebar":"tutorialSidebar"},{"id":"basic/struct","path":"/basic/struct","sidebar":"tutorialSidebar"},{"id":"basic/tipe-data-custom-type-string-slice","path":"/basic/tipe-data-custom-type-string-slice","sidebar":"tutorialSidebar"},{"id":"basic/tipe-data-primitive-scalar","path":"/basic/tipe-data-primitive-scalar","sidebar":"tutorialSidebar"},{"id":"basic/tipe-data-string-literal","path":"/basic/tipe-data-string-literal","sidebar":"tutorialSidebar"},{"id":"basic/trait-function","path":"/basic/trait-function","sidebar":"tutorialSidebar"},{"id":"basic/trait-iterator","path":"/basic/trait-iterator","sidebar":"tutorialSidebar"},{"id":"basic/traits","path":"/basic/traits","sidebar":"tutorialSidebar"},{"id":"basic/tuple","path":"/basic/tuple","sidebar":"tutorialSidebar"},{"id":"basic/type-alias-casting","path":"/basic/type-alias-casting","sidebar":"tutorialSidebar"},{"id":"basic/unrecoverable-panic-error","path":"/basic/unrecoverable-panic-error","sidebar":"tutorialSidebar"},{"id":"basic/use","path":"/basic/use","sidebar":"tutorialSidebar"},{"id":"basic/variabel","path":"/basic/variabel","sidebar":"tutorialSidebar"},{"id":"basic/vector","path":"/basic/vector","sidebar":"tutorialSidebar"},{"id":"basic/visibility-privacy","path":"/basic/visibility-privacy","sidebar":"tutorialSidebar"},{"id":"CONTRIBUTING","path":"/CONTRIBUTING","sidebar":"tutorialSidebar"},{"id":"download-pdf","path":"/download-pdf","sidebar":"tutorialSidebar"},{"id":"index","path":"/","sidebar":"tutorialSidebar"},{"id":"installation/instalasi-rust","path":"/installation/instalasi-rust","sidebar":"tutorialSidebar"},{"id":"installation/rust-editor-plugin","path":"/installation/rust-editor-plugin","sidebar":"tutorialSidebar"},{"id":"LICENSE","path":"/LICENSE","sidebar":"tutorialSidebar"},{"id":"pengelanan-rust-programming","path":"/pengelanan-rust-programming","sidebar":"tutorialSidebar"}],"draftIds":[],"sidebars":{"tutorialSidebar":{"link":{"path":"/","label":"Dasar Pemrograman Rust"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"id","locales":["id"],"path":"i18n","currentLocale":"id","localeConfigs":{"id":{"label":"Indonesia","direction":"ltr","htmlLang":"id","calendar":"gregory","path":"id"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"2.2.0","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.2.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.2.0"},"docusaurus-plugin-google-gtag":{"type":"package","name":"@docusaurus/plugin-google-gtag","version":"2.2.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.2.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.2.0"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.2.0"},"docusaurus-plugin-structured-data":{"type":"package","name":"@stackql/docusaurus-plugin-structured-data","version":"1.3.1"}}}'),u={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},c=r.createContext(u);function d(e){let{children:t}=e;return r.createElement(c.Provider,{value:u},t)}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7294),a=n(412),o=n(5742),i=n(5705);function l(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"50vh",width:"100%",fontSize:"20px"}},r.createElement("h1",null,"This page crashed."),r.createElement("p",null,t.message),r.createElement("button",{type:"button",onClick:n},"Try again"))}function s(e){let{error:t,tryAgain:n}=e;return r.createElement(c,{fallback:()=>r.createElement(l,{error:t,tryAgain:n})},r.createElement(o.Z,null,r.createElement("title",null,"Page Error")),r.createElement(i.Z,null,r.createElement(l,{error:t,tryAgain:n})))}const u=e=>r.createElement(s,e);class c extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??u)(e)}return e??null}}},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(405);function o(e){return r.createElement(a.ql,e)}},9960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7462),a=n(7294),o=n(3727),i=n(8780),l=n(2263),s=n(3919),u=n(412);const c=a.createContext({collectLink:()=>{}});var d=n(4996);function f(e,t){var n;let{isNavLink:f,to:p,href:m,activeClassName:h,isActive:g,"data-noBrokenLinkCheck":b,autoAddBaseUrl:v=!0,...y}=e;const{siteConfig:{trailingSlash:w,baseUrl:E}}=(0,l.Z)(),{withBaseUrl:k}=(0,d.C)(),S=(0,a.useContext)(c),_=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(()=>_.current));const x=p||m;const T=(0,s.Z)(x),C=null==x?void 0:x.replace("pathname://","");let A=void 0!==C?(N=C,v&&(e=>e.startsWith("/"))(N)?k(N):N):void 0;var N;A&&T&&(A=(0,i.applyTrailingSlash)(A,{trailingSlash:w,baseUrl:E}));const O=(0,a.useRef)(!1),L=f?o.OL:o.rU,I=u.Z.canUseIntersectionObserver,P=(0,a.useRef)(),R=()=>{O.current||null==A||(window.docusaurus.preload(A),O.current=!0)};(0,a.useEffect)((()=>(!I&&T&&null!=A&&window.docusaurus.prefetch(A),()=>{I&&P.current&&P.current.disconnect()})),[P,A,I,T]);const M=(null==(n=A)?void 0:n.startsWith("#"))??!1,D=!A||!T||M;return D||b||S.collectLink(A),D?a.createElement("a",(0,r.Z)({ref:_,href:A},x&&!T&&{target:"_blank",rel:"noopener noreferrer"},y)):a.createElement(L,(0,r.Z)({},y,{onMouseEnter:R,onTouchStart:R,innerRef:e=>{_.current=e,I&&e&&T&&(P.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(P.current.unobserve(e),P.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),P.current.observe(e))},to:A},f&&{isActive:g,activeClassName:h}))}const p=a.forwardRef(f)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s,I:()=>l});var r=n(7294);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=null==t?void 0:t[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var o=n(7529);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return o[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:o}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,a(l,o))}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>a,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,Z:()=>i});var r=n(2263),a=n(3919);function o(){const{siteConfig:{baseUrl:e,url:t}}=(0,r.Z)();return{withBaseUrl:(n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:o=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,a.b)(n))return n;if(o)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)}}function i(e,t){void 0===t&&(t={});const{withBaseUrl:n}=o();return n(e,t)}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8940);function o(){return(0,r.useContext)(a._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8934);function o(){return(0,r.useContext)(a._)}},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});function r(e){const t={};return function e(n,r){Object.entries(n).forEach((n=>{let[a,o]=n;const i=r?`${r}.${a}`:a;var l;"object"==typeof(l=o)&&l&&Object.keys(l).length>0?e(o,i):t[i]=o}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,z:()=>o});var r=n(7294);const a=r.createContext(null);function o(e){let{children:t,value:n}=e;const o=r.useContext(a),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...null==n?void 0:n.data};return{plugin:t.plugin,data:r}}({parent:o,value:n})),[o,n]);return r.createElement(a.Provider,{value:i},t)}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>b,gA:()=>p,WS:()=>m,_r:()=>d,Jo:()=>v,zh:()=>f,yW:()=>g,gB:()=>h});var r=n(6775),a=n(2263),o=n(9935);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}function u(e,t){const n=s(e,t),a=null==n?void 0:n.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const c={},d=()=>i("docusaurus-plugin-content-docs")??c,f=e=>function(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});const r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function p(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function m(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.TH)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return f(e).versions}function g(e){const t=f(e);return l(t)}function b(e){const t=f(e),{pathname:n}=(0,r.TH)();return u(t,n)}function v(e){const t=f(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=l(e);return{latestDocSuggestion:u(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},6657:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;!n||t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash||setTimeout((()=>{window.gtag("event","page_view",{page_title:document.title,page_location:window.location.href,page_path:t.pathname+t.search+t.hash})}))}}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(4865),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r=n(7410),a=n(6809);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(6991)(`./prism-${e}`)})),delete globalThis.Prism}(r.Z)},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294);const a="iconExternalLink_nPIU";function o(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:a},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},5705:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Nt});var r=n(7294),a=n(6010),o=n(4763),i=n(833),l=n(7462),s=n(6775),u=n(5999),c=n(5936);const d="docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,s.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,c.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,u.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:a}=p();return r.createElement("div",{ref:n,role:"region","aria-label":m},r.createElement("a",(0,l.Z)({},e,{href:`#${d}`,onClick:a}),t))}var g=n(5281),b=n(9727);const v="skipToContent_fXgn";function y(){return r.createElement(h,{className:v})}var w=n(6668),E=n(9689);function k(e){let{width:t=21,height:n=21,color:a="currentColor",strokeWidth:o=1.2,className:i,...s}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 15 15",width:t,height:n},s),r.createElement("g",{stroke:a,strokeWidth:o},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const S="closeButton_CVFx";function _(e){return r.createElement("button",(0,l.Z)({type:"button","aria-label":(0,u.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,a.Z)("clean-btn close",S,e.className)}),r.createElement(k,{width:14,height:14,strokeWidth:3.1}))}const x="content_knG7";function T(e){const{announcementBar:t}=(0,w.L)(),{content:n}=t;return r.createElement("div",(0,l.Z)({},e,{className:(0,a.Z)(x,e.className),dangerouslySetInnerHTML:{__html:n}}))}const C="announcementBar_mb4j",A="announcementBarPlaceholder_vyr4",N="announcementBarClose_gvF7",O="announcementBarContent_xLdY";function L(){const{announcementBar:e}=(0,w.L)(),{isActive:t,close:n}=(0,E.nT)();if(!t)return null;const{backgroundColor:a,textColor:o,isCloseable:i}=e;return r.createElement("div",{className:C,style:{backgroundColor:a,color:o},role:"banner"},i&&r.createElement("div",{className:A}),r.createElement(T,{className:O}),i&&r.createElement(_,{onClick:n,className:N}))}var I=n(2961),P=n(2466);var R=n(902),M=n(3102);const D=r.createContext(null);function F(e){let{children:t}=e;const n=function(){const e=(0,I.e)(),t=(0,M.HY)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,R.D9)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return r.createElement(D.Provider,{value:n},t)}function B(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function $(){const e=(0,r.useContext)(D);if(!e)throw new R.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,M.HY)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:B(o)})),[a,o,t])}function U(e){let{header:t,primaryMenu:n,secondaryMenu:o}=e;const{shown:i}=$();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,a.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},o)))}var z=n(2949),j=n(2389);function H(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function Z(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const G={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function V(e){let{className:t,value:n,onChange:o}=e;const i=(0,j.Z)(),l=(0,u.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===n?(0,u.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,u.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,a.Z)(G.toggle,t)},r.createElement("button",{className:(0,a.Z)("clean-btn",G.toggleButton,!i&&G.toggleButtonDisabled),type:"button",onClick:()=>o("dark"===n?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite"},r.createElement(H,{className:(0,a.Z)(G.toggleIcon,G.lightToggleIcon)}),r.createElement(Z,{className:(0,a.Z)(G.toggleIcon,G.darkToggleIcon)})))}const W=r.memo(V);function q(e){let{className:t}=e;const n=(0,w.L)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,z.I)();return n?null:r.createElement(W,{className:t,value:a,onChange:o})}var Y=n(1327);function K(){return r.createElement(Y.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function X(){const e=(0,I.e)();return r.createElement("button",{type:"button","aria-label":(0,u.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(k,{color:"var(--ifm-color-emphasis-600)"}))}function Q(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(K,null),r.createElement(q,{className:"margin-right--md"}),r.createElement(X,null))}var J=n(9960),ee=n(4996),te=n(3919),ne=n(8022),re=n(9471);function ae(e){let{activeBasePath:t,activeBaseRegex:n,to:a,href:o,label:i,html:s,isDropdownLink:u,prependBaseUrlToHref:c,...d}=e;const f=(0,ee.Z)(a),p=(0,ee.Z)(t),m=(0,ee.Z)(o,{forcePrependBaseUrl:!0}),h=i&&o&&!(0,te.Z)(o),g=s?{dangerouslySetInnerHTML:{__html:s}}:{children:r.createElement(r.Fragment,null,i,h&&r.createElement(re.Z,u&&{width:12,height:12}))};return o?r.createElement(J.Z,(0,l.Z)({href:c?m:o},d,g)):r.createElement(J.Z,(0,l.Z)({to:f,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?(0,ne.F)(n,t.pathname):t.pathname.startsWith(p)},d,g))}function oe(e){let{className:t,isDropdownItem:n=!1,...o}=e;const i=r.createElement(ae,(0,l.Z)({className:(0,a.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},o));return n?r.createElement("li",null,i):i}function ie(e){let{className:t,isDropdownItem:n,...o}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(ae,(0,l.Z)({className:(0,a.Z)("menu__link",t)},o)))}function le(e){let{mobile:t=!1,position:n,...a}=e;const o=t?ie:oe;return r.createElement(o,(0,l.Z)({},a,{activeClassName:a.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var se=n(6043),ue=n(8596),ce=n(2263);function de(e,t){return e.some((e=>function(e,t){return!!(0,ue.Mg)(e.to,t)||!!(0,ne.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function fe(e){let{items:t,position:n,className:o,onClick:i,...s}=e;const u=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[u]),r.createElement("div",{ref:u,className:(0,a.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c})},r.createElement(ae,(0,l.Z)({"aria-haspopup":"true","aria-expanded":c,role:"button",href:s.to?void 0:"#",className:(0,a.Z)("navbar__link",o)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))}}),s.children??s.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,n)=>r.createElement(Ze,(0,l.Z)({isDropdownItem:!0,onKeyDown:e=>{if(n===t.length-1&&"Tab"===e.key){e.preventDefault(),d(!1);const t=u.current.nextElementSibling;if(t){(t instanceof HTMLAnchorElement?t:t.querySelector("a")).focus()}}},activeClassName:"dropdown__link--active"},e,{key:n}))))))}function pe(e){let{items:t,className:n,position:o,onClick:i,...u}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,ce.Z)(),{pathname:t}=(0,s.TH)();return t.replace(e,"/")}(),d=de(t,c),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,se.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[c,d,m]),r.createElement("li",{className:(0,a.Z)("menu__list-item",{"menu__list-item--collapsed":f})},r.createElement(ae,(0,l.Z)({role:"button",className:(0,a.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},u,{onClick:e=>{e.preventDefault(),p()}}),u.children??u.label),r.createElement(se.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:f},t.map(((e,t)=>r.createElement(Ze,(0,l.Z)({mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active"},e,{key:t}))))))}function me(e){let{mobile:t=!1,...n}=e;const a=t?pe:fe;return r.createElement(a,n)}var he=n(4711);function ge(e){let{width:t=20,height:n=20,...a}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},a),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const be="iconLanguage_nlXk";var ve=n(3935),ye=n(5742),we=n(6177);function Ee(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var ke=n(830),Se=["translations"];function _e(){return _e=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ae="Ctrl";var Ne=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=Ce(e,Se),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,u=void 0===s?"Search":s,c=xe((0,r.useState)(null),2),d=c[0],f=c[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?f("\u2318"):f(Ae))}),[]),r.createElement("button",_e({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(ke.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===Ae?r.createElement(Ee,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Oe=n(3320);const Le={button:{buttonText:(0,u.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,u.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,u.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,u.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,u.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,u.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,u.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,u.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,u.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,u.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,u.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,u.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,u.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,u.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,u.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,u.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,u.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,u.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,u.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,u.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,u.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,u.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,u.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,u.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,u.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,u.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,u.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Ie=null;function Pe(e){let{hit:t,children:n}=e;return r.createElement(J.Z,{to:t.url},n)}function Re(e){let{state:t,onClose:n}=e;const{generateSearchPageLink:a}=(0,we.O)();return r.createElement(J.Z,{to:a(t.query),onClick:n},r.createElement(u.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits}},"See all {count} results"))}function Me(e){var t;let{contextualSearch:a,externalUrlRegex:o,...i}=e;const{siteMetadata:u}=(0,ce.Z)(),c=function(){const{locale:e,tags:t}=(0,Oe._q)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),d=(null==(t=i.searchParameters)?void 0:t.facetFilters)??[],f=a?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(c,d):d,p={...i.searchParameters,facetFilters:f},{withBaseUrl:m}=(0,ee.C)(),h=(0,s.k6)(),g=(0,r.useRef)(null),b=(0,r.useRef)(null),[v,y]=(0,r.useState)(!1),[w,E]=(0,r.useState)(void 0),k=(0,r.useCallback)((()=>Ie?Promise.resolve():Promise.all([n.e(6780).then(n.bind(n,6780)),Promise.all([n.e(532),n.e(6945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,8894))]).then((e=>{let[{DocSearchModal:t}]=e;Ie=t}))),[]),S=(0,r.useCallback)((()=>{k().then((()=>{g.current=document.createElement("div"),document.body.insertBefore(g.current,document.body.firstChild),y(!0)}))}),[k,y]),_=(0,r.useCallback)((()=>{var e;y(!1),null==(e=g.current)||e.remove()}),[y]),x=(0,r.useCallback)((e=>{k().then((()=>{y(!0),E(e.key)}))}),[k,y,E]),T=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,ne.F)(o,t)?window.location.href=t:h.push(t)}}).current,C=(0,r.useRef)((e=>e.map((e=>{if((0,ne.F)(o,e.url))return e;const t=new URL(e.url);return{...e,url:m(`${t.pathname}${t.hash}`)}})))).current,A=(0,r.useMemo)((()=>e=>r.createElement(Re,(0,l.Z)({},e,{onClose:_}))),[_]),N=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",u.docusaurusVersion),e)),[u.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key.toLowerCase()&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:v,onOpen:S,onClose:_,onInput:x,searchButtonRef:b}),r.createElement(r.Fragment,null,r.createElement(ye.Z,null,r.createElement("link",{rel:"preconnect",href:`https://${i.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.createElement(Ne,{onTouchStart:k,onFocus:k,onMouseOver:k,onClick:S,ref:b,translations:Le.button}),v&&Ie&&g.current&&(0,ve.createPortal)(r.createElement(Ie,(0,l.Z)({onClose:_,initialScrollY:window.scrollY,initialQuery:w,navigator:T,transformItems:C,hitComponent:Pe,transformSearchClient:N},i.searchPagePath&&{resultsFooterComponent:A},i,{searchParameters:p,placeholder:Le.placeholder,translations:Le.modal})),g.current))}function De(){const{siteConfig:e}=(0,ce.Z)();return r.createElement(Me,e.themeConfig.algolia)}const Fe="searchBox_ZlJk";function Be(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,a.Z)(n,Fe)},t)}var $e=n(143),Ue=n(2802);var ze=n(373);const je=e=>e.docs.find((t=>t.id===e.mainDocId));const He={default:le,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:a,...o}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,ce.Z)(),f=(0,he.l)(),{search:p,hash:m}=(0,s.TH)(),h=[...n,...c.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...a],g=t?(0,u.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return r.createElement(me,(0,l.Z)({},o,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(ge,{className:be}),g),items:h}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(Be,{className:n},r.createElement(De,null))},dropdown:me,html:function(e){let{value:t,className:n,mobile:o=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,a.Z)({navbar__item:!o&&!i,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,$e.Iw)(a),s=(0,Ue.vY)(t,a);return null===s?null:r.createElement(le,(0,l.Z)({exact:!0},o,{isActive:()=>(null==i?void 0:i.path)===s.path||!(null==i||!i.sidebar)&&i.sidebar===s.sidebar,label:n??s.id,to:s.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,$e.Iw)(a),s=(0,Ue.oz)(t,a).link;if(!s)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(le,(0,l.Z)({exact:!0},o,{isActive:()=>(null==i?void 0:i.sidebar)===t,label:n??s.label,to:s.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:a,...o}=e;const i=(0,Ue.lO)(a)[0],s=t??i.label,u=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(i).path;return r.createElement(le,(0,l.Z)({},o,{label:s,to:u}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:a,dropdownItemsBefore:o,dropdownItemsAfter:i,...c}=e;const{search:d,hash:f}=(0,s.TH)(),p=(0,$e.Iw)(n),m=(0,$e.gB)(n),{savePreferredVersionName:h}=(0,ze.J)(n),g=[...o,...m.map((e=>{const t=p.alternateDocVersions[e.name]??je(e);return{label:e.label,to:`${t.path}${d}${f}`,isActive:()=>e===p.activeVersion,onClick:()=>h(e.name)}})),...i],b=(0,Ue.lO)(n)[0],v=t&&g.length>1?(0,u.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):b.label,y=t&&g.length>1?void 0:je(b).path;return g.length<=1?r.createElement(le,(0,l.Z)({},c,{mobile:t,label:v,to:y,isActive:a?()=>!1:void 0})):r.createElement(me,(0,l.Z)({},c,{mobile:t,label:v,to:y,items:g,isActive:a?()=>!1:void 0}))}};function Ze(e){let{type:t,...n}=e;const a=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=He[a];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(o,n)}function Ge(){const e=(0,I.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(Ze,(0,l.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function Ve(e){return r.createElement("button",(0,l.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(u.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function We(){const e=0===(0,w.L)().navbar.items.length,t=$();return r.createElement(r.Fragment,null,!e&&r.createElement(Ve,{onClick:()=>t.hide()}),t.content)}function qe(){const e=(0,I.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(U,{header:r.createElement(Q,null),primaryMenu:r.createElement(Ge,null),secondaryMenu:r.createElement(We,null)}):null}const Ye="navbarHideable_m1mJ",Ke="navbarHidden_jGov";function Xe(e){return r.createElement("div",(0,l.Z)({role:"presentation"},e,{className:(0,a.Z)("navbar-sidebar__backdrop",e.className)}))}function Qe(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.L)(),i=(0,I.e)(),{navbarRef:l,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,P.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+u{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,className:(0,a.Z)("navbar","navbar--fixed-top",n&&[Ye,!s&&Ke],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown})},t,r.createElement(Xe,{onClick:i.toggle}),r.createElement(qe,null))}function Je(e){let{width:t=30,height:n=30,className:a,...o}=e;return r.createElement("svg",(0,l.Z)({className:a,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},o),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function et(){const{toggle:e,shown:t}=(0,I.e)();return r.createElement("button",{onClick:e,"aria-label":(0,u.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(Je,null))}const tt="colorModeToggle_x44X";function nt(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(Ze,(0,l.Z)({},e,{key:t})))))}function rt(e){let{left:t,right:n}=e;const{siteConfig:a}=(0,ce.Z)();return(0,r.useEffect)((()=>{var e=document.createElement("script");e.type="text/javascript",e.src="https://buttons.github.io/buttons.js",document.querySelector("head").append(e)})),r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},r.createElement("div",{style:{marginTop:"8px",marginRight:"15px"}},r.createElement("a",{className:"github-button",href:`https://github.com/sponsors/${a.organizationName}`,"data-color-scheme":"no-preference: light; light: light; dark: dark;","data-icon":"octicon-heart","data-size":"large","aria-label":`Sponsor @${a.organizationName} on GitHub`},"Sponsor"),"\xa0",r.createElement("a",{className:"github-button",href:`https://github.com/${a.organizationName}/${a.projectName}`,"data-icon":"octicon-star","data-size":"large","data-show-count":"true","aria-label":`Star ${a.organizationName}/${a.projectName} on GitHub`},"Star"),"\xa0",r.createElement("a",{className:"github-button",href:`https://github.com/${a.organizationName}`,"data-size":"large","aria-label":`Follow @${a.organizationName} on GitHub`},`Follow @${a.organizationName}`)),n))}function at(){const e=(0,I.e)(),t=(0,w.L)().navbar.items,[n,a]=function(e){function t(e){return"left"===(e.position??"right")}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return r.createElement(rt,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(et,null),r.createElement(K,null),r.createElement(nt,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(nt,{items:a}),r.createElement(q,{className:tt}),!o&&r.createElement(Be,null,r.createElement(De,null)))})}function ot(){return r.createElement(Qe,null,r.createElement(at,null))}function it(e){let{item:t}=e;const{to:n,href:a,label:o,prependBaseUrlToHref:i,...s}=t,u=(0,ee.Z)(n),c=(0,ee.Z)(a,{forcePrependBaseUrl:!0});return r.createElement(J.Z,(0,l.Z)({className:"footer__link-item"},a?{href:i?c:a}:{to:u},s),o,a&&!(0,te.Z)(a)&&r.createElement(re.Z,null))}function lt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(it,{item:t}))}function st(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(lt,{key:t,item:e})))))}function ut(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(st,{key:t,column:e}))))}function ct(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function dt(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(it,{item:t})}function ft(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(dt,{item:e}),t.length!==n+1&&r.createElement(ct,null))))))}function pt(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(ut,{columns:t}):r.createElement(ft,{links:t})}var mt=n(941);const ht="footerLogoLink_BH7S";function gt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,ee.C)(),o={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(mt.Z,{className:(0,a.Z)("footer__logo",t.className),alt:t.alt,sources:o,width:t.width,height:t.height,style:t.style})}function bt(e){let{logo:t}=e;return t.href?r.createElement(J.Z,{href:t.href,className:ht,target:t.target},r.createElement(gt,{logo:t})):r.createElement(gt,{logo:t})}function vt(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function yt(e){let{style:t,links:n,logo:o,copyright:i}=e;return r.createElement("footer",{className:(0,a.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(o||i)&&r.createElement("div",{className:"footer__bottom text--center"},o&&r.createElement("div",{className:"margin-bottom--sm"},o),i)))}function wt(){const{footer:e}=(0,w.L)();if(!e)return null;const{copyright:t,links:n,logo:a,style:o}=e;return r.createElement(yt,{style:o,links:n&&n.length>0&&r.createElement(pt,{links:n}),logo:a&&r.createElement(bt,{logo:a}),copyright:t&&r.createElement(vt,{copyright:t})})}const Et=r.memo(wt);var kt=n(12);const St="docusaurus.tab.",_t=r.createContext(void 0);const xt=(0,R.Qc)([z.S,E.pl,function(e){let{children:t}=e;const n=function(){const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)(((e,t)=>{(0,kt.W)(`docusaurus.tab.${e}`).set(t)}),[]);(0,r.useEffect)((()=>{try{const e={};(0,kt._)().forEach((t=>{if(t.startsWith(St)){const n=t.substring(St.length);e[n]=(0,kt.W)(t).get()}})),t(e)}catch(e){console.error(e)}}),[]);const a=(0,r.useCallback)(((e,r)=>{t((t=>({...t,[e]:r}))),n(e,r)}),[n]);return(0,r.useMemo)((()=>({tabGroupChoices:e,setTabGroupChoices:a})),[e,a])}();return r.createElement(_t.Provider,{value:n},t)},P.OC,ze.L5,i.VC,function(e){let{children:t}=e;return r.createElement(M.n2,null,r.createElement(I.M,null,r.createElement(F,null,t)))}]);function Tt(e){let{children:t}=e;return r.createElement(xt,null,t)}function Ct(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(u.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("p",null,t.message),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},r.createElement(u.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again when the page crashed"},"Try again"))))))}const At="mainWrapper_z2l0";function Nt(e){const{children:t,noFooter:n,wrapperClassName:l,title:s,description:u}=e;return(0,b.t)(),r.createElement(Tt,null,r.createElement(i.d,{title:s,description:u}),r.createElement(y,null),r.createElement(L,null),r.createElement(ot,null),r.createElement("div",{id:d,className:(0,a.Z)(g.k.wrapper.main,At,l)},r.createElement(o.Z,{fallback:e=>r.createElement(Ct,e)},t)),!n&&r.createElement(Et,null))}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7462),a=n(7294),o=n(9960),i=n(4996),l=n(2263),s=n(6668),u=n(941);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,i.Z)(t.src),dark:(0,i.Z)(t.srcDark||t.src)},l=a.createElement(u.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?a.createElement("div",{className:r},l):l}function d(e){const{siteConfig:{title:t}}=(0,l.Z)(),{navbar:{title:n,logo:u}}=(0,s.L)(),{imageClassName:d,titleClassName:f,...p}=e,m=(0,i.Z)((null==u?void 0:u.href)||"/"),h=n?"":t,g=(null==u?void 0:u.alt)??h;return a.createElement(o.Z,(0,r.Z)({to:m},p,(null==u?void 0:u.target)&&{target:u.target}),u&&a.createElement(c,{logo:u,alt:g,imageClassName:d}),null!=n&&a.createElement("b",{className:f},n))}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(5742);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return r.createElement(a.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),o&&r.createElement("meta",{name:"docusaurus_tag",content:o}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),o&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:o}))}},941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(7462),a=n(7294),o=n(6010),i=n(2389),l=n(2949);const s={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function u(e){const t=(0,i.Z)(),{colorMode:n}=(0,l.I)(),{sources:u,className:c,alt:d,...f}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return a.createElement(a.Fragment,null,p.map((e=>a.createElement("img",(0,r.Z)({key:e,src:u[e],alt:d,className:(0,o.Z)(s.themedImage,s[`themedImage--${e}`],c)},f)))))}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>i,z:()=>m});var r=n(7462),a=n(7294),o=n(412);function i(e){let{initialState:t}=e;const[n,r]=(0,a.useState)(t??!1),o=(0,a.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:o}}const l={display:"none",overflow:"hidden",height:"0px"},s={display:"block",overflow:"visible",height:"auto"};function u(e,t){const n=t?l:s;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function c(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const o=(0,a.useRef)(!1);(0,a.useEffect)((()=>{const e=t.current;function a(){const t=e.scrollHeight,n=(null==r?void 0:r.duration)??function(e){const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${(null==r?void 0:r.easing)??"ease-in-out"}`,height:`${t}px`}}function i(){const t=a();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return u(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(i(),requestAnimationFrame((()=>{e.style.height=l.height,e.style.overflow=l.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{i()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function d(e){if(!o.Z.canUseDOM)return e?l:s}function f(e){let{as:t="div",collapsed:n,children:r,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const f=(0,a.useRef)(null);return c({collapsibleRef:f,collapsed:n,animation:o}),a.createElement(t,{ref:f,style:s?void 0:d(n),onTransitionEnd:e=>{"height"===e.propertyName&&(u(f.current,n),null==i||i(n))},className:l},r)}function p(e){let{collapsed:t,...n}=e;const[o,i]=(0,a.useState)(!t),[l,s]=(0,a.useState)(t);return(0,a.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,a.useLayoutEffect)((()=>{o&&s(t)}),[o,t]),o?a.createElement(f,(0,r.Z)({},n,{collapsed:l})):null}function m(e){let{lazy:t,...n}=e;const r=t?p:f;return a.createElement(r,n)}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>p});var r=n(7294),a=n(2389),o=n(12),i=n(902),l=n(6668);const s=(0,o.W)("docusaurus.announcement.dismiss"),u=(0,o.W)("docusaurus.announcement.id"),c=()=>"true"===s.get(),d=e=>s.set(String(e)),f=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.L)(),t=(0,a.Z)(),[n,o]=(0,r.useState)((()=>!!t&&c()));(0,r.useEffect)((()=>{o(c())}),[]);const i=(0,r.useCallback)((()=>{d(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&d(!1),!r&&c()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(f.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>g,S:()=>h});var r=n(7294),a=n(412),o=n(902),i=n(12),l=n(6668);const s=r.createContext(void 0),u="theme",c=(0,i.W)(u),d="light",f="dark",p=e=>e===f?f:d;function m(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.L)(),[o,i]=(0,r.useState)((e=>a.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e))(e));(0,r.useEffect)((()=>{t&&c.del()}),[t]);const s=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(i(t),a&&(e=>{c.set(p(e))})(t)):(i(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f:d:e),c.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=c.get();null!==t&&s(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,s]);const m=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||m.current?m.current=window.matchMedia("print").matches:s(null)};return e.addListener(r),()=>e.removeListener(r)}),[s,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:s,get isDarkTheme(){return o===f},setLightTheme(){s(d)},setDarkTheme(){s(f)}})),[o,s])}function h(e){let{children:t}=e;const n=m();return r.createElement(s.Provider,{value:n},t)}function g(){const e=(0,r.useContext)(s);if(null==e)throw new o.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>y,L5:()=>b,Oh:()=>w});var r=n(7294),a=n(143),o=n(9935),i=n(6668),l=n(2802),s=n(902),u=n(12);const c=e=>`docs-preferred-version-${e}`,d=(e,t,n)=>{(0,u.W)(c(e),{persistence:t}).set(n)},f=(e,t)=>(0,u.W)(c(e),{persistence:t}).get(),p=(e,t)=>{(0,u.W)(c(e),{persistence:t}).del()};const m=r.createContext(null);function h(){const e=(0,a._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>(e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}]))))(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=f(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(p(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=h();return r.createElement(m.Provider,{value:n},t)}function b(e){let{children:t}=e;return l.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function v(){const e=(0,r.useContext)(m);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function y(e){void 0===e&&(e=o.m);const t=(0,a.zh)(e),[n,i]=v(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function w(){const e=(0,a._r)(),[t]=v();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,b:()=>l});var r=n(7294),a=n(902);const o=Symbol("EmptyContext"),i=r.createContext(o);function l(e){let{children:t,name:n,items:a}=e;const o=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return r.createElement(i.Provider,{value:o},t)}function s(){const e=(0,r.useContext)(i);if(e===o)throw new a.i6("DocsSidebarProvider");return e}},2961:(e,t,n)=>{"use strict";n.d(t,{M:()=>f,e:()=>p});var r=n(7294),a=n(3102),o=n(7524),i=n(6775),l=n(902);function s(e){!function(e){const t=(0,i.k6)(),n=(0,l.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var u=n(6668);const c=r.createContext(void 0);function d(){const e=function(){const e=(0,a.HY)(),{items:t}=(0,u.L)().navbar;return 0===t.length&&!e.component}(),t=(0,o.i)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1);s((()=>{if(i)return l(!1),!1}));const c=(0,r.useCallback)((()=>{l((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&l(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:c,shown:i})),[e,n,c,i])}function f(e){let{children:t}=e;const n=d();return r.createElement(c.Provider,{value:n},t)}function p(){const e=r.useContext(c);if(void 0===e)throw new l.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>s,n2:()=>i});var r=n(7294),a=n(902);const o=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(o.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(o);if(!e)throw new a.i6("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(o);if(!i)throw new a.i6("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(0,a.Ql)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,t:()=>o});var r=n(7294);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{O:()=>l});var r=n(7294),a=n(6775),o=n(2263);const i="q";function l(){const e=(0,a.k6)(),{siteConfig:{baseUrl:t}}=(0,o.Z)(),[n,l]=(0,r.useState)("");(0,r.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get(i)??"";l(e)}),[]);return{searchQuery:n,setSearchQuery:(0,r.useCallback)((t=>{const n=new URLSearchParams(window.location.search);t?n.set(i,t):n.delete(i),e.replace({search:n.toString()}),l(t)}),[e]),generateSearchPageLink:(0,r.useCallback)((e=>`${t}search?q=${encodeURIComponent(e)}`),[t])}}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>u});var r=n(7294),a=n(412);const o="desktop",i="mobile",l="ssr";function s(){return a.Z.canUseDOM?window.innerWidth>996?o:i:l}function u(){const[e,t]=(0,r.useState)((()=>s()));return(0,r.useEffect)((()=>{function e(){t(s())}return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(undefined)}}),[]),e}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},2802:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>f,_F:()=>m,cE:()=>d,hI:()=>w,lO:()=>b,vY:()=>y,oz:()=>v,s1:()=>g});var r=n(7294),a=n(6775),o=n(8790),i=n(143),l=n(373),s=n(1116);function u(e){return Array.from(new Set(e))}var c=n(8596);const d=!!i._r;function f(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=f(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,c.Mg)(e,t);function m(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||((e,t)=>e.some((e=>m(e,t))))(e.items,t))}function h(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,c.Mg)(o.href,n)||e(o.items))||"link"===o.type&&(0,c.Mg)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function g(){var e;const t=(0,s.V)(),{pathname:n}=(0,a.TH)();return!1!==(null==(e=(0,i.gA)())?void 0:e.pluginData.breadcrumbs)&&t?h({sidebarItems:t.items,pathname:n}):null}function b(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,l.J)(e),a=(0,i.yW)(e);return(0,r.useMemo)((()=>u([t,n,a].filter(Boolean))),[t,n,a])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\n Available sidebar ids are:\n - ${Object.keys(t).join("\n- ")}`);return r[1]}),[e,n])}function y(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`DocNavbarItem: couldn't find any doc with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${u(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function w(e){let{route:t,versionMetadata:n}=e;const r=(0,a.TH)(),i=t.routes,l=i.find((e=>(0,a.LX)(r.pathname,e)));if(!l)return null;const s=l.sidebar,u=s?n.docsSidebars[s]:void 0;return{docElement:(0,o.H)(i),sidebarName:s,sidebarItems:u}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(2263);function a(e){const{siteConfig:t}=(0,r.Z)(),{title:n,titleDelimiter:a}=t;return null!=e&&e.trim().length?`${e.trim()} ${a} ${n}`:n}},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>f,d:()=>c,VC:()=>p});var r=n(7294),a=n(6010),o=n(5742),i=n(226);function l(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(4996),u=n(2128);function c(e){let{title:t,description:n,keywords:a,image:i,children:l}=e;const c=(0,u.p)(t),{withBaseUrl:d}=(0,s.C)(),f=i?d(i,{absolute:!0}):void 0;return r.createElement(o.Z,null,t&&r.createElement("title",null,c),t&&r.createElement("meta",{property:"og:title",content:c}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),l)}const d=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.Z)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(o.Z,null,r.createElement("html",{className:l})),n)}function p(e){let{children:t}=e;const n=l(),o=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(f,{className:(0,a.Z)(o,i)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>i,Qc:()=>u,Ql:()=>s,i6:()=>l,zX:()=>o});var r=n(7294);const a=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function o(e){const t=(0,r.useRef)(e);return a((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return a((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){var n,r,a;super(),this.name="ReactContextError",this.message=`Hook ${(null==(n=this.stack)||null==(r=n.split("\n")[1])||null==(a=r.match(/at (?:\w+\.)?(?\w+)/))?void 0:a.groups.name)??""} is called outside the <${e}>. ${t??""}`}}function s(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(7294),a=n(723),o=n(2263);function i(e,t){const n=e=>{var t;return null==(t=!e||e.endsWith("/")?e:`${e}/`)?void 0:t.toLowerCase()};return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.Z,baseUrl:e})),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>f,OC:()=>s,RF:()=>d});var r=n(7294),a=n(412),o=n(2389),i=n(902);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function u(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const c=()=>a.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=u(),a=(0,r.useRef)(c()),o=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=c();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function f(){const e=(0,r.useRef)(null),t=(0,o.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>null==e.current?void 0:e.current()}}},3320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>i,_q:()=>s,os:()=>l});var r=n(143),a=n(2263),o=n(373);const i="default";function l(e,t){return`docs-${e}-${t}`}function s(){const{i18n:e}=(0,a.Z)(),t=(0,r._r)(),n=(0,r.WS)(),s=(0,o.Oh)();const u=[i,...Object.keys(t).map((function(e){const r=(null==n?void 0:n.activePlugin.pluginId)===e?n.activeVersion:void 0,a=s[e],o=t[e].versions.find((e=>e.isLast));return l(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:u}}},12:(e,t,n)=>{"use strict";n.d(t,{W:()=>l,_:()=>s});const r="localStorage";function a(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,o||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),o=!0),null}var t}let o=!1;const i={get:()=>null,set:()=>{},del:()=>{}};function l(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t}}(e);const n=a(null==t?void 0:t.persistence);return null===n?i:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{n.setItem(e,t)}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{n.removeItem(e)}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}}}}function s(e){void 0===e&&(e=r);const t=a(e);if(!t)return[];const n=[];for(let r=0;r{"use strict";n.d(t,{l:()=>o});var r=n(2263),a=n(6775);function o(){const{siteConfig:{baseUrl:e,url:t},i18n:{defaultLocale:n,currentLocale:o}}=(0,r.Z)(),{pathname:i}=(0,a.TH)(),l=o===n?e:e.replace(`/${o}/`,"/"),s=i.replace(e,"");return{createUrl:function(e){let{locale:r,fullyQualified:a}=e;return`${a?t:""}${function(e){return e===n?`${l}`:`${l}${e}/`}(r)}${s}`}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),a=n(6775),o=n(902);function i(e){const t=(0,a.TH)(),n=(0,o.D9)(t),i=(0,o.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="post-content";var a=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}})},6010:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;ta});const a=function(){for(var e,t,n=0,a="";n{"use strict";n.d(t,{lX:()=>S,q_:()=>N,ob:()=>h,PP:()=>L,Ep:()=>m,Hp:()=>g});var r=n(7462);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),a=l(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var u=n(2177);function c(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function h(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.Z)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=h(e,t,f(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(9864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2497:(e,t,n)=>{"use strict";n.r(t)},6882:(e,t,n)=>{"use strict";n.r(t)},8049:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function u(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,o){for(var i,l,s=a(e),u=1;u{var r=n(5826);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var m=e[i],h=n[2],g=n[3],b=n[4],v=n[5],y=n[6],w=n[7];l&&(r.push(l),l="");var E=null!=h&&null!=m&&m!==h,k="+"===y||"*"===y,S="?"===y||"*"===y,_=n[2]||c,x=b||v;r.push({name:g||o++,prefix:h||"",delimiter:_,optional:S,repeat:k,partial:E,asterisk:!!w,pattern:x?u(x):w?".*":"[^"+s(_)+"]+?"})}}return i{"use strict";n.d(t,{Z:()=>o});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);S+=k.value.length,k=k.next){var _=k.value;if(t.length>e.length)return;if(!(_ instanceof a)){var x,T=1;if(v){if(!(x=o(E,S,e,b))||x.index>=e.length)break;var C=x.index,A=x.index+x[0].length,N=S;for(N+=k.value.length;C>=N;)N+=(k=k.next).value.length;if(S=N-=k.value.length,k.value instanceof a)continue;for(var O=k;O!==t.tail&&(Nd.reach&&(d.reach=R);var M=k.prev;if(I&&(M=s(t,M,I),S+=I.length),u(t,M,T),k=s(t,M,new a(f,g?r.tokenize(L,g):L,y,L)),P&&s(t,k,P),T>1){var D={cause:f+","+m,reach:R};i(e,t,n,k.prev,S,D),d&&D.reach>d.reach&&(d.reach=D.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function u(e,t,n){for(var r=t.next,a=0;a"+o.content+""},r}(),a=r;r.default=r,a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},a.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(a),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(a),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(a),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(a),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(a),a.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:a.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},a.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s=0&&p(u,"variable-input")}}}}function c(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var a={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(a.code,a.grammar),e.hooks.run("after-tokenize",a),a.tokens}function u(t){var n={};n["interpolation-punctuation"]=a;var o=e.tokenize(t,n);if(3===o.length){var i=[1,1];i.push.apply(i,s(o[1],e.languages.javascript,"javascript")),o.splice.apply(o,i)}return new e.Token("interpolation",o,r.alias,t)}function c(t,n,r){var a=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),i=0,c={},d=s(a.map((function(e){if("string"==typeof e)return e;for(var n,a=e.content;-1!==t.indexOf(n=l(i++,r)););return c[n]=a,n})).join(""),n,r),f=Object.keys(c);return i=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=f[i],o="string"==typeof r?r:r.content,l=o.indexOf(a);if(-1!==l){++i;var s=o.substring(0,l),d=u(c[a]),p=o.substring(l+a.length),m=[];if(s&&m.push(s),m.push(d),p){var h=[p];e(h),m.push.apply(m,h)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,a=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(a),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function o(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return a})),RegExp(e,t)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===i(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(a);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}a.content&&"string"!=typeof a.content&&l(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(a),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(a),a.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],f="string"==typeof u?u:u.content,p=t(r,c),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),b&&v.push.apply(v,i([b])),"string"==typeof u?l.splice.apply(l,[s,1].concat(v)):u.content=v}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(a),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(a),a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json,a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec,a.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python,a.languages.reason=a.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),a.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete a.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(a),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(a),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(a),a.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const o=a},7874:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i{Prism.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,inside:{type:{pattern:/(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+\{)/],property:[/[-\w\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:count|data|local|module|path|self|terraform|var)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,boolean:/\b(?:false|true)\b/i,punctuation:/[=\[\]{}]/}},3335:()=>{Prism.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Prism.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp(/\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source+"|"+/\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/.source+"|"+/\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/.source,"i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/}},366:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},767:()=>{!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,n=0;n<2;n++)t=t.replace(//g,(function(){return t}));t=t.replace(//g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)},9930:()=>{!function(e){var t=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function n(e){return e.replace(/__/g,(function(){return t}))}e.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(n(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(n(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}}(Prism)},3358:()=>{!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},6991:(e,t,n)=>{var r={"./prism-bash":7874,"./prism-hcl":4677,"./prism-log":3335,"./prism-python":366,"./prism-rust":767,"./prism-toml":9930,"./prism-yaml":3358};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6991},2703:(e,t,n)=>{"use strict";var r=n(414);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),a=n(7418),o=n(3840);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n