async fn check_and_hold<I: Into<AnySgdHash> + Clone>(
    hash: &I,
    workspace: &mut SysValidationWorkspace,
    network: AIngleP2pCell,
) -> SysValidationResult<Source> {
    let hash: AnySgdHash = hash.clone().into();
    // Create a workspace with just the local stores
    let mut local_cascade = workspace.local_cascade();
    if let Some(el) = local_cascade
        .retrieve(hash.clone(), Default::default())
        .await?
    {
        return Ok(Source::Local(el));
    }
    // Create a workspace with just the network
    let mut network_only_cascade = workspace.full_cascade(network);
    match network_only_cascade
        .retrieve(hash.clone(), Default::default())
        .await?
    {
        Some(el) => Ok(Source::Network(el)),
        None => Err(ValidationOutcome::NotHoldingDep(hash).into()),
    }
}
/// Check if we are holding a dependency and
/// run a check callback on the it.
/// This function also returns where the dependency
/// was found so you can decide whether or not to add
/// it to the incoming ops.
Check if we are holding a dependency and
run a check callback on the it.
This function also returns where the dependency
was found so you can decide whether or not to add
it to the incoming ops.
Check if we are holding a dependency and run a check callback on the it . This function also returns where the dependency was found so you can decide whether or not to add it to the incoming ops .
async fn check_and_hold<I: Into<AnySgdHash> + Clone>(
    hash: &I,
    workspace: &mut SysValidationWorkspace,
    network: AIngleP2pCell,
) -> SysValidationResult<Source> {
    let hash: AnySgdHash = hash.clone().into();
    // Create a workspace with just the local stores
    let mut local_cascade = workspace.local_cascade();
    if let Some(el) = local_cascade
        .retrieve(hash.clone(), Default::default())
        .await?
    {
        return Ok(Source::Local(el));
    }
    // Create a workspace with just the network
    let mut network_only_cascade = workspace.full_cascade(network);
    match network_only_cascade
        .retrieve(hash.clone(), Default::default())
        .await?
    {
        Some(el) => Ok(Source::Network(el)),
        None => Err(ValidationOutcome::NotHoldingDep(hash).into()),
    }
}
async fn check_and_hold < I : Into < AnySgdHash > + Clone > ( hash : & I , workspace : & mut SysValidationWorkspace , network : AIngleP2pCell , ) -> SysValidationResult < Source > { let hash : AnySgdHash = hash . clone ( ) . into ( ) ; // Create a workspace with just the local stores let mut local_cascade = workspace . local_cascade ( ) ; if let Some ( el ) = local_cascade . retrieve ( hash . clone ( ) , Default :: default ( ) ) . await ? { return Ok ( Source :: Local ( el ) ) ; } // Create a workspace with just the network let mut network_only_cascade = workspace . full_cascade ( network ) ; match network_only_cascade . retrieve ( hash . clone ( ) , Default :: default ( ) ) . await ? { Some ( el ) => Ok ( Source :: Network ( el ) ) , None => Err ( ValidationOutcome :: NotHoldingDep ( hash ) . into ( ) ) , } }
Check if we are holding a dependency and
run a check callback on the it.
Check if we are holding a dependency and run a check callback on the it .
hash
&I
workspace
&mut SysValidationWorkspace
network
AIngleP2pCell
hash
&I
workspace
&mut SysValidationWorkspace
network
AIngleP2pCell