pub struct OptimizedParameterMapper<'a> { /* private fields */ }Expand description
Example of how to refactor parameter mapping to reduce clones
Implementations§
Source§impl<'a> OptimizedParameterMapper<'a>
impl<'a> OptimizedParameterMapper<'a>
pub fn new(param_names: Vec<&'a str>) -> Self
Sourcepub fn map_parameters(&mut self, args: &[&'a str]) -> HashMap<&'a str, &'a str>
pub fn map_parameters(&mut self, args: &[&'a str]) -> HashMap<&'a str, &'a str>
Map parameters without cloning the parameter names
Sourcepub fn add_dynamic_param(&mut self, name: String, value: String)
pub fn add_dynamic_param(&mut self, name: String, value: String)
Add a dynamic parameter (only when string ownership is required)
Auto Trait Implementations§
impl<'a> Freeze for OptimizedParameterMapper<'a>
impl<'a> RefUnwindSafe for OptimizedParameterMapper<'a>
impl<'a> Send for OptimizedParameterMapper<'a>
impl<'a> Sync for OptimizedParameterMapper<'a>
impl<'a> Unpin for OptimizedParameterMapper<'a>
impl<'a> UnsafeUnpin for OptimizedParameterMapper<'a>
impl<'a> UnwindSafe for OptimizedParameterMapper<'a>
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
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