Rs
Module 6Lifetimes & LabLesson 8 of 825 min

Module 5 Lab: Generic Pricer Boundary

Errors + Payoff trait + validated call.

Combine

  1. PricingError checks
  1. Payoff trait
  1. Result-returning boundary

Shape of a real library edge.

Challenge

Reject strike<=0 via Call::new -> Result.

Tips
  • Traits + Result = pro pattern
  • Validate at boundary
  • Next: concurrency

Try it live

Module 5 Lab: Generic Pricer BoundaryRust 2021
Loading editor…
Output
Press Run to compile and execute.