pub struct Rpc { /* private fields */ }Implementations§
Source§impl Rpc
impl Rpc
Sourcepub fn arg_string(&mut self, name: &str, value: &str) -> Result<&mut Self>
pub fn arg_string(&mut self, name: &str, value: &str) -> Result<&mut Self>
Sourcepub fn arg_double(&mut self, name: &str, value: f64) -> Result<&mut Self>
pub fn arg_double(&mut self, name: &str, value: f64) -> Result<&mut Self>
Sourcepub fn arg_bool(&mut self, name: &str, value: bool) -> Result<&mut Self>
pub fn arg_bool(&mut self, name: &str, value: bool) -> Result<&mut Self>
Add a boolean argument to the RPC call
§Arguments
name- The argument namevalue- The boolean value
Sourcepub fn execute(self, timeout: f64) -> Result<Value>
pub fn execute(self, timeout: f64) -> Result<Value>
Execute the RPC call synchronously
§Arguments
timeout- Maximum time to wait in seconds
§Returns
Returns the result value from the server, or an error if the operation failed or timed out.
§Example
let mut rpc = ctx.rpc("calculator:add").unwrap();
rpc.arg_double("a", 10.0);
rpc.arg_double("b", 5.0);
let result = rpc.execute(5.0).unwrap();
let sum = result.get_field_double("result").unwrap();Auto Trait Implementations§
impl Freeze for Rpc
impl RefUnwindSafe for Rpc
impl !Send for Rpc
impl !Sync for Rpc
impl Unpin for Rpc
impl UnsafeUnpin for Rpc
impl UnwindSafe for Rpc
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