(path: P) -> Result (path: P) -> Self where P: AsRef(&self, serializer: &mut S) -> Result<(), S::Error>
+ where S: Serializer {
+ match *self {
+ CipherSer::Aes128Ctr => serializer.serialize_str("aes-128-ctr"),
+ }
+ }
+}
+
+impl Deserialize for CipherSer {
+ fn deserialize(&self, serializer: &mut S) -> Result<(), S::Error>
+ where S: Serializer {
+ match *self {
+ CipherSerParams::Aes128Ctr(ref params) => params.serialize(serializer),
+ }
+ }
+}
+
+impl Deserialize for CipherSerParams {
+ fn deserialize(&self, serializer: &mut S) -> Result<(), S::Error>
+ where S: Serializer
+ {
+ serializer.serialize_struct("Crypto", CryptoMapVisitor {
+ value: self,
+ state: 0,
+ })
+ }
+}
+
+struct CryptoMapVisitor<'a> {
+ value: &'a Crypto,
+ state: u8,
+}
+
+impl<'a> ser::MapVisitor for CryptoMapVisitor<'a> {
+ fn visit(&mut self, serializer: &mut S) -> Result