Struct parse_mediawiki_sql::field_types::PageRestrictionsOld[][src]

pub struct PageRestrictionsOld<'a>(pub BTreeMap<PageAction<'a>, Vec<ProtectionLevel<'a>>>);
Expand description

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 | spec (":" spec)*
spec: action "=" level
level: "autoconfirmed" | "templateeditor" | "sysop" | ""
action: "edit" | "move" | "upload"

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

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

The example given is nonsensical because users in the sysop group have all the rights of users in the autoconfirmed group, and neither English Wikipedia nor English Wiktionary have any page_restrictions strings in this format, but perhaps these types of protection strings have existed in the past or exist now on other wikis.

Tuple Fields

0: BTreeMap<PageAction<'a>, Vec<ProtectionLevel<'a>>>

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.