MCPcopy Create free account

hub / github.com/buraksenyurt/rust-training / functions

Functions216 in github.com/buraksenyurt/rust-training

↓ 6 callersFunctionget_discount_amount
(unit_price: f64, rate: f64)
S16_testing/src/accounting.rs:1
↓ 4 callersFunctionlog_any
Örnek bir generic fonksiyon. parametre olarak gelen object değişkeni T türünden olabilir. T için herhangibir kısıt belirtilmediğinden herhangibi
S11_generics/src/main.rs:47
↓ 4 callersMethodvalidate_nickname
(&self, nick_name: &str)
S16_testing/src/membership.rs:4
↓ 3 callersMethodadd
(self, other: Point<T>)
S11_generics/src/main.rs:80
↓ 3 callersFunctionfetch_data_async
(url: &str)
S23_asynchronous_programming/src/api_sample.rs:26
↓ 3 callersFunctionfetch_metrics
(service_name: &str, tx: mpsc::Sender<String>)
S23_asynchronous_programming/src/metric_sample.rs:23
↓ 3 callersFunctionfetch_sensor_data
(sensor_id: u32, interval: u64)
S23_asynchronous_programming/src/iot_sample.rs:13
↓ 3 callersFunctionis_prime
Sayının asal olup olmadığını kontrol eden fonksiyon
S22_parallelism/src/main.rs:35
↓ 3 callersMethodpay
(&self, amount: f64)
S12_traits/src/main.rs:122
↓ 3 callersFunctionrun
()
S23_asynchronous_programming/src/iot_sample.rs:5
↓ 3 callersFunctiontrim_last
(context: &mut String)
S06_ownership/src/main.rs:109
↓ 2 callersMethodactivate
(&mut self)
S12_traits/src/main.rs:84
↓ 2 callersMethodactivate
(&mut self)
S09_enums/src/main.rs:77
↓ 2 callersMethodadd_friend
(self: &Rc<Self>, friend: Rc<Player>)
S18_smart_pointers/src/rc_scenario.rs:142
↓ 2 callersMethodallocate
Bu fonksiyon bir bellek bölgesini ayırır ve başlangıç adresini raw pointer olarak döner. Buradaki raw pointer mutable'dır. */
S26_unsafe_coding/src/advanced.rs:57
↓ 2 callersMethodchange_level
(&mut self, level: Level)
S09_enums/src/main.rs:74
↓ 2 callersFunctioncreate_report
(title: String)
S09_enums/src/main.rs:28
↓ 2 callersMethoddeactivate
(&mut self)
S12_traits/src/main.rs:87
↓ 2 callersFunctiondraw
(a, b, c, x_min, x_max, steps)
meth-leb/www/index.js:29
↓ 2 callersFunctiondrawAxes
()
meth-leb/www/index.js:12
↓ 2 callersFunctionfind_account
Referans olarak gelen vektör içerisinde id bilgisine sahip Account değişkenini arayan bu fonksiyon Option<&T> dönmektedir. Metodun kullanıldığı
S10_pattern_matching/src/main.rs:168
↓ 2 callersFunctionget_alignment
Sistemin 32 veya 64 bit olmasına göre gerekli olan byte hizalama değerini aldığımı fonksiyon */
S26_unsafe_coding/src/advanced.rs:20
↓ 2 callersFunctionload_level
(name: &String)
S06_ownership/src/main.rs:105
↓ 2 callersFunctionprocess_transaction
(balance: &mut f64, transaction: CustomerTransaction)
S10_pattern_matching/src/main.rs:117
↓ 2 callersFunctionread
Bu fonksiyon ise path ile gelen dosya içeriğini okuyup geriye döndürür. Metin tabanlı dosyalar için ele alınan bir yöntemdir. */
S24_file_io/src/basics.rs:23
↓ 2 callersFunctionrun
()
S26_unsafe_coding/src/advanced.rs:88
↓ 2 callersFunctionrun
()
S24_file_io/src/basics.rs:33
↓ 2 callersFunctionstart_sample
Aşağıdaki fonksiyon parametre olarak Service trait' ini uygulayan değişkenler ile çalışabilmektedir. */
S12_traits/src/main.rs:43
↓ 2 callersFunctionupdate_players_system
(world: &mut GameWorld, mut f: F)
S17_closures/src/scenario.rs:22
↓ 1 callersFunctionaccelerate
(mut speed: Velocity)
S13_built_in_traits/src/main.rs:87
↓ 1 callersFunctionadd
(left: u64, right: u64)
S16_testing/src/lib.rs:29
↓ 1 callersFunctionanalyze_logs
(file_path: &str, num_threads: usize)
S24_file_io/src/advanced.rs:13
↓ 1 callersFunctionappend_game
Aşağıdaki metot games.dat isimli bir dosya oluşturur. Sistemde varsa append modda açar ve gelen içeriği sonuna ekleyerek devam eder. */
S24_file_io/src/basics.rs:10
↓ 1 callersFunctionapprove_application
(account_owner: &str)
S15_error_handling/src/main.rs:108
↓ 1 callersFunctioncalc_factorial
(n: u64)
S19_threads/src/basic.rs:74
↓ 1 callersFunctioncalculate_parabola
( a: f64, b: f64, c: f64, x_min: f64, x_max: f64, steps: usize, )
meth-leb/src/lib.rs:22
↓ 1 callersMethodcall
(&self)
S13_built_in_traits/src/main.rs:251
↓ 1 callersFunctioncheck_department
(department: String)
S06_ownership/src/main.rs:117
↓ 1 callersFunctioncheck_exam
(student: Student)
S10_pattern_matching/src/main.rs:99
↓ 1 callersFunctioncheck_exam_score
(point: i32)
S05_control_flows/src/main.rs:57
↓ 1 callersFunctioncheck_status
()
S10_pattern_matching/src/main.rs:47
↓ 1 callersMethoddeactivate
(&mut self)
S09_enums/src/main.rs:80
↓ 1 callersFunctiondouble_usage
Aşağıdaki metod verilen teriman komutuna göre şöyle çalışır. logs.dat dosyası cat uygulaması ile açılır, bu uygulama dosyanın içeriğini okur ve
S25_streams/src/basics.rs:123
↓ 1 callersMethoddraw
(&self)
S12_traits/src/main.rs:145
↓ 1 callersFunctiondraw_shapes
draw_shape fonksiyonu dikkat edileceği üzre &dyn Draw türünden bir parametre almaktadır. Buna göre bu fonksiyona Draw trait'ini implemente eden her
S12_traits/src/main.rs:167
↓ 1 callersFunctionfetch_credit_score
(account_owner: &str)
S15_error_handling/src/main.rs:97
↓ 1 callersFunctionfind_another_total
()
S21_macros/src/main.rs:34
↓ 1 callersFunctionfind_primes_scenario
Kendi sistemimde seri hesaplama yani tek thread ile asal sayı bulma operasyonu 4 dakika 41 saniye kadar sürdü. Thread'leri kendimiz manuel açar
S22_parallelism/src/main.rs:97
↓ 1 callersFunctionfind_total
()
S21_macros/src/main.rs:21
↓ 1 callersMethodfree
(&mut self)
S26_unsafe_coding/src/advanced.rs:68
↓ 1 callersFunctiongenerate_random_file
Aşağıdaki fonksiyonun amacı basitçe büyük miktarda veri içeren bir log dosyası üretmektir. Senaryo gereği messages isimli vektörden rastgele içeri
S24_file_io/src/data_generator.rs:12
↓ 1 callersFunctionget_app_settings
()
S08_lifetimes/src/main.rs:113
↓ 1 callersFunctionget_evens
(numbers: &Vec<i32>)
S04_functions/src/main.rs:48
↓ 1 callersFunctionget_odds
(numbers: &[i32])
S04_functions/src/main.rs:58
↓ 1 callersFunctionget_random_numbers
(max_limit: u8)
S05_control_flows/src/main.rs:44
↓ 1 callersFunctionget_upper_counts
(context: &String)
S06_ownership/src/main.rs:95
↓ 1 callersFunctiongreet
(name: &str)
S04_functions/src/main.rs:24
↓ 1 callersFunctionhandle_ping
Bu örnekte TcpStream ve TcpListener kullanılarak ilkel bir web server işletiliyor. İstemciler http://localhost:5001/ping adresine bir talepte bulu
S25_streams/src/ping_server.rs:19
↓ 1 callersFunctionhandle_request
(mut stream: TcpStream)
S25_streams/src/file_server.rs:24
↓ 1 callersFunctionhandle_request
(mut stream: TcpStream, value_store: Arc<Mutex<HashMap<String, String>>>)
S25_streams/src/kv_server.rs:23
↓ 1 callersFunctionhello_rc
()
S18_smart_pointers/src/rc_scenario.rs:10
↓ 1 callersFunctionload_accounts
()
S10_pattern_matching/src/main.rs:172
↓ 1 callersFunctionload_games
()
S17_closures/src/repository.rs:8
↓ 1 callersFunctionmain
()
meth-leb/www/index.js:3
↓ 1 callersFunctionmove_position
(mut x: f32, mut y: f32, acceleration: f32)
S04_functions/src/main.rs:42
↓ 1 callersFunctionmove_rule
()
S06_ownership/src/main.rs:130
↓ 1 callersFunctionmove_rule_with_clone
()
S06_ownership/src/main.rs:141
↓ 1 callersFunctiononly_one_mutable
()
S06_ownership/src/main.rs:157
↓ 1 callersFunctionparallel_find_primes
(numbers: Vec<u64>, num_threads: usize)
S22_parallelism/src/main.rs:47
↓ 1 callersFunctionping
Sembolik olarak bir servise gidipte rastgele HttpStatus bilgisi döndüren fonksiyon
S10_pattern_matching/src/main.rs:72
↓ 1 callersFunctionpoisoning_case_logging
Aşağıdaki senaryoda da Thread Poisoning durumu söz konusudur ancak biraz daha gerçekçi bir durum ele alınmaktadır. Birden fazla thread'in bir log d
S20_channels/src/problems.rs:139
↓ 1 callersMethodprint
(&self)
S18_smart_pointers/src/rc_scenario.rs:146
↓ 1 callersFunctionprint_all_to_upper
(names: Vec<&str>)
S04_functions/src/main.rs:28
↓ 1 callersFunctionprint_games
(games: &Vec<Game>)
S17_closures/src/main.rs:49
↓ 1 callersFunctionprint_greetings
()
S04_functions/src/main.rs:20
↓ 1 callersFunctionprint_thread_count
()
S22_parallelism/src/main.rs:13
↓ 1 callersFunctionread
()
S25_streams/src/basics.rs:65
↓ 1 callersFunctionread_lines_with_pause
Aşağıdaki fonksiyon dosya içeriğini sayfa sayfa okumak için kullanılır. Dosya içeriği yine bir buffer üzerinden ele alınır ancak page_size değerin
S24_file_io/src/data_generator.rs:62
↓ 1 callersFunctionrecursive_sample
()
S18_smart_pointers/src/boxing.rs:52
↓ 1 callersMethodresize
(&mut self, width: f32, height: f32)
S07_structs/src/main.rs:71
↓ 1 callersFunctionrun
()
S17_closures/src/scenario.rs:46
↓ 1 callersFunctionrun
()
S25_streams/src/basics.rs:137
↓ 1 callersFunctionrun_correctly
()
S19_threads/src/arc_and_mutex.rs:36
↓ 1 callersFunctionrun_rc
()
S18_smart_pointers/src/rc_scenario.rs:154
↓ 1 callersFunctionsearch_book
Bu fonksiyon parametre olarak gelen title değişkeninin sahipliğini de alır (ownership) Dolayısıyla metottan çıkılırken scope kuralı gereği title de
S06_ownership/src/main.rs:126
↓ 1 callersFunctionsend_money
(money: f32)
S06_ownership/src/main.rs:113
↓ 1 callersFunctionsimple_boxing
()
S18_smart_pointers/src/boxing.rs:1
↓ 1 callersFunctionspawn_random_user
(name: String)
S07_structs/src/main.rs:37
↓ 1 callersFunctionstart_sample2
Bazı durumlarda Trait bildirimi generic tanımlama üzerinden de yapılabilir
S12_traits/src/main.rs:50
↓ 1 callersFunctionsum
()
S21_macros/src/main.rs:51
↓ 1 callersFunctionupdate_score_system
(world: &GameWorld, mut f: F)
S17_closures/src/scenario.rs:31
Functionadd
()
S14_modules/src/repository.rs:1
Methodarea
(&self)
S07_structs/src/main.rs:65
Functionborrow
()
S14_modules/src/borrow_system.rs:1
Functiondeadlock_case
()
S20_channels/src/problems.rs:15
Functiondeadlock_case_banking
Aşağıdaki senaryoda da bir deadlock durumu oluşmaktadır. Hesap bilgileri Mutex'ler ile korunu ve arka arkaya açılan iki thread bu mutex'ler ile
S20_channels/src/problems.rs:53
Methoddefault
()
S13_built_in_traits/src/main.rs:174
Functiondo_with_standard
()
S20_channels/src/scenarios.rs:60
Functiondo_with_tokio
()
S20_channels/src/scenarios.rs:88
Functiondouble_it
(value: i32)
S04_functions/src/main.rs:38
next →1–100 of 216, ranked by callers