std

  • Rust std study series: Pin

    This time we dive into std::pin which has a dense documentation. Types that pin data to its location in memory. It is sometimes useful to have objects that are guaranteed to not move, in the sense that their placement in memory does not change, and can thus be relied upon. A prime example of such… Continue reading

  • Rust std study series: alloc

    Let’s get deep into std::alloc! Memory allocator 101 The very basic need for any program to compile and execute is having access to either physical memory or virtual memory. An allocator is responsible for providing such an access. You can think of an allocator as a service, taking some sort of requests and either giving… Continue reading

  • Rust std study series: Interior mutability

    Continuing the standard library study, it’s time for Cell<T>! Rust compiler enforces multiple reads access and a single write access mutually exclusive, i.e. either multiple shared references & or one and only one mutable reference & mut. So essentially, Rust prevents the evil of aliasing and mutation between multiple threads. Cell<T> is a sharable mutable… Continue reading

  • Rust std study series: VecDeque

    Continuing from Rust standard library study series, it’s time for VecDeque<T>. Because of its similarity to Vec, there isn’t much to say. A double-ended queue implemented with a growable ring buffer. The “default” usage of this type as a queue is to use push_back to add to the queue, and pop_front to remove from the… Continue reading

  • Rust std study series: LinkedList

    Continuing from Rust standard library study series, it’s time for LinkedList<T>. Note that implementation are taken from Rust stable v1.33.0. A doubly-linked list with owned nodes. The LinkedList allows pushing and popping elements at either end in constant time. Almost always it is better to use Vec or VecDeque instead of LinkedList. In general, array-based… Continue reading

  • Rust std study series: Vec

    The upcoming series of blog posts will contain my study of Rust standard library. I’ve partially written some parts of the series in scattered places and want to gather them in one place for better and easier access. I intend to update whenever I discover something interesting/important to remember. I’m referring to implementations in Rust… Continue reading

About Me

I’m a Machine Learning Engineer. If you want to know more about me and my work, please check out my GitHub and Linkedin.

Newsletter