Skip to Content
이펙티브 러스트
book

이펙티브 러스트

by 데이비드 드라이스데일, 남기혁
October 2024
Beginner to intermediate
344 pages
7h 44m
Korean
Hanbit Media, Inc.
Content preview from 이펙티브 러스트
17
1
타입
CHAPTER
타입
1
첫 번째 장에서는 러스트의 타입 시스템에 대해 조언한다. 러스트의 타입 시스템은 다른 주류
언어보다 훨씬 표현력이 뛰어나며, 오캐멀
OCaml
이나 하스켈
Haskell
과 같은 학술 연구용
academic
어와 비슷한 점이 많다.
러스트 타입 시스템의 핵심 중 하나인
enum
(이넘, 열거형) 타입은 다른 언어보다 표현력이 훨
씬 뛰어나며, 대수적 데이터 타입
algebraic
data
type
(
ADT
)
1
도 지원한다.
이 장에서는 러스트에서 제공하는 기본 타입을 소개하고, 이를 조합하는 방식으로 프로그램의
의미를 정확히 반영한 데이터 구조를 만드는 방법을 설명한다. 이렇게 프로그램 동작을 타입
시스템에 인코딩하면 프로그램 오류를 런타임이 아닌 컴파일 타임에 걸러낼 수 있어서 오류를
찾는 데 드는 수고를 줄일 수 있다.
이번 장에서는 러스트의 표준 라이브러리에서 제공하는 데이터 구조 중에서도 특히 자주 사용
되는
Option
,
Result
,
Error
,
Iterator
에 대해서도 소개한다. 이런 표준 도구를 익혀 두면,
코드를 간결하고 효율적이면서 러스트답게 관용적으로
idiomatic
Rust
작성하는 데 도움 된다. 또한
러스트의 물음표 연산자를 사용하면 타입 안전성을 해치지 않으면서 오류를 간결하게 처리할
수 있다.
러스트의 트레이트 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리

Publisher Resources

ISBN: 9791169212946