OperationParams

Struct OperationParams 

Source
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

Source

pub fn new() -> Self

Create a new empty parameter set

Source

pub fn with_string(self, key: &str, value: &str) -> Self

Add a string parameter

Source

pub fn with_int(self, key: &str, value: i64) -> Self

Add an integer parameter

Source

pub fn with_float(self, key: &str, value: f64) -> Self

Add a float parameter

Source

pub fn with_bool(self, key: &str, value: bool) -> Self

Add a boolean parameter

Source

pub fn with_vector(self, key: &str, value: Vec<f64>) -> Self

Add a vector parameter

Source

pub fn with_shape(self, key: &str, value: Vec<usize>) -> Self

Add a shape parameter

Source

pub fn get_string(&self, key: &str) -> Option<&String>

Get a string parameter

Source

pub fn get_int(&self, key: &str) -> Option<i64>

Get an integer parameter

Source

pub fn get_float(&self, key: &str) -> Option<f64>

Get a float parameter

Source

pub fn get_bool(&self, key: &str) -> Option<bool>

Get a boolean parameter

Source

pub fn get_vector(&self, key: &str) -> Option<&Vec<f64>>

Get a vector parameter

Source

pub fn get_shape(&self, key: &str) -> Option<&Vec<usize>>

Get a shape parameter

Trait Implementations§

Source§

impl Clone for OperationParams

Source§

fn clone(&self) -> OperationParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OperationParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OperationParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V