MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / CustomOperationBody

Interface CustomOperationBody

ciphercore-base/src/custom_ops.rs:102–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100// #[typetag::serde] before it
101#[typetag::serde(tag = "type")]
102pub trait CustomOperationBody: 'static + Debug + DynEqHash + Send + Sync {
103 /// Defines the logic of a custom operation.
104 ///
105 /// This function must create a graph in a given context computing a custom operation.
106 /// Note that that the number of inputs and their types can vary.
107 /// This function should describe the logic of the custom operation for all acceptable cases and return an error otherwise.
108 ///
109 /// # Arguments
110 ///
111 /// * `context` - context where a graph computing a custom operation should be created
112 /// * `arguments_types` - vector of input types of a custom operation
113 ///
114 /// # Returns
115 ///
116 /// New graph computing a custom operation
117 fn instantiate(&self, context: Context, arguments_types: Vec<Type>) -> Result<Graph>;
118
119 /// Specifies and returns the name of this custom operation.
120 ///
121 /// The name must be unique among all the implemented custom operations.
122 ///
123 /// # Returns
124 ///
125 /// Name of this custom operation
126 fn get_name(&self) -> String;
127}
128
129/// A structure that stores a pointer to a custom operation.
130///

Callers

nothing calls this directly

Implementers 15

custom_ops.rsciphercore-base/src/custom_ops.rs
multiplexer.rsciphercore-base/src/ops/multiplexer.rs
clip.rsciphercore-base/src/ops/clip.rs
comparisons.rsciphercore-base/src/ops/comparisons.rs
long_division.rsciphercore-base/src/ops/long_division.
inverse_sqrt.rsciphercore-base/src/ops/inverse_sqrt.r
integer_key_sort.rsciphercore-base/src/ops/integer_key_so
min_max.rsciphercore-base/src/ops/min_max.rs
goldschmidt_division.rsciphercore-base/src/ops/goldschmidt_di
taylor_exponent.rsciphercore-base/src/ops/taylor_exponen
adder.rsciphercore-base/src/ops/adder.rs
auc.rsciphercore-base/src/ops/auc.rs

Calls

no outgoing calls

Tested by

no test coverage detected