fn parse_resource_with_type<T: ResourceType>(resource: &str) -> Result<Resource<T>, String> {
    let (package, resource_type, resource_name) = parse_resource(resource)?;
    if resource_type != T::resource_type() {
        return Err(format!(
            "a wrong resource type, expected @[package:]{}/{}, found {}",
            T::resource_type(),
            resource_name,
            resource
        ));
    };
    Ok(Resource {
        name: resource_name,
        package,
        phantom: PhantomData,
    })
}
/// Parses a resource string into given `Resource<ResourceType>`
Parses a resource string into given `Resource`
Parses a resource string into given ` Resource `
fn parse_resource_with_type<T: ResourceType>(resource: &str) -> Result<Resource<T>, String> {
    let (package, resource_type, resource_name) = parse_resource(resource)?;
    if resource_type != T::resource_type() {
        return Err(format!(
            "a wrong resource type, expected @[package:]{}/{}, found {}",
            T::resource_type(),
            resource_name,
            resource
        ));
    };
    Ok(Resource {
        name: resource_name,
        package,
        phantom: PhantomData,
    })
}
fn parse_resource_with_type < T : ResourceType > ( resource : & str ) -> Result < Resource < T > , String > { let ( package , resource_type , resource_name ) = parse_resource ( resource ) ? ; if resource_type != T :: resource_type ( ) { return Err ( format ! ( " " T resource_type ( ) resource_name resource ) ) ; } ; Ok ( Resource { name : resource_name , package , phantom : PhantomData , } ) }
Parses a resource string into given `Resource<ResourceType>`
Parses a resource string into given ` Resource<ResourceType > `
resource
&str
resource
&str