fn visit_enum<A: EnumAccess<'de>>(self, access: A) -> Result<Self::Value, A::Error> {
                let (variant, access) = access.variant()?;
                use fog_crypto::serde::*;
                use serde_bytes::Bytes;
                let bytes: &Bytes = access.newtype_variant()?;
                match variant {
                    FOG_TYPE_ENUM_TIME_INDEX => {
                        let val = Timestamp::try_from(bytes.as_ref()).map_err(A::Error::custom)?;
                        Ok(Value::Timestamp(val))
                    }
                    FOG_TYPE_ENUM_HASH_INDEX => {
                        let val = Hash::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::Hash(val))
                    }
                    FOG_TYPE_ENUM_IDENTITY_INDEX => {
                        let val = Identity::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::Identity(val))
                    }
                    FOG_TYPE_ENUM_LOCK_ID_INDEX => {
                        let val = LockId::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::LockId(val))
                    }
                    FOG_TYPE_ENUM_STREAM_ID_INDEX => {
                        let val = StreamId::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::StreamId(val))
                    }
                    FOG_TYPE_ENUM_DATA_LOCKBOX_INDEX => {
                        let val = DataLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::DataLockbox(val))
                    }
                    FOG_TYPE_ENUM_IDENTITY_LOCKBOX_INDEX => {
                        let val = IdentityLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::IdentityLockbox(val))
                    }
                    FOG_TYPE_ENUM_STREAM_LOCKBOX_INDEX => {
                        let val = StreamLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::StreamLockbox(val))
                    }
                    FOG_TYPE_ENUM_LOCK_LOCKBOX_INDEX => {
                        let val = LockLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::LockLockbox(val))
                    }
                    _ => Err(A::Error::custom("unrecognized fogpack extension type")),
                }
            }
/// Should only be called when deserializing our special types.
/// Fogpack's deserializer will always turn the variant into a u64
Should only be called when deserializing our special types.
Fogpack's deserializer will always turn the variant into a u64
Should only be called when deserializing our special types . Fogpack ' s deserializer will always turn the variant into a u64
fn visit_enum<A: EnumAccess<'de>>(self, access: A) -> Result<Self::Value, A::Error> {
                let (variant, access) = access.variant()?;
                use fog_crypto::serde::*;
                use serde_bytes::Bytes;
                let bytes: &Bytes = access.newtype_variant()?;
                match variant {
                    FOG_TYPE_ENUM_TIME_INDEX => {
                        let val = Timestamp::try_from(bytes.as_ref()).map_err(A::Error::custom)?;
                        Ok(Value::Timestamp(val))
                    }
                    FOG_TYPE_ENUM_HASH_INDEX => {
                        let val = Hash::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::Hash(val))
                    }
                    FOG_TYPE_ENUM_IDENTITY_INDEX => {
                        let val = Identity::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::Identity(val))
                    }
                    FOG_TYPE_ENUM_LOCK_ID_INDEX => {
                        let val = LockId::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::LockId(val))
                    }
                    FOG_TYPE_ENUM_STREAM_ID_INDEX => {
                        let val = StreamId::try_from(bytes.as_ref())
                            .map_err(|e| A::Error::custom(e.serde_err()))?;
                        Ok(Value::StreamId(val))
                    }
                    FOG_TYPE_ENUM_DATA_LOCKBOX_INDEX => {
                        let val = DataLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::DataLockbox(val))
                    }
                    FOG_TYPE_ENUM_IDENTITY_LOCKBOX_INDEX => {
                        let val = IdentityLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::IdentityLockbox(val))
                    }
                    FOG_TYPE_ENUM_STREAM_LOCKBOX_INDEX => {
                        let val = StreamLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::StreamLockbox(val))
                    }
                    FOG_TYPE_ENUM_LOCK_LOCKBOX_INDEX => {
                        let val = LockLockboxRef::from_bytes(bytes)
                            .map_err(|e| A::Error::custom(e.serde_err()))?
                            .to_owned();
                        Ok(Value::LockLockbox(val))
                    }
                    _ => Err(A::Error::custom("unrecognized fogpack extension type")),
                }
            }
fn visit_enum < A : EnumAccess < ' de > > ( self , access : A ) -> Result < Self :: Value , A :: Error > { let ( variant , access ) = access . variant ( ) ? ; use fog_crypto :: serde :: * ; use serde_bytes :: Bytes ; let bytes : & Bytes = access . newtype_variant ( ) ? ; match variant { FOG_TYPE_ENUM_TIME_INDEX => { let val = Timestamp :: try_from ( bytes . as_ref ( ) ) . map_err ( A :: Error :: custom ) ? ; Ok ( Value :: Timestamp ( val ) ) } FOG_TYPE_ENUM_HASH_INDEX => { let val = Hash :: try_from ( bytes . as_ref ( ) ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? ; Ok ( Value :: Hash ( val ) ) } FOG_TYPE_ENUM_IDENTITY_INDEX => { let val = Identity :: try_from ( bytes . as_ref ( ) ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? ; Ok ( Value :: Identity ( val ) ) } FOG_TYPE_ENUM_LOCK_ID_INDEX => { let val = LockId :: try_from ( bytes . as_ref ( ) ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? ; Ok ( Value :: LockId ( val ) ) } FOG_TYPE_ENUM_STREAM_ID_INDEX => { let val = StreamId :: try_from ( bytes . as_ref ( ) ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? ; Ok ( Value :: StreamId ( val ) ) } FOG_TYPE_ENUM_DATA_LOCKBOX_INDEX => { let val = DataLockboxRef :: from_bytes ( bytes ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? . to_owned ( ) ; Ok ( Value :: DataLockbox ( val ) ) } FOG_TYPE_ENUM_IDENTITY_LOCKBOX_INDEX => { let val = IdentityLockboxRef :: from_bytes ( bytes ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? . to_owned ( ) ; Ok ( Value :: IdentityLockbox ( val ) ) } FOG_TYPE_ENUM_STREAM_LOCKBOX_INDEX => { let val = StreamLockboxRef :: from_bytes ( bytes ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? . to_owned ( ) ; Ok ( Value :: StreamLockbox ( val ) ) } FOG_TYPE_ENUM_LOCK_LOCKBOX_INDEX => { let val = LockLockboxRef :: from_bytes ( bytes ) . map_err ( | e | A :: Error :: custom ( e . serde_err ( ) ) ) ? . to_owned ( ) ; Ok ( Value :: LockLockbox ( val ) ) } _ => Err ( A :: Error :: custom ( " " ) ) , } }
Should only be called when deserializing our special types.
Should only be called when deserializing our special types .
self
access
A
self
access
A