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§impl PartialOrd for NamespaceInfo
impl PartialOrd for NamespaceInfo
impl Eq for NamespaceInfo
impl StructuralPartialEq for NamespaceInfo
Auto Trait Implementations§
impl Freeze for NamespaceInfo
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