Trait json_api::view::Render [] [src]

pub trait Render<T: PrimaryData> {
    fn render(self, query: Option<&Query>) -> Result<Document<T>, Error>;
}

A trait to render a given type as a document.

This trait is automatically implemented for any type which implements Resource.

Required Methods

Attempts to render the given type as a document.

Types that implement the Resource trait via the resource! macro can use the optional query argument to match object field-sets and included resources with what is present in the query.

If a query does not have a matching field-set for a given type and the type in question is a part of the document's primary data or included resources, each attribute specified in the type's resource! macro invocation will be used.

Implementations on Foreign Types

impl<'a, T: Resource> Render<Identifier> for &'a T
[src]

impl<'a, T: Resource> Render<Identifier> for &'a [T]
[src]

impl<'a, T: Resource> Render<Object> for &'a T
[src]

[src]

impl<'a, T: Resource> Render<Object> for &'a [T]
[src]

[src]

impl Render<Identifier> for Vec<Identifier>
[src]

impl Render<Identifier> for Vec<Object>
[src]

impl Render<Object> for Vec<Object>
[src]

impl<D, T> Render<D> for Option<T> where
    D: PrimaryData,
    T: Render<D> + Sized
[src]

[src]

Implementors