-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "remove()". Disabled "SliceArray" for now (code is still there,…
… just not imported).
- Loading branch information
1 parent
024a42f
commit 8c6159e
Showing
9 changed files
with
170 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
use core::ops::Range; | ||
use core::ops::{Range, RangeBounds}; | ||
|
||
use crate::StrResult; | ||
|
||
/// The required trait for any kind of storage used in a SliceMap. | ||
pub trait Storage<T> { | ||
fn len(&self) -> usize; | ||
fn reset(&mut self); | ||
fn iter_items(&self) -> core::slice::Iter<T>; | ||
fn items(&self) -> core::slice::Iter<T>; | ||
fn items_mut(&mut self) -> core::slice::IterMut<T>; | ||
fn get_item(&self, index: impl Into<usize>) -> Option<&T>; | ||
fn get_slice(&self, range: Range<usize>) -> Option<&[T]>; | ||
fn push_item(&mut self, item: T) -> StrResult; | ||
fn extend_from_iter<I: IntoIterator<Item = T>>(&mut self, iter: I) -> StrResult; | ||
fn remove(&mut self, index: impl Into<usize>) -> Option<T>; | ||
fn drain(&mut self, range: impl RangeBounds<usize>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters