crate::ix!();
pub struct SerActionSerialize { }
impl SerActionSerialize {
#[inline]
pub fn for_read(&self) -> bool {
trace!("SerActionSerialize::for_read -> false");
false
}
}
pub struct SerActionUnserialize { }
impl SerActionUnserialize {
#[inline]
pub fn for_read(&self) -> bool {
trace!("SerActionUnserialize::for_read -> true");
true
}
}
#[cfg(test)]
mod action_tests {
use super::*;
use std::mem;
#[traced_test]
fn serialize_marker_properties() {
let marker = SerActionSerialize {};
assert!(!marker.for_read(), "Serialize marker incorrectly reports read phase");
assert_eq!(mem::size_of::<SerActionSerialize>(), 0, "Serialize marker should be ZST");
}
#[traced_test]
fn unserialize_marker_properties() {
let marker = SerActionUnserialize {};
assert!(marker.for_read(), "BtcUnserialize marker incorrectly reports write phase");
assert_eq!(mem::size_of::<SerActionUnserialize>(), 0, "BtcUnserialize marker should be ZST");
}
}