Derive serde traits for TrapCode
This commit is contained in:
@@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
use core::fmt::{self, Display, Formatter};
|
use core::fmt::{self, Display, Formatter};
|
||||||
use core::str::FromStr;
|
use core::str::FromStr;
|
||||||
|
#[cfg(feature = "enable-serde")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// A trap code describing the reason for a trap.
|
/// A trap code describing the reason for a trap.
|
||||||
///
|
///
|
||||||
/// All trap instructions have an explicit trap code.
|
/// All trap instructions have an explicit trap code.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
|
||||||
|
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
||||||
pub enum TrapCode {
|
pub enum TrapCode {
|
||||||
/// The current stack space was exhausted.
|
/// The current stack space was exhausted.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user