pub struct CalculatorSynchronousProxy { /* private fields */ }Implementations§
Source§impl CalculatorSynchronousProxy
impl CalculatorSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<CalculatorEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<CalculatorEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn add(
&self,
a: f64,
b: f64,
___deadline: MonotonicInstant,
) -> Result<f64, Error>
pub fn add( &self, a: f64, b: f64, ___deadline: MonotonicInstant, ) -> Result<f64, Error>
Adds two numbers together and returns their sum.
For example, with a being 4.5 and b being 3.2, the response sum is
7.7.
- request
athe first number to be added. - request
bthe second number to be added.
- response
sumthe sum of a and b.
Sourcepub fn subtract(
&self,
a: f64,
b: f64,
___deadline: MonotonicInstant,
) -> Result<f64, Error>
pub fn subtract( &self, a: f64, b: f64, ___deadline: MonotonicInstant, ) -> Result<f64, Error>
Subtracts two numbers and returns their difference.
For example, with a being 7.7 and b being 3.2, the response
difference is 4.5
- request
athe number to be subracted from. - request
bthe number to subtract.
- response
differencethe difference betweenaandb.
Sourcepub fn multiply(
&self,
a: f64,
b: f64,
___deadline: MonotonicInstant,
) -> Result<f64, Error>
pub fn multiply( &self, a: f64, b: f64, ___deadline: MonotonicInstant, ) -> Result<f64, Error>
Multiplies two numbers and returns their product.
For example, with a being 1.5 and b being 2.0, the response
product is 3.0
- request
athe first number used to calculatorulate theproduct. - request
bthe second number used to calculatorulate theproduct.
- response
productthe result of multiplyingaandb.
Sourcepub fn divide(
&self,
dividend: f64,
divisor: f64,
___deadline: MonotonicInstant,
) -> Result<f64, Error>
pub fn divide( &self, dividend: f64, divisor: f64, ___deadline: MonotonicInstant, ) -> Result<f64, Error>
Divides one number by another and return the quotient.
For example with a dividend of 2.0 and a divisor of 4.0, the
response quotient is 0.5.
- request
dividendthe number to divide with. - request
divisorthe number to divide into.
- response
quotientthe result of dividing thedividendinto thedivisor.
Sourcepub fn pow(
&self,
base: f64,
exponent: f64,
___deadline: MonotonicInstant,
) -> Result<f64, Error>
pub fn pow( &self, base: f64, exponent: f64, ___deadline: MonotonicInstant, ) -> Result<f64, Error>
Takes base to the exponent and returns the power.
For example with a base of 3.0 and an exponent of 4.0, the response
power is 81.0.
- request
basethe number to multiply by itself. - request
exponentthe number of times to successively multiplybase.
- response
powerthe result of multiplyingbaseby itselfexponenttimes..
Trait Implementations§
Source§impl Debug for CalculatorSynchronousProxy
impl Debug for CalculatorSynchronousProxy
Source§impl From<CalculatorSynchronousProxy> for Handle
Available on Fuchsia only.
impl From<CalculatorSynchronousProxy> for Handle
Source§fn from(value: CalculatorSynchronousProxy) -> Self
fn from(value: CalculatorSynchronousProxy) -> Self
Source§impl From<Channel> for CalculatorSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for CalculatorSynchronousProxy
Source§impl FromClient for CalculatorSynchronousProxy
Available on Fuchsia only.
impl FromClient for CalculatorSynchronousProxy
Source§type Protocol = CalculatorMarker
type Protocol = CalculatorMarker
Source§fn from_client(value: ClientEnd<CalculatorMarker>) -> Self
fn from_client(value: ClientEnd<CalculatorMarker>) -> Self
Source§impl SynchronousProxy for CalculatorSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for CalculatorSynchronousProxy
Source§type Proxy = CalculatorProxy
type Proxy = CalculatorProxy
Source§type Protocol = CalculatorMarker
type Protocol = CalculatorMarker
Proxy controls.