async fn partially_in_containerd(
    mut content_client: ContentClient<tonic::transport::Channel>,
    digest: &Digest,
) -> Result<Option<u64>> {
    let req = tonic::Request::new_namespaced(StatusRequest {
        r#ref: digest.to_string(),
    });

    let res = content_client.status(req).await;

    let offset = match res {
        Ok(res) => {
            // `status` is only an `Option` type because of funky protobuf codegen
            let status = res
                .into_inner()
                .status
                .expect("containerd grpc api returned null status");
            Some(status.offset as u64)
        }
        Err(e) => match e.code() {
            tonic::Code::NotFound => None,
            _ => return Err(e.context(ErrorKind::GrpcUnexpectedErr).into()),
        },
    };

    Ok(offset)
}
/// Check if a blob has been partially downloaded to containerd, returning the
/// downloaded offset if applicable.
Check if a blob has been partially downloaded to containerd, returning the
downloaded offset if applicable.
Check if a blob has been partially downloaded to containerd returning the downloaded offset if applicable .
async fn partially_in_containerd(
    mut content_client: ContentClient<tonic::transport::Channel>,
    digest: &Digest,
) -> Result<Option<u64>> {
    let req = tonic::Request::new_namespaced(StatusRequest {
        r#ref: digest.to_string(),
    });
    let res = content_client.status(req).await;
    let offset = match res {
        Ok(res) => {
            // `status` is only an `Option` type because of funky protobuf codegen
            let status = res
                .into_inner()
                .status
                .expect("containerd grpc api returned null status");
            Some(status.offset as u64)
        }
        Err(e) => match e.code() {
            tonic::Code::NotFound => None,
            _ => return Err(e.context(ErrorKind::GrpcUnexpectedErr).into()),
        },
    };
    Ok(offset)
}
async fn partially_in_containerd ( mut content_client : ContentClient < tonic :: transport :: Channel > , digest : & Digest , ) -> Result < Option < u64 > > { let req = tonic :: Request :: new_namespaced ( StatusRequest { r#ref : digest . to_string ( ) , } ) ; let res = content_client . status ( req ) . await ; let offset = match res { Ok ( res ) => { // `status` is only an `Option` type because of funky protobuf codegen let status = res . into_inner ( ) . status . expect ( " " ) ; Some ( status . offset as u64 ) } Err ( e ) => match e . code ( ) { tonic :: Code :: NotFound => None , _ => return Err ( e . context ( ErrorKind :: GrpcUnexpectedErr ) . into ( ) ) , } , } ; Ok ( offset ) }
Check if a blob has been partially downloaded to containerd, returning the
downloaded offset if applicable.
Check if a blob has been partially downloaded to containerd returning the downloaded offset if applicable .
content_client
ContentClient<tonic::transport::Channel>
digest
&Digest
content_client
ContentClient<tonic::transport::Channel>
digest
&Digest