e019: Let's `Clone` a `Cow` episode artwork

EPISODE · Feb 28, 2017 · 18 MIN

e019: Let's `Clone` a `Cow`

from New Rustacean · host Chris Krycho

code{white-space: pre;} The final pieces of the story for (single-threaded) memory management in Rust. Notes Sometimes, we actually do need to copy types. Wouldn't it be nice if Rust gave us a convenient way to do that when it's convenient, or when the cost is low enough that the ergonomic tradeoffs are worth it? Well, perhaps unsurprisingly, it does! The Copy and Clone traits, plus the Cow type, give us everything we need! Links underhanded.rs The typess std::marker::Copy "Copy types" in the book "Stack-Only Data: Copy" in the new book 7.2.0.2 Moved and copied types: When a local variable is used as an rvalue, the variable will be copied if its type implements Copy. All others are moved. Extended example in "Traits" section of new book std::clone::Clone std::borrow::Cow Default implementations discussion in the current book discussion in the new book Supertraits from the discussion in the reference (6.1.9 Traits): Traits may inherit from other traits.... The syntax Circle : Shape means that types that implement Circle must also have an implementation for Shape. Multiple supertraits are separated by +, trait Circle : Shape + PartialEq { }. In an implementation of Circle for a given type T, methods can refer to Shape methods, since the typechecker checks that any type with an implementation of Circle also has an implementation of Shape... discussion of trait "inheritance" in the book discussion of trait super- and subtyping in the new book (note: still to-be-written at the time this episode was published) Marker traits std::marker in the reference: 9 Special Traits Previous episodes on traits: e008: Just like something else e009: Composing a Rustic tune Sponsors Aleksey Pirogov Andreas Fischer Andrew Thompson Austin LeSure Ben Whitley Charlie Egan Chris Palmer Christopher Giffard Daniel Collin Derek Morr Jakub "Limeth" Hlusička Jordan Henderson Jupp Müller Keith Gray Lachlan Collins Luca Schmid Matt Rudder Matthew Piziak Max Jacobson Micael Bergeron Ovidiu Curcan Pascal Hertleif Peter Tillemans Philipp Keller Ralph Giles ("rillian") Raph Levien reddraggone9 Steven Murawski Stuart Hinson Tyler Harper Vesa Kaihlavirta Vlad Bezden William Roe Zaki (Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!) Become a sponsor Patreon Venmo Dwolla Cash.me Flattr PayPal.me Contact New Rustacean: Twitter: @newrustacean Email: [email protected] Chris Krycho GitHub: chriskrycho Twitter: @chriskrycho

Episode metadata supplied by the publisher feed · Published Feb 28, 2017

The final pieces of the story for (single-threaded) memory management in Rust. Notes ----- Sometimes, we actually do need to copy types. Wouldn't it be nice if Rust gave us a convenient way to do that when it's convenient, or when the cost is low enough that the ergonomic tradeoffs are worth it? Well, perhaps unsurprisingly, it does! The Copy and Clone traits, plus the Cow type, give us everything we need! Sponsors -------- - Aleksey Pirogov - Andreas Fischer - Andrew Thompson - Austin LeSure - Ben Whitley - Charlie Egan - Chris Palmer - Christopher Giffard - Daniel Collin - Derek Morr - Jakub "Limeth" Hlusička - Jordan Henderson - Jupp Müller - Keith Gray - Lachlan Collins - Luca Schmid - Matt Rudder - Matthew Piziak - [Max Jacobson] - Micael Bergeron - Ovidiu Curcan - Pascal Hertleif - Peter Tillemans - Philipp Keller - Ralph Giles ("rillian") - Raph Levien - reddraggone9 - Steven Murawski - Stuart Hinson - Tyler Harper - Vesa Kaihlavirta - Vlad Bezden - William Roe - Zaki (Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!) ### Become a sponsor - Patreon.com/newrustacean - Venmo.com/chriskrycho - Dwolla](https://www.dwolla.com/hub/chriskrycho - Cash.me/$chriskrycho - Flattr.com/profile/chriskrycho - PayPal.me/chriskrycho Contact ------- - New Rustacean: + Twitter: @newrustacean + Email: [email protected] - Chris Krycho + GitHub: chriskrycho + Twitter: @chriskrycho

PodParley-generated summary based on available episode metadata and transcript content.

NOW PLAYING

e019: Let's `Clone` a `Cow`

0:00 18:11

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

Chewing the Fat with WorkForge WorkForge Bite-Sized Conversations for Building a Stronger Workforce Welcome to Chewing the Fat, a podcast delving deep into the world of food manufacturing. Dive into real conversations around critical topics like staffing, retention, onboarding, and career development in this essential industry. Subscribe now to gain insights from your peers, subject matter experts and more on the biggest issues facing food manufacturers today: -Hiring and retaining employees -Addressing the challenges of the Silver Tsunami -Improving time to productivity of new employees -Engaging employees from hire to retire And more... Tune in to Chewing the Fat, a WorkForge podcast, and join the conversation on how to build and sustain a resilient, high-performing workforce in food manufacturing. The Course Mentors Podcast The Course Mentors Hey there, future course creator!Ever feel like turning your know-how into an online course is like trying to solve a Rubik's cube blindfolded? Well, grab your headphones because "The Course Mentors Podcast" is here to be your secret weapon!Meet Aimee and Odette (that's us!), your new best friends in the course creation world. We've been in the trenches for over a decade, and for the last five years, we've been rocking the online course space. Now we're here to spill all our secrets in bite-sized, 15-20 minute episodes that'll fit perfectly in your coffee breaks.No fluff, no filler - just real, actionable advice that'll take you from "um, what's a landing page?" to "holy moly, I just hit six figures!". We're talking everything from crafting your course to marketing it like a pro and building a business that'll have you pinching yourself.Whether you're dreaming of ditching the 9-to-5 grind, adding a sweet extra income str CISO Perspectives (public) N2K Networks This season on CISO Perspectives, host Kim Jones explores some of the challenges of leading through uncertainty. We explore the complexity of the changing nature of regulation and working with the federal government, the evolution of privacy and fraud, and how emerging technologies like AI and quantum computing are changing cyber. When you don’t know what questions to ask, you’re afraid to ask, or don’t know who to ask, CISO Perspectives provides the foundation for learning in this brave new world. The PFN Cincinnati Bengals Podcast Pro Football Network The PFN Cincinnati Bengals Podcast is where you can stay up-to-date with the latest news and analysis on the Cincinnati Bengals! Our hosts, industry experts Jay Morrison and Dallas Robinson, provide weekly coverage of all the latest rumors and updates about the Bengals. Don’t forget to follow the show to receive new episodes directly in your podcast feed and leave a rating and review to let us know your thoughts.

Frequently Asked Questions

How long is this episode of New Rustacean?

This episode is 18 minutes long.

When was this New Rustacean episode published?

This episode was published on February 28, 2017.

What is this episode about?

code{white-space: pre;} The final pieces of the story for (single-threaded) memory management in Rust. Notes Sometimes, we actually do need to copy types. Wouldn't it be nice if Rust gave us a convenient way to do that...

Can I download this New Rustacean episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!