Enum wikidata::IdParseError
source · pub enum IdParseError {
UnparseableNumber(ParseIntError),
InvalidPrefix,
TooManyParts,
TooFewParts,
}
Expand description
An error parsing an ID.
Variants§
UnparseableNumber(ParseIntError)
The number couldn’t be parsed.
InvalidPrefix
The ID had an invalid prefix letter.
TooManyParts
The ID had too many parts seperated by dashes
§Example
use std::str::FromStr;
use wikidata::{Fid, IdParseError};
assert_eq!(Fid::from_str("L3-F2-S6"), Err(IdParseError::TooManyParts));
TooFewParts
The ID had too few parts seperated by dashes
§Example
use std::str::FromStr;
use wikidata::{Fid, IdParseError};
assert_eq!(Fid::from_str("L3"), Err(IdParseError::TooFewParts));
Trait Implementations§
source§impl Clone for IdParseError
impl Clone for IdParseError
source§fn clone(&self) -> IdParseError
fn clone(&self) -> IdParseError
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 IdParseError
impl Debug for IdParseError
source§impl PartialEq for IdParseError
impl PartialEq for IdParseError
source§fn eq(&self, other: &IdParseError) -> bool
fn eq(&self, other: &IdParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for IdParseError
impl StructuralPartialEq for IdParseError
Auto Trait Implementations§
impl Freeze for IdParseError
impl RefUnwindSafe for IdParseError
impl Send for IdParseError
impl Sync for IdParseError
impl Unpin for IdParseError
impl UnwindSafe for IdParseError
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)