pub trait ResourceService: Sized + 'static {
type MemberType: Resource<Error = Self::Error, Principal = Self::Principal>;
type PathComponents: for<'de> Deserialize<'de> + Sized + Clone + 'static;
type Resource: Resource<Error = Self::Error, Principal = Self::Principal>;
type Error: ResponseError + From<Error>;
type Principal: Principal;
// Required method
fn get_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
) -> Pin<Box<dyn Future<Output = Result<Self::Resource, Self::Error>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_members<'life0, 'life1, 'async_trait>(
&'life0 self,
_path_components: &'life1 Self::PathComponents,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Self::MemberType)>, Self::Error>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn save_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
_file: Self::Resource,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn delete_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
_use_trashbin: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn actix_resource(self) -> Resource { ... }
fn actix_additional_routes(res: Resource) -> Resource { ... }
}
Required Associated Types§
type MemberType: Resource<Error = Self::Error, Principal = Self::Principal>
type PathComponents: for<'de> Deserialize<'de> + Sized + Clone + 'static
type Resource: Resource<Error = Self::Error, Principal = Self::Principal>
type Error: ResponseError + From<Error>
type Principal: Principal
Required Methods§
fn get_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
) -> Pin<Box<dyn Future<Output = Result<Self::Resource, Self::Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn get_members<'life0, 'life1, 'async_trait>(
&'life0 self,
_path_components: &'life1 Self::PathComponents,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Self::MemberType)>, Self::Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
_file: Self::Resource,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Self::PathComponents,
_use_trashbin: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn actix_resource(self) -> Resource
Sourcefn actix_additional_routes(res: Resource) -> Resource
fn actix_additional_routes(res: Resource) -> Resource
Hook for other resources to insert their additional methods (i.e. REPORT, MKCALENDAR)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.