Trait ResourceService

Source
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§

Source

type MemberType: Resource<Error = Self::Error, Principal = Self::Principal>

Source

type PathComponents: for<'de> Deserialize<'de> + Sized + Clone + 'static

Source

type Resource: Resource<Error = Self::Error, Principal = Self::Principal>

Source

type Error: ResponseError + From<Error>

Source

type Principal: Principal

Required Methods§

Source

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§

Source

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,

Source

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,

Source

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,

Source

fn actix_resource(self) -> Resource

Source

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.

Implementors§