Skip to content

Commit

Permalink
Merge pull request #8 from antiguru/integration
Browse files Browse the repository at this point in the history
  • Loading branch information
antiguru authored Feb 13, 2024
2 parents 549c190 + cb32856 commit 7117032
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rust-version = "1.70"

[dependencies]
cfg-if = "1.0"
paste = "1.0.14"
paste = "1.0"
serde = { version = "1.0", optional = true, features = ["derive"]}

[dev-dependencies]
Expand Down
26 changes: 25 additions & 1 deletion src/impls/columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,33 @@ use crate::{CopyOnto, CopyRegion, Index, Region};
///
/// Copy a table-like structure:
/// ```
/// # use flatcontainer::impls::deduplicate::ConsecutiveOffsetPairs;
/// # use flatcontainer::{ColumnsRegion, CopyOnto, Region, StringRegion};
/// let data = [
/// vec![],
/// vec!["1"],
/// vec!["2", "3"],
/// vec!["4", "5", "6"],
/// vec!["7", "8"],
/// vec!["9"],
/// vec![],
/// ];
///
/// let mut r = ColumnsRegion::<ConsecutiveOffsetPairs<StringRegion>, _>::default();
///
/// let mut indices = Vec::with_capacity(data.len());
///
/// for row in &data {
/// let index = row.copy_onto(&mut r);
/// indices.push(index);
/// }
///
/// for (&index, row) in indices.iter().zip(&data) {
/// assert!(row.iter().copied().eq(r.index(index).iter()));
/// }
/// ```
#[derive(Debug)]
struct ColumnsRegion<R, Idx>
pub struct ColumnsRegion<R, Idx>
where
R: Region<Index = Idx>,
Idx: Index,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use serde::{Deserialize, Serialize};
pub mod codec;
pub mod impls;

pub use impls::columns::ColumnsRegion;
pub use impls::mirror::MirrorRegion;
pub use impls::option::OptionRegion;
pub use impls::result::ResultRegion;
Expand Down

0 comments on commit 7117032

Please sign in to comment.