Skip to main content

ValueRef

Struct ValueRef 

Source
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>

Source

pub fn with_type(kind: Kind<'a>, type_info: TypeInfo<'a>) -> ValueRef<'a>

Create a value reference with minimal information.

Source

pub fn with_children( kind: Kind<'a>, type_info: TypeInfo<'a>, children: Children<'a>, ) -> ValueRef<'a>

Create a value reference with children.

Source

pub fn with_variant(self, variant: VariantInfo<'a>) -> ValueRef<'a>

Set the variant information for enum values.

Source

pub fn with_sensitivity(self, sensitivity: Sensitivity) -> ValueRef<'a>

Set the sensitivity level.

Source

pub fn kind(&self) -> &Kind<'a>

Get the value’s kind.

Source

pub fn type_info(&self) -> &TypeInfo<'a>

Get the value’s type information.

Source

pub fn children(&self) -> Option<&Children<'a>>

Get the value’s children, if any.

Source

pub fn variant(&self) -> Option<&VariantInfo<'a>>

Get the enum variant information, if applicable.

Source

pub fn sensitivity(&self) -> Sensitivity

Get the value’s sensitivity classification.

Source

pub fn capability(&self) -> Capability

Get the value’s capabilities.

Trait Implementations§

Source§

impl<'a> Debug for ValueRef<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.