pub fn fetch_url(url: Url, flags: FetchFlags) -> Result<Data, FetchError> {
    match url.scheme() {
        "file" => {
            if flags.allow_file {
                fetch_file(url)
            } else {
                Err(FetchError::ProhibitedScheme)
            }
        }
        "data" => fetch_data(url),
        _ => Err(FetchError::UnsupportedScheme),
    }
}
/// Fetch data from a URL with optional restrictions from accessing file system or network (if
/// everything is restricted, the only allowed option are data URLs where everything is encoded
/// in the URL itself).
Fetch data from a URL with optional restrictions from accessing file system or network (if
everything is restricted, the only allowed option are data URLs where everything is encoded
in the URL itself).
Fetch data from a URL with optional restrictions from accessing file system or network ( if everything is restricted the only allowed option are data URLs where everything is encoded in the URL itself ) .
pub fn fetch_url(url: Url, flags: FetchFlags) -> Result<Data, FetchError> {
    match url.scheme() {
        "file" => {
            if flags.allow_file {
                fetch_file(url)
            } else {
                Err(FetchError::ProhibitedScheme)
            }
        }
        "data" => fetch_data(url),
        _ => Err(FetchError::UnsupportedScheme),
    }
}
pub fn fetch_url ( url : Url , flags : FetchFlags ) -> Result < Data , FetchError > { match url . scheme ( ) { " " => { if flags . allow_file { fetch_file ( url ) } else { Err ( FetchError :: ProhibitedScheme ) } } " " => fetch_data ( url ) , _ => Err ( FetchError :: UnsupportedScheme ) , } }
Fetch data from a URL with optional restrictions from accessing file system or network (if
everything is restricted, the only allowed option are data URLs where everything is encoded
in the URL itself).
Fetch data from a URL with optional restrictions from accessing file system or network ( if everything is restricted the only allowed option are data URLs where everything is encoded in the URL itself ) .
url
Url
flags
FetchFlags
url
Url
flags
FetchFlags