Skip to main content

decode_as_any

Function decode_as_any 

Source
fn decode_as_any<R>(
    stage: &MessageStage,
    codec: &mut ChannelCodec,
    src: &mut BytesMut,
) -> Result<Option<(AnyChanCell, Bytes)>, Error>
where R: Into<AnyChanMsg> + ChanMsg,
Expand description

Helper function to decode a cell within a restricted msg set into an AnyChanCell.

The given stage is used to know which error to return.

Returns both the cell and the bytes that the cell were decoded from.