fn decode_blend_mode_only(param: &mut Chars) -> Result<BlendMode, DecoderError> {
        let (a, b)  = (param.next(), param.next());
        let a       = a.ok_or(DecoderError::MissingCharacter)?;
        let b       = b.ok_or(DecoderError::MissingCharacter)?;

        match (a, b) {
            ('S', 'V') => Ok(BlendMode::SourceOver),
            ('S', 'I') => Ok(BlendMode::SourceIn),
            ('S', 'O') => Ok(BlendMode::SourceOut),
            ('S', 'A') => Ok(BlendMode::SourceAtop),

            ('D', 'V') => Ok(BlendMode::DestinationOver),
            ('D', 'I') => Ok(BlendMode::DestinationIn),
            ('D', 'O') => Ok(BlendMode::DestinationOut),
            ('D', 'A') => Ok(BlendMode::DestinationAtop),

            ('E', 'M') => Ok(BlendMode::Multiply),
            ('E', 'S') => Ok(BlendMode::Screen),
            ('E', 'D') => Ok(BlendMode::Darken),
            ('E', 'L') => Ok(BlendMode::Lighten),

            _          => Err(DecoderError::InvalidCharacter(a))
        }
    }
///
/// Consumes 2 characters to decode a blend mode
///
Consumes 2 characters to decode a blend mode
Consumes 2 characters to decode a blend mode
fn decode_blend_mode_only(param: &mut Chars) -> Result<BlendMode, DecoderError> {
        let (a, b)  = (param.next(), param.next());
        let a       = a.ok_or(DecoderError::MissingCharacter)?;
        let b       = b.ok_or(DecoderError::MissingCharacter)?;
        match (a, b) {
            ('S', 'V') => Ok(BlendMode::SourceOver),
            ('S', 'I') => Ok(BlendMode::SourceIn),
            ('S', 'O') => Ok(BlendMode::SourceOut),
            ('S', 'A') => Ok(BlendMode::SourceAtop),
            ('D', 'V') => Ok(BlendMode::DestinationOver),
            ('D', 'I') => Ok(BlendMode::DestinationIn),
            ('D', 'O') => Ok(BlendMode::DestinationOut),
            ('D', 'A') => Ok(BlendMode::DestinationAtop),
            ('E', 'M') => Ok(BlendMode::Multiply),
            ('E', 'S') => Ok(BlendMode::Screen),
            ('E', 'D') => Ok(BlendMode::Darken),
            ('E', 'L') => Ok(BlendMode::Lighten),
            _          => Err(DecoderError::InvalidCharacter(a))
        }
    }
fn decode_blend_mode_only ( param : & mut Chars ) -> Result < BlendMode , DecoderError > { let ( a , b ) = ( param . next ( ) , param . next ( ) ) ; let a = a . ok_or ( DecoderError :: MissingCharacter ) ? ; let b = b . ok_or ( DecoderError :: MissingCharacter ) ? ; match ( a , b ) { ( 'S' , 'V' ) => Ok ( BlendMode :: SourceOver ) , ( 'S' , 'I' ) => Ok ( BlendMode :: SourceIn ) , ( 'S' , 'O' ) => Ok ( BlendMode :: SourceOut ) , ( 'S' , 'A' ) => Ok ( BlendMode :: SourceAtop ) , ( 'D' , 'V' ) => Ok ( BlendMode :: DestinationOver ) , ( 'D' , 'I' ) => Ok ( BlendMode :: DestinationIn ) , ( 'D' , 'O' ) => Ok ( BlendMode :: DestinationOut ) , ( 'D' , 'A' ) => Ok ( BlendMode :: DestinationAtop ) , ( 'E' , 'M' ) => Ok ( BlendMode :: Multiply ) , ( 'E' , 'S' ) => Ok ( BlendMode :: Screen ) , ( 'E' , 'D' ) => Ok ( BlendMode :: Darken ) , ( 'E' , 'L' ) => Ok ( BlendMode :: Lighten ) , _ => Err ( DecoderError :: InvalidCharacter ( a ) ) } }
Consumes 2 characters to decode a blend mode
Consumes 2 characters to decode a blend mode
param
&mut Chars