diff --git a/container/Cargo.toml b/container/Cargo.toml index 88d2ef563..baed97e41 100644 --- a/container/Cargo.toml +++ b/container/Cargo.toml @@ -7,5 +7,6 @@ license = "MIT" [dependencies] columnation = { git = "https://github.com/frankmcsherry/columnation" } -flatcontainer = "0.5" +# flatcontainer = "0.5" +flatcontainer = { git = "https://github.com/antiguru/flatcontainer" } serde = { version = "1.0"} diff --git a/container/src/flatcontainer.rs b/container/src/flatcontainer.rs index 62600a77e..441445e97 100644 --- a/container/src/flatcontainer.rs +++ b/container/src/flatcontainer.rs @@ -1,9 +1,14 @@ //! Present a [`FlatStack`] as a timely container. pub use flatcontainer::*; +use flatcontainer::impls::offsets::OffsetContainer; use crate::{buffer, Container, SizableContainer, PushInto}; -impl Container for FlatStack { +impl Container for FlatStack +where + R: Region + Clone + 'static, + S: OffsetContainer<::Index> + Clone + 'static, +{ type ItemRef<'a> = R::ReadItem<'a> where Self: 'a; type Item<'a> = R::ReadItem<'a> where Self: 'a; @@ -28,6 +33,7 @@ impl Container for FlatStack { } } +// Only implemented for `FlatStack` with `Vec` offsets. impl SizableContainer for FlatStack { fn capacity(&self) -> usize { self.capacity() @@ -42,7 +48,12 @@ impl SizableContainer for FlatStack { } } -impl, T> PushInto for FlatStack { +impl PushInto for FlatStack +where + R: Region + Push, + S: OffsetContainer + Clone + 'static, + for<'a> &'a S: IntoIterator, +{ #[inline] fn push_into(&mut self, item: T) { self.copy(item);