pub struct CollectionIdList { /* private fields */ }Expand description
The value of the key mirrored-collection-ids: a list of collection
ids that is not empty.
Each id passes is_valid_collection_id,
and each id occurs one time. A list that breaks a rule cannot be built.
§Examples
use ostrya_core::config::{CollectionIdList, Value};
let ids = CollectionIdList::parse("org.ex.B;org.ex.A;org.ex.B;").unwrap();
assert_eq!(ids.ids(), ["org.ex.B", "org.ex.A"]);
assert!(CollectionIdList::parse("").is_err());
assert!(CollectionIdList::parse("org/ex").is_err());Implementations§
Trait Implementations§
Source§impl Clone for CollectionIdList
impl Clone for CollectionIdList
Source§impl Debug for CollectionIdList
impl Debug for CollectionIdList
impl Eq for CollectionIdList
Source§impl Hash for CollectionIdList
impl Hash for CollectionIdList
Source§impl PartialEq for CollectionIdList
impl PartialEq for CollectionIdList
impl StructuralPartialEq for CollectionIdList
Source§impl TryFrom<Vec<String>> for CollectionIdList
impl TryFrom<Vec<String>> for CollectionIdList
Source§fn try_from(ids: Vec<String>) -> Result<CollectionIdList, ValueError>
fn try_from(ids: Vec<String>) -> Result<CollectionIdList, ValueError>
Keeps the first copy of an id that occurs again.
§Errors
A ValueError if ids is empty, or if an id fails the
collection-id rule.
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Source§impl Value for CollectionIdList
The text is a ; list with the escape sequences of a key file. The
list is decoded, and then checked as CollectionIdList::try_from
checks it.
impl Value for CollectionIdList
The text is a ; list with the escape sequences of a key file. The
list is decoded, and then checked as CollectionIdList::try_from
checks it.
Auto Trait Implementations§
impl Forget for CollectionIdList
impl Freeze for CollectionIdList
impl Move for CollectionIdList
impl RefUnwindSafe for CollectionIdList
impl Send for CollectionIdListwhere
RawVecInner: Send,
impl Sync for CollectionIdListwhere
RawVecInner: Sync,
impl Unpin for CollectionIdList
impl UnsafeUnpin for CollectionIdList
impl UnwindSafe for CollectionIdListwhere
RawVecInner: 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