pub struct UnsupportedStepType(pub StepType);Expand description
Error raised when converting a parsed Gherkin gherkin::StepType into a
StepKeyword fails.
This is a localized wrapper around UnsupportedStepTypeBase that uses the
runtime localization system for user-friendly error messages.
§Examples
use gherkin::StepType;
use rstest_bdd::{StepKeyword, UnsupportedStepType};
fn convert(ty: StepType) -> Result<StepKeyword, UnsupportedStepType> {
StepKeyword::try_from(ty).map_err(UnsupportedStepType::from)
}
match convert(StepType::Given) {
Ok(keyword) => assert_eq!(keyword, StepKeyword::Given),
Err(error) => {
eprintln!("unsupported step type: {:?}", error.0);
}
}Tuple Fields§
§0: StepTypeTrait Implementations§
Source§impl Debug for UnsupportedStepType
impl Debug for UnsupportedStepType
Source§impl Display for UnsupportedStepType
impl Display for UnsupportedStepType
Source§impl Error for UnsupportedStepType
impl Error for UnsupportedStepType
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<UnsupportedStepType> for UnsupportedStepType
impl From<UnsupportedStepType> for UnsupportedStepType
Source§fn from(base: UnsupportedStepTypeBase) -> Self
fn from(base: UnsupportedStepTypeBase) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for UnsupportedStepType
impl RefUnwindSafe for UnsupportedStepType
impl Send for UnsupportedStepType
impl Sync for UnsupportedStepType
impl Unpin for UnsupportedStepType
impl UnwindSafe for UnsupportedStepType
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