From 2f7dcfd2bd313d82f352e2b1cf0d597b9971d77f Mon Sep 17 00:00:00 2001 From: osmannyildiz Date: Mon, 29 Apr 2024 14:53:22 +0300 Subject: [PATCH] add readme and notes --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d16dcd --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Rust Weekend - April 27-28, 2024 + +## My Notes + +There are code-based notes in the file `src/main.rs`. I recommend tinkering with it, like commenting/uncommenting portions, reading compiler errors, and looking at the types in your IDE. + +Plain text notes are below. + +```text +cargo init -> existing dir +cargo new -> new subdir + +compiler doesn't check against infinite loops + +access modifiers: +- private (default) +- pub +- pub(crate) + +Ownership kuralları: +- Bir şeyin sadece bir sahibi olur +- Bir şeyin birim zamanda tek sahibi olur +- Bir şey gerekli olmadığında drop edilir +Bunun 3 uygulanış biçimi vardır: +- Copy (veri transferi, fixed size) +- Move (move semantic/ownership transfer, non-fixed size) +- Clone (birebir aynısını oluşturma, non-fixed size) + +Borrowing için & operatörü kullanılır. 2 çeşidi vardır: +- Immutable borrowing/shared reference (1:N, sanat galerisi/ziyaretçi ilişkisi) +- Mutable borrowing (1:1, kiracı/ev sahibi ilişkisi) + +rust'ta method overloading (aynı isim farklı parametre) yok +```