pub async fn open_blob(
    pkgfs_install: &pkgfs::install::Client,
    merkle: Hash,
    kind: BlobKind,
) -> Result<OpenBlobSuccess, OpenBlobError> {
    use pkgfs::install::BlobCreateError;

    let res = pkgfs_install.create_blob(merkle, kind.into()).await;

    match res {
        Ok((blob, closer)) => Ok(OpenBlobSuccess::Needed(OpenBlob { blob, closer })),
        Err(BlobCreateError::AlreadyExists) => Ok(OpenBlobSuccess::AlreadyExists),
        Err(BlobCreateError::ConcurrentWrite) => Err(OpenBlobError::ConcurrentWrite),
        Err(BlobCreateError::Io(err)) => Err(OpenBlobError::Io(err)),
    }
}
/// Opens the requested blob for write.
Opens the requested blob for write.
Opens the requested blob for write .
pub async fn open_blob(
    pkgfs_install: &pkgfs::install::Client,
    merkle: Hash,
    kind: BlobKind,
) -> Result<OpenBlobSuccess, OpenBlobError> {
    use pkgfs::install::BlobCreateError;
    let res = pkgfs_install.create_blob(merkle, kind.into()).await;
    match res {
        Ok((blob, closer)) => Ok(OpenBlobSuccess::Needed(OpenBlob { blob, closer })),
        Err(BlobCreateError::AlreadyExists) => Ok(OpenBlobSuccess::AlreadyExists),
        Err(BlobCreateError::ConcurrentWrite) => Err(OpenBlobError::ConcurrentWrite),
        Err(BlobCreateError::Io(err)) => Err(OpenBlobError::Io(err)),
    }
}
pub async fn open_blob ( pkgfs_install : & pkgfs :: install :: Client , merkle : Hash , kind : BlobKind , ) -> Result < OpenBlobSuccess , OpenBlobError > { use pkgfs :: install :: BlobCreateError ; let res = pkgfs_install . create_blob ( merkle , kind . into ( ) ) . await ; match res { Ok ( ( blob , closer ) ) => Ok ( OpenBlobSuccess :: Needed ( OpenBlob { blob , closer } ) ) , Err ( BlobCreateError :: AlreadyExists ) => Ok ( OpenBlobSuccess :: AlreadyExists ) , Err ( BlobCreateError :: ConcurrentWrite ) => Err ( OpenBlobError :: ConcurrentWrite ) , Err ( BlobCreateError :: Io ( err ) ) => Err ( OpenBlobError :: Io ( err ) ) , } }
Opens the requested blob for write.
Opens the requested blob for write .
pkgfs_install
&pkgfs::install::Client
merkle
Hash
kind
BlobKind
pkgfs_install
&pkgfs::install::Client
merkle
Hash
kind
BlobKind