comparison rust/hg-core/src/dirstate.rs @ 42886:7083ac37314f

rust-dirstate: provide CopyMapIter and StateMapIter types They will be used in the declaration of Python iterator types.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 08 Sep 2019 12:00:26 +0900
parents 2e1f74cc3350
children 7a01778bc7b7
comparison
equal deleted inserted replaced
42885:a03a29462c0a 42886:7083ac37314f
4 // 4 //
5 // This software may be used and distributed according to the terms of the 5 // This software may be used and distributed according to the terms of the
6 // GNU General Public License version 2 or any later version. 6 // GNU General Public License version 2 or any later version.
7 7
8 use crate::DirstateParseError; 8 use crate::DirstateParseError;
9 use std::collections::hash_map;
9 use std::collections::HashMap; 10 use std::collections::HashMap;
10 use std::convert::TryFrom; 11 use std::convert::TryFrom;
11 12
12 pub mod dirs_multiset; 13 pub mod dirs_multiset;
13 pub mod dirstate_map; 14 pub mod dirstate_map;
29 pub mtime: i32, 30 pub mtime: i32,
30 pub size: i32, 31 pub size: i32,
31 } 32 }
32 33
33 pub type StateMap = HashMap<Vec<u8>, DirstateEntry>; 34 pub type StateMap = HashMap<Vec<u8>, DirstateEntry>;
35 pub type StateMapIter<'a> = hash_map::Iter<'a, Vec<u8>, DirstateEntry>;
34 pub type CopyMap = HashMap<Vec<u8>, Vec<u8>>; 36 pub type CopyMap = HashMap<Vec<u8>, Vec<u8>>;
37 pub type CopyMapIter<'a> = hash_map::Iter<'a, Vec<u8>, Vec<u8>>;
35 38
36 #[derive(Copy, Clone, Debug, Eq, PartialEq)] 39 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
37 pub enum EntryState { 40 pub enum EntryState {
38 Normal, 41 Normal,
39 Added, 42 Added,