pub fn generate(&mut self) -> i64 {
        self.idx = (self.idx + 1) % 2048;

        // Maintenance `last_time_millis` for every 2048 ids generated.
        if self.idx == 0 {
            let mut now_millis = get_time_millis();

            if now_millis == self.last_time_millis {
                now_millis = biding_time_conditions(self.last_time_millis);
            }

            self.last_time_millis = now_millis;
        }

        // last_time_millis is 64 bits，left shift 23 bit，store 41 bits 
        // machine is 28 bits, left shift 12 bit, store 16 bits
        // idx complementing bits.
        self.last_time_millis << 22
            | ((self.machine_bits << 12) as i64)
            | (self.idx as i64)
    }
/// The basic guarantee time punctuality.
///
/// Basic guarantee time punctuality.
/// sometimes one millis can't use up 2048 ID, the property of the ID isn't real-time.
/// But setting time after every 2048 calls.
/// # Examples
///
/// ```
/// use snowflake::SnowflakeIdGenerator;
///
/// let mut id_generator = SnowflakeIdGenerator::new_from_ip("102.65.2.123".to_string());
/// id_generator.generate();
/// ```
The basic guarantee time punctuality.
Basic guarantee time punctuality.
sometimes one millis can't use up 2048 ID, the property of the ID isn't real-time.
But setting time after every 2048 calls.
The basic guarantee time punctuality . Basic guarantee time punctuality . sometimes one millis can ' t use up 2048 ID the property of the ID isn ' t real - time . But setting time after every 2048 calls .
pub fn generate(&mut self) -> i64 {
        self.idx = (self.idx + 1) % 2048;
        // Maintenance `last_time_millis` for every 2048 ids generated.
        if self.idx == 0 {
            let mut now_millis = get_time_millis();
            if now_millis == self.last_time_millis {
                now_millis = biding_time_conditions(self.last_time_millis);
            }
            self.last_time_millis = now_millis;
        }
        // last_time_millis is 64 bits，left shift 23 bit，store 41 bits 
        // machine is 28 bits, left shift 12 bit, store 16 bits
        // idx complementing bits.
        self.last_time_millis << 22
            | ((self.machine_bits << 12) as i64)
            | (self.idx as i64)
    }
pub fn generate ( & mut self ) -> i64 { self . idx = ( self . idx + 1 ) % 2048 ; // Maintenance `last_time_millis` for every 2048 ids generated. if self . idx == 0 { let mut now_millis = get_time_millis ( ) ; if now_millis == self . last_time_millis { now_millis = biding_time_conditions ( self . last_time_millis ) ; } self . last_time_millis = now_millis ; } // last_time_millis is 64 bits，left shift 23 bit，store 41 bits  // machine is 28 bits, left shift 12 bit, store 16 bits // idx complementing bits. self . last_time_millis << 22 | ( ( self . machine_bits << 12 ) as i64 ) | ( self . idx as i64 ) }
The basic guarantee time punctuality.
The basic guarantee time punctuality .
&mut self
examples
```
use snowflake::SnowflakeIdGenerator.

let mut id_generator = SnowflakeIdGenerator::new_from_ip("102.65.2.123".to_string());
id_generator.generate();
```
` ` ` use snowflake :: SnowflakeIdGenerator . let mut id_generator = SnowflakeIdGenerator :: new_from_ip ( " 102 . 65 . 2 . 123 " . to_string () ) ; id_generator . generate () ; ` ` `