Revision control
Copy as Markdown
Other Tools
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterData: FfiConverterRustBuffer {
typealias SwiftType = Data
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data {
let len: Int32 = try readInt(&buf)
return Data(try readBytes(&buf, count: Int(len)))
}
public static func write(_ value: Data, into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
writeBytes(&buf, value)
}
}