pub struct OptimizationPatterns;Expand description
Common optimization patterns
Implementations§
Source§impl OptimizationPatterns
impl OptimizationPatterns
Sourcepub fn clone_elimination_example() -> (&'static str, &'static str)
pub fn clone_elimination_example() -> (&'static str, &'static str)
Example: Avoiding unnecessary clones
Sourcepub fn string_slice_example() -> (&'static str, &'static str)
pub fn string_slice_example() -> (&'static str, &'static str)
Example: String slice optimization
Sourcepub fn iterator_chain_example() -> (&'static str, &'static str)
pub fn iterator_chain_example() -> (&'static str, &'static str)
Example: Iterator chain optimization
Sourcepub fn slice_parameter_example() -> (&'static str, &'static str)
pub fn slice_parameter_example() -> (&'static str, &'static str)
Example: Slice parameter
Sourcepub fn cow_example() -> (&'static str, &'static str)
pub fn cow_example() -> (&'static str, &'static str)
Example: Cow optimization
Sourcepub fn smart_pointer_example() -> &'static str
pub fn smart_pointer_example() -> &'static str
Example: Smart pointer selection
Auto Trait Implementations§
impl Freeze for OptimizationPatterns
impl RefUnwindSafe for OptimizationPatterns
impl Send for OptimizationPatterns
impl Sync for OptimizationPatterns
impl Unpin for OptimizationPatterns
impl UnsafeUnpin for OptimizationPatterns
impl UnwindSafe for OptimizationPatterns
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more