pub type Result<T> = core::result::Result<T, Error>;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
FromUtf8Error(#[from] std::string::FromUtf8Error),
#[error(transparent)]
XmlError(#[from] quick_xml::Error),
#[error(transparent)]
GtkBoolError(#[from] glib::BoolError),
#[error("GTK exited with code {0:?}")]
GtkBadExitCode(glib::ExitCode),
#[error("Builder is missing widget with ID {0:?}")]
WidgetMissingInBuilder(String),
#[error("Expected widget {widget_id:?} to be {expected_type} - not {actual_type}")]
IncorrectWidgetTypeInBuilder {
widget_id: String,
expected_type: glib::types::Type,
actual_type: glib::types::Type,
},
#[error("Cannot handle the signal named {0:?}")]
NoSuchSignalError(String),
#[error("Expected the parameter at index {index} of {signal:?} to be {expected_type} - not {actual_type}")]
IncorrectSignalParameterType {
signal: String,
index: usize,
expected_type: glib::types::Type,
actual_type: glib::types::Type,
},
#[error("{signal:?} does not have a parameter at index {index} - it only has {num_parameters} parameters")]
SignalParameterIndexOutOfBound {
signal: String,
index: usize,
num_parameters: usize,
},
#[error("Expected the event parameter of {signal:?} to be {expected_type} - not {actual_type:?}")]
IncorrectEventParameter {
signal: String,
expected_type: &'static str,
actual_type: gdk4::EventType,
},
#[error("Expected the action parameter of {signal:?} to be {expected_type} - not {actual_type}")]
IncorrectActionParameter {
signal: String,
expected_type: glib::VariantType,
actual_type: glib::VariantType,
},
#[error("{signal:?} has {num_parameters} parameters - only {num_extracted} extracted")]
NotAllParametersExtracted {
signal: String,
num_parameters: usize,
num_extracted: usize,
},
#[error(transparent)]
WakerPerished(#[from] WakerPerished),
#[error(transparent)]
RuntimeStopError(#[from] crate::RuntimeStopError),
#[error(transparent)]
GenericError(#[from] Box<dyn 'static + Send + Sync + std::error::Error>),
}
#[derive(thiserror::Error, Debug)]
#[error("The object that was supposed to wake this future was dropped")]
pub struct WakerPerished;