Trait ResourceService

Source
pub trait ResourceService:
    Clone
    + Sized
    + Send
    + Sync
    + AxumMethods
    + 'static {
    type PathComponents: Debug + for<'de> Deserialize<'de> + Sized + Send + Sync + Clone + 'static;
    type MemberType: Resource<Error = Self::Error, Principal = Self::Principal> + ResourceName;
    type Resource: Resource<Error = Self::Error, Principal = Self::Principal>;
    type Error: From<Error> + Send + Sync + IntoResponse + 'static;
    type Principal: Principal + FromRequestParts<Self>;
    type PrincipalUri: PrincipalUri;

    const DAV_HEADER: &'static str;

    // Required method
    fn get_resource<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Self::PathComponents,
        show_deleted: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Resource, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn get_members<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _path: &'life1 Self::PathComponents,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::MemberType>, Self::Error>> + Send + '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>> + Send + '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>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn copy_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _path: &'life1 Self::PathComponents,
        _destination: &'life2 Self::PathComponents,
        _user: &'life3 Self::Principal,
        _overwrite: bool,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn move_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _path: &'life1 Self::PathComponents,
        _destination: &'life2 Self::PathComponents,
        _user: &'life3 Self::Principal,
        _overwrite: bool,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn axum_service(self) -> AxumService<Self>
       where Self: AxumMethods { ... }
    fn axum_router<S: Send + Sync + Clone + 'static>(self) -> Router<S> { ... }
}

Required Associated Constants§

Source

const DAV_HEADER: &'static str

Required Associated Types§

Source

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

Source

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

Source

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

Source

type Error: From<Error> + Send + Sync + IntoResponse + 'static

Source

type Principal: Principal + FromRequestParts<Self>

Source

type PrincipalUri: PrincipalUri

Required Methods§

Source

fn get_resource<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Self::PathComponents, show_deleted: bool, ) -> Pin<Box<dyn Future<Output = Result<Self::Resource, Self::Error>> + Send + '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: &'life1 Self::PathComponents, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::MemberType>, Self::Error>> + Send + '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>> + Send + '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>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn copy_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _path: &'life1 Self::PathComponents, _destination: &'life2 Self::PathComponents, _user: &'life3 Self::Principal, _overwrite: bool, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn move_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _path: &'life1 Self::PathComponents, _destination: &'life2 Self::PathComponents, _user: &'life3 Self::Principal, _overwrite: bool, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn axum_service(self) -> AxumService<Self>
where Self: AxumMethods,

Source

fn axum_router<S: Send + Sync + Clone + 'static>(self) -> Router<S>

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§

Source§

impl<PRS: ResourceService<Principal = P> + Clone, P: Principal + FromRequestParts<Self>, PURI: PrincipalUri> ResourceService for RootResourceService<PRS, P, PURI>
where PRS::Resource: ResourceName,