Struct mwtitle::NamespaceInfo
source · pub struct NamespaceInfo {
pub id: i32,
pub case: String,
pub name: String,
pub canonical: Option<String>,
}Expand description
Represents a namespace object in the namespaces field of a SiteInfo.
Contains only the fields required to generate a NamespaceMap that can be used
by a TitleCodec to parse the namespace in a Title.
Supports formatversion=1 with the local namespace name in the "*" field,
and formatversion=2 with the local namespace name in the "name" field.
Fields§
§id: i32§case: String§name: String§canonical: Option<String>Implementations§
source§impl NamespaceInfo
impl NamespaceInfo
sourcepub fn try_from_iter<I: IntoIterator<Item = (String, String)>>(
iter: I
) -> Result<Self>
pub fn try_from_iter<I: IntoIterator<Item = (String, String)>>( iter: I ) -> Result<Self>
Fallibly convert a HashMap<String, String> and a String into a NamespaceInfo.
Errors
Fails if any of the keys "id", "case" is missing,
or if the value for "id" cannot be parsed as an i32.
Trait Implementations§
source§impl Clone for NamespaceInfo
impl Clone for NamespaceInfo
source§fn clone(&self) -> NamespaceInfo
fn clone(&self) -> NamespaceInfo
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 NamespaceInfo
impl Debug for NamespaceInfo
source§impl<'de> Deserialize<'de> for NamespaceInfo
impl<'de> Deserialize<'de> for NamespaceInfo
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 Ord for NamespaceInfo
impl Ord for NamespaceInfo
source§fn cmp(&self, other: &NamespaceInfo) -> Ordering
fn cmp(&self, other: &NamespaceInfo) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for NamespaceInfo
impl PartialEq for NamespaceInfo
source§fn eq(&self, other: &NamespaceInfo) -> bool
fn eq(&self, other: &NamespaceInfo) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NamespaceInfo
impl PartialOrd for NamespaceInfo
source§fn partial_cmp(&self, other: &NamespaceInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &NamespaceInfo) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for NamespaceInfo
impl StructuralEq for NamespaceInfo
impl StructuralPartialEq for NamespaceInfo
Auto Trait Implementations§
impl RefUnwindSafe for NamespaceInfo
impl Send for NamespaceInfo
impl Sync for NamespaceInfo
impl Unpin for NamespaceInfo
impl UnwindSafe for NamespaceInfo
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