StateHandling

Trait StateHandling 

Source
pub trait StateHandling {
    // Required methods
    fn state_type(&self) -> StateType;
    fn as_any(&self) -> &dyn Any;
    fn compare(&self, other: &dyn StateHandling) -> StateComparisonReport;

    // Provided method
    fn is_comparable(&self, other: &dyn StateHandling) -> bool { ... }
}
Expand description

An interface to handle and compare the state of various types.

Required Methods§

Source

fn state_type(&self) -> StateType

Returns the StateType of the implementation.

Source

fn as_any(&self) -> &dyn Any

Returns self as an Any.

Source

fn compare(&self, other: &dyn StateHandling) -> StateComparisonReport

Compares this and another StateHandling implementation.

§Notes

An implementation is expected to return

Provided Methods§

Source

fn is_comparable(&self, other: &dyn StateHandling) -> bool

Checks whether this StateHandling implementation is comparable to another.

Returns true, if the StateType of self and that of other can be compared, false otherwise.

§Note

It should not be necessary to specifically implement this method.

Implementors§