Skip to main content

Op

Enum Op 

Source
#[repr(u8)]
pub enum Op {
Show 13 variants Ping = 0, Pong = 1, Auth = 2, AuthUser = 3, Query = 16, RowDescription = 17, DataRow = 18, CommandComplete = 19, ErrorResponse = 20, Stats = 21, StatsResponse = 22, DataRowBatch = 23, Error = 255,
}
Expand description

Wire opcodes (1 byte each). Numeric values are stable on the wire — never renumber an existing variant.

Variants§

§

Ping = 0

§

Pong = 1

§

Auth = 2

v1.14 client → server. Payload is the candidate password (UTF-8 bytes). When the server is configured with a password, the connection stays unauthenticated and refuses every other opcode until Auth succeeds. A matching password gets a Pong reply; a wrong one gets ErrorResponse.

§

AuthUser = 3

v4.1 client → server. Carries (username, password) for per-user authentication. Layout: [u16 user_len][user UTF-8][password UTF-8]. When the server has a user table configured, this is the only auth that works; legacy Op::Auth (password-only) still works in single-password mode for backwards compatibility.

§

Query = 16

§

RowDescription = 17

§

DataRow = 18

§

CommandComplete = 19

§

ErrorResponse = 20

§

Stats = 21

§

StatsResponse = 22

§

DataRowBatch = 23

v3.3.0 server → client: many result rows packed into one frame. Layout: [u16 row_count][u16 cell_count][per-cell WireValue]*. cell_count is hoisted out (same for every row in the batch, fixed by schema), saving 2 bytes / row vs sending a stream of DataRow frames. The server only emits this for SELECTs with more than one returned row — single-row paths still use DataRow so a v3.2 / v3.1 client stays decodable.

§

Error = 255

Implementations§

Source§

impl Op

Source

pub const fn from_byte(b: u8) -> Result<Self, FrameError>

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Op

Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Op

Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.