pub fn set_asset_handler(
key: &AssetKey,
content: &Blob,
headers: &[HeaderField],
) -> Result<(), String>
Expand description
Handles the setting of an asset within the store. This function performs various checks and operations to ensure the asset can be set and updated correctly.
§Parameters
key
: A reference to theAssetKey
representing the unique identifier for the asset within the collection.content
: A reference to theString
containing the asset content to be stored.headers
: A slice ofHeaderField
representing any additional headers associated with the asset.
§Returns
Result<(), String>
: ReturnsOk(())
if the asset is successfully set. Returns anErr(String)
with an error message if the operation fails.
§Errors
- Returns an error if the asset cannot be retrieved from the storage.
- Returns an error if the permission check fails when the asset is identified as existing and private.
§Important Note
The content is set for the identity encoding, meaning there is no compression applied.