pub fn map_from_text_file<Map, Key, Value, ReadCallback, Reader>(
    file: &mut Reader,
    integrity: &mut Option<Integrity>,
    read_callback: Option<ReadCallback>,
) -> Result<Map, LoadFileError>
    where
        Key: std::cmp::Ord + DeserializeOwned,
        Value: DeserializeOwned,
        Map: MapTrait<Key, Value> + Default,
        ReadCallback: FnMut(&mut String) -> Result<(), Box<dyn std::error::Error>>,
        Reader: std::io::Read,
{
    let mut map = Map::default();
    load_from_text_file(file, integrity, read_callback, |map_operation| {
        match map_operation {
            MapOperation::Insert(key, value) => map.insert(key, value),
            MapOperation::Remove(key) => map.remove(&key),
        };

        Ok(())
    })?;

    Ok(map)
}
/// Load from text format file all operations and make actual map.
Load from text format file all operations and make actual map.
Load from text format file all operations and make actual map .
pub fn map_from_text_file<Map, Key, Value, ReadCallback, Reader>(
    file: &mut Reader,
    integrity: &mut Option<Integrity>,
    read_callback: Option<ReadCallback>,
) -> Result<Map, LoadFileError>
    where
        Key: std::cmp::Ord + DeserializeOwned,
        Value: DeserializeOwned,
        Map: MapTrait<Key, Value> + Default,
        ReadCallback: FnMut(&mut String) -> Result<(), Box<dyn std::error::Error>>,
        Reader: std::io::Read,
{
    let mut map = Map::default();
    load_from_text_file(file, integrity, read_callback, |map_operation| {
        match map_operation {
            MapOperation::Insert(key, value) => map.insert(key, value),
            MapOperation::Remove(key) => map.remove(&key),
        };
        Ok(())
    })?;
    Ok(map)
}
pub fn map_from_text_file < Map , Key , Value , ReadCallback , Reader > ( file : & mut Reader , integrity : & mut Option < Integrity > , read_callback : Option < ReadCallback > , ) -> Result < Map , LoadFileError > where Key : std :: cmp :: Ord + DeserializeOwned , Value : DeserializeOwned , Map : MapTrait < Key , Value > + Default , ReadCallback : FnMut ( & mut String ) -> Result < ( ) , Box < dyn std :: error :: Error > > , Reader : std :: io :: Read , { let mut map = Map :: default ( ) ; load_from_text_file ( file , integrity , read_callback , | map_operation | { match map_operation { MapOperation :: Insert ( key , value ) => map . insert ( key , value ) , MapOperation :: Remove ( key ) => map . remove ( & key ) , } ; Ok ( ( ) ) } ) ? ; Ok ( map ) }
Load from text format file all operations and make actual map.
Load from text format file all operations and make actual map .
file
&mut Reader
integrity
&mut Option<Integrity>
read_callback
Option<ReadCallback>
file
&mut Reader
integrity
&mut Option<Integrity>
read_callback
Option<ReadCallback>