pub struct NeededBlobsProxy { /* private fields */ }
Implementations§
Source§impl NeededBlobsProxy
impl NeededBlobsProxy
Sourcepub fn take_event_stream(&self) -> NeededBlobsEventStream
pub fn take_event_stream(&self) -> NeededBlobsEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn open_meta_blob(
&self,
) -> QueryResponseFut<NeededBlobsOpenMetaBlobResult, DefaultFuchsiaResourceDialect>
pub fn open_meta_blob( &self, ) -> QueryResponseFut<NeededBlobsOpenMetaBlobResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<NeededBlobsOpenBlobResult, DefaultFuchsiaResourceDialect>
pub fn open_blob( &self, blob_id: &BlobId, ) -> QueryResponseFut<NeededBlobsOpenBlobResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<NeededBlobsBlobWrittenResult, DefaultFuchsiaResourceDialect>
pub fn blob_written( &self, blob_id: &BlobId, ) -> QueryResponseFut<NeededBlobsBlobWrittenResult, DefaultFuchsiaResourceDialect>
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) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn abort(&self) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
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 Clone for NeededBlobsProxy
impl Clone for NeededBlobsProxy
Source§fn clone(&self) -> NeededBlobsProxy
fn clone(&self) -> NeededBlobsProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for NeededBlobsProxy
impl Debug for NeededBlobsProxy
Source§impl NeededBlobsProxyInterface for NeededBlobsProxy
impl NeededBlobsProxyInterface for NeededBlobsProxy
type OpenMetaBlobResponseFut = QueryResponseFut<Result<Option<Box<BlobWriter>>, OpenBlobError>>
type OpenBlobResponseFut = QueryResponseFut<Result<Option<Box<BlobWriter>>, OpenBlobError>>
type BlobWrittenResponseFut = QueryResponseFut<Result<(), BlobWrittenError>>
type AbortResponseFut = QueryResponseFut<()>
fn open_meta_blob(&self) -> Self::OpenMetaBlobResponseFut
fn get_missing_blobs( &self, iterator: ServerEnd<BlobInfoIteratorMarker>, ) -> Result<(), Error>
fn open_blob(&self, blob_id: &BlobId) -> Self::OpenBlobResponseFut
fn blob_written(&self, blob_id: &BlobId) -> Self::BlobWrittenResponseFut
fn abort(&self) -> Self::AbortResponseFut
Source§impl Proxy for NeededBlobsProxy
impl Proxy for NeededBlobsProxy
Source§type Protocol = NeededBlobsMarker
type Protocol = NeededBlobsMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for NeededBlobsProxy
impl !RefUnwindSafe for NeededBlobsProxy
impl Send for NeededBlobsProxy
impl Sync for NeededBlobsProxy
impl Unpin for NeededBlobsProxy
impl !UnwindSafe for NeededBlobsProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)