pub struct PlaceholderErrorInfo {
pub message: &'static str,
pub position: usize,
pub placeholder: Option<String>,
}
Expand description
Additional context for placeholder-related parsing errors.
§Examples
use rstest_bdd_patterns::PlaceholderErrorInfo;
let info = PlaceholderErrorInfo::new("invalid placeholder", 3, Some("value".into()));
assert_eq!(info.placeholder.as_deref(), Some("value"));
assert_eq!(info.position, 3);
Fields§
§message: &'static str
§position: usize
§placeholder: Option<String>
Implementations§
Source§impl PlaceholderErrorInfo
impl PlaceholderErrorInfo
Sourcepub fn new(
message: &'static str,
position: usize,
placeholder: Option<String>,
) -> Self
pub fn new( message: &'static str, position: usize, placeholder: Option<String>, ) -> Self
Create a new error description for a placeholder failure.
§Examples
use rstest_bdd_patterns::PlaceholderErrorInfo;
let info = PlaceholderErrorInfo::new("invalid", 1, None);
assert_eq!(info.message, "invalid");
Trait Implementations§
Source§impl Clone for PlaceholderErrorInfo
impl Clone for PlaceholderErrorInfo
Source§fn clone(&self) -> PlaceholderErrorInfo
fn clone(&self) -> PlaceholderErrorInfo
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 moreSource§impl Debug for PlaceholderErrorInfo
impl Debug for PlaceholderErrorInfo
Source§impl Display for PlaceholderErrorInfo
impl Display for PlaceholderErrorInfo
Source§impl PartialEq for PlaceholderErrorInfo
impl PartialEq for PlaceholderErrorInfo
impl Eq for PlaceholderErrorInfo
impl StructuralPartialEq for PlaceholderErrorInfo
Auto Trait Implementations§
impl Freeze for PlaceholderErrorInfo
impl RefUnwindSafe for PlaceholderErrorInfo
impl Send for PlaceholderErrorInfo
impl Sync for PlaceholderErrorInfo
impl Unpin for PlaceholderErrorInfo
impl UnwindSafe for PlaceholderErrorInfo
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