| 100 | // #[typetag::serde] before it |
| 101 | #[typetag::serde(tag = "type")] |
| 102 | pub 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 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected