From 3bd6141d32feb86ae800d7aafa5ce71ab3ed4309 Mon Sep 17 00:00:00 2001 From: novalagung Date: Fri, 26 Jan 2024 05:54:17 +0000 Subject: [PATCH] deploy: 13be9331d9c8e99e0dfaef417dbbe9785af50ba7 --- 404.html | 4 ++-- CONTRIBUTING.html | 6 +++--- LICENSE.html | 6 +++--- assets/js/0ae704f7.27cb1279.js | 1 - assets/js/0ae704f7.5940e697.js | 1 + ...{runtime~main.4bc44724.js => runtime~main.d4337db1.js} | 2 +- basic/array.html | 6 +++--- basic/associated-function.html | 6 +++--- basic/attributes.html | 6 +++--- basic/basic-memory-management.html | 6 +++--- basic/block-expression.html | 6 +++--- basic/borrowing.html | 6 +++--- basic/build-dan-run-program-rust.html | 6 +++--- basic/closures.html | 6 +++--- basic/datetime.html | 6 +++--- basic/enum.html | 6 +++--- basic/file-path-directory.html | 6 +++--- basic/function.html | 6 +++--- basic/generics.html | 6 +++--- basic/hello-rust.html | 6 +++--- basic/komentar.html | 6 +++--- basic/konstanta.html | 6 +++--- basic/lifetime.html | 6 +++--- basic/method.html | 6 +++--- basic/module-basic.html | 6 +++--- basic/module-inline.html | 6 +++--- basic/module-scope-item-access.html | 6 +++--- basic/operator.html | 6 +++--- basic/option-type.html | 6 +++--- basic/ownership.html | 6 +++--- basic/package-crate.html | 6 +++--- basic/path-item.html | 6 +++--- basic/pattern-matching.html | 6 +++--- basic/perulangan-for-in.html | 6 +++--- basic/perulangan-loop-break-continue-label.html | 6 +++--- basic/perulangan-while.html | 6 +++--- basic/pointer-references.html | 8 ++++---- basic/result-type.html | 6 +++--- basic/seleksi-kondisi-if.html | 6 +++--- basic/shadowing.html | 6 +++--- basic/slice-memory-management.html | 6 +++--- basic/slice.html | 6 +++--- basic/static.html | 6 +++--- basic/string-slice-vs-string-literal.html | 6 +++--- basic/struct.html | 6 +++--- basic/tipe-data-custom-type-string-slice.html | 6 +++--- basic/tipe-data-primitive-scalar.html | 6 +++--- basic/tipe-data-string-literal.html | 6 +++--- basic/trait-function.html | 6 +++--- basic/trait-iterator.html | 6 +++--- basic/traits.html | 6 +++--- basic/tuple.html | 6 +++--- basic/type-alias-casting.html | 6 +++--- basic/use.html | 6 +++--- basic/variabel.html | 6 +++--- basic/vector.html | 6 +++--- basic/visibility-privacy.html | 6 +++--- download-pdf.html | 6 +++--- index.html | 6 +++--- installation/instalasi-rust.html | 6 +++--- installation/rust-editor-plugin.html | 6 +++--- intro.html | 6 +++--- pengelanan-rust-programming.html | 6 +++--- search.html | 4 ++-- 64 files changed, 184 insertions(+), 184 deletions(-) delete mode 100644 assets/js/0ae704f7.27cb1279.js create mode 100644 assets/js/0ae704f7.5940e697.js rename assets/js/{runtime~main.4bc44724.js => runtime~main.d4337db1.js} (99%) diff --git a/404.html b/404.html index d479a72b..c68a2001 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 47abe0d2..4b3701b2 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. Fal
  4. Fredianto
  5. I Putu Saputrayana
  6. Khisby Al Ghofari
  7. Lori
  8. M. Zakiyuddin Munziri
  9. Opa Kholis Majid
  10. Rian
  11. Shandy Siswandi
  12. Theis Andatu
  13. ... 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 74a0168b..256ffc87 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

- + \ No newline at end of file diff --git a/assets/js/0ae704f7.27cb1279.js b/assets/js/0ae704f7.27cb1279.js deleted file mode 100644 index 9090203e..00000000 --- a/assets/js/0ae704f7.27cb1279.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2089],{3905:(e,a,n)=>{n.d(a,{Zo:()=>o,kt:()=>k});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 m=t.createContext({}),u=function(e){var a=t.useContext(m),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},o=function(e){var a=u(e.components);return t.createElement(m.Provider,{value:a},e.children)},d={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},b=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,i=e.originalType,m=e.parentName,o=p(e,["components","mdxType","originalType","parentName"]),b=u(n),k=r,s=b["".concat(m,".").concat(k)]||b[k]||d[k]||i;return n?t.createElement(s,l(l({ref:a},o),{},{components:n})):t.createElement(s,l({ref:a},o))}));function k(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=b;var p={};for(var m in a)hasOwnProperty.call(a,m)&&(p[m]=a[m]);p.originalType=e,p.mdxType="string"==typeof e?e:r,l[1]=p;for(var u=2;u{n.r(a),n.d(a,{assets:()=>m,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>u});var t=n(7462),r=(n(7294),n(3905));const i={sidebar_position:33,title:"A.33. Pointer & References",sidebar_label:"A.33. Pointer & References"},l=void 0,p={unversionedId:"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.",source:"@site/docs/basic/pointer-references.md",sourceDirName:"basic",slug:"/basic/pointer-references",permalink:"/basic/pointer-references",draft:!1,tags:[],version:"current",sidebarPosition:33,frontMatter:{sidebar_position:33,title:"A.33. Pointer & References",sidebar_label:"A.33. Pointer & References"},sidebar:"tutorialSidebar",previous:{title:"A.32. Basic Memory Management",permalink:"/basic/basic-memory-management"},next:{title:"A.34. Ownership",permalink:"/basic/ownership"}},m={},u=[{value:"A.33.1. Pointer",id:"a331-pointer",level:2},{value:"A.33.2. Reference (operator &)",id:"a332-reference-operator-",level:2},{value:"A.33.3. Dereference (operator *)",id:"a333-dereference-operator-",level:2},{value:"A.33.4. Mutable References (operator &mut)",id:"a334-mutable-references-operator-mut",level:2},{value:"A.33.5. Aturan Reference",id:"a335-aturan-reference",level:2},{value:"A.33.6. Karakteristik pointer & reference",id:"a336-karakteristik-pointer--reference",level:2},{value:"\u25c9 Contoh ke-1",id:"-contoh-ke-1",level:3},{value:"\u25c9 Contoh ke-2",id:"-contoh-ke-2",level:3},{value:"A.33.7. Reference & borrowing",id:"a337-reference--borrowing",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}],o={toc:u};function d(e){let{components:a,...i}=e;return(0,r.kt)("wrapper",(0,t.Z)({},o,i,{components:a,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"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."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Penulis tekankan bahwa ",(0,r.kt)("strong",{parentName:"p"},"pada chapter ini, konsep reference yang dibahas adalah dalam konteks programming secara general.")," Tidak dari sudut pandang ownership.")),(0,r.kt)("p",null,"Reference pada Rust memiliki keunikan, tapi kita akan bahas itu secara terpisah pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),". Untuk sekarang silakan ikuti terlebih dahulu pembahasan chapter-per-chapter secara berurutan."),(0,r.kt)("h2",{id:"a331-pointer"},"A.33.1. Pointer"),(0,r.kt)("p",null,"Pointer artinya adalah alamat memori. Variabel pointer artinya adalah variabel yang berisi alamat memory (hanya alamat memory-nya saja, bukan value yang sebenarnya)."),(0,r.kt)("p",null,"Di Rust, variabel pointer ditandai dengan adanya karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," pada tipe data. Sebagai contoh ",(0,r.kt)("inlineCode",{parentName:"p"},"&i32")," artinya adalah tipe data pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),". Contoh lain adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"&bool")," yang merupakan tipe data pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Ada dua jenis tipe pointer di Rust programming, yaitu smart pointer dan raw pointer. Pada chapter ini kita tidak membahasnya karena termasuk topik yang cukup advance. Pembahasan akan ada pada chapter terpisah ",(0,r.kt)("a",{parentName:"p",href:"#/wip/smart-pointer-raw-pointer"},"Smart Pointer vs Raw Pointer"),".")),(0,r.kt)("h2",{id:"a332-reference-operator-"},"A.33.2. Reference (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"&"),")"),(0,r.kt)("p",null,"Ok, selanjutnya apa itu ",(0,r.kt)("em",{parentName:"p"},"reference"),"? Istilah ini sudah beberapa kali disinggung pada chapter sebelum-sebelumnya."),(0,r.kt)("p",null,"Reference artinya adalah pointer dari sebuah variabel atau data. Operasi pengambilan pointer dari variabel disebut dengan ",(0,r.kt)("em",{parentName:"p"},"referencing"),", caranya dilakukan dengan menggunakan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"&"),"."),(0,r.kt)("p",null,"O iya, semua jenis variabel bisa diambil nilai pointernya. Contohnya bisa dilihat berikut ini:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let number: i32 = 24;\nprintln!("value: {:?}", number);\n\nlet pointer_number: &i32 = &number;\nprintln!("pointer: {:p}", pointer_number);\n')),(0,r.kt)("p",null,"Pada contoh di atas, sebuah variabel dideklarasikan bernama ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," dengan tipe data adalah numerik dan value ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),". Variabel tersebut jika di-print akan muncul nilainya, yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),"."),(0,r.kt)("p",null,"Ada satu lagi variabel yang dideklarasikan yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number"),", yang nilainya adalah ",(0,r.kt)("em",{parentName:"p"},"reference")," dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Cara pengambilan reference yabng dilihat pada contoh, yaitu dengan menambahkan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," pada variabel yang ingin dimabil pointernya."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// variabel pointer_number nilainya adalah reference variabel number.\n// contoh statement:\nlet pointer_number_1 = &number;\nlet pointer_number_2: &i32 = &number;\n")),(0,r.kt)("p",null,"By default, ketika variabel pointer di print, yang muncul adalah ",(0,r.kt)("em",{parentName:"p"},"underlying value")," atau nilai sebenarnya, yang pada contoh di atas adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),". Untuk menampilkan alamat memory gunakan formatted print ",(0,r.kt)("inlineCode",{parentName:"p"},"{:p}"),"."),(0,r.kt)("p",null,"Coba jalankan program kemudian lihat hasilnya. Value muncul sesuai dengan yang ditulis, sedangkan pointer memunculkan data alamat memory yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"0xa3bbeff6dc"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"pointer & reference",src:n(1007).Z,width:"494",height:"320"})),(0,r.kt)("p",null,"Seperti yang sudah dijelaskan di awal bahwa variabel pointer isinya adalah alamat memory. Penulisannya dalam notasi heksadesimal diawali dengan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"0x"),". Contohnya adalah nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"0xa3bbeff6dc")," yang merupakan alamat memory, yang alamat tersebut adalah reference ke pemilik data sebenarnya (yaitu variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),")."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Di environment lokal masing-masing, alamat memory yang muncul sangat mungkin berbeda karena alokasi adalah random")),(0,r.kt)("h2",{id:"a333-dereference-operator-"},"A.33.3. Dereference (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"*"),")"),(0,r.kt)("p",null,"Kita sudah belajar cara mengambil data pointer dari sebuah variabel. Pada bagian ini kita belajar cara mengambil nilai sebenarnya atau underlying value dari sebuah pointer (istilahnya adalah ",(0,r.kt)("em",{parentName:"p"},"dereference"),")."),(0,r.kt)("p",null,"Cara melakukan operasi ",(0,r.kt)("em",{parentName:"p"},"dereferencing")," adalah dengan menambahkan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"*")," pada variabel pointer. Contohnya seperti berikut, silakan tambahkan kode ini ke program yang sudah ditulis."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'// variabel underlying_value nilainya adalah nilai sebenarnya dari pointer pointer_number\nlet underlying_value = *pointer_number;\nprintln!("value: {:}", underlying_value);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Dereference",src:n(6356).Z,width:"467",height:"412"})),(0,r.kt)("p",null,"Bisa dilihat, nilai dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"underlying_value")," adalah nilai sebenarnya dari pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number"),", yang pastinya adalah sama dengan nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),"."),(0,r.kt)("h2",{id:"a334-mutable-references-operator-mut"},"A.33.4. Mutable References (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"&mut"),")"),(0,r.kt)("p",null,"By default, reference sifatnya ",(0,r.kt)("em",{parentName:"p"},"read-only")," atau ",(0,r.kt)("em",{parentName:"p"},"immutable"),", artinya tidak bisa diubah ",(0,r.kt)("em",{parentName:"p"},"underlying-value"),"-nya."),(0,r.kt)("p",null,"Jika ada variabel (sebut saja X) yang merupakan underlying value dari reference variabel lain, maka perubahan value pada variabel X tersebut ",(0,r.kt)("em",{parentName:"p"},"default"),"-nya menghasilkan error."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let mut number = 24;\nprintln!("number: {}", number);\n\nlet pointer_number = &number;\nprintln!("pointer_number: {:p}", pointer_number);\n\n*pointer_number = 12;\n\nprintln!("*pointer_number: {}", *pointer_number);\nprintln!("number: {}", number);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(8992).Z,width:"715",height:"343"})),(0,r.kt)("p",null,"Pada gambar di atas bisa dilihat, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," merupakan reference dari variabel mutable ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Setelahnya ada statement ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number = 12"),", yang artinya adalah underlying value dari variabel pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," diakses kemudian di-isi nilainya dengan angka ",(0,r.kt)("inlineCode",{parentName:"p"},"12"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number = 12")," tidak menghasilkan error, dan statement ini berbeda dengan ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number = 12"),"."),(0,r.kt)("p",{parentName:"blockquote"},"Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number = 12")," menghasilkan error karena ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," adalah variabel bertipe ",(0,r.kt)("strong",{parentName:"p"},"pointer ",(0,r.kt)("inlineCode",{parentName:"strong"},"i32")," atau ",(0,r.kt)("inlineCode",{parentName:"strong"},"&i32")," (bukan ",(0,r.kt)("inlineCode",{parentName:"strong"},"i32"),")"),". Jika ingin mengubah nilainya perlu mengakses dulu underlying value-nya menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number"),".")),(0,r.kt)("p",null,"Ok, lalu kenapa muncul error? Di gambar terlihat ada garis merah dan popup pesan error muncul, padahal tidak ada yang salah dengan statement-nya."),(0,r.kt)("p",null,"Penyebab erronya bukan dari statement tersebut, tetapi pada baris statement pengambilan reference variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"&number")," artinya adalah mengambil reference dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Di atas sempat kita bahas bahwa ",(0,r.kt)("em",{parentName:"p"},"by default")," sebuah reference tidak bisa diubah nilainya (",(0,r.kt)("em",{parentName:"p"},"immutable"),"), dan ini adalah penyebab error yang dialami."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Silakan perhatikan pesan di popup error message agar mudah untuk tau dimana sumber masalahnya.")),(0,r.kt)("p",null,"Perubahan isi nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," tidak menghasilkan error, hal ini karena number adalah variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," adalah mutable. Sedangkan operasi perubahan nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number")," pada contoh di atas, dianggap sebagai error karena variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," reference-nya adalah bukan mutable (meskipun reference diperoleh dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," yang notabene mutable)."),(0,r.kt)("p",null,"Solusi dari error di atas adalah menerapkan ",(0,r.kt)("strong",{parentName:"p"},"mutable reference"),". Mutable reference sama seperti reference biasa tetapi nilainya diperbolehkan untuk diubah (mutable). Caranya pengaksesan mutable reference dilakukan menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut"),"."),(0,r.kt)("p",null,"Ok, sekarang ubah statement berikut ini, lalu jalankan program:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// before\nlet pointer_number = &number;\n\n// after\nlet pointer_number = &mut number;\n")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(5127).Z,width:"488",height:"417"})),(0,r.kt)("p",null,"Deklarasi variable pointer yang menampung mutable reference bisa via metode penulisan ",(0,r.kt)("em",{parentName:"p"},"manifest typing")," atau ",(0,r.kt)("em",{parentName:"p"},"type inference"),". Pada contoh berikut, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," tipe data-nya adalah mutable reference ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),", maka penulisan tipe data adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut i32"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// type inference\nlet pointer_number = &mut number;\n\n// manifest typing\nlet pointer_number: &mut i32 = &mut number;\n")),(0,r.kt)("p",null,"Pada contoh ini kita menggunakan tipe data primitif, lalu bagaimana dengan tipe data non-primitive seperti custom type struct atau ",(0,r.kt)("inlineCode",{parentName:"p"},"String"),", apakah penerapan mutable reference juga sama? Jawabannya tidak. Ada beberapa perbedaan dan nantinya kita akan bahas secara detail pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),". Untuk sekarang, dianjurkan mengikuti pembahasan chapter per chapter secara urut."),(0,r.kt)("h2",{id:"a335-aturan-reference"},"A.33.5. Aturan Reference"),(0,r.kt)("p",null,"Ada dua aturan penting yang harus dipatuhi dalam penerapan reference baik mutable atau immutable reference."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Dalam waktu yang sama, hanya boleh ada satu mutable reference atau banyak immutable reference (keduanya tidak bisa bersamaan, harus salah satu)."),(0,r.kt)("li",{parentName:"ul"},"Reference harus selalu valid.")),(0,r.kt)("p",null,"Mengenai penjelasan tentang dua aturan penting di atas akan bahas pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),"."),(0,r.kt)("h2",{id:"a336-karakteristik-pointer--reference"},"A.33.6. Karakteristik pointer & reference"),(0,r.kt)("p",null,"Kita sudah belajar tentang definisi beserta cara penerapan pointer, reference, dereference, dan mutable reference. Sekarang lanjut ke pembahasan tentang karakteristik dari pointer & reference."),(0,r.kt)("p",null,"Pointer merupakan variabel yang isinya adalah alamat memory (bukan nilai sebenarnya). Dan reference adalah alamat memory suatu data/variabel. Dengan menerapkan keduanya kita bisa menerapkan efisiensi penggunaan memory yang dampaknya sangat positif terhadap performa program."),(0,r.kt)("p",null,"Sekarang perhatikan statement berikut:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"let number_one = 24;\nlet number_two = number_one;\n")),(0,r.kt)("p",null,"Variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," adalah data numerik bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),", eksekusi statement tersebut menghasilkan alokasi memori selebar 32-bit."),(0,r.kt)("p",null,"Kemudian ada lagi statement ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),". Meskipun nilainya didapat dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),", yang terjadi di balik layar adalah Rust akan mengalokasikan lagi alamat memory selebar 32-bit untuk menampung data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two")," yang didapat dari hasil operasi ",(0,r.kt)("strong",{parentName:"p"},"copy")," dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Semua variabel primitif di Rust mengadopsi ",(0,r.kt)("em",{parentName:"p"},"copy semantics"),", yang artinya jika variabel tersebut digunakan dalam statement assignment, maka nilai akan di-duplikasi untuk kemudian ditampung pada variabel baru."),(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,r.kt)("em",{parentName:"p"},"copy semantics")," dibahas pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/ownership#a334-copy-semantics-vs-move-semantics"},"Ownership"),".")),(0,r.kt)("p",null,"Selanjutnya, bandingkan dengan statement berikut:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"let number_one = 24;\nlet number_two = &number_one;\n")),(0,r.kt)("p",null,"Pada contoh di atas, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," datanya disimpan di memory dengan lebar 32-bit (masih sama seperti contoh sebelumnya). Namun ada yang berbeda dengan dengan variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),", variabel ini adalah variabel pointer yang nilainya reference ke alamat memory data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),". Yang terjadi di belakang layar, Rust tidak mengalokasikan lagi memory selebar 32-bit untuk menampung data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),", melainkan menggunakan alamat memory data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," sebagai reference, menjadikannya sebagai alamat tujuan variabel pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),"."),(0,r.kt)("p",null,"Ok, lanjut. Per sekarang, reference variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two")," adalah sama. Dengan ini, jika dicontohkan isi data satu variabel diubah, maka variabel lainnya juga akan berubah, hal karena reference-nya adalah sama."),(0,r.kt)("h3",{id:"-contoh-ke-1"},"\u25c9 Contoh ke-1"),(0,r.kt)("p",null,"Contoh penerapannya bisa kita lihat pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/pointer-references#a315-karakteristik-pointer--reference"},"Pointer & References")," chapter ini, disitu bisa dilihat ada variabel mutable ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," yang reference-nya adalah sama dengan variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Ketika underlying value ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," diubah (dari ",(0,r.kt)("inlineCode",{parentName:"p"},"24")," ke ",(0,r.kt)("inlineCode",{parentName:"p"},"12"),"), isi data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," juga berubah."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(5127).Z,width:"488",height:"417"})),(0,r.kt)("h3",{id:"-contoh-ke-2"},"\u25c9 Contoh ke-2"),(0,r.kt)("p",null,"Agar makin familiar dengan cara penerapan pointer & reference, silakan lanjut dengan praktik program berikut:"),(0,r.kt)("pre",null,(0,r.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 \u2514\u2500\u2500\u2500 main.rs\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="Cargo.toml"',title:'"Cargo.toml"'},'# ...\n\n[dependencies]\nrand = "0.8.5"\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="main.rs"',title:'"main.rs"'},'use rand::Rng;\n\nfn main() {\n let mut number = 24;\n println!("number: {}", number);\n\n for _ in 0..=5 {\n change_value(&mut number);\n println!("number: {}", number);\n }\n}\n\nfn change_value(n: &mut i32) {\n *n = generate_random_number()\n}\n\nfn generate_random_number() -> i32 {\n rand::thread_rng().gen_range(0..100)\n}\n')),(0,r.kt)("p",null,"Pada sederhana di atas, ada sebuah variable mutable bernama ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," yang dideklarasikan. Variabel tersebut kemudian diakses ",(0,r.kt)("em",{parentName:"p"},"mutable reference"),"-nya untuk dijadikan argumen statement pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value"),"."),(0,r.kt)("p",null,"Di dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value"),", disiapkan 1 buah angka random hasil pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"generate_random_number"),", yang angka tersebut kemudian dijadikan sebagai nilai baru variable mutable reference yang mengarah ke ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Perubahan dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value")," akan mempengaruhi data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),", karena reference-nya adalah sama."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(3319).Z,width:"457",height:"204"})),(0,r.kt)("h2",{id:"a337-reference--borrowing"},"A.33.7. Reference & borrowing"),(0,r.kt)("p",null,"Di Rust, reference (atau pengaksesan alamat memory suatu data) memiliki hubungan yang sangat erat dengan konsep ",(0,r.kt)("strong",{parentName:"p"},"borrowing"),"."),(0,r.kt)("p",null,"Ketika kita mengambil reference suatu data, yang terjadi sebenarnya adalah kita meminjam data tersebut dari owner/pemilik sebenarnya."),(0,r.kt)("p",null,"Pada chapter ini kita tidak akan membahasnya lebih jauh lagi, karena akan ada chapter lain yang fokus mengulas topik tersebut secara detail, yaitu chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),"."),(0,r.kt)("p",null,"Untuk sekarang penulis anjurkan untuk lanjut ke chapter berikutnya secara urut."),(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/pointer_references"},"github.com/novalagung/dasarpemrogramanrust-example/../pointer_references")),(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/ch04-02-references-and-borrowing.html"},"https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/marker/trait.Copy.html"},"https://doc.rust-lang.org/std/marker/trait.Copy.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://en.wikipedia.org/wiki/Reference_(computer_science)"},"https://en.wikipedia.org/wiki/Reference_(computer_science)")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://progressivecoder.com/understanding-rust-ownership-and-borrowing-with-examples/"},"https://progressivecoder.com/understanding-rust-ownership-and-borrowing-with-examples/")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://os.phil-opp.com/heap-allocation/"},"https://os.phil-opp.com/heap-allocation/"))))}d.isMDXComponent=!0},1007:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-1-f103aebf5517db2d9de53c1fe39be319.png"},6356:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-2-8fdb7f20f15717b7d97311d81ffe005d.png"},8992:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-3-7b60c4bdc0392eb962187ee76ac2ab54.png"},5127:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-4-ba178a14defb70eb04b45ce050af0e6e.png"},3319:(e,a,n)=>{n.d(a,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAckAAADMCAIAAACX588hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAGdWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGF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Vh6EGtqAUAcBNx61be2HmgKkpC2AoArWtra97YImj1/QQA0Ii2NumNLRRbuWUDADSgrQAAgLYCAKCtAABoKwAAoK0AAGgrAADaCgAAV9NWzKcAAG09vLamhiyJdQEqDwBo6wxd7RxkY23lS1cAaFBbj+KN/ePXYFWAtgLAEbT1SN7YaCsAHEZbD+SNnWsro60AcOvaur83dhKAI68AcJtx67be2DULV7QVABrX1ga9sUvaStgKAM1ra4Pe2NlAw2WWgsgcAODa2goAAGgrAADaCgCAtgIAANoKAIC2AgCgrQAAcDVt5WMoAEBbj6ytg49h+J2B3AgAgLbOyzP7CqtgNAAAsLu2HsUbOwlhcxldxQoGAGA1bT2SNzbSCgCH0daDeGOPsXCwp9wIAHBL2rq9N3YSC9c2AgDcRty6sTd2IeplOhgAHEBb2/TGHocefng2AgA0pK2te2OHas78VgBoUFsBAABtBQBAWwEA0FYAAEBbAQDQVgAAtBUAAK6mrXwMBQBo67G1VRhhJ9YFqDwAoK3zMxq+b+3dZ2lmAGhNW4/ijR19MTucH9oKAM1q6zG8scdEgRUM2goA7WrrQbyxB3mOA1hGWwHgxrV1S2/sUZo7hZXe2MgrANxo3LqRN3ayqoAya2U6GAAcQFvb8saODxkNLxC2AsBBtLVBb+x4euv5QGEuvNMCgIa0FQAA0FYAALQVAABtBQAAtBUAAG0FAEBbAQDgatrKx1AAgLYeXlullYD2FwAAQFuduto5yIYyKjcCAFxbW4/jjT1YFYTGr2IjAEAT2noMb+xTcrjaRgCAK2vrYbyx0VYAeInauqU3NtoKAC84bt3IGxttBYDb0Na2vLHRVgA4vrY26I2dDTRcZinkgw8AAFfXVgAAQFsBANBWAAC0FQAA0FYAALQVAABtBQAAtBUAAG0FAEBbAQAg4v9FZVTogLiptQAAAABJRU5ErkJggg=="}}]); \ No newline at end of file diff --git a/assets/js/0ae704f7.5940e697.js b/assets/js/0ae704f7.5940e697.js new file mode 100644 index 00000000..850fceca --- /dev/null +++ b/assets/js/0ae704f7.5940e697.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdasarpemrogramanrust=self.webpackChunkdasarpemrogramanrust||[]).push([[2089],{3905:(e,a,n)=>{n.d(a,{Zo:()=>o,kt:()=>k});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 m=t.createContext({}),u=function(e){var a=t.useContext(m),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},o=function(e){var a=u(e.components);return t.createElement(m.Provider,{value:a},e.children)},d={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},b=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,i=e.originalType,m=e.parentName,o=p(e,["components","mdxType","originalType","parentName"]),b=u(n),k=r,s=b["".concat(m,".").concat(k)]||b[k]||d[k]||i;return n?t.createElement(s,l(l({ref:a},o),{},{components:n})):t.createElement(s,l({ref:a},o))}));function k(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=b;var p={};for(var m in a)hasOwnProperty.call(a,m)&&(p[m]=a[m]);p.originalType=e,p.mdxType="string"==typeof e?e:r,l[1]=p;for(var u=2;u{n.r(a),n.d(a,{assets:()=>m,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>u});var t=n(7462),r=(n(7294),n(3905));const i={sidebar_position:33,title:"A.33. Pointer & References",sidebar_label:"A.33. Pointer & References"},l=void 0,p={unversionedId:"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.",source:"@site/docs/basic/pointer-references.md",sourceDirName:"basic",slug:"/basic/pointer-references",permalink:"/basic/pointer-references",draft:!1,tags:[],version:"current",sidebarPosition:33,frontMatter:{sidebar_position:33,title:"A.33. Pointer & References",sidebar_label:"A.33. Pointer & References"},sidebar:"tutorialSidebar",previous:{title:"A.32. Basic Memory Management",permalink:"/basic/basic-memory-management"},next:{title:"A.34. Ownership",permalink:"/basic/ownership"}},m={},u=[{value:"A.33.1. Pointer",id:"a331-pointer",level:2},{value:"A.33.2. Reference (operator &)",id:"a332-reference-operator-",level:2},{value:"A.33.3. Dereference (operator *)",id:"a333-dereference-operator-",level:2},{value:"A.33.4. Mutable References (operator &mut)",id:"a334-mutable-references-operator-mut",level:2},{value:"A.33.5. Aturan Reference",id:"a335-aturan-reference",level:2},{value:"A.33.6. Karakteristik pointer & reference",id:"a336-karakteristik-pointer--reference",level:2},{value:"\u25c9 Contoh ke-1",id:"-contoh-ke-1",level:3},{value:"\u25c9 Contoh ke-2",id:"-contoh-ke-2",level:3},{value:"A.33.7. Reference & borrowing",id:"a337-reference--borrowing",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}],o={toc:u};function d(e){let{components:a,...i}=e;return(0,r.kt)("wrapper",(0,t.Z)({},o,i,{components:a,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"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."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Penulis tekankan bahwa ",(0,r.kt)("strong",{parentName:"p"},"pada chapter ini, konsep reference yang dibahas adalah dalam konteks programming secara general.")," Tidak dari sudut pandang ownership.")),(0,r.kt)("p",null,"Reference pada Rust memiliki keunikan, tapi kita akan bahas itu secara terpisah pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),". Untuk sekarang silakan ikuti terlebih dahulu pembahasan chapter-per-chapter secara berurutan."),(0,r.kt)("h2",{id:"a331-pointer"},"A.33.1. Pointer"),(0,r.kt)("p",null,"Pointer artinya adalah alamat memori. Variabel pointer artinya adalah variabel yang berisi alamat memory (hanya alamat memory-nya saja, bukan value yang sebenarnya)."),(0,r.kt)("p",null,"Di Rust, variabel pointer ditandai dengan adanya karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," pada tipe data. Sebagai contoh ",(0,r.kt)("inlineCode",{parentName:"p"},"&i32")," artinya adalah tipe data pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),". Contoh lain adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"&bool")," yang merupakan tipe data pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"bool"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Ada dua jenis tipe pointer di Rust programming, yaitu smart pointer dan raw pointer. Pada chapter ini kita tidak membahasnya karena termasuk topik yang cukup advance. Pembahasan akan ada pada chapter terpisah ",(0,r.kt)("a",{parentName:"p",href:"#/wip/smart-pointer-raw-pointer"},"Smart Pointer vs Raw Pointer"),".")),(0,r.kt)("h2",{id:"a332-reference-operator-"},"A.33.2. Reference (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"&"),")"),(0,r.kt)("p",null,"Ok, selanjutnya apa itu ",(0,r.kt)("em",{parentName:"p"},"reference"),"? Istilah ini sudah beberapa kali disinggung pada chapter sebelum-sebelumnya."),(0,r.kt)("p",null,"Reference artinya adalah pointer dari sebuah variabel atau data. Operasi pengambilan pointer dari variabel disebut dengan ",(0,r.kt)("em",{parentName:"p"},"referencing"),", caranya dilakukan dengan menggunakan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"&"),"."),(0,r.kt)("p",null,"O iya, semua jenis variabel bisa diambil nilai pointernya. Contohnya bisa dilihat berikut ini:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let number: i32 = 24;\nprintln!("value: {:?}", number);\n\nlet pointer_number: &i32 = &number;\nprintln!("pointer: {:p}", pointer_number);\n')),(0,r.kt)("p",null,"Pada contoh di atas, sebuah variabel dideklarasikan bernama ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," dengan tipe data adalah numerik dan value ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),". Variabel tersebut jika di-print akan muncul nilainya, yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),"."),(0,r.kt)("p",null,"Ada satu lagi variabel yang dideklarasikan yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number"),", yang nilainya adalah ",(0,r.kt)("em",{parentName:"p"},"reference")," dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Cara pengambilan reference yang dilihat pada contoh, yaitu dengan menambahkan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"&")," pada variabel yang ingin dimabil pointernya."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// variabel pointer_number nilainya adalah reference variabel number.\n// contoh statement:\nlet pointer_number_1 = &number;\nlet pointer_number_2: &i32 = &number;\n")),(0,r.kt)("p",null,"By default, ketika variabel pointer di print, yang muncul adalah ",(0,r.kt)("em",{parentName:"p"},"underlying value")," atau nilai sebenarnya, yang pada contoh di atas adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"24"),". Untuk menampilkan alamat memory gunakan formatted print ",(0,r.kt)("inlineCode",{parentName:"p"},"{:p}"),"."),(0,r.kt)("p",null,"Coba jalankan program kemudian lihat hasilnya. Value muncul sesuai dengan yang ditulis, sedangkan pointer memunculkan data alamat memory yaitu ",(0,r.kt)("inlineCode",{parentName:"p"},"0xa3bbeff6dc"),"."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"pointer & reference",src:n(1007).Z,width:"494",height:"320"})),(0,r.kt)("p",null,"Seperti yang sudah dijelaskan di awal bahwa variabel pointer isinya adalah alamat memory. Penulisannya dalam notasi heksadesimal diawali dengan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"0x"),". Contohnya adalah nilai ",(0,r.kt)("inlineCode",{parentName:"p"},"0xa3bbeff6dc")," yang merupakan alamat memory, yang alamat tersebut adalah reference ke pemilik data sebenarnya (yaitu variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),")."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Di environment lokal masing-masing, alamat memory yang muncul sangat mungkin berbeda karena alokasi adalah random")),(0,r.kt)("h2",{id:"a333-dereference-operator-"},"A.33.3. Dereference (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"*"),")"),(0,r.kt)("p",null,"Kita sudah belajar cara mengambil data pointer dari sebuah variabel. Pada bagian ini kita belajar cara mengambil nilai sebenarnya atau underlying value dari sebuah pointer (istilahnya adalah ",(0,r.kt)("em",{parentName:"p"},"dereference"),")."),(0,r.kt)("p",null,"Cara melakukan operasi ",(0,r.kt)("em",{parentName:"p"},"dereferencing")," adalah dengan menambahkan karakter ",(0,r.kt)("inlineCode",{parentName:"p"},"*")," pada variabel pointer. Contohnya seperti berikut, silakan tambahkan kode ini ke program yang sudah ditulis."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'// variabel underlying_value nilainya adalah nilai sebenarnya dari pointer pointer_number\nlet underlying_value = *pointer_number;\nprintln!("value: {:}", underlying_value);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Dereference",src:n(6356).Z,width:"467",height:"412"})),(0,r.kt)("p",null,"Bisa dilihat, nilai dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"underlying_value")," adalah nilai sebenarnya dari pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number"),", yang pastinya adalah sama dengan nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),"."),(0,r.kt)("h2",{id:"a334-mutable-references-operator-mut"},"A.33.4. Mutable References (operator ",(0,r.kt)("inlineCode",{parentName:"h2"},"&mut"),")"),(0,r.kt)("p",null,"By default, reference sifatnya ",(0,r.kt)("em",{parentName:"p"},"read-only")," atau ",(0,r.kt)("em",{parentName:"p"},"immutable"),", artinya tidak bisa diubah ",(0,r.kt)("em",{parentName:"p"},"underlying-value"),"-nya."),(0,r.kt)("p",null,"Jika ada variabel (sebut saja X) yang merupakan underlying value dari reference variabel lain, maka perubahan value pada variabel X tersebut ",(0,r.kt)("em",{parentName:"p"},"default"),"-nya menghasilkan error."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},'let mut number = 24;\nprintln!("number: {}", number);\n\nlet pointer_number = &number;\nprintln!("pointer_number: {:p}", pointer_number);\n\n*pointer_number = 12;\n\nprintln!("*pointer_number: {}", *pointer_number);\nprintln!("number: {}", number);\n')),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(8992).Z,width:"715",height:"343"})),(0,r.kt)("p",null,"Pada gambar di atas bisa dilihat, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," merupakan reference dari variabel mutable ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Setelahnya ada statement ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number = 12"),", yang artinya adalah underlying value dari variabel pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," diakses kemudian di-isi nilainya dengan angka ",(0,r.kt)("inlineCode",{parentName:"p"},"12"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number = 12")," tidak menghasilkan error, dan statement ini berbeda dengan ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number = 12"),"."),(0,r.kt)("p",{parentName:"blockquote"},"Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number = 12")," menghasilkan error karena ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," adalah variabel bertipe ",(0,r.kt)("strong",{parentName:"p"},"pointer ",(0,r.kt)("inlineCode",{parentName:"strong"},"i32")," atau ",(0,r.kt)("inlineCode",{parentName:"strong"},"&i32")," (bukan ",(0,r.kt)("inlineCode",{parentName:"strong"},"i32"),")"),". Jika ingin mengubah nilainya perlu mengakses dulu underlying value-nya menggunakan ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number"),".")),(0,r.kt)("p",null,"Ok, lalu kenapa muncul error? Di gambar terlihat ada garis merah dan popup pesan error muncul, padahal tidak ada yang salah dengan statement-nya."),(0,r.kt)("p",null,"Penyebab erronya bukan dari statement tersebut, tetapi pada baris statement pengambilan reference variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Statement ",(0,r.kt)("inlineCode",{parentName:"p"},"&number")," artinya adalah mengambil reference dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Di atas sempat kita bahas bahwa ",(0,r.kt)("em",{parentName:"p"},"by default")," sebuah reference tidak bisa diubah nilainya (",(0,r.kt)("em",{parentName:"p"},"immutable"),"), dan ini adalah penyebab error yang dialami."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Silakan perhatikan pesan di popup error message agar mudah untuk tau dimana sumber masalahnya.")),(0,r.kt)("p",null,"Perubahan isi nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," tidak menghasilkan error, hal ini karena number adalah variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," adalah mutable. Sedangkan operasi perubahan nilai variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"*pointer_number")," pada contoh di atas, dianggap sebagai error karena variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," reference-nya adalah bukan mutable (meskipun reference diperoleh dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," yang notabene mutable)."),(0,r.kt)("p",null,"Solusi dari error di atas adalah menerapkan ",(0,r.kt)("strong",{parentName:"p"},"mutable reference"),". Mutable reference sama seperti reference biasa tetapi nilainya diperbolehkan untuk diubah (mutable). Caranya pengaksesan mutable reference dilakukan menggunakan operator ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut"),"."),(0,r.kt)("p",null,"Ok, sekarang ubah statement berikut ini, lalu jalankan program:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// before\nlet pointer_number = &number;\n\n// after\nlet pointer_number = &mut number;\n")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(5127).Z,width:"488",height:"417"})),(0,r.kt)("p",null,"Deklarasi variable pointer yang menampung mutable reference bisa via metode penulisan ",(0,r.kt)("em",{parentName:"p"},"manifest typing")," atau ",(0,r.kt)("em",{parentName:"p"},"type inference"),". Pada contoh berikut, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," tipe data-nya adalah mutable reference ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),", maka penulisan tipe data adalah ",(0,r.kt)("inlineCode",{parentName:"p"},"&mut i32"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"// type inference\nlet pointer_number = &mut number;\n\n// manifest typing\nlet pointer_number: &mut i32 = &mut number;\n")),(0,r.kt)("p",null,"Pada contoh ini kita menggunakan tipe data primitif, lalu bagaimana dengan tipe data non-primitive seperti custom type struct atau ",(0,r.kt)("inlineCode",{parentName:"p"},"String"),", apakah penerapan mutable reference juga sama? Jawabannya tidak. Ada beberapa perbedaan dan nantinya kita akan bahas secara detail pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),". Untuk sekarang, dianjurkan mengikuti pembahasan chapter per chapter secara urut."),(0,r.kt)("h2",{id:"a335-aturan-reference"},"A.33.5. Aturan Reference"),(0,r.kt)("p",null,"Ada dua aturan penting yang harus dipatuhi dalam penerapan reference baik mutable atau immutable reference."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Dalam waktu yang sama, hanya boleh ada satu mutable reference atau banyak immutable reference (keduanya tidak bisa bersamaan, harus salah satu)."),(0,r.kt)("li",{parentName:"ul"},"Reference harus selalu valid.")),(0,r.kt)("p",null,"Mengenai penjelasan tentang dua aturan penting di atas akan bahas pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),"."),(0,r.kt)("h2",{id:"a336-karakteristik-pointer--reference"},"A.33.6. Karakteristik pointer & reference"),(0,r.kt)("p",null,"Kita sudah belajar tentang definisi beserta cara penerapan pointer, reference, dereference, dan mutable reference. Sekarang lanjut ke pembahasan tentang karakteristik dari pointer & reference."),(0,r.kt)("p",null,"Pointer merupakan variabel yang isinya adalah alamat memory (bukan nilai sebenarnya). Dan reference adalah alamat memory suatu data/variabel. Dengan menerapkan keduanya kita bisa menerapkan efisiensi penggunaan memory yang dampaknya sangat positif terhadap performa program."),(0,r.kt)("p",null,"Sekarang perhatikan statement berikut:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"let number_one = 24;\nlet number_two = number_one;\n")),(0,r.kt)("p",null,"Variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," adalah data numerik bertipe ",(0,r.kt)("inlineCode",{parentName:"p"},"i32"),", eksekusi statement tersebut menghasilkan alokasi memori selebar 32-bit."),(0,r.kt)("p",null,"Kemudian ada lagi statement ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),". Meskipun nilainya didapat dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),", yang terjadi di balik layar adalah Rust akan mengalokasikan lagi alamat memory selebar 32-bit untuk menampung data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two")," yang didapat dari hasil operasi ",(0,r.kt)("strong",{parentName:"p"},"copy")," dari variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),"."),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},"Semua variabel primitif di Rust mengadopsi ",(0,r.kt)("em",{parentName:"p"},"copy semantics"),", yang artinya jika variabel tersebut digunakan dalam statement assignment, maka nilai akan di-duplikasi untuk kemudian ditampung pada variabel baru."),(0,r.kt)("p",{parentName:"blockquote"},"Lebih jelasnya mengenai ",(0,r.kt)("em",{parentName:"p"},"copy semantics")," dibahas pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/ownership#a334-copy-semantics-vs-move-semantics"},"Ownership"),".")),(0,r.kt)("p",null,"Selanjutnya, bandingkan dengan statement berikut:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust"},"let number_one = 24;\nlet number_two = &number_one;\n")),(0,r.kt)("p",null,"Pada contoh di atas, variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," datanya disimpan di memory dengan lebar 32-bit (masih sama seperti contoh sebelumnya). Namun ada yang berbeda dengan dengan variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),", variabel ini adalah variabel pointer yang nilainya reference ke alamat memory data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one"),". Yang terjadi di belakang layar, Rust tidak mengalokasikan lagi memory selebar 32-bit untuk menampung data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),", melainkan menggunakan alamat memory data ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," sebagai reference, menjadikannya sebagai alamat tujuan variabel pointer ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two"),"."),(0,r.kt)("p",null,"Ok, lanjut. Per sekarang, reference variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number_one")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"number_two")," adalah sama. Dengan ini, jika dicontohkan isi data satu variabel diubah, maka variabel lainnya juga akan berubah, hal karena reference-nya adalah sama."),(0,r.kt)("h3",{id:"-contoh-ke-1"},"\u25c9 Contoh ke-1"),(0,r.kt)("p",null,"Contoh penerapannya bisa kita lihat pada chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/pointer-references#a315-karakteristik-pointer--reference"},"Pointer & References")," chapter ini, disitu bisa dilihat ada variabel mutable ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," dan ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," yang reference-nya adalah sama dengan variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Ketika underlying value ",(0,r.kt)("inlineCode",{parentName:"p"},"pointer_number")," diubah (dari ",(0,r.kt)("inlineCode",{parentName:"p"},"24")," ke ",(0,r.kt)("inlineCode",{parentName:"p"},"12"),"), isi data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," juga berubah."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(5127).Z,width:"488",height:"417"})),(0,r.kt)("h3",{id:"-contoh-ke-2"},"\u25c9 Contoh ke-2"),(0,r.kt)("p",null,"Agar makin familiar dengan cara penerapan pointer & reference, silakan lanjut dengan praktik program berikut:"),(0,r.kt)("pre",null,(0,r.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 \u2514\u2500\u2500\u2500 main.rs\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="Cargo.toml"',title:'"Cargo.toml"'},'# ...\n\n[dependencies]\nrand = "0.8.5"\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-rust",metastring:'title="main.rs"',title:'"main.rs"'},'use rand::Rng;\n\nfn main() {\n let mut number = 24;\n println!("number: {}", number);\n\n for _ in 0..=5 {\n change_value(&mut number);\n println!("number: {}", number);\n }\n}\n\nfn change_value(n: &mut i32) {\n *n = generate_random_number()\n}\n\nfn generate_random_number() -> i32 {\n rand::thread_rng().gen_range(0..100)\n}\n')),(0,r.kt)("p",null,"Pada sederhana di atas, ada sebuah variable mutable bernama ",(0,r.kt)("inlineCode",{parentName:"p"},"number")," yang dideklarasikan. Variabel tersebut kemudian diakses ",(0,r.kt)("em",{parentName:"p"},"mutable reference"),"-nya untuk dijadikan argumen statement pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value"),"."),(0,r.kt)("p",null,"Di dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value"),", disiapkan 1 buah angka random hasil pemanggilan fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"generate_random_number"),", yang angka tersebut kemudian dijadikan sebagai nilai baru variable mutable reference yang mengarah ke ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),". Perubahan dalam fungsi ",(0,r.kt)("inlineCode",{parentName:"p"},"change_value")," akan mempengaruhi data variabel ",(0,r.kt)("inlineCode",{parentName:"p"},"number"),", karena reference-nya adalah sama."),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Pointer & reference",src:n(3319).Z,width:"457",height:"204"})),(0,r.kt)("h2",{id:"a337-reference--borrowing"},"A.33.7. Reference & borrowing"),(0,r.kt)("p",null,"Di Rust, reference (atau pengaksesan alamat memory suatu data) memiliki hubungan yang sangat erat dengan konsep ",(0,r.kt)("strong",{parentName:"p"},"borrowing"),"."),(0,r.kt)("p",null,"Ketika kita mengambil reference suatu data, yang terjadi sebenarnya adalah kita meminjam data tersebut dari owner/pemilik sebenarnya."),(0,r.kt)("p",null,"Pada chapter ini kita tidak akan membahasnya lebih jauh lagi, karena akan ada chapter lain yang fokus mengulas topik tersebut secara detail, yaitu chapter ",(0,r.kt)("a",{parentName:"p",href:"/basic/borrowing"},"Borrowing"),"."),(0,r.kt)("p",null,"Untuk sekarang penulis anjurkan untuk lanjut ke chapter berikutnya secara urut."),(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/pointer_references"},"github.com/novalagung/dasarpemrogramanrust-example/../pointer_references")),(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/ch04-02-references-and-borrowing.html"},"https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://doc.rust-lang.org/std/marker/trait.Copy.html"},"https://doc.rust-lang.org/std/marker/trait.Copy.html")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://en.wikipedia.org/wiki/Reference_(computer_science)"},"https://en.wikipedia.org/wiki/Reference_(computer_science)")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://progressivecoder.com/understanding-rust-ownership-and-borrowing-with-examples/"},"https://progressivecoder.com/understanding-rust-ownership-and-borrowing-with-examples/")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://os.phil-opp.com/heap-allocation/"},"https://os.phil-opp.com/heap-allocation/"))))}d.isMDXComponent=!0},1007:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-1-f103aebf5517db2d9de53c1fe39be319.png"},6356:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-2-8fdb7f20f15717b7d97311d81ffe005d.png"},8992:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/images/pointer-references-3-7b60c4bdc0392eb962187ee76ac2ab54.png"},5127:(e,a,n)=>{n.d(a,{Z:()=>t});const t=n.p+"assets/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ANBWAAC0FQAA0FYAALQVAABtBQAAtBUAAG0FAEBbAQAg4v9FZVTogLiptQAAAABJRU5ErkJggg=="}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.4bc44724.js b/assets/js/runtime~main.d4337db1.js similarity index 99% rename from assets/js/runtime~main.4bc44724.js rename to assets/js/runtime~main.d4337db1.js index eb5eff06..fb9ec8c2 100644 --- a/assets/js/runtime~main.4bc44724.js +++ b/assets/js/runtime~main.d4337db1.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,d,r,b={},t={};function f(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={exports:{}};return b[e].call(c.exports,c,c.exports,f),c.exports}f.m=b,e=[],f.O=(a,c,d,r)=>{if(!c){var b=1/0;for(i=0;i=r)&&Object.keys(f.O).every((e=>f.O[e](c[o])))?c.splice(o--,1):(t=!1,r0&&e[i-1][2]>r;i--)e[i]=e[i-1];e[i]=[c,d,r]},f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var r=Object.create(null);f.r(r);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,f.d(r,b),r},f.d=(e,a)=>{for(var c in a)f.o(a,c)&&!f.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((a,c)=>(f.f[c](e,a),a)),[])),f.u=e=>"assets/js/"+({53:"935f2afb",274:"016a0787",620:"2bc2e36b",623:"9e6fe7cf",740:"f8d4e457",909:"bd9b9d52",1059:"7d03ccaf",1422:"62b99870",2089:"0ae704f7",2107:"8e991452",2359:"48e2ebd6",2399:"8ad68633",2706:"4c7e7ada",2870:"5f289fb7",2959:"68ec37cc",3007:"04da11da",3257:"82a9b669",3306:"164327b9",4197:"7a2568c4",4248:"8333c691",4274:"7390b81e",4452:"bc4edc5c",4622:"d8837387",4729:"c76cc2e3",4738:"496dcc30",4758:"68e1906b",4790:"b97d8256",4861:"db8ccf76",4943:"dabee7bd",5572:"be3f5c40",5673:"fef7d16c",5729:"4513d9f5",5751:"fd4f5a0c",5758:"71880105",5989:"2452d5f5",6161:"3b1dfe68",6345:"a2bea3ed",6388:"eb2a6637",6403:"475d163e",6477:"05cc1716",6531:"c01cce30",6691:"cb962766",6794:"b28a365a",6971:"c377a04b",7310:"fb18633e",7386:"3aa512bf",7505:"8d193b98",7539:"e7bd9b37",7720:"bdfc7662",7742:"87499f15",7865:"9a3629a6",7918:"17896441",7920:"1a4e3797",7949:"0e6b6dd1",8051:"dadaca00",8308:"4232c3ed",8358:"7794a932",8469:"93422b31",8732:"e4904969",8784:"d47a3664",8794:"af6aab29",9157:"c526a898",9323:"8333ea4d",9514:"1be78505",9831:"5925ce9f",9886:"8b55bf27"}[e]||e)+"."+{53:"13143cb2",205:"e9ca4e1a",274:"0ab1d3ab",620:"876e08c0",623:"c549f588",740:"88f7a231",909:"8d109af6",1059:"46ca6fcc",1422:"4801cdae",2089:"27cb1279",2107:"9f077664",2359:"0b6ce575",2399:"0a69a909",2706:"f4643a6f",2870:"e0fc9497",2959:"d3961cb0",3007:"b3ba07e3",3257:"bb49d726",3306:"ce557677",4197:"cb80d87b",4248:"54569977",4274:"686f428e",4452:"f0b380ec",4622:"e6bc9bd5",4729:"c1ae2c67",4738:"a168eb53",4758:"f87d9410",4790:"7eff2a81",4861:"f925a746",4943:"9e39dc43",4972:"ea87a18a",5572:"4baec74d",5673:"7198ddd5",5729:"6ce8fc47",5751:"7de9809a",5758:"a92b59bc",5989:"c8d9088c",6161:"84da4a4d",6345:"c14ec614",6388:"01009699",6403:"4cbfe654",6477:"272262df",6531:"1810b6cb",6691:"fe11400b",6780:"3e547342",6794:"28a71aca",6945:"19e06702",6971:"753abc35",7310:"b4caf1fa",7386:"a1c7a02b",7505:"c7232d69",7539:"38bdc3e5",7720:"e5ac5751",7742:"679ef493",7865:"fcabd2cf",7918:"062de7c5",7920:"615c0dbb",7949:"a5062737",8051:"d3047a10",8308:"0eade53f",8358:"0807e2e7",8469:"7d2d5eae",8732:"2c9c10d1",8784:"2e54129a",8794:"fff2a138",8894:"7d968ee6",9157:"e25aff7f",9323:"d3688653",9514:"fa7071eb",9831:"d25861ea",9886:"a01d27dd"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},r="dasarpemrogramanrust:",f.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var r=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),r&&r.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",f.gca=function(e){return e={17896441:"7918",71880105:"5758","935f2afb":"53","016a0787":"274","2bc2e36b":"620","9e6fe7cf":"623",f8d4e457:"740",bd9b9d52:"909","7d03ccaf":"1059","62b99870":"1422","0ae704f7":"2089","8e991452":"2107","48e2ebd6":"2359","8ad68633":"2399","4c7e7ada":"2706","5f289fb7":"2870","68ec37cc":"2959","04da11da":"3007","82a9b669":"3257","164327b9":"3306","7a2568c4":"4197","8333c691":"4248","7390b81e":"4274",bc4edc5c:"4452",d8837387:"4622",c76cc2e3:"4729","496dcc30":"4738","68e1906b":"4758",b97d8256:"4790",db8ccf76:"4861",dabee7bd:"4943",be3f5c40:"5572",fef7d16c:"5673","4513d9f5":"5729",fd4f5a0c:"5751","2452d5f5":"5989","3b1dfe68":"6161",a2bea3ed:"6345",eb2a6637:"6388","475d163e":"6403","05cc1716":"6477",c01cce30:"6531",cb962766:"6691",b28a365a:"6794",c377a04b:"6971",fb18633e:"7310","3aa512bf":"7386","8d193b98":"7505",e7bd9b37:"7539",bdfc7662:"7720","87499f15":"7742","9a3629a6":"7865","1a4e3797":"7920","0e6b6dd1":"7949",dadaca00:"8051","4232c3ed":"8308","7794a932":"8358","93422b31":"8469",e4904969:"8732",d47a3664:"8784",af6aab29:"8794",c526a898:"9157","8333ea4d":"9323","1be78505":"9514","5925ce9f":"9831","8b55bf27":"9886"}[e]||e,f.p+f.u(e)},(()=>{var e={1303:0,532:0};f.f.j=(a,c)=>{var d=f.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var r=new Promise(((c,r)=>d=e[a]=[c,r]));c.push(d[2]=r);var b=f.p+f.u(a),t=new Error;f.l(b,(c=>{if(f.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var r=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+r+": "+b+")",t.name="ChunkLoadError",t.type=r,t.request=b,d[1](t)}}),"chunk-"+a,a)}},f.O.j=a=>0===e[a];var a=(a,c)=>{var d,r,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(d in t)f.o(t,d)&&(f.m[d]=t[d]);if(o)var i=o(f)}for(a&&a(c);n{"use strict";var e,a,c,d,r,b={},t={};function f(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={exports:{}};return b[e].call(c.exports,c,c.exports,f),c.exports}f.m=b,e=[],f.O=(a,c,d,r)=>{if(!c){var b=1/0;for(i=0;i=r)&&Object.keys(f.O).every((e=>f.O[e](c[o])))?c.splice(o--,1):(t=!1,r0&&e[i-1][2]>r;i--)e[i]=e[i-1];e[i]=[c,d,r]},f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var r=Object.create(null);f.r(r);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,f.d(r,b),r},f.d=(e,a)=>{for(var c in a)f.o(a,c)&&!f.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((a,c)=>(f.f[c](e,a),a)),[])),f.u=e=>"assets/js/"+({53:"935f2afb",274:"016a0787",620:"2bc2e36b",623:"9e6fe7cf",740:"f8d4e457",909:"bd9b9d52",1059:"7d03ccaf",1422:"62b99870",2089:"0ae704f7",2107:"8e991452",2359:"48e2ebd6",2399:"8ad68633",2706:"4c7e7ada",2870:"5f289fb7",2959:"68ec37cc",3007:"04da11da",3257:"82a9b669",3306:"164327b9",4197:"7a2568c4",4248:"8333c691",4274:"7390b81e",4452:"bc4edc5c",4622:"d8837387",4729:"c76cc2e3",4738:"496dcc30",4758:"68e1906b",4790:"b97d8256",4861:"db8ccf76",4943:"dabee7bd",5572:"be3f5c40",5673:"fef7d16c",5729:"4513d9f5",5751:"fd4f5a0c",5758:"71880105",5989:"2452d5f5",6161:"3b1dfe68",6345:"a2bea3ed",6388:"eb2a6637",6403:"475d163e",6477:"05cc1716",6531:"c01cce30",6691:"cb962766",6794:"b28a365a",6971:"c377a04b",7310:"fb18633e",7386:"3aa512bf",7505:"8d193b98",7539:"e7bd9b37",7720:"bdfc7662",7742:"87499f15",7865:"9a3629a6",7918:"17896441",7920:"1a4e3797",7949:"0e6b6dd1",8051:"dadaca00",8308:"4232c3ed",8358:"7794a932",8469:"93422b31",8732:"e4904969",8784:"d47a3664",8794:"af6aab29",9157:"c526a898",9323:"8333ea4d",9514:"1be78505",9831:"5925ce9f",9886:"8b55bf27"}[e]||e)+"."+{53:"13143cb2",205:"e9ca4e1a",274:"0ab1d3ab",620:"876e08c0",623:"c549f588",740:"88f7a231",909:"8d109af6",1059:"46ca6fcc",1422:"4801cdae",2089:"5940e697",2107:"9f077664",2359:"0b6ce575",2399:"0a69a909",2706:"f4643a6f",2870:"e0fc9497",2959:"d3961cb0",3007:"b3ba07e3",3257:"bb49d726",3306:"ce557677",4197:"cb80d87b",4248:"54569977",4274:"686f428e",4452:"f0b380ec",4622:"e6bc9bd5",4729:"c1ae2c67",4738:"a168eb53",4758:"f87d9410",4790:"7eff2a81",4861:"f925a746",4943:"9e39dc43",4972:"ea87a18a",5572:"4baec74d",5673:"7198ddd5",5729:"6ce8fc47",5751:"7de9809a",5758:"a92b59bc",5989:"c8d9088c",6161:"84da4a4d",6345:"c14ec614",6388:"01009699",6403:"4cbfe654",6477:"272262df",6531:"1810b6cb",6691:"fe11400b",6780:"3e547342",6794:"28a71aca",6945:"19e06702",6971:"753abc35",7310:"b4caf1fa",7386:"a1c7a02b",7505:"c7232d69",7539:"38bdc3e5",7720:"e5ac5751",7742:"679ef493",7865:"fcabd2cf",7918:"062de7c5",7920:"615c0dbb",7949:"a5062737",8051:"d3047a10",8308:"0eade53f",8358:"0807e2e7",8469:"7d2d5eae",8732:"2c9c10d1",8784:"2e54129a",8794:"fff2a138",8894:"7d968ee6",9157:"e25aff7f",9323:"d3688653",9514:"fa7071eb",9831:"d25861ea",9886:"a01d27dd"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},r="dasarpemrogramanrust:",f.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var r=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),r&&r.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",f.gca=function(e){return e={17896441:"7918",71880105:"5758","935f2afb":"53","016a0787":"274","2bc2e36b":"620","9e6fe7cf":"623",f8d4e457:"740",bd9b9d52:"909","7d03ccaf":"1059","62b99870":"1422","0ae704f7":"2089","8e991452":"2107","48e2ebd6":"2359","8ad68633":"2399","4c7e7ada":"2706","5f289fb7":"2870","68ec37cc":"2959","04da11da":"3007","82a9b669":"3257","164327b9":"3306","7a2568c4":"4197","8333c691":"4248","7390b81e":"4274",bc4edc5c:"4452",d8837387:"4622",c76cc2e3:"4729","496dcc30":"4738","68e1906b":"4758",b97d8256:"4790",db8ccf76:"4861",dabee7bd:"4943",be3f5c40:"5572",fef7d16c:"5673","4513d9f5":"5729",fd4f5a0c:"5751","2452d5f5":"5989","3b1dfe68":"6161",a2bea3ed:"6345",eb2a6637:"6388","475d163e":"6403","05cc1716":"6477",c01cce30:"6531",cb962766:"6691",b28a365a:"6794",c377a04b:"6971",fb18633e:"7310","3aa512bf":"7386","8d193b98":"7505",e7bd9b37:"7539",bdfc7662:"7720","87499f15":"7742","9a3629a6":"7865","1a4e3797":"7920","0e6b6dd1":"7949",dadaca00:"8051","4232c3ed":"8308","7794a932":"8358","93422b31":"8469",e4904969:"8732",d47a3664:"8784",af6aab29:"8794",c526a898:"9157","8333ea4d":"9323","1be78505":"9514","5925ce9f":"9831","8b55bf27":"9886"}[e]||e,f.p+f.u(e)},(()=>{var e={1303:0,532:0};f.f.j=(a,c)=>{var d=f.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var r=new Promise(((c,r)=>d=e[a]=[c,r]));c.push(d[2]=r);var b=f.p+f.u(a),t=new Error;f.l(b,(c=>{if(f.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var r=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+r+": "+b+")",t.name="ChunkLoadError",t.type=r,t.request=b,d[1](t)}}),"chunk-"+a,a)}},f.O.j=a=>0===e[a];var a=(a,c)=>{var d,r,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(d in t)f.o(t,d)&&(f.m[d]=t[d]);if(o)var i=o(f)}for(a&&a(c);n