pub trait Resource: Clone + 'static {
type Prop: ResourceProp + PartialEq + Clone + EnumVariants + EnumUnitVariants;
type Error: ResponseError + From<Error>;
type Principal: Principal;
// Required methods
fn get_resourcetype(&self) -> Resourcetype;
fn get_prop(
&self,
rmap: &ResourceMap,
principal: &Self::Principal,
prop: &<Self::Prop as EnumUnitVariants>::UnitVariants,
) -> Result<Self::Prop, Self::Error>;
fn get_user_privileges(
&self,
principal: &Self::Principal,
) -> Result<UserPrivilegeSet, Self::Error>;
// Provided methods
fn list_props() -> Vec<(Option<Namespace<'static>>, &'static str)> { ... }
fn set_prop(&mut self, _prop: Self::Prop) -> Result<(), Error> { ... }
fn remove_prop(
&mut self,
_prop: &<Self::Prop as EnumUnitVariants>::UnitVariants,
) -> Result<(), Error> { ... }
fn get_owner(&self) -> Option<&str> { ... }
fn get_etag(&self) -> Option<String> { ... }
fn satisfies_if_match(&self, if_match: &IfMatch) -> bool { ... }
fn satisfies_if_none_match(&self, if_none_match: &IfNoneMatch) -> bool { ... }
fn propfind(
&self,
path: &str,
props: &[&str],
principal: &Self::Principal,
rmap: &ResourceMap,
) -> Result<ResponseElement<Self::Prop>, Self::Error> { ... }
}
Required Associated Types§
type Prop: ResourceProp + PartialEq + Clone + EnumVariants + EnumUnitVariants
type Error: ResponseError + From<Error>
type Principal: Principal
Required Methods§
fn get_resourcetype(&self) -> Resourcetype
fn get_prop( &self, rmap: &ResourceMap, principal: &Self::Principal, prop: &<Self::Prop as EnumUnitVariants>::UnitVariants, ) -> Result<Self::Prop, Self::Error>
fn get_user_privileges( &self, principal: &Self::Principal, ) -> Result<UserPrivilegeSet, Self::Error>
Provided Methods§
fn list_props() -> Vec<(Option<Namespace<'static>>, &'static str)>
fn set_prop(&mut self, _prop: Self::Prop) -> Result<(), Error>
fn remove_prop( &mut self, _prop: &<Self::Prop as EnumUnitVariants>::UnitVariants, ) -> Result<(), Error>
fn get_owner(&self) -> Option<&str>
fn get_etag(&self) -> Option<String>
fn satisfies_if_match(&self, if_match: &IfMatch) -> bool
fn satisfies_if_none_match(&self, if_none_match: &IfNoneMatch) -> bool
fn propfind( &self, path: &str, props: &[&str], principal: &Self::Principal, rmap: &ResourceMap, ) -> Result<ResponseElement<Self::Prop>, Self::Error>
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.