Тёмный
No video :(

Rust: RefCell 

The Dev Method
Подписаться 6 тыс.
Просмотров 7 тыс.
50% 1

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@mx-5driver406
@mx-5driver406 Год назад
Also worth mentioning is that it's almost always better to use Cell instead of RefCell for Copy types (like i32). This avoids the overhead of the runtime borrow check and can never cause a panic.
@peterthecoderd.1210
@peterthecoderd.1210 Год назад
Arc, Rc, Box and Cell/RefCell are the most confusing aspects, so far, of my learning Rust. I will have to re-watch your videos a few times, in hopes of grasping these concepts. Thanks!
@joeystenbeck6697
@joeystenbeck6697 Год назад
I've been confused by this but this video explains RefCell/RefMut so clearly! Thanks!
@npf21
@npf21 9 месяцев назад
Just wanted to mention you say the the correct definition for Rc but the text is incorrect it should be allow "immutable" checks at compile time @4:09
@ovidiu_nl
@ovidiu_nl Год назад
Unsafe Rust gives you a few "superpowers", but playing jedi mind tricks with the borrow checker is not one of them. The borrow checker will still check your code. :D As far as I remember these types with internal mutability all ultimately use UnsafeCell as a building block. The compiler gives UnsafeCell some special treatment.
@ovidiu_nl
@ovidiu_nl Год назад
Nice video, btw 👍 I liked your mock example.
@SimonClarkstone
@SimonClarkstone 11 месяцев назад
Agreed; the Rustonomicon is pretty clear that you still have to obey the borrowing rules, in some form.
@matthewbridges3147
@matthewbridges3147 Год назад
Just worked through this chapter in the rust programming book today, perfect time for your video to appear in my feed for a recap!
@kimpham54
@kimpham54 Год назад
this was helpful. much appreciated!
@Christobanistan
@Christobanistan 2 месяца назад
So why would RefCell be unsafe if it's implemented by the Rust devs? The entire compiler could have bugs that make Rust code fail, so why not give RefCell the same guarantee and call it a safe intrinsic?
@GlobalYoung7
@GlobalYoung7 Год назад
thank you ❤
@gubasso
@gubasso Год назад
Why don't just change the `trait Messenger` signature to `mut self` ?
@ameer6168
@ameer6168 10 месяцев назад
because it just checking if it's sending correct message or not in the real world example it will not take mutable reference of a string because we just want send that message via email or number , so we are not storing it and we can't really change our implementation just for test
Далее
Rust: Weak References
19:40
Просмотров 3,9 тыс.
Mike Seddon - Rust GPU Compute
29:58
Просмотров 9 тыс.
Rust: Closures
19:53
Просмотров 16 тыс.
Rust: Starting a Workspace
27:47
Просмотров 7 тыс.
Self-referential structs (in Rust)
27:21
Просмотров 53 тыс.
Rc and RefCell Smart Pointers - Rust
26:03
Просмотров 7 тыс.
Rust: Smart Pointers, Linked Lists - CS196 SP20
34:58
Rust: Store Data on the Heap with Box
10:02
Просмотров 5 тыс.
The Secret to Rust Ownership: Rc vs. Arc
13:47
Просмотров 2,8 тыс.
Rust: Send Data between Threads
8:26
Просмотров 10 тыс.