Implement Methods on Rust Structs 🦀

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • Rust developers can implement behaviors on their custom data structures by using methods. Methods are simply Rust functions that operate on a type (aka. static methods) or an instance of a type (instance methods). In this video, we'll look at some practical examples of implementing Rust methods on a "Vehicle" and "Person" structs.
    🤯 Rust Programming Playlist 🦀 • Rust Programming Tutor...
    📖 Rust Struct Methods: doc.rust-lang....
    Visual Studio Code ➡️ code.visualstu...
    Rust Website ➡️ rust-lang.org
    Rustup Installer ➡️ rustup.rs
    Rust Docs ➡️ doc.rust-lang....
    Please follow me on these other social channels!
    ➡️ trevorsullivan...
    ➡️ github.com/pcg...
    ➡️ / pcgeek86
    ➡️ / trevorsullivan
    ➡️ / trevorsoftware
    ➡️ tiktok.com/pcg...
    All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names,trademarks and brands does not imply endorsement.
    #rustlang #rust #rustdev #opensource #software #linux #devops #programming #rusty #dev #coding #codinglife #code #coder #ubuntu #ubuntulinux #appdev #developer
  • НаукаНаука

Комментарии • 22

  • @TrevorSullivan
    @TrevorSullivan  Год назад

    Check out the FULL Rust video playlist! 🦀 ruclips.net/p/PLDbRgZ0OOEpUkWDGqp91ODn0dk7LPBAUL

  • @ExidifulCrypto
    @ExidifulCrypto 11 месяцев назад +3

    i dont even know how im keeping up, my only explanation, my teacher is awesome. Thanks brother, I can tell you just because of how good you explained rust, I will be a permanent fan for every series you have on your channel

    • @TrevorSullivan
      @TrevorSullivan  11 месяцев назад +1

      Just keep learning a little bit each day! That's how it's done. 🦀

    • @codingwithrendi
      @codingwithrendi 25 дней назад

      other tutorial seems make it more complicated, i like this, super easy to understand

  • @cbbcbb6803
    @cbbcbb6803 3 месяца назад

    I will try this.

  • @OmbasaMukhwami
    @OmbasaMukhwami 4 месяца назад +1

    How dare you make rush so easy 😂😂

  • @princemarkied8071
    @princemarkied8071 Год назад +2

    I will never be smart enough to use this, but I can dream.

    • @TrevorSullivan
      @TrevorSullivan  Год назад

      You are capable of it!! What's holding you back? Try it yourself!

    • @minkus-moinkus
      @minkus-moinkus 7 месяцев назад

      u got it brudda

  • @gamehacker5692
    @gamehacker5692 26 дней назад

    So Java is basically C# and Rust is basically C++ lmao

    • @TrevorSullivan
      @TrevorSullivan  26 дней назад

      Rust is actually just about as fast as C++ applications! Check out some benchmarks out there.

    • @harshjain3122
      @harshjain3122 25 дней назад

      More like...Rust is closer to C and Haskell is closer to C++

    • @gamehacker5692
      @gamehacker5692 25 дней назад

      @@harshjain3122 I haven’t taught myself C or Haskell yet but I get the jist since Java and c# are always compared (c# is biter imo but that’s bc I use unity lol)

  • @ojoawojoshua780
    @ojoawojoshua780 2 месяца назад

    The create_vehicle inside the impl fuction which returns "Vehicle" can also return "Self" which points to Vehicle because it's in an impl of Vehicle

  • @sulaimonakande8611
    @sulaimonakande8611 3 месяца назад

    Your explanations are top-notch. Thanks.
    what project can i start building at this level

    • @TrevorSullivan
      @TrevorSullivan  3 месяца назад

      Thanks! I'm glad you're learning from these videos. A good start would be a CLI tool.

    • @sulaimonakande8611
      @sulaimonakande8611 3 месяца назад

      Ok thanks

  • @gautamjh
    @gautamjh 8 месяцев назад

    Nicely explained

  • @pipi_delina
    @pipi_delina Год назад

    Do you have plans to do something on Golang as well

    • @TrevorSullivan
      @TrevorSullivan  Год назад

      Great question. It is on my radar, but in the short term, I'm investing in Rust. Are you planning to use Golang, or currently are?

    • @pipi_delina
      @pipi_delina Год назад

      @@TrevorSullivan I have been split between the two.. I most default to python. I see them both as similar but will be great to be able to understand them all

    • @TrevorSullivan
      @TrevorSullivan  Год назад +1

      @@pipi_delina 💯 you are on the right track! Never limit yourself to just one technology stack! I used to do that earlier in my career, but now I just use what's best or interesting!