pub fn new_partial(timeline: &'a Timeline, start: usize, values: Vec<T>, pad: T) -> Self {
        let mut data;
        // If start is after the timeline then just return a vector full of the pad value
        if start >= timeline.len {
            data = vec![pad; timeline.len];
            return TimeSeries::new_unchecked(timeline, data);
        }
        // Pad before the start
        let p = pad.clone();
        data = vec![p; start];
        // Add the values
        let val_len = cmp::min(values.len(), timeline.len - start);
        data.extend_from_slice(&values[..val_len]);
        // Pad to the end as required
        let mut end = vec![pad; timeline.len - start - val_len];
        data.append(&mut end);
        // ... and out
        TimeSeries::new_unchecked(timeline, data)
    }
/// Create a new TimeSeries object with a partial
/// specification of the input values. The method will
/// pad out values either side of the provided values to
/// ensure that the TimeSeries is properly formed.
///
/// If the values, after the start offset, do not fit within
/// the timeline the rightmost values will be silently discarded.
/// In extremis, if the start index provided is greater than the
/// timeline, then the returned TimeSeries will only contain the
/// pad values and none of the values vector will remain
Create a new TimeSeries object with a partial
specification of the input values. The method will
pad out values either side of the provided values to
ensure that the TimeSeries is properly formed.

If the values, after the start offset, do not fit within
the timeline the rightmost values will be silently discarded.
In extremis, if the start index provided is greater than the
timeline, then the returned TimeSeries will only contain the
pad values and none of the values vector will remain
Create a new TimeSeries object with a partial specification of the input values . The method will pad out values either side of the provided values to ensure that the TimeSeries is properly formed . If the values after the start offset do not fit within the timeline the rightmost values will be silently discarded . In extremis if the start index provided is greater than the timeline then the returned TimeSeries will only contain the pad values and none of the values vector will remain
pub fn new_partial(timeline: &'a Timeline, start: usize, values: Vec<T>, pad: T) -> Self {
        let mut data;
        // If start is after the timeline then just return a vector full of the pad value
        if start >= timeline.len {
            data = vec![pad; timeline.len];
            return TimeSeries::new_unchecked(timeline, data);
        }
        // Pad before the start
        let p = pad.clone();
        data = vec![p; start];
        // Add the values
        let val_len = cmp::min(values.len(), timeline.len - start);
        data.extend_from_slice(&values[..val_len]);
        // Pad to the end as required
        let mut end = vec![pad; timeline.len - start - val_len];
        data.append(&mut end);
        // ... and out
        TimeSeries::new_unchecked(timeline, data)
    }
pub fn new_partial ( timeline : & ' a Timeline , start : usize , values : Vec < T > , pad : T ) -> Self { let mut data ; // If start is after the timeline then just return a vector full of the pad value if start >= timeline . len { data = vec ! [ pad timeline len ] ; return TimeSeries :: new_unchecked ( timeline , data ) ; } // Pad before the start let p = pad . clone ( ) ; data = vec ! [ p start ] ; // Add the values let val_len = cmp :: min ( values . len ( ) , timeline . len - start ) ; data . extend_from_slice ( & values [ .. val_len ] ) ; // Pad to the end as required let mut end = vec ! [ pad timeline len start val_len ] ; data . append ( & mut end ) ; // ... and out TimeSeries :: new_unchecked ( timeline , data ) }
Create a new TimeSeries object with a partial
specification of the input values.
Create a new TimeSeries object with a partial specification of the input values .
timeline
&'a Timeline
start
usize
values
Vec<T>
pad
T
timeline
&'a Timeline
start
usize
values
Vec<T>
pad
T