7 struct pxprpc_abstract_io
{
8 //onCompleted is called when expected length data is read or error occured.
9 void (*read
)(struct pxprpc_abstract_io
*self
,uint32_t length
,uint8_t *buf
,void (*onCompleted
)(void *args
),void *p
);
10 //onCompleted is called when buf is processed and can be free or error occured.
11 //Write request should be processed in order.
12 void (*write
)(struct pxprpc_abstract_io
*self
,uint32_t length
,const uint8_t *buf
,void (*onCompleted
)(void *args
),void *p
);
13 //get last error. For example, to get error caused by read, call "io->get_error(io,io->read)". return NULL if no error
14 const char *(*get_error
)(struct pxprpc_abstract_io
*self
,void *fn
);
20 //variable length array