pub mod build;
pub mod partial;
pub mod clone;
use derive_more::{ Deref, DerefMut };
use crate::Block;
#[derive(Debug, Default, Clone, Deref, DerefMut)]
pub struct Row<B: Block> {
pub(crate) blocks: Vec<B>
}
impl<B: Block> Row<B> {
pub fn new() -> Self {
Self::default()
}
pub fn wrap(blocks: Vec<B>) -> Self {
Row { blocks }
}
pub fn blocks(&self) -> &Vec<B> {
&self.blocks
}
pub fn map<C: Block, T: Fn(&B) -> C>(&self, t: T) -> Row<C> {
let mapped_blocks = self.blocks()
.iter()
.map(t)
.collect();
Row::wrap(mapped_blocks)
}
}