pub fn decode(frame: &Frame) -> Result<MethodFrame> {
        if frame.frame_type != FrameType::METHOD {
            return Err(ErrorKind::Protocol("Not a method frame".to_string()).into());
        }
        let reader = &mut frame.payload.inner();
        let class_id = try!(reader.read_u16::<BigEndian>());
        let method_id = try!(reader.read_u16::<BigEndian>());
        let mut arguments = vec![];
        try!(reader.read_to_end(&mut arguments));
        Ok(MethodFrame {
            class_id: class_id,
            method_id: method_id,
            arguments: EncodedMethod::new(arguments),
        })
    }
// We need this method, so we can match on class_id & method_id
We need this method, so we can match on class_id & method_id
We need this method so we can match on class_id & method_id
pub fn decode(frame: &Frame) -> Result<MethodFrame> {
        if frame.frame_type != FrameType::METHOD {
            return Err(ErrorKind::Protocol("Not a method frame".to_string()).into());
        }
        let reader = &mut frame.payload.inner();
        let class_id = try!(reader.read_u16::<BigEndian>());
        let method_id = try!(reader.read_u16::<BigEndian>());
        let mut arguments = vec![];
        try!(reader.read_to_end(&mut arguments));
        Ok(MethodFrame {
            class_id: class_id,
            method_id: method_id,
            arguments: EncodedMethod::new(arguments),
        })
    }
pub fn decode ( frame : & Frame ) -> Result < MethodFrame > { if frame . frame_type != FrameType :: METHOD { return Err ( ErrorKind :: Protocol ( " " . to_string ( ) ) . into ( ) ) ; } let reader = & mut frame . payload . inner ( ) ; let class_id = try ! ( reader read_u16 BigEndian ( ) ) ; let method_id = try ! ( reader read_u16 BigEndian ( ) ) ; let mut arguments = vec ! [ ] ; try ! ( reader read_to_end ( mut arguments ) ) ; Ok ( MethodFrame { class_id : class_id , method_id : method_id , arguments : EncodedMethod :: new ( arguments ) , } ) }
We need this method, so we can match on class_id & method_id
We need this method so we can match on class_id & method_id
frame
&Frame
frame
&Frame