Closed TonalidadeHidrica closed 4 years ago
Clone
, Debug
We should implement Clone
and Debug
for all of the types.Copy
If a type can implement Copy
and is small enough, we should implement Copy
for it.
Default
Hash
We cannot insert into Hash{Set, Map}
without Hash
implementation.(Partial)Eq
Required for ==
, !=
operators.(Partial)Ord
Required for comperation operators such as <
, <=
. Also types without Ord
implementation cannot be store in BTree{Set, Map}
or BinaryHeap
.From
, Into
, TryFrom
, TryInto
(No derive macro in std
)
With these implementations, we can easiliy convert types with .into()
.FromStr
(No derive macro in std
)
We can get values from stdin directly.Display
(No derive macro in std
)
We can println!
the values directly.FromIterator
(No derive macro in std
)
Collection-like types should be implement this, as we can construct them with elements.collect::<Foo>()
.IntoIterator
(No derive macro in std
)
Collection-like types should be implement this, as we can iterate elements with for elem in &foo { .. }
or for elem in foo { .. }
.As{Ref, Mut}
, Index{Mut}
, binary operators, ... (No derive macro in std
)Thanks a lot. I'll consider implementing those traits. Should I close it now?
Yes. We may discuss such a general topic in rust-jp.slack.com.
We should discuss in each PR.
What macros do we have to derive for structs?