pub fn gen_frame<'a, W: Write + BackToTheBuffer + 'a>(
    frame: &'a AMQPFrame,
) -> impl SerializeFn<W> + 'a {
    move |x| match frame {
        AMQPFrame::ProtocolHeader => gen_protocol_header()(x),
        AMQPFrame::Heartbeat(_) => gen_heartbeat_frame()(x),
        AMQPFrame::Method(channel_id, method) => gen_method_frame(*channel_id, method)(x),
        AMQPFrame::Header(channel_id, class_id, header) => {
            gen_content_header_frame(*channel_id, *class_id, header.body_size, &header.properties)(
                x,
            )
        }
        AMQPFrame::Body(channel_id, data) => gen_content_body_frame(*channel_id, data)(x),
    }
}
/// Serialize a frame in the given buffer
Serialize a frame in the given buffer
Serialize a frame in the given buffer
pub fn gen_frame<'a, W: Write + BackToTheBuffer + 'a>(
    frame: &'a AMQPFrame,
) -> impl SerializeFn<W> + 'a {
    move |x| match frame {
        AMQPFrame::ProtocolHeader => gen_protocol_header()(x),
        AMQPFrame::Heartbeat(_) => gen_heartbeat_frame()(x),
        AMQPFrame::Method(channel_id, method) => gen_method_frame(*channel_id, method)(x),
        AMQPFrame::Header(channel_id, class_id, header) => {
            gen_content_header_frame(*channel_id, *class_id, header.body_size, &header.properties)(
                x,
            )
        }
        AMQPFrame::Body(channel_id, data) => gen_content_body_frame(*channel_id, data)(x),
    }
}
pub fn gen_frame < ' a , W : Write + BackToTheBuffer + ' a > ( frame : & ' a AMQPFrame , ) -> impl SerializeFn < W > + ' a { move | x | match frame { AMQPFrame :: ProtocolHeader => gen_protocol_header ( ) ( x ) , AMQPFrame :: Heartbeat ( _ ) => gen_heartbeat_frame ( ) ( x ) , AMQPFrame :: Method ( channel_id , method ) => gen_method_frame ( * channel_id , method ) ( x ) , AMQPFrame :: Header ( channel_id , class_id , header ) => { gen_content_header_frame ( * channel_id , * class_id , header . body_size , & header . properties ) ( x , ) } AMQPFrame :: Body ( channel_id , data ) => gen_content_body_frame ( * channel_id , data ) ( x ) , } }
Serialize a frame in the given buffer
Serialize a frame in the given buffer
frame
&'a AMQPFrame