pub struct DecayParamsExpressionBuilder { /* private fields */ }Expand description
Builder for the DecayParamsExpression struct, which represents parameters for decay functions.
Decay functions (exponential, Gaussian, linear) are used in scoring to create a decay effect based on distance from a target value.
Implementations§
Source§impl DecayParamsExpressionBuilder
impl DecayParamsExpressionBuilder
Sourcepub fn new<E: Into<Expression>>(x: E) -> Self
pub fn new<E: Into<Expression>>(x: E) -> Self
Creates a new DecayParamsExpressionBuilder with the variable to decay. This is the only required parameter.
Sourcepub fn x<E: Into<Expression>>(self, x: E) -> Self
pub fn x<E: Into<Expression>>(self, x: E) -> Self
Sets the variable to decay. This is the value that will be compared to the target.
Sourcepub fn target<E: Into<Expression>>(self, target: E) -> Self
pub fn target<E: Into<Expression>>(self, target: E) -> Self
Sets the target value to start decaying from. Defaults to 0 if not specified. The decay is at its maximum (1.0) when x equals the target.
Source§impl DecayParamsExpressionBuilder
impl DecayParamsExpressionBuilder
Sourcepub fn build(self) -> DecayParamsExpression
pub fn build(self) -> DecayParamsExpression
Builds the DecayParamsExpression from this builder.
Trait Implementations§
Source§impl Clone for DecayParamsExpressionBuilder
impl Clone for DecayParamsExpressionBuilder
Source§fn clone(&self) -> DecayParamsExpressionBuilder
fn clone(&self) -> DecayParamsExpressionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<DecayParamsExpressionBuilder> for DecayParamsExpression
impl From<DecayParamsExpressionBuilder> for DecayParamsExpression
Source§fn from(value: DecayParamsExpressionBuilder) -> Self
fn from(value: DecayParamsExpressionBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DecayParamsExpressionBuilder
impl RefUnwindSafe for DecayParamsExpressionBuilder
impl Send for DecayParamsExpressionBuilder
impl Sync for DecayParamsExpressionBuilder
impl Unpin for DecayParamsExpressionBuilder
impl UnwindSafe for DecayParamsExpressionBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request