Function cargo::util::network::with_retry [] [src]

pub fn with_retry<T, E, F>(config: &Config, callback: F) -> CargoResult<T> where F: FnMut() -> Result<T, E>, E: NetworkError

Wrapper method for network call retry logic.

Retry counts provided by Config object 'net.retry'. Config shell outputs a warning on per retry.

Closure must return a CargoResult.

Example: use util::network; cargo_result = network.with_retry(&config, || something.download());