Struct lace_codebook::RowNameList
source · pub struct RowNameList { /* private fields */ }Expand description
A structure that enforces unique IDs and row names.
Notes
Serializes to a Vec of String and deserializes to a Vec of
String.
Implementations§
source§impl RowNameList
impl RowNameList
pub fn new() -> RowNameList
pub fn with_capacity(n: usize) -> RowNameList
pub fn from_range(range: Range<usize>) -> RowNameList
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn index(&self, row_name: &str) -> Option<usize>
pub fn name(&self, ix: usize) -> Option<&String>
pub fn insert(&mut self, row_name: String) -> Result<(), InsertRowError>
pub fn iter(&self) -> Iter<'_, String, usize>
pub fn remove(&mut self, row_name: &str) -> bool
pub fn pop_front(&mut self) -> String
sourcepub fn last(&mut self) -> Option<&String>
pub fn last(&mut self) -> Option<&String>
Return the last row name. Returns None if the list is empty
pub fn as_slice(&self) -> &[String]
Trait Implementations§
source§impl Clone for RowNameList
impl Clone for RowNameList
source§fn clone(&self) -> RowNameList
fn clone(&self) -> RowNameList
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RowNameList
impl Debug for RowNameList
source§impl Default for RowNameList
impl Default for RowNameList
source§fn default() -> RowNameList
fn default() -> RowNameList
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RowNameList
impl<'de> Deserialize<'de> for RowNameList
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<RowNameList> for Vec<String>
impl From<RowNameList> for Vec<String>
source§fn from(rows: RowNameList) -> Self
fn from(rows: RowNameList) -> Self
Converts to this type from the input type.
source§impl Index<usize> for RowNameList
impl Index<usize> for RowNameList
source§impl PartialEq<RowNameList> for RowNameList
impl PartialEq<RowNameList> for RowNameList
source§fn eq(&self, other: &RowNameList) -> bool
fn eq(&self, other: &RowNameList) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for RowNameList
impl Serialize for RowNameList
impl StructuralPartialEq for RowNameList
Auto Trait Implementations§
impl RefUnwindSafe for RowNameList
impl Send for RowNameList
impl Sync for RowNameList
impl Unpin for RowNameList
impl UnwindSafe for RowNameList
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.