Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rmarmanriazi•rust•concept•polymorphism

In a struct or enum, the data in the struct fields and the behavior in impl blocks are separated, whereas in other languages, the data and behavior combined into one concept is often labeled an object.
However, trait objects are more like objects in other languages in the sense that they combine data and behavior
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
4+8 =