pub struct Assembly { /* private fields */ }Expand description
A vector being built out of pieces, each landing at the positions it is given.
Build one with Assembly::new, call Assembly::place once per piece, and finish it with
Assembly::finish. A row no piece claims is null.
Implementations§
Source§impl Assembly
impl Assembly
Sourcepub fn new(ty: LogicalType, rows: usize) -> Result<Self>
pub fn new(ty: LogicalType, rows: usize) -> Result<Self>
An assembly of rows rows of ty, with every row null until a piece claims it.
§Errors
If the type is one there is no flat layout for yet, which today means ARRAY and UNION.
Sourcepub fn place(&mut self, positions: &[u32], piece: &Vector) -> Result<()>
pub fn place(&mut self, positions: &[u32], piece: &Vector) -> Result<()>
Writes row n of piece at output row positions[n], for every row of piece.
A row claimed twice takes the value the later call gave it, which is not a case CASE
produces, since its arms run over disjoint sets of rows, and is defined rather than left
open so that a caller that does it gets an answer instead of whichever of the two the copy
loop happened to reach.
§Errors
If piece has a different number of rows than there are positions, if a position is past the
end of the assembly, or if piece is not of a layout that can be laid after what is already
there.