Skip to main content

IntoSeries

Trait IntoSeries 

Source
pub trait IntoSeries {
    // Required method
    fn into_series(self) -> Series;
}
Expand description

Trait for types that can be converted into a Series.

This is the primary entry-point for user data. Any function that accepts chart data should be generic over impl IntoSeries so that callers can pass slices, vectors, arrays, integer collections, or ranges without manual conversion.

Required Methods§

Source

fn into_series(self) -> Series

Converts this value into a Series.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoSeries for &ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>

Source§

fn into_series(self) -> Series

Converts a reference to an Array1<f64> into a Series.

Uses as_slice() for zero-copy access on contiguous arrays and falls back to an iterator copy for non-standard memory layouts.

Source§

impl IntoSeries for &ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for &ArrayBase<OwnedRepr<i64>, Dim<[usize; 1]>>

Source§

impl IntoSeries for &Vec<f64>

Source§

fn into_series(self) -> Series

Clones the vector data into a new Series.

Source§

impl IntoSeries for &[f32]

Source§

fn into_series(self) -> Series

Converts an f32 slice into a Series by casting each element to f64.

Source§

impl IntoSeries for &[f64]

Source§

fn into_series(self) -> Series

Clones the slice data into a new Series.

Source§

impl IntoSeries for &[i32]

Source§

fn into_series(self) -> Series

Converts an i32 slice into a Series by casting each element to f64.

Source§

impl IntoSeries for ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>

Source§

fn into_series(self) -> Series

Converts an owned Array1<f64> into a Series.

Attempts to unwrap the underlying Vec without copying. Falls back to a copy when the array is not in standard layout.

Source§

impl IntoSeries for ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for ArrayBase<OwnedRepr<i64>, Dim<[usize; 1]>>

Source§

impl IntoSeries for ArrayBase<ViewRepr<&f32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for ArrayBase<ViewRepr<&f64>, Dim<[usize; 1]>>

Source§

fn into_series(self) -> Series

Converts an ArrayView1<f64> into a Series.

Uses as_slice() for contiguous views and falls back to element-wise iteration for strided views.

Source§

impl IntoSeries for ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>

Source§

impl IntoSeries for ArrayBase<ViewRepr<&i64>, Dim<[usize; 1]>>

Source§

impl IntoSeries for Range<i32>

Source§

fn into_series(self) -> Series

Converts an integer range into a Series of f64 values.

§Examples
use plotkit_core::series::IntoSeries;

let s = (0..5).into_series();
assert_eq!(s.data, vec![0.0, 1.0, 2.0, 3.0, 4.0]);
Source§

impl IntoSeries for Vec<f32>

Source§

fn into_series(self) -> Series

Converts a Vec<f32> into a Series by casting each element to f64.

Source§

impl IntoSeries for Vec<f64>

Source§

fn into_series(self) -> Series

Zero-copy conversion from an owned Vec<f64>.

Source§

impl IntoSeries for Vec<i32>

Source§

fn into_series(self) -> Series

Converts a Vec<i32> into a Series by casting each element to f64.

Source§

impl<const N: usize> IntoSeries for &[f64; N]

Source§

fn into_series(self) -> Series

Clones a fixed-size array reference into a Series.

Source§

impl<const N: usize> IntoSeries for [f64; N]

Source§

fn into_series(self) -> Series

Converts a fixed-size array of f64 into a Series.

Implementors§