pub struct FieldPath(/* private fields */);Expand description
A path through a (possibly nested) struct, composed of a sequence of field selectors
Implementations§
Source§impl FieldPath
impl FieldPath
Sourcepub fn from_name<F: Into<Field>>(name: F) -> Self
pub fn from_name<F: Into<Field>>(name: F) -> Self
Constructs a new FieldPath from a single field selector (i.e., a direct child field of the top-level struct)
Sourcepub fn push<F: Into<Field>>(self, field: F) -> Self
pub fn push<F: Into<Field>>(self, field: F) -> Self
Pushes a new field selector to the end of this path
Sourcepub fn starts_with_field(&self, field: &Field) -> bool
pub fn starts_with_field(&self, field: &Field) -> bool
Whether the path starts with the given field name TODO(joe): handle asserts better.
Trait Implementations§
Source§impl FromIterator<Field> for FieldPath
impl FromIterator<Field> for FieldPath
impl Eq for FieldPath
impl StructuralPartialEq for FieldPath
Auto Trait Implementations§
impl Freeze for FieldPath
impl RefUnwindSafe for FieldPath
impl Send for FieldPath
impl Sync for FieldPath
impl Unpin for FieldPath
impl UnwindSafe for FieldPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more