pub struct FieldResolver { /* private fields */ }Expand description
Resolves fixture field paths to language-specific accessor expressions.
Implementations§
Source§impl FieldResolver
impl FieldResolver
Sourcepub fn new(fields: &HashMap<String, String>, optional: &HashSet<String>) -> Self
pub fn new(fields: &HashMap<String, String>, optional: &HashSet<String>) -> Self
Create a new resolver from the e2e config’s fields aliases and
fields_optional set.
Sourcepub fn resolve<'a>(&'a self, fixture_field: &'a str) -> &'a str
pub fn resolve<'a>(&'a self, fixture_field: &'a str) -> &'a str
Resolve a fixture field path to the actual struct path. Falls back to the field itself if no alias exists.
Sourcepub fn is_optional(&self, field: &str) -> bool
pub fn is_optional(&self, field: &str) -> bool
Check if a resolved field path is optional.
Auto Trait Implementations§
impl Freeze for FieldResolver
impl RefUnwindSafe for FieldResolver
impl Send for FieldResolver
impl Sync for FieldResolver
impl Unpin for FieldResolver
impl UnsafeUnpin for FieldResolver
impl UnwindSafe for FieldResolver
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