Expand description
The facet-reflect crate provides utilities for inspecting and manipulating data structures.
This crate combines functionality that was previously split between separate crates:
- Peeking: Reading or inspecting data structures
- Poking: Modifying or manipulating data structures
Both capabilities are essential for reflection operations in the Facet ecosystem.
Structs§
- Guard
- Ensures a value is dropped when the guard is dropped.
- ISet
- Keeps track of which fields were initialized, up to 64 fields
- Peek
Enum - Lets you read from an enum (implements read-only enum operations)
- Peek
List - Lets you read from a list (implements read-only
facet_core::ListVTableproxies) - Peek
List Iter - Iterator over a
PeekList - PeekMap
- Lets you read from a map (implements read-only
facet_core::MapVTableproxies) - Peek
MapIter - Iterator over key-value pairs in a
PeekMap - Peek
Option - Lets you read from an option (implements read-only option operations)
- Peek
Struct - Lets you read from a struct (implements read-only struct operations)
- Peek
Value - Lets you read from a value (implements read-only
ValueVTableproxies) - Poke
Enum - Allows poking an enum with a selected variant (setting fields, etc.)
- Poke
Enum NoVariant - Represents an enum before a variant has been selected
- Poke
List - Allows poking a list (appending, etc.)
- Poke
List Uninit - Allows initializing an uninitialized list
- PokeMap
- Allows poking a map (inserting, etc.)
- Poke
MapUninit - Allows initializing an uninitialized map
- Poke
Option - Allows poking an option (setting Some/None)
- Poke
Option Uninit - Allows initializing an uninitialized option
- Poke
Smart Pointer - Poke
Smart Pointer Read Guard - Poke
Smart Pointer Uninit - Allows initializing an uninitialized option
- Poke
Smart Pointer Write Guard - Poke
Struct - Allows poking a struct (setting fields, etc.)
- Poke
Value - Lets you modify an initialized value (implements read-write
ValueVTableproxies) - Poke
Value Uninit - Lets you write to a value (implements write-only
ValueVTableproxies) - Typed
Poke Value - A strongly-typed value writer for initialized values that ensures type safety at compile-time
- Typed
Poke Value Uninit - A strongly-typed value writer that ensures type safety at compile-time
Enums§
- Peek
- Lets you peek at the innards of a value
- Poke
- Allows manipulating already-initialized values of different kinds.
- Poke
Uninit - Allows initializing values of different kinds.
- Scalar
Type - All scalar types supported out of the box by peek and poke.
- Variant
Error - All possible errors when getting a variant by index or by name
Functions§
- peek_
enum - Returns the enum definition if the shape represents an enum, None otherwise
- peek_
enum_ repr - Returns the enum representation if the shape represents an enum, None otherwise
- peek_
enum_ variants - Returns the enum variants if the shape represents an enum, None otherwise
- peek_
option - Returns the option definition if the shape represents an option, None otherwise