pub type StateCallback = dyn FnMut(State) + Send + Sync + 'static;
User supplied state callback.
state: The new state of the stream
state