/// Given a backend path, return a Box'd Backend.
Given a backend path, return a Box'd Backend.
Given a backend path return a Box ' d Backend .
pub fn backend_from_backend_path(path: &str) -> Result<Box<dyn Backend>> {
	let url = Url::parse(path).map_err(|_| Error::BadBackendPath("Given backend path could not be understood.".to_string()))?;
	match url.scheme() {
		"file" => Ok(Box::new(FileBackend::new(url.path()))),
		e => return Err(Error::BadBackendPath(format!("Unknown backend: {}", e))),
	}
}
pub fn backend_from_backend_path ( path : & str ) -> Result < Box < dyn Backend > > { let url = Url :: parse ( path ) . map_err ( | _ | Error :: BadBackendPath ( " " . to_string ( ) ) ) ? ; match url . scheme ( ) { " " => Ok ( Box :: new ( FileBackend :: new ( url . path ( ) ) ) ) , e => return Err ( Error :: BadBackendPath ( format ! ( " " e ) ) ) , } }
Given a backend path, return a Box'd Backend.
Given a backend path return a Box ' d Backend .
path
&str