pub enum FieldValue<'a> {
Str(&'a str),
U64(u64),
I64(i64),
Bool(bool),
Opaque(Arc<dyn Any + Send + Sync>),
}Expand description
Typed view over a producer-field value projected through a route binding.
The ProducerEffect::field implementation returns one of these so the
dispatcher can move the value into the consumer input without a
serde_json::Value round-trip. The variant set is intentionally small;
richer shapes are expressed by the producer keeping the typed value
inside its effect body and the consumer accepting it via the same
typed enum (the codegen emits the matching types on both sides).
Variants§
Str(&'a str)
Borrowed string slice (owning producer retains the backing String).
U64(u64)
Unsigned 64-bit integer.
I64(i64)
Signed 64-bit integer.
Bool(bool)
Boolean flag.
Opaque(Arc<dyn Any + Send + Sync>)
Opaque typed handle — producer and consumer agree on the Rust type.
The dispatcher moves the Arc<dyn Any> across without inspecting it.
This is not a serde_json::Value escape hatch: the contained Rust
type is determined by the typed route binding, not by ad-hoc JSON.
Implementations§
Source§impl FieldValue<'_>
impl FieldValue<'_>
Sourcepub fn to_owned_value(&self) -> OwnedFieldValue
pub fn to_owned_value(&self) -> OwnedFieldValue
Lift a borrowed field value into its owned counterpart, cloning the
backing &str when required. The Arc<dyn Any> path is shared,
not cloned.
Trait Implementations§
Source§impl<'a> Clone for FieldValue<'a>
impl<'a> Clone for FieldValue<'a>
Source§fn clone(&self) -> FieldValue<'a>
fn clone(&self) -> FieldValue<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more