| 214 | } |
| 215 | |
| 216 | pub fn skip<'a, V, R>(visitor: &mut V, reader: &mut R) -> Result<(), V::Error> |
| 217 | where |
| 218 | V: Visitor<Row = T>, |
| 219 | R: BufReader<'a>, |
| 220 | { |
| 221 | let flags = Flags::from_bits_retain(reader.get_u8()?); |
| 222 | |
| 223 | // If the flags indicate that the payload contains `Inputs`, |
| 224 | // try to decode them. |
| 225 | if flags.contains(Flags::HAVE_INPUTS) { |
| 226 | Inputs::decode(reader)?; |
| 227 | } |
| 228 | |
| 229 | // If the flags indicate that the payload contains `Outputs`, |
| 230 | // try to decode them. |
| 231 | if flags.contains(Flags::HAVE_OUTPUTS) { |
| 232 | Outputs::decode(reader)?; |
| 233 | } |
| 234 | |
| 235 | // If the flags indicate that the payload contains `Mutations`, |
| 236 | // try to consume them (i.e. decode but don't allocate). |
| 237 | if flags.contains(Flags::HAVE_MUTATIONS) { |
| 238 | Mutations::skip(visitor, reader)?; |
| 239 | } |
| 240 | |
| 241 | Ok(()) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /// The inputs of a transaction, i.e. the name and arguments of a reducer call. |