MySQL 8.0.40
Source Code Documentation
classic_protocol Namespace Reference

Namespaces

namespace  binary
 
namespace  borrowable
 
namespace  borrowed
 
namespace  capabilities
 
namespace  clone
 
namespace  collation
 
namespace  column_def
 
namespace  cursor
 
namespace  field_type
 
namespace  frame
 
namespace  impl
 
namespace  message
 
namespace  reload_cmds
 
namespace  session_track
 
namespace  status
 
namespace  wire
 

Classes

class  Codec
 Codec for a type. More...
 
class  Codec< borrowable::binary::Bit< Borrowed > >
 
class  Codec< borrowable::binary::Blob< Borrowed > >
 
class  Codec< borrowable::binary::Date >
 
class  Codec< borrowable::binary::DateTime >
 
class  Codec< borrowable::binary::Decimal< Borrowed > >
 
class  Codec< borrowable::binary::Double >
 
class  Codec< borrowable::binary::Enum< Borrowed > >
 
class  Codec< borrowable::binary::Float >
 
class  Codec< borrowable::binary::Geometry< Borrowed > >
 
class  Codec< borrowable::binary::Int24 >
 
class  Codec< borrowable::binary::Json< Borrowed > >
 
class  Codec< borrowable::binary::Long >
 
class  Codec< borrowable::binary::LongBlob< Borrowed > >
 
class  Codec< borrowable::binary::LongLong >
 
class  Codec< borrowable::binary::MediumBlob< Borrowed > >
 
class  Codec< borrowable::binary::NewDecimal< Borrowed > >
 
class  Codec< borrowable::binary::Null >
 
class  Codec< borrowable::binary::Set< Borrowed > >
 
class  Codec< borrowable::binary::Short >
 
class  Codec< borrowable::binary::String< Borrowed > >
 
class  Codec< borrowable::binary::Time >
 
class  Codec< borrowable::binary::Timestamp >
 
class  Codec< borrowable::binary::Tiny >
 
class  Codec< borrowable::binary::TinyBlob< Borrowed > >
 
class  Codec< borrowable::binary::Varchar< Borrowed > >
 
class  Codec< borrowable::binary::VarString< Borrowed > >
 
class  Codec< borrowable::binary::Year >
 
class  Codec< borrowable::message::client::AuthMethodData< Borrowed > >
 codec for client::AuthMethodData message. More...
 
class  Codec< borrowable::message::client::BinlogDump< Borrowed > >
 codec for client side dump-binlog message. More...
 
class  Codec< borrowable::message::client::BinlogDumpGtid< Borrowed > >
 codec for client side dump-binlog-with-gtid message. More...
 
class  Codec< borrowable::message::client::ChangeUser< Borrowed > >
 codec for client side change-user message. More...
 
class  Codec< borrowable::message::client::Clone >
 codec for client's Clone command. More...
 
class  Codec< borrowable::message::client::Greeting< Borrowed > >
 codec for client side greeting message. More...
 
class  Codec< borrowable::message::client::InitSchema< Borrowed > >
 codec for client's InitSchema command. More...
 
class  Codec< borrowable::message::client::Kill >
 codec for client's Kill command. More...
 
class  Codec< borrowable::message::client::ListFields< Borrowed > >
 codec for client's ListFields command. More...
 
class  Codec< borrowable::message::client::Ping >
 codec for client's Ping command. More...
 
class  Codec< borrowable::message::client::Query< Borrowed > >
 codec for client's Query command. More...
 
class  Codec< borrowable::message::client::Quit >
 codec for client's Quit command. More...
 
class  Codec< borrowable::message::client::RegisterReplica< Borrowed > >
 codec for client side register-replica message. More...
 
class  Codec< borrowable::message::client::Reload >
 codec for client's Reload command. More...
 
class  Codec< borrowable::message::client::ResetConnection >
 codec for client's ResetConnection command. More...
 
class  Codec< borrowable::message::client::SendFile< Borrowed > >
 codec for client::SendFile message. More...
 
class  Codec< borrowable::message::client::SetOption >
 codec for client's SetOption command. More...
 
class  Codec< borrowable::message::client::Statistics >
 codec for client's Statistics command. More...
 
class  Codec< borrowable::message::client::StmtClose >
 codec for client's Close Statement command. More...
 
class  Codec< borrowable::message::client::StmtExecute< Borrowed > >
 codec for client's Execute Statement command. More...
 
class  Codec< borrowable::message::client::StmtFetch >
 codec for client's Fetch Cursor command. More...
 
class  Codec< borrowable::message::client::StmtParamAppendData< Borrowed > >
 codec for client's append data Statement command. More...
 
class  Codec< borrowable::message::client::StmtPrepare< Borrowed > >
 codec for client's Prepared Statement command. More...
 
class  Codec< borrowable::message::client::StmtReset >
 codec for client's Reset Statement command. More...
 
class  Codec< borrowable::message::server::AuthMethodData< Borrowed > >
 codec for server::AuthMethodData message. More...
 
class  Codec< borrowable::message::server::AuthMethodSwitch< Borrowed > >
 codec for server::AuthMethodSwitch message. More...
 
class  Codec< borrowable::message::server::ColumnCount >
 codec for ColumnCount message. More...
 
class  Codec< borrowable::message::server::ColumnMeta< Borrowed > >
 Codec of ColumnMeta. More...
 
class  Codec< borrowable::message::server::Eof< Borrowed > >
 codec for server-side Eof message. More...
 
class  Codec< borrowable::message::server::Error< Borrowed > >
 codec for Error message. More...
 
class  Codec< borrowable::message::server::Greeting< Borrowed > >
 codec for server Greeting message. More...
 
class  Codec< borrowable::message::server::Ok< Borrowed > >
 codec for server-side Ok message. More...
 
class  Codec< borrowable::message::server::Row< Borrowed > >
 codec for a Row from the server. More...
 
class  Codec< borrowable::message::server::SendFileRequest< Borrowed > >
 codec for server's SendFileRequest response. More...
 
class  Codec< borrowable::message::server::Statistics< Borrowed > >
 codec for server::Statistics message. More...
 
class  Codec< borrowable::message::server::StmtPrepareOk >
 codec for server::StmtPrepareOk message. More...
 
class  Codec< borrowable::message::server::StmtRow< Borrowed > >
 codec for a StmtRow from the server. More...
 
class  Codec< borrowable::session_track::Field< Borrowed > >
 codec for session-track's Field. More...
 
class  Codec< borrowable::session_track::Gtid< Borrowed > >
 codec for session_track::Gtid. More...
 
class  Codec< borrowable::session_track::Schema< Borrowed > >
 codec for session_track::Schema. More...
 
class  Codec< borrowable::session_track::SystemVariable< Borrowed > >
 codec for session_track::SystemVariable. More...
 
class  Codec< borrowable::session_track::TransactionCharacteristics< Borrowed > >
 codec for session_track::TransactionCharacteristics. More...
 
class  Codec< borrowable::session_track::TransactionState >
 codec for session_track::TransactionState. More...
 
class  Codec< borrowable::wire::FixedInt< IntSize > >
 codec of a FixedInt. More...
 
class  Codec< borrowable::wire::Null >
 codec for a NULL value in the Resultset. More...
 
class  Codec< borrowable::wire::NulTermString< Borrowed > >
 codec for 0-terminated string. More...
 
class  Codec< borrowable::wire::String< Borrowed > >
 codec for wire::String. More...
 
class  Codec< borrowable::wire::VarInt >
 codec for variable length integers. More...
 
class  Codec< borrowable::wire::VarString< Borrowed > >
 codec for string with known length. More...
 
class  Codec< clone::client::Ack >
 
class  Codec< clone::client::Attach >
 
class  Codec< clone::client::Execute >
 
class  Codec< clone::client::Exit >
 
class  Codec< clone::client::Init >
 codec for clone::client::Init message. More...
 
class  Codec< clone::client::Reinit >
 
class  Codec< clone::server::Complete >
 
class  Codec< clone::server::Error >
 
class  Codec< frame::CompressedHeader >
 Codec of Compressed Header. More...
 
class  Codec< frame::Frame< PayloadType > >
 Codec for a Frame. More...
 
class  Codec< frame::Header >
 Codec of a Frame Header. More...
 
class  Codec< session_track::State >
 codec for session_track::State. More...
 
class  Codec< void >
 codec for ignorable bytes. More...
 
class  CodecSimpleCommand
 CRTP base for client-side commands that are encoded as a single byte. More...
 

Enumerations

enum class  codec_errc {
  invalid_input = 1 , not_enough_input , missing_nul_term , capability_not_supported ,
  statement_id_not_found , field_type_unknown
}
 
enum class  CommandByte {
  Quit = 0x01 , InitSchema , Query , ListFields ,
  CreateDb , DropDb , Refresh , Shutdown ,
  Statistics , ProcessInfo , Connect , ProcessKill ,
  Debug , Ping , Time , DelayedInsert ,
  ChangeUser , BinlogDump , TableDump , ConnectOut ,
  RegisterReplica , StmtPrepare , StmtExecute , StmtSendLongData ,
  StmtClose , StmtReset , SetOption , StmtFetch ,
  Deamon , BinlogDumpGtid , ResetConnection , Clone
}
 

Functions

constexpr size_t bytes_per_bits (size_t bits)
 
template<class T , class DynamicBuffer >
stdx::expected< size_t, std::error_code > encode (const T &v, capabilities::value_type caps, DynamicBuffer &&dyn_buffer)
 encode a message into a dynamic buffer. More...
 
template<class T >
stdx::expected< std::pair< size_t, T >, std::error_code > decode (const net::const_buffer &buffer, capabilities::value_type caps)
 decode a message from a buffer. More...
 
template<class T , class... Args>
stdx::expected< std::pair< size_t, T >, std::error_code > decode (const net::const_buffer &buffer, capabilities::value_type caps, Args &&... args)
 decode a message from a buffer. More...
 
const std::error_category & codec_category () noexcept
 
std::error_code make_error_code (codec_errc e) noexcept
 

Enumeration Type Documentation

◆ codec_errc

enum class classic_protocol::codec_errc
strong
Enumerator
invalid_input 
not_enough_input 
missing_nul_term 
capability_not_supported 
statement_id_not_found 
field_type_unknown 

◆ CommandByte

enum class classic_protocol::CommandByte
strong
Enumerator
Quit 
InitSchema 
Query 
ListFields 
CreateDb 
DropDb 
Refresh 
Shutdown 
Statistics 
ProcessInfo 
Connect 
ProcessKill 
Debug 
Ping 
Time 
DelayedInsert 
ChangeUser 
BinlogDump 
TableDump 
ConnectOut 
RegisterReplica 
StmtPrepare 
StmtExecute 
StmtSendLongData 
StmtClose 
StmtReset 
SetOption 
StmtFetch 
Deamon 
BinlogDumpGtid 
ResetConnection 
Clone 

Function Documentation

◆ bytes_per_bits()

constexpr size_t classic_protocol::bytes_per_bits ( size_t  bits)
constexpr

◆ codec_category()

const std::error_category & classic_protocol::codec_category ( )
inlinenoexcept

◆ decode() [1/2]

template<class T >
stdx::expected< std::pair< size_t, T >, std::error_code > classic_protocol::decode ( const net::const_buffer buffer,
capabilities::value_type  caps 
)

decode a message from a buffer.

Parameters
bufferbuffer to read from
capsprotocol capabilities
Template Parameters
Tthe message class
Returns
number of bytes read from 'buffers' and a T on success, or std::error_code on error

◆ decode() [2/2]

template<class T , class... Args>
stdx::expected< std::pair< size_t, T >, std::error_code > classic_protocol::decode ( const net::const_buffer buffer,
capabilities::value_type  caps,
Args &&...  args 
)

decode a message from a buffer.

Parameters
bufferbuffer to read from
capsprotocol capabilities
argsarguments that shall be forwarded to T's decode()
Template Parameters
Tthe message class
ArgsTypes of the extra arguments to be forwarded to T's decode() function.
Returns
number of bytes read from 'buffers' and a T on success, or std::error_code on error

◆ encode()

template<class T , class DynamicBuffer >
stdx::expected< size_t, std::error_code > classic_protocol::encode ( const T &  v,
capabilities::value_type  caps,
DynamicBuffer &&  dyn_buffer 
)

encode a message into a dynamic buffer.

Parameters
vmessage to encode
capsprotocol capabilities
dyn_bufferdynamic buffer to write into
Returns
number of bytes written into dynamic buffer or std::error_code on error

◆ make_error_code()

std::error_code classic_protocol::make_error_code ( codec_errc  e)
inlinenoexcept