ZeckFormatError

Enum ZeckFormatError 

Source
pub enum ZeckFormatError {
    HeaderTooShort {
        actual_length: usize,
        required_length: usize,
    },
    UnsupportedVersion {
        found_version: u8,
        supported_version: u8,
    },
    ReservedFlagsSet {
        flags: u8,
    },
    CompressionFailed {
        original_size: usize,
        be_size: usize,
        le_size: usize,
    },
    DecompressedTooLarge {
        expected_size: usize,
        actual_size: usize,
    },
    DataSizeTooLarge {
        size: usize,
    },
}
Expand description

Errors that can occur when parsing or processing .zeck files.

Variants§

§

HeaderTooShort

The input data is too short to contain a valid header.

Fields

§actual_length: usize

The actual length of the input data

§required_length: usize

The minimum required length for a header

§

UnsupportedVersion

The file format version in the header is not supported.

Fields

§found_version: u8

The version found in the header

§supported_version: u8

The maximum supported version

§

ReservedFlagsSet

The reserved flags in the header are set (indicating a newer format version).

Fields

§flags: u8

The flags byte from the header

§

CompressionFailed

Compression did not reduce the size of the data.

Fields

§original_size: usize

Original data size

§be_size: usize

Big endian compressed size

§le_size: usize

Little endian compressed size

§

DecompressedTooLarge

Decompressed data size is larger than the original size specified in the header.

Fields

§expected_size: usize

Expected size from header

§actual_size: usize

Actual decompressed size

§

DataSizeTooLarge

The input data size is too large to be represented in the file format header.

Fields

§size: usize

The size that could not be converted

Trait Implementations§

Source§

impl Clone for ZeckFormatError

Source§

fn clone(&self) -> ZeckFormatError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ZeckFormatError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ZeckFormatError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ZeckFormatError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ZeckFormatError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ZeckFormatError> for JsValue

Source§

fn from(value: ZeckFormatError) -> Self

Converts to this type from the input type.
Source§

impl FromWasmAbi for ZeckFormatError
where Self: DeserializeOwned,

Source§

type Abi = <JsType as FromWasmAbi>::Abi

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoWasmAbi for &ZeckFormatError

Source§

type Abi = <JsType as IntoWasmAbi>::Abi

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl IntoWasmAbi for ZeckFormatError

Source§

type Abi = <JsType as IntoWasmAbi>::Abi

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl OptionFromWasmAbi for ZeckFormatError
where Self: DeserializeOwned,

Source§

fn is_none(js: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for ZeckFormatError

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl PartialEq for ZeckFormatError

Source§

fn eq(&self, other: &ZeckFormatError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefFromWasmAbi for ZeckFormatError
where Self: DeserializeOwned,

Source§

type Abi = <JsType as RefFromWasmAbi>::Abi

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = SelfOwner<ZeckFormatError>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl Serialize for ZeckFormatError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Tsify for ZeckFormatError

Source§

const DECL: &'static str = "/**\n * Errors that can occur when parsing or processing .zeck files.\n */\nexport type ZeckFormatError = { HeaderTooShort: { actual_length: number; required_length: number } } | { UnsupportedVersion: { found_version: number; supported_version: number } } | { ReservedFlagsSet: { flags: number } } | { CompressionFailed: { original_size: number; be_size: number; le_size: number } } | { DecompressedTooLarge: { expected_size: number; actual_size: number } } | { DataSizeTooLarge: { size: number } };"

Source§

const SERIALIZATION_CONFIG: SerializationConfig

Source§

type JsType = JsType

Source§

fn into_js(&self) -> Result<Self::JsType, Error>
where Self: Serialize,

Source§

fn from_js<T>(js: T) -> Result<Self, Error>
where T: Into<JsValue>, Self: DeserializeOwned,

Source§

impl VectorFromWasmAbi for ZeckFormatError
where Self: DeserializeOwned,

Source§

type Abi = <JsType as VectorFromWasmAbi>::Abi

Source§

unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>

Source§

impl VectorIntoWasmAbi for ZeckFormatError

Source§

type Abi = <JsType as VectorIntoWasmAbi>::Abi

Source§

fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi

Source§

impl WasmDescribe for ZeckFormatError

Source§

impl WasmDescribeVector for ZeckFormatError

Source§

impl StructuralPartialEq for ZeckFormatError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,