pub struct CalculatorProxy { /* private fields */ }
Implementations§
Source§impl CalculatorProxy
impl CalculatorProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.examples.calculator/Calculator.
Sourcepub fn take_event_stream(&self) -> CalculatorEventStream
pub fn take_event_stream(&self) -> CalculatorEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn add(
&self,
a: f64,
b: f64,
) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
pub fn add( &self, a: f64, b: f64, ) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
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
a
the first number to be added. - request
b
the second number to be added.
- response
sum
the sum of a and b.
Sourcepub fn subtract(
&self,
a: f64,
b: f64,
) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
pub fn subtract( &self, a: f64, b: f64, ) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
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
a
the number to be subracted from. - request
b
the number to subtract.
- response
difference
the difference betweena
andb
.
Sourcepub fn multiply(
&self,
a: f64,
b: f64,
) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
pub fn multiply( &self, a: f64, b: f64, ) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
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
a
the first number used to calculatorulate theproduct
. - request
b
the second number used to calculatorulate theproduct
.
- response
product
the result of multiplyinga
andb
.
Sourcepub fn divide(
&self,
dividend: f64,
divisor: f64,
) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
pub fn divide( &self, dividend: f64, divisor: f64, ) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
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
dividend
the number to divide with. - request
divisor
the number to divide into.
- response
quotient
the result of dividing thedividend
into thedivisor
.
Sourcepub fn pow(
&self,
base: f64,
exponent: f64,
) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
pub fn pow( &self, base: f64, exponent: f64, ) -> QueryResponseFut<f64, DefaultFuchsiaResourceDialect>
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
base
the number to multiply by itself. - request
exponent
the number of times to successively multiplybase
.
- response
power
the result of multiplyingbase
by itselfexponent
times..
Trait Implementations§
Source§impl CalculatorProxyInterface for CalculatorProxy
impl CalculatorProxyInterface for CalculatorProxy
type AddResponseFut = QueryResponseFut<f64>
type SubtractResponseFut = QueryResponseFut<f64>
type MultiplyResponseFut = QueryResponseFut<f64>
type DivideResponseFut = QueryResponseFut<f64>
type PowResponseFut = QueryResponseFut<f64>
fn add(&self, a: f64, b: f64) -> Self::AddResponseFut
fn subtract(&self, a: f64, b: f64) -> Self::SubtractResponseFut
fn multiply(&self, a: f64, b: f64) -> Self::MultiplyResponseFut
fn divide(&self, dividend: f64, divisor: f64) -> Self::DivideResponseFut
fn pow(&self, base: f64, exponent: f64) -> Self::PowResponseFut
Source§impl Clone for CalculatorProxy
impl Clone for CalculatorProxy
Source§fn clone(&self) -> CalculatorProxy
fn clone(&self) -> CalculatorProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CalculatorProxy
impl Debug for CalculatorProxy
Source§impl Proxy for CalculatorProxy
impl Proxy for CalculatorProxy
Source§type Protocol = CalculatorMarker
type Protocol = CalculatorMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for CalculatorProxy
impl !RefUnwindSafe for CalculatorProxy
impl Send for CalculatorProxy
impl Sync for CalculatorProxy
impl Unpin for CalculatorProxy
impl !UnwindSafe for CalculatorProxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)