mutating func nestedContainer()

in Sources/StructuredFieldValues/Decoder/BareInnerListDecoder.swift [80:96]


    mutating func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type) throws -> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey {
        // This is a request to decode a full item. We decode the next entry and increment the index.
        guard !self.isAtEnd else {
            throw StructuredHeaderError.indexOutOfRange
        }

        let codingKey = _StructuredHeaderCodingKey(intValue: self.currentOffset)
        defer {
            self.currentOffset += 1
        }

        try self.decoder.push(codingKey)
        defer {
            self.decoder.pop()
        }
        return try self.decoder.container(keyedBy: type)
    }