[][src]Struct parse_mediawiki_sql::types::PageRestrictionsOld

pub struct PageRestrictionsOld<'a>(_);

Represents page_restrictions, an outdated field of the page table containing a string representing a map from action to the groups that are allowed to perform that action.

Here the action is represented by PageAction and the protection level by ProtectionLevel. This field was replaced by the page_restrictions table in MediaWiki 1.10, but is still used by the software if a page's restrictions have not been changed since MediaWiki 1.10 came out.

The string is in the following format, at least on the English Wiktionary:

# level on its own seems to be shorthand for both "edit" and "move"
"" | level | spec (":" spec)*
spec: action "=" level
# "" means no restrictions
level: "autoconfirmed" | "templateeditor" | "sysop" | ""
action: "edit" | "move" | "upload"

However, spec is treated as having the following format, because the MediaWiki documentation for the page table gives the example edit=autoconfirmed,sysop:move=sysop with multiple protection levels per action:

spec: action "=" level ("," level)*

The example given is nonsensical because autoconfirmed is a subset of sysop, and neither English Wikipedia nor English Wiktionary have any page_restrictions strings in this format, but perhaps another wiki does.

Implementations

impl<'a> PageRestrictionsOld<'a>[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn iter(
    &self
) -> impl Iterator<Item = (&PageAction<'a>, &Vec<ProtectionLevel<'a>>)>
[src]

Trait Implementations

impl<'a> Clone for PageRestrictionsOld<'a>[src]

impl<'a> Debug for PageRestrictionsOld<'a>[src]

impl<'a> Eq for PageRestrictionsOld<'a>[src]

impl<'a> FromIterator<(PageAction<'a>, Vec<ProtectionLevel<'a>>)> for PageRestrictionsOld<'a>[src]

impl<'a> FromSql<'a> for PageRestrictionsOld<'a>[src]

impl<'a> Hash for PageRestrictionsOld<'a>[src]

impl<'a> Index<PageAction<'a>> for PageRestrictionsOld<'a>[src]

type Output = Vec<ProtectionLevel<'a>>

The returned type after indexing.

impl<'a> Ord for PageRestrictionsOld<'a>[src]

impl<'a> PartialEq<PageRestrictionsOld<'a>> for PageRestrictionsOld<'a>[src]

impl<'a> PartialOrd<PageRestrictionsOld<'a>> for PageRestrictionsOld<'a>[src]

impl<'a> StructuralEq for PageRestrictionsOld<'a>[src]

impl<'a> StructuralPartialEq for PageRestrictionsOld<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for PageRestrictionsOld<'a>

impl<'a> Send for PageRestrictionsOld<'a>

impl<'a> Sync for PageRestrictionsOld<'a>

impl<'a> Unpin for PageRestrictionsOld<'a>

impl<'a> UnwindSafe for PageRestrictionsOld<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.