pub trait ControlHandler {
    fn should_stop(&mut self, multipart: Multipart) -> bool;
}
Expand description

The ControlHandler trait is used to impose stopping rules for streams that otherwise would continue to create multiparts.

Required Methods

should_stop determines whether or not a ControlledStream should stop producing values.

It accepts a Multipart as input. This Multipart comes from the ControlledStream’s associated control MultipartStream. If you want to have a socket that stops based on the content of a message it receives, see the EndHandler trait.

Implementors