fidl_next_codec/encode/
error.rs1use thiserror::Error;
6
7use crate::ValidationError;
8
9#[derive(Clone, Error, Debug, PartialEq)]
11pub enum EncodeError {
12 #[error("required handle was invalid")]
14 InvalidRequiredHandle,
15
16 #[error("cannot encode unknown union ordinal of {0}")]
18 UnknownUnionOrdinal(usize),
19
20 #[error("cannot encode a {0}-byte value in a 4-byte inline envelope")]
22 ExpectedInline(usize),
23
24 #[error("cannot encode driver handles with this encoder")]
26 DriverHandlesUnsupported,
27
28 #[error("expected a driver handle but was given a zircon handle")]
30 ExpectedDriverHandle,
31
32 #[error("expected a zircon handle but was given a driver handle")]
34 ExpectedZirconHandle,
35
36 #[error("invalid bits were set in a strict bits value")]
38 InvalidStrictBits,
39
40 #[error("validation failed")]
42 Validation(#[from] ValidationError),
43}