pub fn encoding_segments(map: &CharacterMap, ctx: &Context) -> Vec<Segment> {
    let mappings = map.iter().take_while(|(&code, _)| code < SENTINEL_SCALER);
    let mut segments: Vec<Segment> = Vec::new();
    let mut spans = mappings.spans_by_key(|(&code, _)| code as u32, |a, b| a + 1 == b);

    while let Some(span) = spans.next() {
        for segment in encoding_segments_continuous(map, span, ctx) {
            segments.push(segment);
        }
    }

    segments
}
/// Returns a segmentation of the given character map suitable for [`compile`].
///
/// Any mappings of `map` extending outside the range of the format 4 subtable are ignored.
///
/// Note that this function does not automatically append a sentinel segment at the end of the segments vector.
///
/// See [`compile_segments`] for usage examples.
///
/// [`compile`]: compile
Returns a segmentation of the given character map suitable for [`compile`].
Any mappings of `map` extending outside the range of the format 4 subtable are ignored.

Note that this function does not automatically append a sentinel segment at the end of the segments vector.

See [`compile_segments`] for usage examples.

[`compile`]: compile
Returns a segmentation of the given character map suitable for [ ` compile ` ] . Any mappings of ` map ` extending outside the range of the format 4 subtable are ignored . Note that this function does not automatically append a sentinel segment at the end of the segments vector . See [ ` compile_segments ` ] for usage examples . [ ` compile ` ] : compile
pub fn encoding_segments(map: &CharacterMap, ctx: &Context) -> Vec<Segment> {
    let mappings = map.iter().take_while(|(&code, _)| code < SENTINEL_SCALER);
    let mut segments: Vec<Segment> = Vec::new();
    let mut spans = mappings.spans_by_key(|(&code, _)| code as u32, |a, b| a + 1 == b);
    while let Some(span) = spans.next() {
        for segment in encoding_segments_continuous(map, span, ctx) {
            segments.push(segment);
        }
    }
    segments
}
pub fn encoding_segments ( map : & CharacterMap , ctx : & Context ) -> Vec < Segment > { let mappings = map . iter ( ) . take_while ( | ( & code , _ ) | code < SENTINEL_SCALER ) ; let mut segments : Vec < Segment > = Vec :: new ( ) ; let mut spans = mappings . spans_by_key ( | ( & code , _ ) | code as u32 , | a , b | a + 1 == b ) ; while let Some ( span ) = spans . next ( ) { for segment in encoding_segments_continuous ( map , span , ctx ) { segments . push ( segment ) ; } } segments }
Returns a segmentation of the given character map suitable for [`compile`].
Returns a segmentation of the given character map suitable for [ ` compile ` ] .
map
&CharacterMap
ctx
&Context
map
&CharacterMap
ctx
&Context