万本电子书0元读

万本电子书0元读

顶部广告

Rust Standard Library Cookbook电子书

售       价:¥

32人正在读 | 0人评论 9.8

作       者:Jan Nils Ferner,Daniel Durante

出  版  社:Packt Publishing

出版时间:2018-03-29

字       数:44.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Explore the Rust Standard library and compose algorithms with minimal dependency on external libraries About This Book ? Develop high-quality, fast, and portable applications by leveraging the power of Rust's Standard library. ? Practical recipes that will help you work with the Standard library to boost your productivity as a Rust developer. ? Learn about most relevant external crates to be used along with the Standard library. Who This Book Is For This book is for developers who would like to explore the power of Rust and learn to use the STL for various functionalities. A basic Rust programming knowledge is assumed. What You Will Learn ? How to use the basic modules of the library: strings, command line access, and more. ? Implement collections and folding of collections using vectors, Deque, linked lists, and more. ? Handle various file types , compressing and decompressing data. ? Search for files with glob patterns. ? Implement parsing through various formats such as CSV, TOML, and JSON. ? Utilize drop trait , the Rust version of destructor. ? Resource locking with Bilocks. In Detail Mozilla’s Rust is gaining much attention with amazing features and a powerful library. This book will take you through varied recipes to teach you how to leverage the Standard library to implement efficient solutions. The book begins with a brief look at the basic modules of the Standard library and collections. From here, the recipes will cover packages that support file/directory handling and interaction through parsing. You will learn about packages related to advanced data structures, error handling, and networking. You will also learn to work with futures and experimental nightly features. The book also covers the most relevant external crates in Rust. By the end of the book, you will be proficient at using the Rust Standard library. Style and approach This recipe-based practical guide presents each topic with step-by-step instructions on how you can create fast and efficient applications utilizing Rust's Standard library packages.
目录展开

Title Page

Copyright and Credits

Rust Standard Library Cookbook

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the authors

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Conventions used

Sections

Getting ready

How to do it…

How it works…

There's more…

See also

Get in touch

Reviews

Disclaimer

Learning the Basics

Introduction

Concatenating strings

Getting ready

How to do it...

How it works...

Using the format! macro

How to do it...

How it works...

There's more...

Providing a default implementation

How to do it...

How it works...

Using the constructor pattern

Getting ready

How to do it...

How it works...

There's more...

See also

Using the builder pattern

How to do it...

How it works...

There's more...

Parallelism through simple threads

How to do it...

How it works...

There's more...

See also

Generating random numbers

How to do it...

How it works...

There's more...

Querying with regexes

Getting ready

How to do it...

How it works...

There's more...

See also

Accessing the command line

How to do it...

How it works...

There's more...

Interacting with environment variables

How to do it...

How it works...

There's more...

Reading from stdin

How to do it...

How it works...

There's more...

See also

Accepting a variable number of arguments

Getting started

How to do it...

How it works...

There's more...

See also

Working with Collections

Introduction

Using a vector

How to do it...

How it works...

There's more...

Using a string

How to do it...

How it works...

There's more...

Accessing collections as iterators

How to do it...

How it works...

There's more...

See also

Using a VecDeque

How to do it...

How it works...

There's more...

Using a HashMap

How to do it...

How it works...

There's more...

Using a HashSet

How to do it...

How it works...

There's more...

Creating an own iterator

How to do it...

How it works...

There's more...

Using a slab

How to do it...

How it works...

There's more...

Handling Files and the Filesystem

Introduction

Working with text files

How to do it...

How it works...

There's more...

See also

Handling bytes

Getting ready

How to do it...

How it works...

There's more...

Working with binary files

How to do it...

How it works...

There's more...

See also

Compressing and decompressing data

How to do it...

How it works...

There's more...

Traversing the filesystem

Getting ready

How to do it...

How it works...

There's more...

See also

Finding files with glob patterns

How to do it...

How it works...

See also

Serialization

Introduction

Working with CSV

Getting started

How to do it...

How it works...

There's more...

See also

Serialization basics with Serde

How to do it...

How it works...

There's more...

See also

Working with TOML

Getting started

How to do it...

How it works...

There's more...

See also

Working with JSON

Getting ready

How to do it...

How it works...

There's more...

See also

Building JSON dynamically

How to do it...

How it works...

See also

Advanced Data Structures

Introduction

Creating lazy static objects

How to do it...

How it works...

There's more...

See also

Working with bit fields

Getting started

How to do it...

How it works...

See also

Providing custom derives

Getting started

How to do it...

How it works...

There's more...

Converting types into each other

How to do it...

How it works...

Boxing data

How to do it...

How it works...

There's more...

See also

Sharing ownership with smart pointers

How to do it...

How it works...

There's more...

See also

Working with interior mutability

How to do it...

How it works...

There's more...

See also

Handling Errors

Introduction

Providing user-defined error types

How to do it...

How it works...

There's more...

Providing logging

How to do it...

How it works...

There's more...

Creating a custom logger

How to do it...

How it works...

There's more...

See also

Implementing the Drop trait

How to do it...

How it works...

There's more...

See also

Understanding RAII

How to do it...

How it works...

There's more...

See also

Parallelism and Rayon

Introduction

Parallelizing iterators

How to do it...

How it works...

See also

Running two operations together

How to do it...

How it works...

There's more...

See also

Sharing resources in multithreaded closures

How to do it...

How it works...

See also

Sending data across threads

How to do it...

How it works...

There's more...

See also

Accessing resources in parallel with RwLocks

How to do it...

How it works...

There's more...

See also

Atomically accessing primitives

How to do it...

How it works...

There's more...

See also

Putting it all together in a connection handler

How to do it...

How it works...

There's more...

Working with Futures

Introduction

Providing futures with a CPU pool and waiting for them

How to do it...

How it works...

Handling errors in futures

How to do it...

How it works...

See also

Combining futures

How to do it...

How it works...

See also

Using Streams

How to do it...

How it works...

Using Sinks

How to do it...

How it works...

Using the oneshot channel

How to do it...

How it works...

Returning futures

How to do it...

How it works...

There's more...

See also

Locking resources with BiLocks

How to do it...

How it works...

Networking

Introduction

Setting up a basic HTTP server

Getting ready

How to do it...

How it works...

See also

Configuring an HTTP server to perform echoing and routing

Getting ready

How to do it...

How it works...

Configuring an HTTP server to perform file serving

How to do it...

How it works...

There's more...

See also

Making requests to APIs

How to do it...

How it works...

There's more...

See also

Using Experimental Nightly Features

Introduction

Iterating over an inclusive range

How to do it...

How it works...

See also

Returning abstract types

How to do it...

How it works...

There's more...

See also

Composing functions

How to do it...

How it works...

See also

Filtering strings efficiently

How to do it...

How it works...

See also

Stepping through an iterator in regular intervals

How to do it...

How it works...

See also

Benchmarking your code

How to do it...

How it works...

There's more...

See also

Using generators

How to do it...

How it works...

See also

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部