Skip to content
เข้าสู่ระบบ

Cargo

Cargo คือ build tool และ package manager ของ Rust รวมทุกอย่างที่ Developer ต้องใช้ไว้ในที่เดียว ทั้ง building, testing, documentation, และ dependency management

ลองนึกภาพว่า Cargo เป็นเหมือน “ผู้ช่วยส่วนตัว” ที่จัดการเรื่องน่าเบื่อทั้งหมด ทั้ง download libraries, compile code, run tests ให้เราแค่เขียน code!

Terminal window
# ============================================
# สร้างโปรเจกต์ใหม่
# ============================================
cargo new my_project # Binary project (มี main.rs)
cargo new --lib my_library # Library project (มี lib.rs)
cargo new --vcs none my_app # ไม่สร้าง git repo
cargo init # Initialize ใน current directory
cargo init --lib # Initialize as library

เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม

ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด