pub trait Function<C: Context>: Node {
type Value: Buffer;
type Error: Error;
fn evaluate<CR: AsRef<C>>(&self, ctx: CR) -> AegirResult<Self, C>;
fn evaluate_spec<CR: AsRef<C>>(
&self,
ctx: CR
) -> Result<Spec<Self::Value>, Self::Error> { ... }
fn evaluate_shape<CR: AsRef<C>>(
&self,
ctx: CR
) -> Result<ShapeOf<Self::Value>, Self::Error> { ... }
}
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn evaluate_shape<CR: AsRef<C>>(
&self,
ctx: CR
) -> Result<ShapeOf<Self::Value>, Self::Error>
fn evaluate_shape<CR: AsRef<C>>(
&self,
ctx: CR
) -> Result<ShapeOf<Self::Value>, Self::Error>
Evaluate the function and return the shape of the Value.
Note: by default, this method performs a full evaluation and calls the shape method on the buffer. This should be overridden in your implementation for better efficiency.