AsyncStorageScopeBase#
- class ansys.bdm.base.base_async_storage_scope.AsyncStorageScopeBase#
Bases:
ansys.bdm.api.iasync_storage_scope.IAsyncStorageScopeA partial implementation of
IAsyncStorageScopethat provides implementations of some methods based on other more fundamental methods.AsyncStorageScopeBasecan be used as a base class for implementations ofIAsyncStorageScope.
Overview#
Import detail#
from ansys.bdm.base.base_async_storage_scope import AsyncStorageScopeBase
Method detail#
- async AsyncStorageScopeBase.get_bytes(entity: ansys.bdm.api.entity_handle.EntityHandle) bytes#
Return the content of the referenced blob.
- Parameters:
- entity: EntityHandle
The handle to the data to realize
- Returns:
- bytes
the contents of the EntityHandle.
- Raises:
- CannotGenerateStreamForDirectoryError
If the entity requested is a collection
- async AsyncStorageScopeBase.get_text(entity: ansys.bdm.api.entity_handle.EntityHandle, encoding: str | None = None) str#
Return the content of the referenced blob.
- Parameters:
- entity: EntityHandle
The handle to the data to realize
- encoding: Optional[str]
The name of an encoding. When this argument is not None the bytes of
entitywill be read using that encoding.
- Returns:
- str
the contents of the blob referenced by
entityin text form with the encoding determined in order of preference: - the encoding argument if not None - the encoding field of the entity argument if set - the BOM of the referenced entity if it contains one; or - UTF-8
- Raises:
- CannotGenerateStreamForDirectoryError
If the entity requested is a collection