Generic Struct Example in Rust

Publicado em: 28 Novembro 2022
no canal de: Learning Rust
293
11

Use a generic struct to accept float or integers.
(add angle brackets as the suffix to the name of the struct)

A generic struct acts as an abstract stand-in for a yet to be chosen data type
(The data type gets specified at compile time based on what you decide to use with your variable types).

Without this, you would get a compiler error if you specified a data type different to what was specified for the struct field.

Code : https://redandgreen.co.uk/how-to-use-...

View the Rust playlist :    • Rust Programming | Rust Code  

It would be amazing if you want to support my channel via Patreon:
Patreon :=   / 3552586  

#Rust #beginnertutorial #rusttutorial


Nesta página do site você pode assistir ao vídeo on-line Generic Struct Example in Rust duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Learning Rust 28 Novembro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 293 vezes e gostou 11 espectadores. Boa visualização!