Trait parse_mediawiki_sql::from_sql::FromSql[][src]

pub trait FromSql<'a>: Sized {
    fn from_sql(s: &'a [u8]) -> IResult<'a, Self>;
}
Expand description

Trait for converting from the SQL syntax for a simple type (anything other than a tuple) to a Rust type, which can borrow from the string or not. Used by schemas::FromSqlTuple.

Required methods

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

Implementations on Foreign Types

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

Parses a bool from 1 or 0.

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

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

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

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

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

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

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

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

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

Matches a float literal with recognize_float and parses it as a f32.

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

Matches a float literal with recognize_float and parses it as a f64.

impl<'a> FromSql<'a> for &'a [u8][src]

Used for byte strings that have no escape sequences.

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'a> FromSql<'a> for &'a str[src]

Used for types represented as strings without escape sequences. For instance, Timestamps matches the regex ^[0-9: -]+$ and thus never has any escape sequences.

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

Use this for string types that require unescaping and are guaranteed to be valid UTF-8, like page titles.

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'a> FromSql<'a> for Vec<u8>[src]

Used for “strings” that sometimes contain invalid UTF-8, like the cl_sortkey field in the categorylinks table, which is truncated to 230 bits, sometimes in the middle of a UTF-8 sequence.

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'a> FromSql<'a> for ()[src]

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'a, T> FromSql<'a> for Option<T> where
    T: FromSql<'a>, 
[src]

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

Implementors

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'a> FromSql<'a> for NotNan<f32>[src]

Parses an f32 and wraps it with NotNan::unchecked_new.

Safety

This will never accidentally wrap a NaN because nom’s recognize_float doesn’t include a representation of NaN.

impl<'a> FromSql<'a> for NotNan<f64>[src]

Parses an f64 and wraps it with NotNan::unchecked_new.

Safety

This will never accidentally wrap a NaN because nom’s recognize_float doesn’t include a representation of NaN.

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

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

fn from_sql(s: &'a [u8]) -> IResult<'a, Self>[src]

impl<'input> FromSql<'input> for Expiry[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for ActorId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for CategoryId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for ChangeTagDefinitionId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for ChangeTagId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for CommentId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for ExternalLinkId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for FullPageTitle[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for LogId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for PageCount[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for PageId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for PageNamespace[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for PageRestrictionId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for PageTitle[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for RecentChangeId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for RevisionId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for Timestamp[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]

impl<'input> FromSql<'input> for UserId[src]

fn from_sql(s: &'input [u8]) -> IResult<'input, Self>[src]