LLVM 링크 정리

Documentation Links

Presentation Materials

Sample Codes

Tools


A skeleton code for Iterator in Rust

For record, I wrote down the same code.

Consuming Iterator


pub struct TaskSet;
pub struct TaskSetIterator {
}
impl Iterator for TaskSetIterator {
type Item = Task;
fn next(&mut self) -> Option<Task> {
….
}
}
pub struct Task;
impl IntoIterator for TaskSet {
type Item = Task;
type IntoIter = TaskSetIterator;
fn into_iter(self) -> Self::IntoIter {
TaskSetIterator { … }
}
}

view raw

task.rs

hosted with ❤ by GitHub

Iterator that does not consume items


pub struct TaskSetRefIterator<'a>
{
….
}
impl<'a> Iterator for TaskSetRefIterator<'a> {
type Item = &'a Task;
fn next(&mut self) -> Option<&'a Task> {
None
}
}
impl<'a> IntoIterator for &'a TaskSet {
type Item = &'a Task;
type IntoIter = TaskSetRefIterator<'a>;
fn into_iter(self) -> Self::IntoIter {
TaskSetRefIterator { … }
}
}

view raw

task2.rs

hosted with ❤ by GitHub


Awesome documentation links for Rust

I wrote down the useful links that I have learned. I’ll continue to update it.

General

Abstraction

Ownership

Object Safety

FFI

Iterator

Pattern Matching

Error handling

biild.rs

Examples

Idiomatic Usages of Rust

API Design

Ownership

Network and I/O

Macro

MIO

Projects Worth Watching

Papers

Profiling

Updates

  • Oct 15, 2015 – Added The Little Book of Rust Macros.
  • Nov 3. 2015 – Add ‘Rust Design Pattern’ and ‘Exposing Rust struct to Python’