You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Encoding functions should have the following form:pubfnencode_usize<Con:BulkConsumer<Item = u8>>(value:&usize,consumer:&mutCon) -> Result<(),Con::Error>{unimplemented!()}// To implement those, you'll need some helper functions for working with ufotofu. For example, you'll probably want the following:pubfnconsume_all<Item,Con:BulkConsumer<Item=Item>>(values:&Item[],consumer:&mutCon) -> Result<(),Con::Error>{unimplemented!()}// And, of course, there'll be nb_local versons of all of these as well (with their own helper functions, too):pubasyncfnnb_local_encode_usize<Con: nb_local::BulkConsumer<Item = u8>>(value:&usize,consumer:&mutCon) -> Result<(),Con::Error>{unimplemented!()}// Note that these designs assume that encoding is infallible, which is not necessarily true in the greater rust ecosystem (for example, a poisoned mutex cannot be encoded with serde). I prefer the design of "every instance of a type is valid" and "every valid value can be encoded", hence no need for encoding errors.// For decoding, things can obviously go wrong. Either because the data source errors, or because the data source produces garbage.pubenumDecodeError<ProducerError>{ProducerErr(ProducerError),GarbageInput,}// Decoding functions should have the following form:pubfndecode_usize<Pro:BulkProducer<Item = u8>>(producer:&mutPro) -> Result<u8,DecodeError<Pro::Error>>{unimplemented!()}// And async:pubasyncfnnb_local_decode_usize<Pro: nb_local::BulkProducer<Item = u8>>(producer:&mutPro) -> Result<u8,DecodeError<Pro::Error>>{unimplemented!()}
General encoding/decoding utilities should live in some (the?) ufotofu create.
The text was updated successfully, but these errors were encountered:
General encoding/decoding utilities should live in some (the?) ufotofu create.
The text was updated successfully, but these errors were encountered: