pub struct ValueRef<'a> { /* private fields */ }Expand description
A borrowed reference to an inspected value.
This is the core data structure returned by Inspect::inspect.
It provides access to the value’s kind, type information, and children without
forcing eager allocation or traversal.
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
Sourcepub fn with_type(kind: Kind<'a>, type_info: TypeInfo<'a>) -> Self
pub fn with_type(kind: Kind<'a>, type_info: TypeInfo<'a>) -> Self
Create a value reference with minimal information.
Sourcepub fn with_children(
kind: Kind<'a>,
type_info: TypeInfo<'a>,
children: Children<'a>,
) -> Self
pub fn with_children( kind: Kind<'a>, type_info: TypeInfo<'a>, children: Children<'a>, ) -> Self
Create a value reference with children.
Sourcepub fn with_variant(self, variant: VariantInfo<'a>) -> Self
pub fn with_variant(self, variant: VariantInfo<'a>) -> Self
Set the variant information for enum values.
Sourcepub fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
pub fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Set the sensitivity level.
Sourcepub fn variant(&self) -> Option<&VariantInfo<'a>>
pub fn variant(&self) -> Option<&VariantInfo<'a>>
Get the enum variant information, if applicable.
Sourcepub fn sensitivity(&self) -> Sensitivity
pub fn sensitivity(&self) -> Sensitivity
Get the value’s sensitivity classification.
Sourcepub fn capability(&self) -> Capability
pub fn capability(&self) -> Capability
Get the value’s capabilities.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ValueRef<'a>
impl<'a> RefUnwindSafe for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnsafeUnpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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