pub trait SoaToOwned<T>: AsSoaRef {
// Required method
fn soa_to_owned(&self) -> T;
}Expand description
Required Methods§
Sourcefn soa_to_owned(&self) -> T
fn soa_to_owned(&self) -> T
Construct an owned value from an SoA element.
§Example
#[derive(Soars, SoaClone, Debug, PartialEq, Clone)]
#[soa_derive(Debug)]
struct Point(f32, f32);
let soa = soa![Point(1.0, 2.0), Point(3.0, 4.0)];
let el = soa.idx(1);
let owned = el.soa_to_owned();
assert_eq!(owned, Point(3.0, 4.0));Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".