diff --git a/src/builder/macros.rs b/src/builder/macros.rs index 4ad9b36..8dec634 100644 --- a/src/builder/macros.rs +++ b/src/builder/macros.rs @@ -1542,42 +1542,42 @@ macro_rules! define_line { // WIP:DATALINE // type_aliases![l: $tname, size: $B, $b, "Copy", "data **Type**", "(Copy)" ]; - // DEFINE DataLineGrow* + // DEFINE DataLineVec* // vec, Copy #[doc = "A **vector** of [`" [< $cname $B Byte Copy With >] "`][crate::all::" [< $cname $B Byte Copy With >] "]" ] #[cfg(feature = "std" )] #[derive(Clone, Debug)] - pub struct [< DataLineGrow $B Byte Copy With >] { + pub struct [< DataLineVec $B Byte Copy With >] { cells: Vec<[< $cname $B Byte Copy With >]> } // vec, Copy, non-With #[cfg(feature = "std" )] #[doc = "A **vector** of [`" [< $cname $B Byte Copy >] "`][crate::all::" [< $cname $B Byte Copy >] "]" ] - pub type [< DataLineGrow $B Byte Copy >] = [< DataLineGrow $B Byte Copy With >]<()>; + pub type [< DataLineVec $B Byte Copy >] = [< DataLineVec $B Byte Copy With >]<()>; // vec, non-Copy #[cfg(feature = "std" )] #[doc = "A **vector** of [`" [< $cname $B Byte Copy With >] "`][crate::all::" [< $cname $B Byte With >] "]" ] #[derive(Debug)] - pub struct [< DataLineGrow $B Byte With >] { + pub struct [< DataLineVec $B Byte With >] { cells: Vec<[< $cname $B Byte With >]> } // vec, non-Copy, non-With #[cfg(feature = "std" )] #[doc = "A **vector** of [`" [< $cname $B Byte>] "`][crate::all::" [< $cname $B Byte >] "]" ] - pub type [< DataLineGrow $B Byte >] = [< DataLineGrow $B Byte With >]<()>; + pub type [< DataLineVec $B Byte >] = [< DataLineVec $B Byte With >]<()>; - // DEFINE DataLineCompact* + // DEFINE DataLineDense* // compact array, Copy #[doc = "A dense **array** of [`" [< $bname $B Byte Copy >] "`][crate::all::" [< $bname $B Byte Copy >] "]\n" ] /// #[derive(Clone, Copy, Debug)] - pub struct [< DataLineCompact $B Byte Copy >] { + pub struct [< DataLineDense $B Byte Copy >] { // WIP _types: [[< $tname $B Byte Copy >]; LEN], _cells: [[< $bname $B Byte Copy >]; LEN] @@ -1616,15 +1616,15 @@ macro_rules! define_line { // From/Into Vec, Copy #[cfg(feature = "std" )] - impl From< [] > for Vec< [<$cname $B Byte Copy With>] > { - fn from(from: []) -> Self { + impl From< [] > for Vec< [<$cname $B Byte Copy With>] > { + fn from(from: []) -> Self { from.cells } } #[cfg(feature = "std" )] - impl From< Vec<[<$cname $B Byte Copy With>]> > for [] { + impl From< Vec<[<$cname $B Byte Copy With>]> > for [] { fn from(from: Vec< [<$cname $B Byte Copy With>] > ) -> Self { - [] { + [] { cells: from } } @@ -1632,15 +1632,15 @@ macro_rules! define_line { // From/Into Vec, non-Copy #[cfg(feature = "std" )] - impl From< [] > for Vec< [<$cname $B Byte With>] > { - fn from(from: []) -> Self { + impl From< [] > for Vec< [<$cname $B Byte With>] > { + fn from(from: []) -> Self { from.cells } } #[cfg(feature = "std" )] - impl From< Vec<[<$cname $B Byte With>]> > for [] { + impl From< Vec<[<$cname $B Byte With>]> > for [] { fn from(from: Vec< [<$cname $B Byte With>] > ) -> Self { - [] { + [] { cells: from } } @@ -1978,7 +1978,7 @@ macro_rules! reexport { (@Line $path:path; size: $size:literal; $( $suf:ident )+ ) => { $crate::reexport![@ $path; DataLine; size: $size ; $( $suf )+ ]; #[cfg(feature = "std" )] - $crate::reexport![@ $path; DataLineGrow; size: $size ; $( $suf )+ ]; + $crate::reexport![@ $path; DataLineVec; size: $size ; $( $suf )+ ]; }; // generic re-export diff --git a/src/lib.rs b/src/lib.rs index 9df9618..78b8158 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,8 +43,8 @@ //! //! The fundamental linear abstractions are: //! - `DataLine…` structs, based on an array `[DataCell*; const usize]`. -//! - `DataLineGrow…` structs, growable, based on a vector `Vec`. -//! - `DataLineCompact*…` structs, uses `DataBare*` plus `DataType*`. +//! - `DataLineVec…` structs, growable, based on a vector `Vec`. +//! - `DataLineDense*…` structs, uses `DataBare*` plus `DataType*`. //! //! ## External dependencies //! @@ -234,7 +234,7 @@ pub mod units { /// /// The concrete implementations of **linear types** observes the following naming schema: /// ```txt -/// -) Data Line [Grow] [Dense|Buffer] [Copy] [With] Legend | Sizes +/// -) Data Line [Vec] [Dense|Buffer] [Copy] [With] Legend | Sizes /// --------------- | ------------- /// <> : required | 1B = 8b /// [] : optional | 2B = 16b