pub struct Interruptor(/* private fields */);Expand description
An interruptor for an InterruptReader.
This struct serves the purpose of interrupting any of the Read
or BufRead functions being performend on the InterruptReader
If it is dropped, the InterruptReader will no longer be able to
be interrupted.
Implementations§
Source§impl Interruptor
impl Interruptor
Sourcepub fn interrupt(&self) -> Result<(), InterruptSendError>
pub fn interrupt(&self) -> Result<(), InterruptSendError>
Interrupts the InterruptReader
This will send an interrupt event to the reader, which makes
the next read operation return Err, with an
ErrorKind::Other with a payload of InterruptReceived.
You can check if an std::io::Error is of this type by
calling the is_interrupt function.
Subsequent read operations proceed as normal.
Trait Implementations§
Source§impl Clone for Interruptor
impl Clone for Interruptor
Source§fn clone(&self) -> Interruptor
fn clone(&self) -> Interruptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Interruptor
impl RefUnwindSafe for Interruptor
impl Send for Interruptor
impl Sync for Interruptor
impl Unpin for Interruptor
impl UnwindSafe for Interruptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more