pub(crate) fn maybe_term(&self, i: u64) -> Option<u64> {
        if i < self.offset {
            if let Some(snapshot) = self.snapshot.as_ref() {
                if snapshot.get_metadata().get_index() == i {
                    return Some(snapshot.get_metadata().get_term());
                }
            }
            return None;
        }
        match self.maybe_last_index() {
            Some(index) => {
                if i > index {
                    None
                } else {
                    Some(
                        self.entries
                            .get((i - self.offset) as usize)
                            .unwrap()
                            .get_Term(),
                    )
                }
            }
            None => None,
        }
    }
// maybe_term returns the term of the entry at index i, if there
// is any.
maybe_term returns the term of the entry at index i, if there
is any.
maybe_term returns the term of the entry at index i if there is any .
pub(crate) fn maybe_term(&self, i: u64) -> Option<u64> {
        if i < self.offset {
            if let Some(snapshot) = self.snapshot.as_ref() {
                if snapshot.get_metadata().get_index() == i {
                    return Some(snapshot.get_metadata().get_term());
                }
            }
            return None;
        }
        match self.maybe_last_index() {
            Some(index) => {
                if i > index {
                    None
                } else {
                    Some(
                        self.entries
                            .get((i - self.offset) as usize)
                            .unwrap()
                            .get_Term(),
                    )
                }
            }
            None => None,
        }
    }
pub ( crate ) fn maybe_term ( & self , i : u64 ) -> Option < u64 > { if i < self . offset { if let Some ( snapshot ) = self . snapshot . as_ref ( ) { if snapshot . get_metadata ( ) . get_index ( ) == i { return Some ( snapshot . get_metadata ( ) . get_term ( ) ) ; } } return None ; } match self . maybe_last_index ( ) { Some ( index ) => { if i > index { None } else { Some ( self . entries . get ( ( i - self . offset ) as usize ) . unwrap ( ) . get_Term ( ) , ) } } None => None , } }
maybe_term returns the term of the entry at index i, if there
is any.
maybe_term returns the term of the entry at index i if there is any .
&self
i
u64