Trait qsym2::chartab::chartab_symbols::CollectionSymbol
source · pub trait CollectionSymbol: MathematicalSymbol {
type CollectionElement;
// Required methods
fn from_reps(
symstr: &str,
reps: Option<Vec<Self::CollectionElement>>,
) -> Result<Self, GenericSymbolParsingError>;
fn representative(&self) -> Option<&Self::CollectionElement>;
fn representatives(&self) -> Option<&Vec<Self::CollectionElement>>;
// Provided method
fn size(&self) -> usize { ... }
}
Expand description
Trait for symbols describing collections of objects such as conjugacy classes.
Required Associated Types§
sourcetype CollectionElement
type CollectionElement
The type of the elements in the collection.
Required Methods§
sourcefn from_reps(
symstr: &str,
reps: Option<Vec<Self::CollectionElement>>,
) -> Result<Self, GenericSymbolParsingError>
fn from_reps( symstr: &str, reps: Option<Vec<Self::CollectionElement>>, ) -> Result<Self, GenericSymbolParsingError>
Constructs a collection symbol from a string and one or more representative collection elements.
§Arguments
symstr
- A string to be parsed. SeeGenericSymbol::from_str
for more information.reps
- An optional vector of one or more representative collection elements.
§Errors
Returns an error if symstr
cannot be parsed.
sourcefn representative(&self) -> Option<&Self::CollectionElement>
fn representative(&self) -> Option<&Self::CollectionElement>
The first representative element of the collection.
sourcefn representatives(&self) -> Option<&Vec<Self::CollectionElement>>
fn representatives(&self) -> Option<&Vec<Self::CollectionElement>>
All representative elements of the collection.
Provided Methods§
Object Safety§
This trait is not object safe.