pub trait PermissionDescriptorParser:
Debug
+ Send
+ Sync {
Show 15 methods
// Required methods
fn parse_read_descriptor(
&self,
text: &str,
) -> Result<ReadDescriptor, PathResolveError>;
fn parse_write_descriptor(
&self,
text: &str,
) -> Result<WriteDescriptor, PathResolveError>;
fn parse_net_descriptor(
&self,
text: &str,
) -> Result<NetDescriptor, NetDescriptorParseError>;
fn parse_import_descriptor(
&self,
text: &str,
) -> Result<ImportDescriptor, NetDescriptorParseError>;
fn parse_env_descriptor(
&self,
text: &str,
) -> Result<EnvDescriptor, EnvDescriptorParseError>;
fn parse_sys_descriptor(
&self,
text: &str,
) -> Result<SysDescriptor, SysDescriptorParseError>;
fn parse_allow_run_descriptor(
&self,
text: &str,
) -> Result<AllowRunDescriptorParseResult, RunDescriptorParseError>;
fn parse_deny_run_descriptor(
&self,
text: &str,
) -> Result<DenyRunDescriptor, PathResolveError>;
fn parse_ffi_descriptor(
&self,
text: &str,
) -> Result<FfiDescriptor, PathResolveError>;
fn parse_path_query<'a>(
&self,
path: Cow<'a, Path>,
) -> Result<PathQueryDescriptor<'a>, PathResolveError>;
fn parse_special_file_descriptor<'a>(
&self,
path: PathQueryDescriptor<'a>,
) -> Result<SpecialFilePathQueryDescriptor<'a>, PathResolveError>;
fn parse_net_query(
&self,
text: &str,
) -> Result<NetDescriptor, NetDescriptorParseError>;
fn parse_run_query<'a>(
&self,
requested: &'a str,
) -> Result<RunQueryDescriptor<'a>, RunDescriptorParseError>;
// Provided methods
fn parse_net_descriptor_from_url(
&self,
url: &Url,
) -> Result<NetDescriptor, NetDescriptorFromUrlParseError> { ... }
fn parse_import_descriptor_from_url(
&self,
url: &Url,
) -> Result<ImportDescriptor, NetDescriptorFromUrlParseError> { ... }
}
Expand description
Parses and normalizes permissions.
This trait is necessary because this crate doesn’t have access to the file system.