pub struct ItemSet<T> { /* private fields */ }Expand description
A dynamic, resizable collection for storing items with sorting support.
ItemSet<T> is a Vec-backed collection that provides:
- Dynamic array storage with automatic capacity management
- Efficient sorting using TimSort with custom comparers
- Iterator support for traversing items
- A completion flag for tracking collection state
This is a Rust port of the C# ItemSet class used in XPath 2.0 operations.
Implementations§
Source§impl<T> ItemSet<T>
impl<T> ItemSet<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new ItemSet with the specified capacity.
Sourcepub fn set_capacity(&mut self, capacity: usize)
pub fn set_capacity(&mut self, capacity: usize)
Sourcepub fn set_completed(&mut self, value: bool)
pub fn set_completed(&mut self, value: bool)
Sets the completion flag.
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a reference to the item at the specified index.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to the item at the specified index.
Sourcepub fn iter(&self) -> ItemSetIter<'_, T> ⓘ
pub fn iter(&self) -> ItemSetIter<'_, T> ⓘ
Returns an iterator over the items.
Sourcepub fn iter_mut(&mut self) -> ItemSetIterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> ItemSetIterMut<'_, T> ⓘ
Returns a mutable iterator over the items.
Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns the underlying items as a mutable slice.
Trait Implementations§
Source§impl<T> Extend<T> for ItemSet<T>
impl<T> Extend<T> for ItemSet<T>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> FromIterator<T> for ItemSet<T>
impl<T> FromIterator<T> for ItemSet<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T> IntoIterator for ItemSet<T>
impl<T> IntoIterator for ItemSet<T>
Source§impl<'a, T> IntoIterator for &'a ItemSet<T>
impl<'a, T> IntoIterator for &'a ItemSet<T>
Source§impl<'a, T> IntoIterator for &'a mut ItemSet<T>
impl<'a, T> IntoIterator for &'a mut ItemSet<T>
Auto Trait Implementations§
impl<T> Freeze for ItemSet<T>
impl<T> RefUnwindSafe for ItemSet<T>where
T: RefUnwindSafe,
impl<T> Send for ItemSet<T>where
T: Send,
impl<T> Sync for ItemSet<T>where
T: Sync,
impl<T> Unpin for ItemSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for ItemSet<T>
impl<T> UnwindSafe for ItemSet<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more