pub struct MultiDeclSharedAxes { /* private fields */ }Expand description
Shared axes in a multi-declaration table prefix.
The final axis has a distinct semantic role: it is the row axis. Any axes
before it are slice axes. This is intentionally not modeled as a generic
NonEmpty<TableIndexSpec> because the tail element is special.
Implementations§
Sourcepub const fn new(
slice_axes: Vec<TableIndexSpec>,
row_axis: TableIndexSpec,
) -> Self
pub const fn new( slice_axes: Vec<TableIndexSpec>, row_axis: TableIndexSpec, ) -> Self
Construct shared axes from zero or more slice axes and the always-present row axis.
Sourcepub fn try_from_vec(axes: Vec<TableIndexSpec>) -> Result<Self, EmptyVecError>
pub fn try_from_vec(axes: Vec<TableIndexSpec>) -> Result<Self, EmptyVecError>
Convert a parser-order vector into semantic slice/row axes.
§Errors
Returns crate::syntax::non_empty::EmptyVecError when axes is empty.
Sourcepub fn slice_axes(&self) -> &[TableIndexSpec]
pub fn slice_axes(&self) -> &[TableIndexSpec]
Slice axes preceding the row axis.
Sourcepub const fn row_axis(&self) -> &TableIndexSpec
pub const fn row_axis(&self) -> &TableIndexSpec
The row axis.
Sourcepub fn iter(&self) -> impl Iterator<Item = &TableIndexSpec>
pub fn iter(&self) -> impl Iterator<Item = &TableIndexSpec>
Iterate over axes in source order: slice axes first, then row axis.
Trait Implementations§
Source§fn clone(&self) -> MultiDeclSharedAxes
fn clone(&self) -> MultiDeclSharedAxes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn format_equivalent(&self, other: &Self) -> bool
fn format_equivalent(&self, other: &Self) -> bool
Returns
true if self and other are equivalent up to formatting.Auto Trait Implementations§
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