pub struct OperationParams {
pub strings: HashMap<String, String>,
pub integers: HashMap<String, i64>,
pub floats: HashMap<String, f64>,
pub booleans: HashMap<String, bool>,
pub vectors: HashMap<String, Vec<f64>>,
pub shapes: HashMap<String, Vec<usize>>,
}Expand description
Parameters that can be passed to custom operations
Fields§
§strings: HashMap<String, String>String parameters
integers: HashMap<String, i64>Integer parameters
floats: HashMap<String, f64>Float parameters
booleans: HashMap<String, bool>Boolean parameters
vectors: HashMap<String, Vec<f64>>Vector parameters
shapes: HashMap<String, Vec<usize>>Shape parameters
Implementations§
Source§impl OperationParams
impl OperationParams
Sourcepub fn with_string(self, key: &str, value: &str) -> Self
pub fn with_string(self, key: &str, value: &str) -> Self
Add a string parameter
Sourcepub fn with_float(self, key: &str, value: f64) -> Self
pub fn with_float(self, key: &str, value: f64) -> Self
Add a float parameter
Sourcepub fn with_vector(self, key: &str, value: Vec<f64>) -> Self
pub fn with_vector(self, key: &str, value: Vec<f64>) -> Self
Add a vector parameter
Sourcepub fn with_shape(self, key: &str, value: Vec<usize>) -> Self
pub fn with_shape(self, key: &str, value: Vec<usize>) -> Self
Add a shape parameter
Sourcepub fn get_string(&self, key: &str) -> Option<&String>
pub fn get_string(&self, key: &str) -> Option<&String>
Get a string parameter
Trait Implementations§
Source§impl Clone for OperationParams
impl Clone for OperationParams
Source§fn clone(&self) -> OperationParams
fn clone(&self) -> OperationParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperationParams
impl Debug for OperationParams
Auto Trait Implementations§
impl Freeze for OperationParams
impl RefUnwindSafe for OperationParams
impl Send for OperationParams
impl Sync for OperationParams
impl Unpin for OperationParams
impl UnwindSafe for OperationParams
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more