ion-rs 1.0.0

Implementation of Amazon Ion
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ice_code::ice as cold_path;
use std::borrow::Cow;
use thiserror::Error;

/// Indicates that a write operation failed to serialize the given data.
#[derive(Clone, Debug, Error, PartialEq)]
#[error("{description}")]
pub struct EncodingError {
    description: Cow<'static, str>,
}

impl EncodingError {
    pub(crate) fn new(description: impl Into<Cow<'static, str>>) -> Self {
        EncodingError {
            description: cold_path! { encoding_error => description.into()},
        }
    }
}