use internals::error::EncodingError;
use internals::encoder::{EncodableInHeader, EncodingWriter};
#[derive(Debug, Hash, Clone, Eq, PartialEq)]
pub struct FWS;
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub enum CFWS {
SingleFws( FWS )
}
impl EncodableInHeader for CFWS {
fn encode(&self, handle: &mut EncodingWriter) -> Result<(), EncodingError> {
match *self {
CFWS::SingleFws(ref _fws ) => {
handle.write_fws();
}
}
Ok( () )
}
fn boxed_clone(&self) -> Box<EncodableInHeader> {
Box::new(self.clone())
}
}
#[cfg(test)]
mod test {
use super::*;
ec_test!{ simple_encode,
{
CFWS::SingleFws( FWS )
} => utf8 => [
MarkFWS,
Text " "
]
}
}