pub trait Function<C: Context>: Node {
type Value: Buffer;
type Error: Error;
// Required method
fn evaluate<CR: AsRef<C>>(&self, ctx: CR) -> AegirResult<Self, C>;
// Provided methods
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.