Struct rotor_stream::Intent [] [src]

pub struct Intent<M>(_, _, _);

A structure that encapsulates a state machine and an expectation

It's usually built with a builder that starts with Intent::of(machine).

Then you add an expectation:

Intent::of(machine).expect_delimiter("\n", 1024)

And then you may add a timeout (in form of "deadline" or "absolute time"):

Intent::of(machine).expect_bytes(100)
    .deadline(scope.now() + Duration::new(10, 0))

Methods

impl<M> Intent<M>
[src]

Start building the Intent object of the state machine

Notifies that state machine has done it's work

Notifies that we have protocol error and connection should be closed

Add/change the deadline

Note: if you skip this method on next return timeout will be reset. Which means this state machine may hang indefinitely.

Add/change the deadline as an optional value

Note this will reset timeout if deadline is None, not keep unchanged

Trait Implementations

impl<M: Debug> Debug for Intent<M>
[src]

Formats the value using the given formatter.