Should We Learn All Syntax and Async Rust?

โš“ Rust    ๐Ÿ“… 2026-01-31    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 14      

surdeus

Warning

This post was published 31 days ago. The information described in this article may have changed.

Hello everyone,

Iโ€™ve recently started my journey learning Rust. Since my English is at a beginner level, I am currently following a translation of the official Rust book in my native language. Iโ€™ve been wanting to learn this language for about 3 years.

The resource Iโ€™m using covers almost every topic in detail, but it doesnโ€™t touch on 'Async Rust'. My goals are entirely hobby-oriented rather than commercial. Specifically, I want to work on compiler writing, game development, CLI tools, and desktop applications.

In this context, I have the following questions:

  1. Is it mandatory for me to learn Async Rust? Will I hit a roadblock if I don't?
  2. Does Rust support async natively (in the language itself), or is it entirely dependent on external libraries (runtimes)?
  3. Does the compiler really help us that much?

Additionally, I am currently working on a simple to-do project. Do you have any advice for a beginner?

use std::fmt::{self, Formatter, format, write};

#[derive(Debug)]
struct Title(String);

#[derive(Debug)]
struct Desc(String);

#[derive(Debug)]
enum Status {
    TODO,
    INPROGRESS,
    DONE,
}

#[derive(Debug)]
struct Todo {
    title: Title,
    desc: Desc,
    done: Status,
}

impl Todo {
    fn new(title: Title, desc: Desc, done: Option<Status>) -> Self {
        Self {
            title,
            desc,
            done: done.unwrap_or(Status::INPROGRESS),
        }
    }
}

impl std::fmt::Display for Todo {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        match self.done {
            Status::TODO => write!(f, "[TODO] - {}\n {}", self.title.0, self.desc.0),
            Status::INPROGRESS => write!(f, "[INPROGRESS] - {}\n {}", self.title.0, self.desc.0),
            Status::DONE => write!(f, "[DONE] - {}\n {}", self.title.0, self.desc.0),
        }
    }
}

impl Title {
    fn new(title: String) -> Result<Self, String> {
        if title.is_empty() {
            return Err(String::from("The Title field cannot be empty."));
        }

        Ok(Self(title))
    }
}

impl Desc {
    fn new(desc: String) -> Result<Self, String> {
        if desc.is_empty() {
            return Err(String::from("The Description field cannot be empty."));
        }

        Ok(Self(desc))
    }
}

struct TodoList {
    todos: Vec<Todo>,
}

impl TodoList {
    fn new() -> Self {
        Self { todos: Vec::new() }
    }

    fn push(&mut self, todo: Todo) -> () {
        self.todos.push(todo);
    }

    fn list(&self) {
        self.todos.iter().for_each(|todo| println!("{}", todo));
    }
}

fn main() -> Result<(), String> {
    let mut todo_list = TodoList::new();

    let my_todo: Todo = Todo::new(
        Title::new(String::from("kaan"))?,
        Desc::new(String::from("kaan"))?,
        None,
    );

    let my_todo_2: Todo = Todo::new(
        Title::new(String::from("Kaan"))?,
        Desc::new(String::from("kaan"))?,
        Some(Status::TODO),
    );

    todo_list.push(my_todo);
    todo_list.push(my_todo_2);
    todo_list.list();

    Ok(())
}

Thank you.

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed