pub struct FunctionCase {
pub id: CaseId,
pub name: Symbol,
pub args: Arc<dyn Shape>,
pub result: Option<Arc<dyn Shape>>,
pub demand: Vec<Demand>,
pub priority: i32,
pub implementation: NativeFunctionImpl,
}Expand description
One overload case of a FunctionObject: a shape-typed signature paired
with the native code that runs when it is selected.
Fields§
§id: CaseIdStable identifier for this case within the function.
name: SymbolSymbol naming the case.
args: Arc<dyn Shape>Shape the argument list must match for this case to apply.
result: Option<Arc<dyn Shape>>Optional shape the result is checked against after the call.
demand: Vec<Demand>Per-argument evaluation demand (how far each argument is forced).
priority: i32Tie-break priority; higher wins before match score is consulted.
implementation: NativeFunctionImplNative code run when this case is selected.
Trait Implementations§
Source§impl Clone for FunctionCase
impl Clone for FunctionCase
Source§fn clone(&self) -> FunctionCase
fn clone(&self) -> FunctionCase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FunctionCase
impl !UnwindSafe for FunctionCase
impl Freeze for FunctionCase
impl Send for FunctionCase
impl Sync for FunctionCase
impl Unpin for FunctionCase
impl UnsafeUnpin for FunctionCase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more