pub enum Formula<QOut, QIn1 = QOut, QIn2 = f32>where
QOut: Quantity + 'static,
QIn1: Quantity + 'static + Mul<QIn2, Output = QOut>,
QIn2: Quantity + 'static,{
Subscriber(Box<dyn FormulaSubscriber<QuantityType = QOut>>),
Coalesce(Vec<FormulaOperand<QOut>>),
Min(Vec<FormulaOperand<QOut>>),
Max(Vec<FormulaOperand<QOut>>),
Avg(Vec<FormulaOperand<QOut>>),
Add(Vec<FormulaOperand<QOut>>),
Subtract(Vec<FormulaOperand<QOut>>),
Multiply(FormulaOperand<QIn1>, FormulaOperand<QIn2>),
Divide(FormulaOperand<QIn1>, FormulaOperand<QIn2>),
}Expand description
A composable Formula.
Variants§
Subscriber(Box<dyn FormulaSubscriber<QuantityType = QOut>>)
Coalesce(Vec<FormulaOperand<QOut>>)
Min(Vec<FormulaOperand<QOut>>)
Max(Vec<FormulaOperand<QOut>>)
Avg(Vec<FormulaOperand<QOut>>)
Add(Vec<FormulaOperand<QOut>>)
Subtract(Vec<FormulaOperand<QOut>>)
Multiply(FormulaOperand<QIn1>, FormulaOperand<QIn2>)
Divide(FormulaOperand<QIn1>, FormulaOperand<QIn2>)
Implementations§
Source§impl<Q> Formula<Q>where
Q: Quantity + 'static,
impl<Q> Formula<Q>where
Q: Quantity + 'static,
pub fn coalesce( self, other: impl Into<FormulaOperand<Q>>, ) -> Result<Formula<Q>, Error>
pub fn min( self, other: impl Into<FormulaOperand<Q>>, ) -> Result<Formula<Q>, Error>
pub fn max( self, other: impl Into<FormulaOperand<Q>>, ) -> Result<Formula<Q>, Error>
pub fn avg(self, others: Vec<Formula<Q>>) -> Result<Formula<Q>, Error>
pub async fn subscribe(&self) -> Result<Receiver<Sample<Q>>, Error>
Trait Implementations§
Source§impl<QOut, QIn1, QIn2> FormulaSubscriber for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1, QIn2> FormulaSubscriber for Formula<QOut, QIn1, QIn2>
Auto Trait Implementations§
impl<QOut, QIn1, QIn2> Freeze for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1 = QOut, QIn2 = f32> !RefUnwindSafe for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1, QIn2> Send for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1, QIn2> Sync for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1, QIn2> Unpin for Formula<QOut, QIn1, QIn2>
impl<QOut, QIn1 = QOut, QIn2 = f32> !UnwindSafe for Formula<QOut, QIn1, QIn2>
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 moreSource§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