pub(crate) fn find_segment(&self, offset: Offset) -> Option<SegmentSlice> {

        trace!("finding segment for: {}",offset);
        if offset >= self.active_segment.get_base_offset()  {
            trace!("active segment found for: {}", offset);
            Some(self.active_segment.to_segment_slice())
        } else {
            trace!("offset is before active, searching prev segment");
            self.prev_segments
                .find_segment(offset)
                .map(|(_, segment)| segment.to_segment_slice())
        }
    }
/// find the segment that contains offsets
/// segment could be active segment which can be written
/// or read only segment.
find the segment that contains offsets
segment could be active segment which can be written
or read only segment.
find the segment that contains offsets segment could be active segment which can be written or read only segment .
pub(crate) fn find_segment(&self, offset: Offset) -> Option<SegmentSlice> {
        trace!("finding segment for: {}",offset);
        if offset >= self.active_segment.get_base_offset()  {
            trace!("active segment found for: {}", offset);
            Some(self.active_segment.to_segment_slice())
        } else {
            trace!("offset is before active, searching prev segment");
            self.prev_segments
                .find_segment(offset)
                .map(|(_, segment)| segment.to_segment_slice())
        }
    }
pub ( crate ) fn find_segment ( & self , offset : Offset ) -> Option < SegmentSlice > { trace ! ( " " offset ) ; if offset >= self . active_segment . get_base_offset ( ) { trace ! ( " " offset ) ; Some ( self . active_segment . to_segment_slice ( ) ) } else { trace ! ( " " ) ; self . prev_segments . find_segment ( offset ) . map ( | ( _ , segment ) | segment . to_segment_slice ( ) ) } }
find the segment that contains offsets
segment could be active segment which can be written
or read only segment.
find the segment that contains offsets segment could be active segment which can be written or read only segment .
&self
offset
Offset
&self
offset
Offset