I am working on a mixed project with swift and C.
I use modulemap,so I can use C in swift.
The C code is like
int write_message_data(model_struct *model, unsigned char *message_data, int message_data_size)
which convert to swift is
public func write_message_data(_ model: UnsafeMutablePointer<model_struct>!, _ message_data: UnsafeMutablePointer<UInt8>!, _ message_data_size: Int32) -> Int32
Then I need to use a Data produced by the protobuf,set it as message_data.
But I can not convert this Data to UnsafeMutablePointer!
I just want Data's pointer and fits the type.