pub struct StructuralView(/* private fields */);Expand description
Borrowed value shared by structural traversal and transformation callbacks. A borrowed value shared by structural visit, walk, map, and mutate callbacks.
Use &StructuralView for an erased callback argument. Self::as_node
borrows an object node, while Self::cast returns a typed value (acquiring
ownership for object handles). This view does not grant in-place permission;
consuming mutation callbacks use crate::MutateValue instead.
Implementations§
Source§impl StructuralView
impl StructuralView
Sourcepub fn cast<R: AnyCompatible>(&self) -> Option<R>
pub fn cast<R: AnyCompatible>(&self) -> Option<R>
Convert the value into an owned typed handle.
Sourcepub fn type_index(&self) -> i32
pub fn type_index(&self) -> i32
Runtime type index stored in this value.
Sourcepub fn as_node<N: ObjectCore>(&self) -> Option<&N>
pub fn as_node<N: ObjectCore>(&self) -> Option<&N>
Borrow the value as node type N if it is an instance of that type.
Trait Implementations§
Source§impl<'a> From<&'a StructuralView> for AnyView<'a>
impl<'a> From<&'a StructuralView> for AnyView<'a>
Source§fn from(value: &'a StructuralView) -> Self
fn from(value: &'a StructuralView) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Send for StructuralView
impl !Sync for StructuralView
impl Freeze for StructuralView
impl RefUnwindSafe for StructuralView
impl Unpin for StructuralView
impl UnsafeUnpin for StructuralView
impl UnwindSafe for StructuralView
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