fn priority_fn_dynamic(_id: &ArtifactId, attribute: &ArtifactAttribute) -> Priority {
        if let ArtifactAttribute::FileTreeSync(attr) = attribute {
            let attr = attr.parse::<i32>().unwrap();
            // Divvy up the 30 adverts in groups of 12, 9, 9
            // Equally distribute the 3 groups to 3 peers
            if attr > 17 {
                Priority::Fetch
            } else if attr > 8 {
                Priority::FetchNow
            } else {
                Priority::Later
            }
        } else {
            Priority::Drop
        }
    }
/// Returns a priority for a given artifact based on its content.
/// This function is used for tests where artifacts are expected to be of
/// a certain type (`FileTreeSync`).
Returns a priority for a given artifact based on its content.
This function is used for tests where artifacts are expected to be of
a certain type (`FileTreeSync`).
Returns a priority for a given artifact based on its content . This function is used for tests where artifacts are expected to be of a certain type ( ` FileTreeSync ` ) .
fn priority_fn_dynamic(_id: &ArtifactId, attribute: &ArtifactAttribute) -> Priority {
        if let ArtifactAttribute::FileTreeSync(attr) = attribute {
            let attr = attr.parse::<i32>().unwrap();
            // Divvy up the 30 adverts in groups of 12, 9, 9
            // Equally distribute the 3 groups to 3 peers
            if attr > 17 {
                Priority::Fetch
            } else if attr > 8 {
                Priority::FetchNow
            } else {
                Priority::Later
            }
        } else {
            Priority::Drop
        }
    }
fn priority_fn_dynamic ( _id : & ArtifactId , attribute : & ArtifactAttribute ) -> Priority { if let ArtifactAttribute :: FileTreeSync ( attr ) = attribute { let attr = attr . parse :: < i32 > ( ) . unwrap ( ) ; // Divvy up the 30 adverts in groups of 12, 9, 9 // Equally distribute the 3 groups to 3 peers if attr > 17 { Priority :: Fetch } else if attr > 8 { Priority :: FetchNow } else { Priority :: Later } } else { Priority :: Drop } }
Returns a priority for a given artifact based on its content.
Returns a priority for a given artifact based on its content .
_id
&ArtifactId
attribute
&ArtifactAttribute
_id
&ArtifactId
attribute
&ArtifactAttribute