Struct rotor::Response [] [src]

pub struct Response<M, N>(_);

The response of a state machine to the (mio) action

This value is returned by many methods of the Machine trait.

Methods

impl<M: Sized, N: Sized> Response<M, N>
[src]

Stop the state machine with an error.

If rotor was compiled with the log_errors feature, the error will be logged on the warning level.

Maps state machine and/or spawned result with a function

Usually it's okay to use constructor of wrapper state machine here as a mapper

Similar to map but only maps state machine

This is especially useful in state machine constructors, which have a Void child type.

Returns true if state machine is stopped

I.e. the method returns true if the Response was created either with Response::done or Response::error

Return a reference to an error passed to Response::error

Returns None if any other constructor was used.

This is mostly useful for printing the error.

impl<M: Sized + Debug, N: Sized + Debug> Response<M, N>
[src]

Return state machine if response created with Response::ok(..)

Use only for unit tests

If the response is not okay, the function panics.

Return a tuple if response created with Response::spawn(..)

Use only for unit tests

If the response is not spawn, the function panics.

Returns if response created with Response::done()

Use only for unit tests

If the response is not done, the function panics.

Returns an error if response created with Response::error(..)

Use only for unit tests

If the response does not contain error, the function panics.