MCPcopy Create free account
hub / github.com/erans/pgsqlite / encode

Method encode

src/protocol/codec.rs:54–74  ·  view source on GitHub ↗
(&mut self, msg: BackendMessage, dst: &mut BytesMut)

Source from the content-addressed store, hash-verified

52 type Error = io::Error;
53
54 fn encode(&mut self, msg: BackendMessage, dst: &mut BytesMut) -> Result<(), Self::Error> {
55 match msg {
56 BackendMessage::Authentication(auth) => encode_authentication(auth, dst),
57 BackendMessage::ParameterStatus { name, value } => encode_parameter_status(&name, &value, dst),
58 BackendMessage::BackendKeyData { process_id, secret_key } => encode_backend_key_data(process_id, secret_key, dst),
59 BackendMessage::ReadyForQuery { status } => encode_ready_for_query(status, dst),
60 BackendMessage::RowDescription(fields) => encode_row_description(fields, dst),
61 BackendMessage::DataRow(values) => encode_data_row(&values, dst),
62 BackendMessage::CommandComplete { tag } => encode_command_complete(&tag, dst),
63 BackendMessage::EmptyQueryResponse => encode_empty_query_response(dst),
64 BackendMessage::ErrorResponse(err) => encode_error_response(*err, dst),
65 BackendMessage::NoticeResponse(notice) => encode_notice_response(notice, dst),
66 BackendMessage::ParseComplete => encode_parse_complete(dst),
67 BackendMessage::BindComplete => encode_bind_complete(dst),
68 BackendMessage::CloseComplete => encode_close_complete(dst),
69 BackendMessage::PortalSuspended => encode_portal_suspended(dst),
70 BackendMessage::NoData => encode_no_data(dst),
71 BackendMessage::ParameterDescription(oids) => encode_parameter_description(oids, dst),
72 }
73 Ok(())
74 }
75}
76
77fn decode_startup_message(src: &mut BytesMut) -> io::Result<Option<FrontendMessage>> {

Callers 6

send_messageFunction · 0.80
send_queryFunction · 0.80

Calls 15

encode_authenticationFunction · 0.85
encode_parameter_statusFunction · 0.85
encode_backend_key_dataFunction · 0.85
encode_ready_for_queryFunction · 0.85
encode_row_descriptionFunction · 0.85
encode_command_completeFunction · 0.85
encode_error_responseFunction · 0.85
encode_notice_responseFunction · 0.85
encode_parse_completeFunction · 0.85
encode_bind_completeFunction · 0.85
encode_close_completeFunction · 0.85

Tested by 6

send_messageFunction · 0.64
send_queryFunction · 0.64