pub struct Array {
pub rows: usize,
pub cols: usize,
pub data: Vec<Value>,
}Expand description
A 2-D array of values (row-major). Always at least 1×1.
Fields§
§rows: usize§cols: usize§data: Vec<Value>Implementations§
Source§impl Array
impl Array
pub fn new(rows: usize, cols: usize, data: Vec<Value>) -> Option<Array>
pub fn filled(rows: usize, cols: usize, v: Value) -> Array
pub fn scalar(v: Value) -> Array
pub fn column(v: Vec<Value>) -> Array
pub fn row(v: Vec<Value>) -> Array
pub fn get(&self, r: usize, c: usize) -> Option<&Value>
Sourcepub fn get_broadcast(&self, r: usize, c: usize) -> Value
pub fn get_broadcast(&self, r: usize, c: usize) -> Value
Excel’s broadcasting read: a 1-row or 1-column array repeats along that axis; outside the
array is #N/A.
pub fn transpose(&self) -> Array
pub fn iter(&self) -> impl Iterator<Item = &Value>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnsafeUnpin for Array
impl UnwindSafe for Array
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more