Trait rustiful::JsonApiResource
[−]
[src]
pub trait JsonApiResource: Sized { type Params: Default; type SortField; type FilterField; type JsonApiIdType: FromStr + Debug; fn resource_name() -> &'static str; fn from_str<'a>(
query_string: &'a str
) -> Result<JsonApiParams<Self::FilterField, Self::SortField>, QueryStringParseError>
where
Self::SortField: for<'b> TryFrom<(&'b str, SortOrder), Error = QueryStringParseError>,
Self::FilterField: for<'b> TryFrom<(&'b str, Vec<&'b str>), Error = QueryStringParseError>, { ... } }
This trait is implemented for any type that derives the JsonApi
attribute.
Associated Types
type Params: Default
An alias for JsonApiParams<Self::SortField, Self::FilterField>
type SortField
This type is generated in rustiful-derive.
type FilterField
This type is generated in rustiful-derive.
type JsonApiIdType: FromStr + Debug
The type of a field named id
or the type of a field that has the #[JsonApiId]
attribute
on the type deriving JsonApi
.
Required Methods
fn resource_name() -> &'static str
This is the pluralized lower-cased name of the type deriving JsonApi
.
Provided Methods
fn from_str<'a>(
query_string: &'a str
) -> Result<JsonApiParams<Self::FilterField, Self::SortField>, QueryStringParseError> where
Self::SortField: for<'b> TryFrom<(&'b str, SortOrder), Error = QueryStringParseError>,
Self::FilterField: for<'b> TryFrom<(&'b str, Vec<&'b str>), Error = QueryStringParseError>,
query_string: &'a str
) -> Result<JsonApiParams<Self::FilterField, Self::SortField>, QueryStringParseError> where
Self::SortField: for<'b> TryFrom<(&'b str, SortOrder), Error = QueryStringParseError>,
Self::FilterField: for<'b> TryFrom<(&'b str, Vec<&'b str>), Error = QueryStringParseError>,