pub struct BlobfsRamdisk { /* private fields */ }
Expand description
A ramdisk-backed blobfs instance
Implementations§
Source§impl BlobfsRamdisk
impl BlobfsRamdisk
Sourcepub fn builder() -> BlobfsRamdiskBuilder
pub fn builder() -> BlobfsRamdiskBuilder
Creates a new BlobfsRamdiskBuilder
with no pre-configured ramdisk.
Sourcepub async fn start() -> Result<Self, Error>
pub async fn start() -> Result<Self, Error>
Starts a blobfs server backed by a freshly formatted ramdisk.
Sourcepub fn root_dir_handle(&self) -> Result<ClientEnd<DirectoryMarker>, Error>
pub fn root_dir_handle(&self) -> Result<ClientEnd<DirectoryMarker>, Error>
Returns a new connection to blobfs’s root directory as a raw zircon channel.
Sourcepub fn root_dir_proxy(&self) -> Result<DirectoryProxy, Error>
pub fn root_dir_proxy(&self) -> Result<DirectoryProxy, Error>
Returns a new connection to blobfs’s root directory as a DirectoryProxy.
Sourcepub fn root_dir(&self) -> Result<Dir, Error>
pub fn root_dir(&self) -> Result<Dir, Error>
Returns a new connection to blobfs’s root directory as a openat::Dir.
Sourcepub async fn into_builder(self) -> Result<BlobfsRamdiskBuilder, Error>
pub async fn into_builder(self) -> Result<BlobfsRamdiskBuilder, Error>
Signals blobfs to unmount and waits for it to exit cleanly, returning a new
BlobfsRamdiskBuilder
initialized with the ramdisk.
Sourcepub async fn unmount(self) -> Result<FormattedRamdisk, Error>
pub async fn unmount(self) -> Result<FormattedRamdisk, Error>
Signals blobfs to unmount and waits for it to exit cleanly, returning the backing Ramdisk.
Sourcepub async fn stop(self) -> Result<(), Error>
pub async fn stop(self) -> Result<(), Error>
Signals blobfs to unmount and waits for it to exit cleanly, stopping the inner ramdisk.
Sourcepub fn list_blobs(&self) -> Result<BTreeSet<Hash>, Error>
pub fn list_blobs(&self) -> Result<BTreeSet<Hash>, Error>
Returns a sorted list of all blobs present in this blobfs instance.
Sourcepub async fn add_blob_from(
&self,
merkle: Hash,
source: impl Read,
) -> Result<(), Error>
pub async fn add_blob_from( &self, merkle: Hash, source: impl Read, ) -> Result<(), Error>
Writes the blob to blobfs.
Sourcepub async fn write_blob(&self, merkle: Hash, bytes: &[u8]) -> Result<(), Error>
pub async fn write_blob(&self, merkle: Hash, bytes: &[u8]) -> Result<(), Error>
Writes a blob with hash merkle
and blob contents bytes
to blobfs. bytes
should be
uncompressed. Ignores AlreadyExists errors.
Sourcepub fn svc_dir(&self) -> Result<Option<DirectoryProxy>, Error>
pub fn svc_dir(&self) -> Result<Option<DirectoryProxy>, Error>
Returns a connection to blobfs’s exposed “svc” directory, or None if the
implementation does not expose any services.
More convenient than using blob_creator_proxy
directly when forwarding the service
to RealmBuilder components.
Sourcepub fn blob_creator_proxy(&self) -> Result<Option<BlobCreatorProxy>, Error>
pub fn blob_creator_proxy(&self) -> Result<Option<BlobCreatorProxy>, Error>
Returns a new connection to blobfs’s fuchsia.fxfs/BlobCreator API, or None if the implementation does not support it.
Sourcepub fn blob_reader_proxy(&self) -> Result<Option<BlobReaderProxy>, Error>
pub fn blob_reader_proxy(&self) -> Result<Option<BlobReaderProxy>, Error>
Returns a new connection to blobfs’s fuchsia.fxfs/BlobReader API, or None if the implementation does not support it.