pub struct NeededBlobsSynchronousProxy { /* private fields */ }
Implementations§
Source§impl NeededBlobsSynchronousProxy
impl NeededBlobsSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<NeededBlobsEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<NeededBlobsEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn open_meta_blob(
&self,
___deadline: MonotonicInstant,
) -> Result<NeededBlobsOpenMetaBlobResult, Error>
pub fn open_meta_blob( &self, ___deadline: MonotonicInstant, ) -> Result<NeededBlobsOpenMetaBlobResult, Error>
Opens the package’s metadata blob for writing. GetMissingBlobs()
should not be called until writing the meta blob or this request
responds with false
.
If the package was already cached, server will close the channel with a
ZX_OK
epitaph.
- response
writer
is used to write the blob. Ifwriter
is absent, the blob is already cached and so does not need to be written.
- error an OpenBlobError indicating failure. Clients may retry this request, though the server end may abort this cache operation on errors it considers to be fatal.
Sourcepub fn get_missing_blobs(
&self,
iterator: ServerEnd<BlobInfoIteratorMarker>,
) -> Result<(), Error>
pub fn get_missing_blobs( &self, iterator: ServerEnd<BlobInfoIteratorMarker>, ) -> Result<(), Error>
Returns an iterator of blobs that are not present on the system that
must be written using the OpenBlob
request before the package will be
fully cached.
Client should call OpenMetaBlob
, and write it if needed, before
calling GetMissingBlobs
.
A client should make this request no more than once per NeededBlobs
connection. Once all blobs yielded by this iterator are written, the
package open request will complete.
New items may be added to the obtained BlobInfoIterator
as the client
calls OpenBlob
, so, to guaranatee termination of the iterator, clients
should call OpenBlob
concurrently with reading the iterator.
- request
iterator
a request for an iterator ofBlobInfo
of blobs that the client should try to write.
Sourcepub fn open_blob(
&self,
blob_id: &BlobId,
___deadline: MonotonicInstant,
) -> Result<NeededBlobsOpenBlobResult, Error>
pub fn open_blob( &self, blob_id: &BlobId, ___deadline: MonotonicInstant, ) -> Result<NeededBlobsOpenBlobResult, Error>
Opens a blob for writing.
- request
blob_id
the blob id describing this blob.
- response
writer
is used to write the blob. Ifwriter
is absent, the blob is already cached and so does not need to be written.
- error an OpenBlobError indicating failure. Clients may retry this request, though the server end may abort this cache operation on errors it considers to be fatal.
Sourcepub fn blob_written(
&self,
blob_id: &BlobId,
___deadline: MonotonicInstant,
) -> Result<NeededBlobsBlobWrittenResult, Error>
pub fn blob_written( &self, blob_id: &BlobId, ___deadline: MonotonicInstant, ) -> Result<NeededBlobsBlobWrittenResult, Error>
Indicates that a blob opened by Open[Meta]Blob
has been successfully
written.
A client should call this once the blob has been fully written using
the writer
returned by Open[Meta]Blob
.
- request
blob_id
the blob id describing this blob.
- error a BlobWrittenError indicating failure. Clients may retry the
Open[Meta]Blob
request that prompted this call, though the server end may abort this cache operation on errors it considers to be fatal.
Sourcepub fn abort(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
pub fn abort(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
Aborts this caching operation for the package.
Any open blobs and any missing blobs iterator will be closed. Any dir
provided to the associated [PackageCache.Get
] request will also be
closed. Once this request is acknowledged, this channel will be closed.
Note, dropping this NeededBlobs channel without writing all needed blobs will also abort the package cache operation. However, this API provides the ability to wait for the operation to be torn down.
Trait Implementations§
Source§impl Debug for NeededBlobsSynchronousProxy
impl Debug for NeededBlobsSynchronousProxy
Source§impl SynchronousProxy for NeededBlobsSynchronousProxy
impl SynchronousProxy for NeededBlobsSynchronousProxy
Source§type Proxy = NeededBlobsProxy
type Proxy = NeededBlobsProxy
Source§type Protocol = NeededBlobsMarker
type Protocol = NeededBlobsMarker
Proxy
controls.