Macros
CLAP
Using Clippy
Std...
HashMap ...
Tricking the HashMap | Ivan Dubrov
!Sized
- iterators
-
Error handling
Option -> Result
? expands to ..... return Err(From::from(e))
Defining new error types out of lower-level ones:
#[non_exhaustive]
thiserror ->
#[derive(Error)]
#[error("message")]
....#[from:] ...
and we can use derive_more::Error
Error trait enables the nesting:
- source()
- provide() default to None, but can be implemented
YT: A Simpler Way to See Results
Anyhow:
https://docs.rs/anyhow/latest/anyhow/index.html
Clarifying references with Claude.io:
https://doc.rust-lang.org/std/primitive.reference.html
Prompts:
Rust references implement all certain traits Copy, Clone etc ..... is it because those traits have only &self methods?
.....
Yes,true. Those specific Traits are implemented by the definition/semantics of References. What I meant is the other Traits which .... references having Deref... when implemented for T and containing only &self methods, are therefore implemented for &T. Or is there anything more profound on that?
Now I know: