pub trait SlotValue:
Any
+ Send
+ Sync {
// Required methods
fn as_any(&self) -> &(dyn Any + 'static);
fn into_any_boxed(self: Box<Self>) -> Box<dyn Any + Sync + Send>;
fn clone_boxed(&self) -> Box<dyn SlotValue>;
fn to_wire_bytes(&self) -> Result<Vec<u8>, SlotValueError>;
fn type_hash(&self) -> u64;
// Provided methods
fn runtime_type(&self) -> &'static TypeNode { ... }
fn charged_bytes(&self) -> usize { ... }
}Expand description
Universal slot value. Slot-table values, op outputs, and
dispatch_atomic inputs are all Box<dyn SlotValue> /
&dyn SlotValue. Local forwarding uses clone_boxed; wire +
snapshot paths use to_wire_bytes.
Required Methods§
Sourcefn into_any_boxed(self: Box<Self>) -> Box<dyn Any + Sync + Send>
fn into_any_boxed(self: Box<Self>) -> Box<dyn Any + Sync + Send>
Repackage Box<dyn SlotValue> as Box<dyn Any> for
Box::downcast. Required because the SlotValue and
Any vtables are distinct even though SlotValue: Any.
Sourcefn clone_boxed(&self) -> Box<dyn SlotValue>
fn clone_boxed(&self) -> Box<dyn SlotValue>
Polymorphic clone preserving the concrete type.
Sourcefn to_wire_bytes(&self) -> Result<Vec<u8>, SlotValueError>
fn to_wire_bytes(&self) -> Result<Vec<u8>, SlotValueError>
Wire-boundary encode (bincode + serde). Local forwarding
uses clone_boxed instead.
Provided Methods§
Sourcefn runtime_type(&self) -> &'static TypeNode
fn runtime_type(&self) -> &'static TypeNode
Sourcefn charged_bytes(&self) -> usize
fn charged_bytes(&self) -> usize
Bytes the carrier owes against
NodeConfig::ingress_byte_budget. Slot-table eviction calls
this to release the charge. Default 0 — only
ingress-derived carriers register a non-zero resolver via
[register_charged_bytes!].
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".