pub struct VisitValue(/* private fields */);Expand description
A borrowed view of a raw tvm-ffi value passed to structural-visit callbacks.
Generated visitors match this value without taking ownership: borrowed
object-node handlers use VisitValue::as_node, while POD or object-ref
value handlers use VisitValue::cast.
A borrowed value shared by structural visit and map callbacks.
This type centralizes the audited unsafe operations used to cast FFI
values and borrow object nodes. The public APIs expose it as VisitValue
or MapValue according to the callback context.
Implementations§
Source§impl StructuralValue
impl StructuralValue
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.
Auto Trait Implementations§
impl !Send for StructuralValue
impl !Sync for StructuralValue
impl Freeze for StructuralValue
impl RefUnwindSafe for StructuralValue
impl Unpin for StructuralValue
impl UnsafeUnpin for StructuralValue
impl UnwindSafe for StructuralValue
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