pub trait Render<T: PrimaryData> {
// Required method
fn render(self, query: Option<&Query>) -> Result<Document<T>, Error>;
}
Expand description
A trait to render a given type as a document.
This trait is automatically implemented for any type which implements Resource
.
Required Methods§
Sourcefn render(self, query: Option<&Query>) -> Result<Document<T>, Error>
fn render(self, query: Option<&Query>) -> Result<Document<T>, Error>
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.