[−][src]Trait cubic_spline::TryFrom
The same as TryFrom
from std/core
, except that it allows generic implementations.
Details are in this issue
Usually you don't need to implement is yourself.
This trait here is for safe conversion into Points
Example
use cubic_spline::{TryFrom, Points, Error}; let my_points: Vec<(f64,f64)> = vec![(1.0, 1.0)]; let prepared_points = Points::try_from(&my_points); assert_eq!(prepared_points.unwrap_err(), Error::TooFewPoints); let another_try = Points::try_from( &[ [3.0, 5.1], [10.3, 11.9] ] ); assert!(another_try.is_ok());