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

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

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.

Examples

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