pub trait IntoResource<S, RequestBody>where
S: Serializer,
RequestBody: BufStream,{
type Destination: Clone + Send + Sync + 'static;
type Resource: Resource<Destination = Self::Destination, RequestBody = RequestBody>;
// Required methods
fn routes(&self) -> RouteSet<Self::Destination>;
fn into_resource(self, serializer: S) -> Self::Resource;
}Expand description
Convert a value into a Resource
Required Associated Types§
Sourcetype Destination: Clone + Send + Sync + 'static
type Destination: Clone + Send + Sync + 'static
Token mapping a route to a resource method.
This will always be set to the same type as
Self::Resource::Destination.
Sourcetype Resource: Resource<Destination = Self::Destination, RequestBody = RequestBody>
type Resource: Resource<Destination = Self::Destination, RequestBody = RequestBody>
The Resource value being converted to
Required Methods§
Sourcefn routes(&self) -> RouteSet<Self::Destination>
fn routes(&self) -> RouteSet<Self::Destination>
Returns the resource’s set of routes.
Sourcefn into_resource(self, serializer: S) -> Self::Resource
fn into_resource(self, serializer: S) -> Self::Resource
Convert self into a Resource value.