var searchIndex = {}; searchIndex["diffusion"] = {"doc":"# Diffusion\nDiffusion is a static library that provides several transport with a unified interface for\nmessages based sub-pub style communication.","items":[[3,"FileReader","diffusion","is a reader that reads from a file.\nThis file needs to be generated by a corresponding writer.\nCurrently it does not support a growing file, e.g. files cannot be modified during read.",null,null],[3,"FileWriter","","is a writer for file.\nIt can only start to write a new file but not append to an existing file.",null,null],[3,"MulticastReader","","is reader for multicast.\nReads the UDP packet multicasted from writer. Each packet is a message.",null,null],[3,"MulticastWriter","","is writer for multicast.\n`MulticastWriter` uses the natual UDP packet as message boundary.",null,null],[4,"Error","","represents errors that can be encountered during the usage of of reader and writer.",null,null],[13,"CorruptSegmentHeader","","indicates corruption when initializing the reader. This can only happens in a file.",0,null],[13,"CorruptMsgHeader","","indicates corruption when reading a message. This can only happens in a file.",0,null],[13,"InsufficientLength","","indicates possibily a curruption. `usize` means the number of bytes it need in addition to\nwhat is already in there. This can only happens in a file.",0,null],[13,"IoError","","indicates there is an IO error happening during reading or writing. This can happen in all\ntransport types.",0,null],[11,"fmt","","",1,null],[11,"new","","returns a new instance of `FileReader`.\nIt returns error if the file is found corrupted.",1,{"inputs":[{"name":"t"}],"output":{"name":"result"}}],[11,"read","","",1,null],[11,"next","","",1,null],[11,"fmt","","",2,null],[11,"new","","returns a new file writer instance.\nIt returns error if there is IO error during the process.",2,{"inputs":[{"name":"t"}],"output":{"name":"result"}}],[11,"write","","",2,null],[11,"fmt","","",3,null],[11,"new","","returns a new instance of `MulticastWriter`.\n`addr` is the address the sending socket binds to, and also the address that it sends to.",3,{"inputs":[{"name":"socketaddrv4"}],"output":{"name":"result"}}],[11,"write","","",3,null],[11,"fmt","","",4,null],[11,"new","","returns a new instance of `MulticastReader`.\nBinds to `addr`.",4,{"inputs":[{"name":"socketaddrv4"}],"output":{"name":"result"}}],[11,"read","","",4,null],[6,"Result","","is an alias for crate level result derived from the crate level `Error`.",null,null],[8,"Reader","","is the general trait for all readers.",null,null],[10,"read","","returns a message if there is one. And returns any error if it cannot return the message.\nIt returns a `Ok(None)` if file reader has reached to the end of the file, or there is no\nnew message currently, in which case user should retry.",5,null],[8,"Writer","","is the general trait for all writers.",null,null],[10,"write","","returns `Ok(())` if write is successful.",6,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"fmt","","",0,null],[11,"description","","",0,null],[11,"cause","","",0,null],[11,"from","","",0,{"inputs":[{"name":"error"}],"output":{"name":"error"}}]],"paths":[[4,"Error"],[3,"FileReader"],[3,"FileWriter"],[3,"MulticastWriter"],[3,"MulticastReader"],[8,"Reader"],[8,"Writer"]]}; initSearch(searchIndex);