Skip to Content
이펙티브 러스트
book

이펙티브 러스트

by 데이비드 드라이스데일, 남기혁
October 2024
Beginner to intermediate
344 pages
7h 44m
Korean
Hanbit Media, Inc.
Content preview from 이펙티브 러스트
18
이펙티브 러스트
아이템
1
: 데이터 구조를 타입 시스템으로 표현하라
누가 프로그래머라고 했나, ‘타이프라이터
typewriter
’라고 하지 않고.
@
thingskatedid
(
https://oreil.ly/hHj5c
)
이번 아이템에서는 러스트의 타입 시스템을 간략히 소개한다. 먼저 컴파일러에서 기본으로 제
공하는 타입부터 살펴본 후, 이를 조합해 다양한 방식으로 복잡한 데이터 구조를 구성하는 방
법을 설명한다.
이 과정에서 러스트의
enum
타입은 핵심적인 역할을 한다. 기본은 다른 언어와 같지만, (
struct
처럼 )
enum
배리언트
variant
에 데이터 필드를 직접 넣을 수 있다는 점에서 다른 언어보다 훨씬
유연하고 표현력이 높다.
기본 타입
C
++, 고
Go
, 자바
Java
와 같은 정적 프로그래밍 언어에 익숙하다면, 러스트의 타입 시스템에 대한
기본적인 내용은 쉽게 이해할 수 있다. 가령, 러스트에서도 다양한 크기로 부호 있는 정수 타입
(
i8
,
i16
,
i32
,
i64
,
i128
)과 부호 없는 정수 타입 (
u8
,
u16
,
u32
,
u64
,
u128
)을 제공한다.
2
또한 부호 있는 정수 타입 (
isize
)
3
과 부호 없는 정수 타입 (
usize
)
4
도 제공한다. 이런 타입
은 타깃 시스템의 포인터 크기에 맞게 제공되지만 러스트에서는 포인터 타입과 정수 타입을
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