pub struct ComputeRequest {
pub domain: String,
pub function: String,
pub params: HashMap<String, ParamValue>,
}Expand description
Inbound computation request.
Fields§
§domain: StringTarget scientific domain.
function: StringFunction to compute.
params: HashMap<String, ParamValue>Named parameters.
Implementations§
Source§impl ComputeRequest
impl ComputeRequest
Sourcepub fn new(domain: &str, function: &str) -> ComputeRequest
pub fn new(domain: &str, function: &str) -> ComputeRequest
Creates an empty request for the given domain and function.
Sourcepub fn with_scalar(self, key: &str, value: f64) -> ComputeRequest
pub fn with_scalar(self, key: &str, value: f64) -> ComputeRequest
Adds a scalar parameter.
Sourcepub fn with_integer(self, key: &str, value: i64) -> ComputeRequest
pub fn with_integer(self, key: &str, value: i64) -> ComputeRequest
Adds an integer parameter.
Sourcepub fn with_text(self, key: &str, value: &str) -> ComputeRequest
pub fn with_text(self, key: &str, value: &str) -> ComputeRequest
Adds a text parameter.
Sourcepub fn with_bool(self, key: &str, value: bool) -> ComputeRequest
pub fn with_bool(self, key: &str, value: bool) -> ComputeRequest
Adds a boolean parameter.
Sourcepub fn with_array(self, key: &str, value: Vec<f64>) -> ComputeRequest
pub fn with_array(self, key: &str, value: Vec<f64>) -> ComputeRequest
Adds an array parameter.
Sourcepub fn get_scalar(&self, key: &str) -> Option<f64>
pub fn get_scalar(&self, key: &str) -> Option<f64>
Returns the scalar value for key, if present.
Sourcepub fn get_integer(&self, key: &str) -> Option<i64>
pub fn get_integer(&self, key: &str) -> Option<i64>
Returns the integer value for key, if present.
Sourcepub fn get_array(&self, key: &str) -> Option<&[f64]>
pub fn get_array(&self, key: &str) -> Option<&[f64]>
Returns the array value for key, if present.
Sourcepub fn from_json_str(json: &str) -> Option<ComputeRequest>
pub fn from_json_str(json: &str) -> Option<ComputeRequest>
Attempts to parse a ComputeRequest from a JSON string.
Trait Implementations§
Source§impl Clone for ComputeRequest
impl Clone for ComputeRequest
Source§fn clone(&self) -> ComputeRequest
fn clone(&self) -> ComputeRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComputeRequest
impl RefUnwindSafe for ComputeRequest
impl Send for ComputeRequest
impl Sync for ComputeRequest
impl Unpin for ComputeRequest
impl UnsafeUnpin for ComputeRequest
impl UnwindSafe for ComputeRequest
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