fn decode_version<'buffer>(&mut self, buffer: &mut &'buffer [u8]) -> DecodeResult<()> {
        use self::GenericDecodeResult::*;

        if buffer.len() < 10 {
            return Incomplete;
        }

        if &buffer[8..10] != b"\r\n" {
            return Error(DecodeError::Version(VersionDecodeError::Invalid));
        }

        match Version::try_from(&buffer[0..8]) {
            Ok(version) if version == Version::Rtsp2_0 => {
                self.builder.version(version);
                self.state = DecodeState::Header;
                *buffer = &buffer[10..];
                Complete(())
            }
            Ok(_) => Error(DecodeError::UnsupportedVersion),
            Err(error) => Error(error.into()),
        }
    }
/// Decodes a version from the buffer.
Decodes a version from the buffer.
Decodes a version from the buffer .
fn decode_version<'buffer>(&mut self, buffer: &mut &'buffer [u8]) -> DecodeResult<()> {
        use self::GenericDecodeResult::*;
        if buffer.len() < 10 {
            return Incomplete;
        }
        if &buffer[8..10] != b"\r\n" {
            return Error(DecodeError::Version(VersionDecodeError::Invalid));
        }
        match Version::try_from(&buffer[0..8]) {
            Ok(version) if version == Version::Rtsp2_0 => {
                self.builder.version(version);
                self.state = DecodeState::Header;
                *buffer = &buffer[10..];
                Complete(())
            }
            Ok(_) => Error(DecodeError::UnsupportedVersion),
            Err(error) => Error(error.into()),
        }
    }
fn decode_version < ' buffer > ( & mut self , buffer : & mut & ' buffer [ u8 ] ) -> DecodeResult < ( ) > { use self :: GenericDecodeResult :: * ; if buffer . len ( ) < 10 { return Incomplete ; } if & buffer [ 8 .. 10 ] != b" \r \n " { return Error ( DecodeError :: Version ( VersionDecodeError :: Invalid ) ) ; } match Version :: try_from ( & buffer [ 0 .. 8 ] ) { Ok ( version ) if version == Version :: Rtsp2_0 => { self . builder . version ( version ) ; self . state = DecodeState :: Header ; * buffer = & buffer [ 10 .. ] ; Complete ( ( ) ) } Ok ( _ ) => Error ( DecodeError :: UnsupportedVersion ) , Err ( error ) => Error ( error . into ( ) ) , } }
Decodes a version from the buffer.
Decodes a version from the buffer .
&mut self
buffer
&mut &'buffer [u8]
&mut self
buffer
&mut &'buffer [u8]