pub trait Operation<S: Scalar> {
type Args;
// Required method
fn apply(
&self,
part: Part<S>,
operation_id: &str,
args: &Self::Args,
) -> GeopResult<Part<S>>;
// Provided method
fn handles(
&self,
before: &Part<S>,
args: &Self::Args,
) -> GeopResult<Vec<Handle>> { ... }
}Expand description
One kind of operation on a Part.
Required Associated Types§
Required Methods§
Sourcefn apply(
&self,
part: Part<S>,
operation_id: &str,
args: &Self::Args,
) -> GeopResult<Part<S>>
fn apply( &self, part: Part<S>, operation_id: &str, args: &Self::Args, ) -> GeopResult<Part<S>>
Applies the operation as the program step operation_id, consuming
part and returning the part it produces. Everything the operation
creates is named after operation_id (see geop_core_part), so the
id has to be unique within a program.
On error no part is returned — a caller that still needs the original should clone it first.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".