ic-asset 0.28.0

Library for storing files in an asset canister.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::asset::content_encoder::ContentEncoder;
use crate::error::create_chunk::CreateChunkError;
use thiserror::Error;

/// Errors related to creating/uploading an asset content encoding to the asset canister
#[derive(Error, Debug)]
pub enum CreateEncodingError {
    /// Failed when creating a chunk.
    #[error("Failed to create chunk")]
    CreateChunkFailed(#[source] CreateChunkError),

    /// Failed when encoding asset content.
    #[error("Failed to encode content of '{0}' with {1} encoding")]
    EncodeContentFailed(String, ContentEncoder, #[source] std::io::Error),
}