pub struct Interrupt(/* private fields */);Expand description
A handle on a running statement.
Cloning is cloning the handle, not the state: every clone reads and
writes the same word, which is what lets one thread hand a copy to
the executor and keep one to raise. Interrupt::default is the
handle nobody is holding, and it is the one that costs nothing.
Implementations§
Source§impl Interrupt
impl Interrupt
Sourcepub fn armed() -> Interrupt
pub fn armed() -> Interrupt
A handle a caller can raise, with the word allocated for it.
Spelled apart from Default because the two are different
things: this one can stop a statement and the default one
cannot, and a constructor that quietly returned the second when
asked for the first would be a cancellation that never arrives.
Sourcepub fn stop(&self)
pub fn stop(&self)
Asks the statement to stop. Does nothing on a handle nobody armed, which is the honest answer: there is no statement on the other end of it.
Sourcepub fn check(&self) -> Result<()>
pub fn check(&self) -> Result<()>
The check an executor makes at a boundary: Ok while nobody has
asked, and the condition that ends the statement once somebody
has.
Sourcepub fn clear(&self)
pub fn clear(&self)
Puts the flag down and the count back to zero, which is what makes one handle serve a session rather than one statement.
Called before a statement rather than after it, so that a stop which arrived while nothing was running cannot end the next thing the user types.
Sourcepub fn read(&self, rows: u64)
pub fn read(&self, rows: u64)
The executor reporting rows it has read out of storage.
Rows read rather than rows answered, because the number is there to show a person that something is happening, and a statement that reads a hundred million rows to answer one row is exactly the statement they are waiting on.