Crate take_ref

Source
Expand description

§take_ref

take_ref provides the TakeRef, TakeSlice, and TakeString traits to enable treating values and their reference/slice types interchangeably until the moment taking ownership is required. If taking ownership is required sometimes but not always, this can eliminate the need to always copy data from reference types.

Traits§

  • The TakeRef trait for Rust enables treating references and values interchangeably.
  • The TakeSlice trait for Rust enables treating slices and Vec instances interchangeably.
  • The TakeString trait for Rust enables treating &str and String instances interchangeably.