pub struct Keys { /* private fields */ }Expand description
Names for the positions on one axis. A position may have no name. The names that are present are unique.
Implementations§
Source§impl Keys
impl Keys
Sourcepub fn partial(names: Vec<Option<Arc<str>>>) -> Result<Arc<Self>, Error>
pub fn partial(names: Vec<Option<Arc<str>>>) -> Result<Arc<Self>, Error>
Keys from names, where None marks a position with no name. A Domain error when a name appears twice.
pub fn names(&self) -> &[Option<Arc<str>>]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn position(&self, name: &str) -> Option<usize>
Sourcepub fn extend(&mut self, names: &[Option<Arc<str>>]) -> Result<(), Error>
pub fn extend(&mut self, names: &[Option<Arc<str>>]) -> Result<(), Error>
Adds positions at the end, named by names. A Domain error, with no position added, when a name is already here or appears twice in names.
Sourcepub fn align(&self, wanted: &Self) -> Vec<Option<usize>>
pub fn align(&self, wanted: &Self) -> Vec<Option<usize>>
For each position of wanted, the matching position here. Named positions match by name. Unnamed positions match in order.
Sourcepub fn positions(
&self,
wanted: &Self,
subset: bool,
) -> Result<Vec<usize>, Error>
pub fn positions( &self, wanted: &Self, subset: bool, ) -> Result<Vec<usize>, Error>
For each position of wanted, the matching position here. With subset, wanted may have fewer positions, and one with no match is an Index error. Otherwise both need the same positions, and a mismatch is a Length error.
Sourcepub fn select(
&self,
positions: impl IntoIterator<Item = Option<usize>>,
) -> Result<Arc<Self>, Error>
pub fn select( &self, positions: impl IntoIterator<Item = Option<usize>>, ) -> Result<Arc<Self>, Error>
Keys at source positions, in the order given. A position with no source has no name.
Trait Implementations§
impl Eq for Keys
Auto Trait Implementations§
impl Forget for Keys
impl Freeze for Keys
impl RefUnwindSafe for Keys
impl Send for Keys
impl Sync for Keys
impl Unpin for Keys
impl UnsafeUnpin for Keys
impl UnwindSafe for Keys
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more