fn push_coords(coords: Option<DebeziumSourceCoordinates>, packer: &mut Row) -> Result<(), ()> {
    let mut is_unknown = false;
    match coords {
        Some(coords) => {
            if coords.snapshot {
                packer.push(Datum::Null)
            } else {
                // Downstream in the deduplication logic, we pack these into rows,
                // and aren't too careful to avoid cloning them. Thus
                // it's important not to go over the 24-byte smallvec inline capacity.
                let data = match coords.row {
                    RowCoordinates::Postgres {
                        last_commit_lsn,
                        lsn,
                        total_order,
                    } => Some(vec![
                        Datum::Int64(last_commit_lsn.unwrap_or(0) as i64),
                        Datum::Int64(lsn as i64),
                        Datum::Int64(total_order.unwrap_or(0) as i64),
                    ]),
                    RowCoordinates::MySql { file_idx, pos, row } => Some(vec![
                        Datum::Int32(file_idx as i32),
                        Datum::Int64(pos as i64),
                        Datum::Int64(row as i64),
                    ]),
                    RowCoordinates::MSSql {
                        change_lsn,
                        event_serial_no,
                    } => {
                        // Consider everything but the file ID to be the offset within the file.
                        let offset_in_file = ((change_lsn.log_block_offset as usize) << 16)
                            | (change_lsn.slot_num as usize);
                        Some(vec![
                            Datum::Int32(change_lsn.file_seq_num as i32),
                            Datum::Int64(offset_in_file as i64),
                            Datum::Int64(event_serial_no as i64),
                        ])
                    }
                    RowCoordinates::Unknown => {
                        is_unknown = true;
                        None
                    }
                };
                match data {
                    Some(data) => {
                        packer.push_list_with(|packer| {
                            for datum in data {
                                packer.push(datum);
                            }
                        });
                    }
                    None => {
                        packer.push(Datum::Null);
                    }
                }
            }
        }
        None => packer.push(Datum::Null),
    }
    if is_unknown {
        Err(())
    } else {
        Ok(())
    }
}
/// Push `coords` onto `packer`, in a format understood by our downstream Debezium deduplication logic.
Push `coords` onto `packer`, in a format understood by our downstream Debezium deduplication logic.
Push ` coords ` onto ` packer ` in a format understood by our downstream Debezium deduplication logic .
fn push_coords(coords: Option<DebeziumSourceCoordinates>, packer: &mut Row) -> Result<(), ()> {
    let mut is_unknown = false;
    match coords {
        Some(coords) => {
            if coords.snapshot {
                packer.push(Datum::Null)
            } else {
                // Downstream in the deduplication logic, we pack these into rows,
                // and aren't too careful to avoid cloning them. Thus
                // it's important not to go over the 24-byte smallvec inline capacity.
                let data = match coords.row {
                    RowCoordinates::Postgres {
                        last_commit_lsn,
                        lsn,
                        total_order,
                    } => Some(vec![
                        Datum::Int64(last_commit_lsn.unwrap_or(0) as i64),
                        Datum::Int64(lsn as i64),
                        Datum::Int64(total_order.unwrap_or(0) as i64),
                    ]),
                    RowCoordinates::MySql { file_idx, pos, row } => Some(vec![
                        Datum::Int32(file_idx as i32),
                        Datum::Int64(pos as i64),
                        Datum::Int64(row as i64),
                    ]),
                    RowCoordinates::MSSql {
                        change_lsn,
                        event_serial_no,
                    } => {
                        // Consider everything but the file ID to be the offset within the file.
                        let offset_in_file = ((change_lsn.log_block_offset as usize) << 16)
                            | (change_lsn.slot_num as usize);
                        Some(vec![
                            Datum::Int32(change_lsn.file_seq_num as i32),
                            Datum::Int64(offset_in_file as i64),
                            Datum::Int64(event_serial_no as i64),
                        ])
                    }
                    RowCoordinates::Unknown => {
                        is_unknown = true;
                        None
                    }
                };
                match data {
                    Some(data) => {
                        packer.push_list_with(|packer| {
                            for datum in data {
                                packer.push(datum);
                            }
                        });
                    }
                    None => {
                        packer.push(Datum::Null);
                    }
                }
            }
        }
        None => packer.push(Datum::Null),
    }
    if is_unknown {
        Err(())
    } else {
        Ok(())
    }
}
fn push_coords ( coords : Option < DebeziumSourceCoordinates > , packer : & mut Row ) -> Result < ( ) , ( ) > { let mut is_unknown = false ; match coords { Some ( coords ) => { if coords . snapshot { packer . push ( Datum :: Null ) } else { // Downstream in the deduplication logic, we pack these into rows, // and aren't too careful to avoid cloning them. Thus // it's important not to go over the 24-byte smallvec inline capacity. let data = match coords . row { RowCoordinates :: Postgres { last_commit_lsn , lsn , total_order , } => Some ( vec ! [ Datum Int64 ( last_commit_lsn unwrap_or ( 0 ) as i64 ) Datum Int64 ( lsn as i64 ) Datum Int64 ( total_order unwrap_or ( 0 ) as i64 ) ] ) , RowCoordinates :: MySql { file_idx , pos , row } => Some ( vec ! [ Datum Int32 ( file_idx as i32 ) Datum Int64 ( pos as i64 ) Datum Int64 ( row as i64 ) ] ) , RowCoordinates :: MSSql { change_lsn , event_serial_no , } => { // Consider everything but the file ID to be the offset within the file. let offset_in_file = ( ( change_lsn . log_block_offset as usize ) << 16 ) | ( change_lsn . slot_num as usize ) ; Some ( vec ! [ Datum Int32 ( change_lsn file_seq_num as i32 ) Datum Int64 ( offset_in_file as i64 ) Datum Int64 ( event_serial_no as i64 ) ] ) } RowCoordinates :: Unknown => { is_unknown = true ; None } } ; match data { Some ( data ) => { packer . push_list_with ( | packer | { for datum in data { packer . push ( datum ) ; } } ) ; } None => { packer . push ( Datum :: Null ) ; } } } } None => packer . push ( Datum :: Null ) , } if is_unknown { Err ( ( ) ) } else { Ok ( ( ) ) } }
Push `coords` onto `packer`, in a format understood by our downstream Debezium deduplication logic.
Push ` coords ` onto ` packer ` in a format understood by our downstream Debezium deduplication logic .
coords
Option<DebeziumSourceCoordinates>
packer
&mut Row
coords
Option<DebeziumSourceCoordinates>
packer
&mut Row