pub trait ConstSource: Sized + 'static {
const SLOT: SlotType;
// Required method
fn extract(arg: &ConstArg) -> Self;
}Expand description
ConstArg → typed-Rust-value bridge for owned types in
Const<T> position.
Borrow shapes (Const<&str>) are handled by the macro at
codegen — it stores String via ConstSource for String
and emits Const(self.field.as_str()) at the eval call site
to satisfy the operator-side Const<&str> signature.
Required Associated Constants§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ConstSource for String
impl ConstSource for String
Source§impl ConstSource for bool
impl ConstSource for bool
Source§impl ConstSource for f64
impl ConstSource for f64
Source§impl ConstSource for u64
impl ConstSource for u64
Source§impl<C: ConstSource> ConstSource for Vec<C>
SRD-80b Phase C — workload-list const combinator. Used by the
macro when it sees Const<Vec<C>> in an operator’s signature
(e.g. Const<Vec<u64>>, Const<Vec<String>>). The macro
emits one Slot::Const { name, slot_type: ConstVec, .. }
for the position and packages the trailing consts[..]
slice into a ConstArg::List at build time; this impl
walks the list, dispatching C::extract per element.
impl<C: ConstSource> ConstSource for Vec<C>
SRD-80b Phase C — workload-list const combinator. Used by the
macro when it sees Const<Vec<C>> in an operator’s signature
(e.g. Const<Vec<u64>>, Const<Vec<String>>). The macro
emits one Slot::Const { name, slot_type: ConstVec, .. }
for the position and packages the trailing consts[..]
slice into a ConstArg::List at build time; this impl
walks the list, dispatching C::extract per element.