fn try_begin_download(
        num_adverts: i32,
        gossip_config: &GossipConfig,
        artifact_manager: &dyn ArtifactManager,
        artifact_download_list: &mut ArtifactDownloadListImpl,
    ) -> std::time::Instant {
        // Insert and remove artifacts.
        let mut max_expiry = std::time::Instant::now();
        for advert_id in 0..num_adverts {
            let gossip_advert = GossipAdvert {
                artifact_id: ArtifactId::FileTreeSync(advert_id.to_string()),
                attribute: ArtifactAttribute::FileTreeSync(advert_id.to_string()),
                size: 0,
                integrity_hash: CryptoHash(vec![u8::try_from(advert_id).unwrap()]),
            };
            let tracker = artifact_download_list
                .schedule_download(
                    node_test_id(0),
                    &gossip_advert,
                    gossip_config,
                    1,
                    artifact_manager,
                )
                .unwrap();

            if tracker.expiry_instant > max_expiry {
                max_expiry = tracker.expiry_instant;
            }
        }
        max_expiry
    }
/// The function schedules the download of the given number of adverts.
The function schedules the download of the given number of adverts.
The function schedules the download of the given number of adverts .
fn try_begin_download(
        num_adverts: i32,
        gossip_config: &GossipConfig,
        artifact_manager: &dyn ArtifactManager,
        artifact_download_list: &mut ArtifactDownloadListImpl,
    ) -> std::time::Instant {
        // Insert and remove artifacts.
        let mut max_expiry = std::time::Instant::now();
        for advert_id in 0..num_adverts {
            let gossip_advert = GossipAdvert {
                artifact_id: ArtifactId::FileTreeSync(advert_id.to_string()),
                attribute: ArtifactAttribute::FileTreeSync(advert_id.to_string()),
                size: 0,
                integrity_hash: CryptoHash(vec![u8::try_from(advert_id).unwrap()]),
            };
            let tracker = artifact_download_list
                .schedule_download(
                    node_test_id(0),
                    &gossip_advert,
                    gossip_config,
                    1,
                    artifact_manager,
                )
                .unwrap();
            if tracker.expiry_instant > max_expiry {
                max_expiry = tracker.expiry_instant;
            }
        }
        max_expiry
    }
fn try_begin_download ( num_adverts : i32 , gossip_config : & GossipConfig , artifact_manager : & dyn ArtifactManager , artifact_download_list : & mut ArtifactDownloadListImpl , ) -> std :: time :: Instant { // Insert and remove artifacts. let mut max_expiry = std :: time :: Instant :: now ( ) ; for advert_id in 0 .. num_adverts { let gossip_advert = GossipAdvert { artifact_id : ArtifactId :: FileTreeSync ( advert_id . to_string ( ) ) , attribute : ArtifactAttribute :: FileTreeSync ( advert_id . to_string ( ) ) , size : 0 , integrity_hash : CryptoHash ( vec ! [ u8 try_from ( advert_id ) unwrap ( ) ] ) , } ; let tracker = artifact_download_list . schedule_download ( node_test_id ( 0 ) , & gossip_advert , gossip_config , 1 , artifact_manager , ) . unwrap ( ) ; if tracker . expiry_instant > max_expiry { max_expiry = tracker . expiry_instant ; } } max_expiry }
The function schedules the download of the given number of adverts.
The function schedules the download of the given number of adverts .
num_adverts
i32
gossip_config
&GossipConfig
artifact_manager
&dyn ArtifactManager
artifact_download_list
&mut ArtifactDownloadListImpl
num_adverts
i32
gossip_config
&GossipConfig
artifact_manager
&dyn ArtifactManager
artifact_download_list
&mut ArtifactDownloadListImpl