pub struct WordVec(/* private fields */);Expand description
A vector of words that is capped in size to 2^8 entries, is always sorted and contains no duplicate entries.
Implementations§
Source§impl WordVec
impl WordVec
Sourcepub fn new(
words: impl IntoIterator<Item = impl Into<String>>,
) -> Result<WordVec, OverflowError>
pub fn new( words: impl IntoIterator<Item = impl Into<String>>, ) -> Result<WordVec, OverflowError>
Creates a new vector from a given iterable of string-like words.
§Errors
OverflowError if this operation would result in a vector that exceeds 2^8 entries.
Sourcepub fn push(&mut self, word: impl Into<String>) -> Result<(), OverflowError>
pub fn push(&mut self, word: impl Into<String>) -> Result<(), OverflowError>
Appends a string-like word to the vector.
§Errors
OverflowError if this operation would result in a vector that exceeds 2^8 entries.
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for WordVec
impl<'__de, __Context> BorrowDecode<'__de, __Context> for WordVec
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
impl Eq for WordVec
impl StructuralPartialEq for WordVec
Auto Trait Implementations§
impl Freeze for WordVec
impl RefUnwindSafe for WordVec
impl Send for WordVec
impl Sync for WordVec
impl Unpin for WordVec
impl UnwindSafe for WordVec
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