interrupt_support/
error.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2License, v. 2.0. If a copy of the MPL was not distributed with this
3* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5/// The error returned by err_if_interrupted.
6#[derive(Debug, Clone)]
7pub struct Interrupted;
8
9impl std::fmt::Display for Interrupted {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        f.write_str("The operation was interrupted")
12    }
13}
14
15impl std::error::Error for Interrupted {}