Struct Path
pub struct Path {
pub root: PathRoot,
pub projection: Projection,
}Expand description
Describes a traversal through fields.
The root is not specified as part of the struct.
Fields§
§root: PathRootWhere the path originates from
projection: ProjectionTraversal through the fields
Implementations§
§impl Path
impl Path
pub fn model(root: impl Into<ModelId>) -> Path
pub fn field(root: impl Into<ModelId>, field: usize) -> Path
pub const fn from_index(root: ModelId, index: usize) -> Path
pub fn from_variant(parent: Path, variant_id: VariantId) -> Path
pub fn from_variant(parent: Path, variant_id: VariantId) -> Path
Creates a path rooted at a specific enum variant.
parent is the path that navigates to the enum field. Subsequent
projection steps (appended via chain) index into the
variant’s fields using 0-based local indices.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn chain(&mut self, other: &Path)
pub fn into_stmt(self) -> Expr
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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